mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-01-24 14:04:07 +08:00
use PrettyPageHandler to handler errors while installing
This commit is contained in:
parent
a03a515613
commit
fba53c1fe5
@ -72,8 +72,21 @@ class Boot
|
||||
}
|
||||
}
|
||||
|
||||
public static function registerErrorHandler()
|
||||
/**
|
||||
* Register error handler
|
||||
*
|
||||
* @param object $handler Push specified whoops handler
|
||||
* @return void
|
||||
*/
|
||||
public static function registerErrorHandler($handler = null)
|
||||
{
|
||||
if (!is_null($handler) && $handler instanceof \Whoops\Handler\HandlerInterface) {
|
||||
$whoops = new \Whoops\Run;
|
||||
$whoops->pushHandler($handler);
|
||||
$whoops->register();
|
||||
return;
|
||||
}
|
||||
|
||||
if ($_ENV['APP_DEBUG'] !== "false") {
|
||||
// whoops: php errors for cool kids
|
||||
$whoops = new \Whoops\Run;
|
||||
|
@ -13,7 +13,7 @@ require BASE_DIR.'/vendor/autoload.php';
|
||||
App\Services\Boot::loadServices();
|
||||
Config::checkPHPVersion();
|
||||
Boot::loadDotEnv(BASE_DIR);
|
||||
Boot::registerErrorHandler();
|
||||
Boot::registerErrorHandler(new \Whoops\Handler\PrettyPageHandler);
|
||||
Boot::startSession();
|
||||
|
||||
$db_config = Config::getDbConfig();
|
||||
@ -77,7 +77,7 @@ switch ($step) {
|
||||
$options = require "options.php";
|
||||
$options['site_name'] = $_POST['sitename'];
|
||||
$options['site_url'] = Http::getBaseUrl();
|
||||
$options['version'] = Application::getVersion();
|
||||
$options['version'] = App::getVersion();
|
||||
|
||||
foreach ($options as $key => $value) {
|
||||
Option::add($key, $value);
|
||||
|
@ -13,7 +13,7 @@ require BASE_DIR.'/vendor/autoload.php';
|
||||
App\Services\Boot::loadServices();
|
||||
Config::checkPHPVersion();
|
||||
Boot::loadDotEnv(BASE_DIR);
|
||||
Boot::registerErrorHandler();
|
||||
Boot::registerErrorHandler(new \Whoops\Handler\PrettyPageHandler);
|
||||
Boot::startSession();
|
||||
|
||||
$db_config = Config::getDbConfig();
|
||||
|
Loading…
Reference in New Issue
Block a user