1 Star 4 Fork 0

好未来技术团队 / fend

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
init.php 1.46 KB
AI 代码解读
一键复制 编辑 原始数据 按行查看 历史
thinkpc 提交于 2020-07-21 16:15 . init project
<?php
use Fend\Config;
use Fend\Log\EagleEye;
use Fend\Log\LogAgent;
use Fend\Logger;
ini_set('display_errors', 'off');//开启或关闭PHP异常信息
date_default_timezone_set('Asia/Shanghai');
error_reporting(E_ALL);//异常级别设置
//系统设置不可替换的静态配置
define('FD_DS', DIRECTORY_SEPARATOR);//定制目录符合
define('SYS_ROOTDIR', dirname(__FILE__) . FD_DS);
define('SYS_CACHE', SYS_ROOTDIR . 'app' . FD_DS . 'Cache' . FD_DS);//cache目录,smarty cache,文件缓存放置区域
define('SYS_VIEW', SYS_ROOTDIR . 'app' . FD_DS . 'View' . FD_DS);//http业务模板层
define('ERR_CODE_PATH', SYS_ROOTDIR . 'app' . FD_DS . 'Const' . FD_DS); // 错误码定义路径
//autoload not init tips
//加载autoload
if(!include_once(SYS_ROOTDIR. 'vendor/autoload.php')){
echo "please run composer update. on project root to init.\n";
exit;
}
//设置配置,加载路径
\Fend\Config::setConfigPath(SYS_ROOTDIR . 'app/Config');
\Fend\Config::set('fend_err_code_file', SYS_ROOTDIR . 'app' . FD_DS . 'Const' . FD_DS . 'ModuleDefine.php');
//初始化日志
$fend = Config::get("Fend");
EagleEye::disable(!$fend["log"]["trace"]);
LogAgent::setLogPath($fend["log"]["path"]);
Logger::setLogLevel($fend["log"]["level"]);
LogAgent::setFormat($fend["log"]["logFormat"] ?? "json");
LogAgent::setLogRoll($fend["log"]["logRoll"] ?? "day");
LogAgent::setFileNameWithPid($fend["log"]["filenameWithPid"] ?? true);
LogAgent::setLogPrefix($fend["log"]["logPrefix"] ?? "");
1
https://gitee.com/ta-tech-team/fend.git
git@gitee.com:ta-tech-team/fend.git
ta-tech-team
fend
fend
master

搜索帮助