12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #!/usr/bin/env php
- <?php
- /**
- * Yii console bootstrap file.
- *
- * @link http://www.yiiframework.com/
- * @copyright Copyright (c) 2008 Yii Software LLC
- * @license http://www.yiiframework.com/license/
- */
- setlocale(LC_ALL, 'zh_CN.UTF-8');
- defined('TIMESTAMP') or define('TIMESTAMP',time());//start time of request
- defined('SYS_START_TIME') or define('SYS_START_TIME',microtime());//start time of request
- define('IN_KIIVO', true);//make the file be the only import of the app
- //KIIVOKMS框架目录,如:D:\phpStudy\PHPTutorial\WWW\kiivokms\
- defined('BASE_PATH') or define('BASE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
- $config = require __DIR__ . '/config/config.php';
- require __DIR__ . '/vendor/autoload.php';
- require __DIR__ . '/vendor/yiisoft/yii2/Yii.php';
- include_once __DIR__ . '/common/functions/global.php';
- include_once __DIR__ . '/common/functions/dir.php';
- include_once __DIR__ . '/common/functions/cus.php';
- $domain = require_config('domain.php');
- define('COOKIE_DOMAIN', $domain['cookie_domain']);//定义cookie全局域
- define('WAP_URL', $domain['wap_url']);//WAP站域名
- define('WEB_URL', $domain['web_url']);//PC站域名
- define('API_URL', $domain['api_url']);//接口域名
- define('UPLOAD_DOMAIN', $domain['upload_domain']);//附件域名
- $config = array_merge_recursive(require_config('console.php'), $config);//命令行配置
- $params = $config['params'];
- //定义网页编码
- defined('CHARSET') or define('CHARSET',$config['params']['charSet']);
- //加密因子
- defined('AUTH_KEY') or define('AUTH_KEY',$config['params']['authKey']);
- //主机协议
- define('SITE_PROTOCOL', strpos(WEB_URL,'https') !==false ? 'https://' : 'http://');
- //当前访问的主机名(格式:www.xxx.cn)
- define('SITE_URL', (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''));
- //定义时区
- defined('TIME_ZONE') or define('TIME_ZONE',$config['params']['timeZone']);
- /********************二次定义params结束*****************************************/
- defined('UPLOAD_PATH') or define('UPLOAD_PATH',$config['params']['uploadPath']);
- defined('THUMB_PATH') or define('THUMB_PATH',$config['params']['thumbPath']);
- defined('UPLOAD_URL') or define('UPLOAD_URL',$config['params']['uploadUrl']);
- defined('HTML_PATH') or define('HTML_PATH',$config['params']['htmlPath']);
- defined('CACHE_PATH') or define('CACHE_PATH',$config['params']['cachePath']);
- defined('IN_WAP') or define('IN_WAP',FALSE);
- $application = new yii\console\Application($config);
- $exitCode = $application->run();
- exit($exitCode);
|