1 Star 0 Fork 3

king2019/RapPHP

forked from Gitee 极速下载/RapPHP 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
start.php 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
藤之内 提交于 2018-09-06 11:18 +08:00 . 整体格式
<?php
error_reporting(E_ALL& ~E_NOTICE& ~E_WARNING);
define('RAP_VERSION', '2.0.6');
define('DS', DIRECTORY_SEPARATOR);
ini_set("display_errors", "On");
define('RAP_DIR',__DIR__);
define('APP_DIR', 'app');
defined('ROOT_PATH') or define('ROOT_PATH', getcwd() . DS);
defined('APP_PATH') or define('APP_PATH',ROOT_PATH.APP_DIR.DS);
defined('RUNTIME') or define('RUNTIME', ROOT_PATH ."runtime".DS);
// 环境常量
define('IS_CLI', PHP_SAPI == 'cli' ? true : false);
define('IS_WIN', strpos(PHP_OS, 'WIN') !== false);
define('IS_SWOOLE_HTTP', IS_CLI&&$argv[1]=='http');
$loader = require ROOT_PATH . '/vendor/autoload.php';
$loader->setPsr4(APP_DIR."\\", ROOT_PATH.APP_DIR);
$loader->setPsr4("rap\\aop\\build\\", RUNTIME.'aop');
include_once 'common.php';
//swoole 模式
if(IS_CLI){
if(IS_SWOOLE_HTTP){
\rap\ioc\Ioc::bind(\rap\web\Application::class,\rap\RapApplication::class);
\rap\ioc\Ioc::get(\rap\web\Application::class)->console(["index.php",'aop']);
\rap\ioc\Ioc::clear();
}
\rap\ioc\Ioc::bind(\rap\web\Application::class,\rap\RapApplication::class);
\rap\ioc\Ioc::get(\rap\web\Application::class)->console($argv);
}else{
//正常模式
\rap\ioc\Ioc::bind(\rap\web\Application::class,\rap\RapApplication::class);
$response=new \rap\web\Response();
$request=new \rap\web\Request($response);
\rap\web\mvc\RequestHolder::setRequest($request);
\rap\ioc\Ioc::get(\rap\web\Application::class)->start($request,$response);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xmkc/RapPHP.git
git@gitee.com:xmkc/RapPHP.git
xmkc
RapPHP
RapPHP
master

搜索帮助