public static function init() { $logConfig = Config::get('log'); $logName = $logConfig['path'] . '/' . date('y_m_d') . '.log'; $logger = new Logger('run_logger'); $stream = new StreamHandler($logName, Logger::DEBUG); $logger->pushHandler(new BufferHandler($stream, 10, Logger::DEBUG, true, true)); //用BufferHandler设置同一请求下日志数达到10条再写一次文件 ErrorHandler::register($logger); }
public function config($config) { $path = FRAMEWORK_CONFIG_PATH . $config . '.php'; Config::load($config, $path); }
public static function init() { $capsule = new Capsule(); $capsule->addConnection(Config::get('database')); $capsule->bootEloquent(); }