1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-23 20:00:27 +08:00
xiaochong0302 6614cdc8d2 1.优化boostrap
2.优化logger
3.优化contact
2024-12-16 20:27:40 +08:00

65 lines
1.2 KiB
PHP

<?php
/**
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
* @license https://opensource.org/licenses/GPL-2.0
* @link https://www.koogua.com
*/
namespace Bootstrap;
use Phalcon\Application;
use Phalcon\Config;
use Phalcon\Di;
use Phalcon\Loader;
abstract class Kernel
{
/**
* @var Di
*/
protected $di;
/**
* @var Application
*/
protected $app;
/**
* @var Loader
*/
protected $loader;
protected function initAppEnv()
{
require __DIR__ . '/Helper.php';
}
protected function registerSettings()
{
/**
* @var Config $config
*/
$config = $this->di->getShared('config');
ini_set('date.timezone', $config->get('timezone'));
if ($config->get('env') == ENV_DEV) {
ini_set('display_errors', 1);
error_reporting(E_ALL);
} else {
ini_set('display_errors', 0);
error_reporting(0);
}
}
abstract public function handle();
abstract protected function registerLoaders();
abstract protected function registerServices();
abstract protected function registerErrorHandler();
}