12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- declare(strict_types=0);
- /**
- * 商城板块初始化文件
- *
- *
- * * */
- define('APP_ID','admin');
- define('BASE_ROOT_PATH',str_replace('/admin','',dirname(__FILE__)));
- define('BASE_PATH',str_replace('\\','/',dirname(__FILE__)));
- function handle_error($level, $message, $file, $line)
- {
- if($level == E_NOTICE) return;
- $trace = "handle_error: level={$level},msg={$message} file={$file},line={$line}\n";
- $backtrace = debug_backtrace();
- foreach ($backtrace as $item) {
- $trace .= "{$item['file']}\t{$item['line']}\t{$item['function']}\n";
- }
- Log::record($trace,Log::DEBUG);
- }
- set_error_handler('handle_error');
- if (!@include(dirname(dirname(__FILE__)).'/global.php')) exit('global.php isn\'t exists!');
- if (!@include(BASE_CORE_PATH.'/lrlz.php')) exit('lrlz.php isn\'t exists!');
- define('TPL_NAME',TPL_ADMIN_NAME);
- define('ADMIN_TEMPLATES_URL',ADMIN_SITE_URL.'/templates/'.TPL_NAME);
- define('BASE_TPL_PATH',BASE_PATH.'/templates/'.TPL_NAME);
- if (!@include(BASE_PATH.'/control/control.php')) exit('control.php isn\'t exists!');
- include(BASE_CONFIG_PATH . CONFIG_PREFIX . '/refill.ini.php');
- $start = microtime(true);
- $addr = $_SERVER['REMOTE_ADDR'];
- Log::record("admin start request ip:$addr", Log::DEBUG);
- Base::run();
- $msg = sprintf("admin request time=%.6f\r\n\r\n",microtime(true) - $start);
- Log::record($msg,Log::DEBUG);
|