loader = $loader; //配置 DI()->config = new PhalApi_Config_File(API_ROOT . '/Config'); //调试模式,$_GET['__debug__']可自行改名 //DI()->debug = !empty($_GET['__debug__']) ? true : DI()->config->get('sys.debug'); DI()->debug = false; //日记纪录 DI()->logger = new PhalApi_Logger_File(API_ROOT . '/Runtime', PhalApi_Logger::LOG_LEVEL_DEBUG | PhalApi_Logger::LOG_LEVEL_INFO | PhalApi_Logger::LOG_LEVEL_ERROR); //数据操作 - 基于NotORM,$_GET['__sql__']可自行改名 //DI()->notorm = new PhalApi_DB_NotORM(DI()->config->get('dbs'), !empty($_GET['__sql__'])); DI()->notorm = new PhalApi_DB_NotORM(DI()->config->get('dbs'), false); //翻译语言包设定 SL('zh_cn'); /** ---------------- 定制注册 可选服务组件 ---------------- **/ require_once API_ROOT . '/Common/functions.php'; if(!DI()->redis){ DI()->redis=connectionRedis(); } /* error_reporting(E_ALL); ini_set('display_errors', 'On'); */ /** //签名验证服务 DI()->filter = 'PhalApi_Filter_SimpleMD5'; */ /** //缓存 - Memcache/Memcached DI()->cache = function () { return new PhalApi_Cache_Memcache(DI()->config->get('sys.mc')); }; */ /** //支持JsonP的返回 if (!empty($_GET['callback'])) { DI()->response = new PhalApi_Response_JsonP($_GET['callback']); } */ /* 七牛上传 */ DI()->qiniu = new Qiniu_Lite(); /* 本地/云 上传 */ DI()->ucloud = new UCloud_Lite();