2 Star 8 Fork 2

弄月/alipay-crawler

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bootstrap.php 1.72 KB
一键复制 编辑 原始数据 按行查看 历史
弄月 提交于 2018-04-27 19:59 . init
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
define('DS', DIRECTORY_SEPARATOR);
define('ROOT_PATH', realpath(__DIR__.'/').DS);
define('APP_PATH', realpath(__DIR__.'/app/').DS);
define('CONFIG_PATH', realpath(__DIR__.'/config/').DS);
define('STORAGE_PATH', realpath(__DIR__.'/storage/').DS);
define('RESOURCES_PATH', realpath(__DIR__.'/resources/').DS);
define('PUBLIC_PATH', realpath(__DIR__.'/public/').DS);
require ROOT_PATH.'vendor'.DS.'autoload.php';
$console = PHP_SAPI == 'cli' ? true : false;
date_default_timezone_set('Asia/Shanghai');
$settings = require CONFIG_PATH.'app.php';
$settingsEnv = require CONFIG_PATH.($settings['settings']['environment']).'.php';
$settings = array_merge_recursive($settings, $settingsEnv);
if ($console) {
set_time_limit(0);
$argv = $GLOBALS['argv'];
array_shift($argv);
//save argv to settings
$_argv = [];
if (count($argv) > 2) {
for ($i = 2, $j = count($argv); $i < $j; $i++) {
parse_str($argv[$i], $temp);
$_argv = array_merge($_argv, $temp);
}
}
$settings['argv'] = $_argv;
//Convert $argv to PATH_INFO
$env = \Slim\Http\Environment::mock([
'SCRIPT_NAME' => $_SERVER['SCRIPT_NAME'],
'REQUEST_URI' => count($argv) >= 2 ? "/{$argv[0]}/{$argv[1]}" : "/help"
]);
$settings['environment'] = $env;
}
// instance app
$app = app($settings, $console);
// Set up dependencies
$app->registerProviders();
// Register middleware
$app->registerMiddleware();
if ($console) {
// include your routes for cli requests here
require CONFIG_PATH.'routes'.DS.'console.php';
} else {
// include your routes for http requests here
require CONFIG_PATH.'routes'.DS.'app.php';
}
$app->run();
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/mrpzx/alipay-crawler.git
git@gitee.com:mrpzx/alipay-crawler.git
mrpzx
alipay-crawler
alipay-crawler
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385