diff --git a/resources/views/setup/migrations/import-v2-both.tpl b/resources/views/setup/migrations/import-v2-both.tpl index a831db77..3978c073 100644 --- a/resources/views/setup/migrations/import-v2-both.tpl +++ b/resources/views/setup/migrations/import-v2-both.tpl @@ -48,9 +48,8 @@ - @if (session()->has('msg')) -
diff --git a/resources/views/setup/migrations/import-v2-textures.tpl b/resources/views/setup/migrations/import-v2-textures.tpl index 456f5db1..c37f2e31 100644 --- a/resources/views/setup/migrations/import-v2-textures.tpl +++ b/resources/views/setup/migrations/import-v2-textures.tpl @@ -56,9 +56,8 @@ - @if (session()->has('msg')) -
diff --git a/resources/views/setup/migrations/import-v2-users.tpl b/resources/views/setup/migrations/import-v2-users.tpl index fcd69894..ccfb32d2 100644 --- a/resources/views/setup/migrations/import-v2-users.tpl +++ b/resources/views/setup/migrations/import-v2-users.tpl @@ -26,9 +26,8 @@ - @if (session()->has('msg')) -
diff --git a/setup/bootstrap.php b/setup/bootstrap.php index 8eccd809..4696c6ad 100644 --- a/setup/bootstrap.php +++ b/setup/bootstrap.php @@ -23,13 +23,15 @@ $handler = new \Whoops\Handler\PrettyPageHandler; $whoops->pushHandler($handler); $whoops->register(); +// Instantiate Application $app = new Illuminate\Foundation\Application(BASE_DIR); +// Set Container for Facades Illuminate\Support\Facades\Facade::setFacadeApplication($app); +// Register Basic Service Providers manually (new Illuminate\View\ViewServiceProvider($app))->register(); (new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app); - (new Illuminate\Database\DatabaseServiceProvider($app))->register(); (new Illuminate\Filesystem\FilesystemServiceProvider($app))->register(); (new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app); @@ -47,11 +49,6 @@ foreach ($config['aliases'] as $facade => $class) { \View::addExtension('tpl', 'blade'); -// Set Default Timezone to UTC+8 -date_default_timezone_set('Asia/Shanghai'); - - - $config = require BASE_DIR.'/config/database.php'; $db_config = $config['connections']['mysql']; diff --git a/setup/index.php b/setup/index.php index 9b6fa624..17332897 100644 --- a/setup/index.php +++ b/setup/index.php @@ -3,7 +3,6 @@ * Installation of Blessing Skin Server */ -// Register Composer Auto Loader require __DIR__."/bootstrap.php"; // If already installed diff --git a/setup/migrations/index.php b/setup/migrations/index.php index a29cdade..a1afe6dc 100644 --- a/setup/migrations/index.php +++ b/setup/migrations/index.php @@ -3,20 +3,12 @@ * Migrations Bootstrap of Blessing Skin Server */ -// Define Base Directory -define('BASE_DIR', dirname(dirname(dirname(__FILE__)))); +require dirname(__DIR__)."/bootstrap.php"; -// Register Composer Auto Loader -require BASE_DIR.'/vendor/autoload.php'; - -// Initialize Application -$app = new Blessing\Foundation\Application(); -$app->boot(); -Boot::registerErrorHandler(new \Whoops\Handler\PrettyPageHandler); - -$db_config = Config::getDbConfig(); - -Boot::checkInstallation('../../setup/index.php'); +// If already installed +if (!checkTableExist()) { + Http::redirect('../index.php'); +} if (isset($_COOKIE['uid']) && isset($_COOKIE['token'])) { $_SESSION['uid'] = $_COOKIE['uid']; diff --git a/setup/update.php b/setup/update.php index ea293bf7..19286f36 100644 --- a/setup/update.php +++ b/setup/update.php @@ -3,21 +3,10 @@ * Migrations Bootstrap of Blessing Skin Server */ -// Define Base Directory -define('BASE_DIR', dirname(dirname(__FILE__))); - -// Register Composer Auto Loader -require BASE_DIR.'/vendor/autoload.php'; - -// Initialize Application -$app = new Blessing\Foundation\Application(); -$app->boot(); -Boot::registerErrorHandler(new \Whoops\Handler\PrettyPageHandler); - -$db_config = Config::getDbConfig(); +require __DIR__."/bootstrap.php"; // If no update is available -if (App::version() == Option::get('version', '')) { +if (config('app.version') == Option::get('version', '')) { View::show('setup.locked'); exit; } @@ -37,7 +26,7 @@ switch ($step) { preg_match('/update-(.*)-to-(.*).php/', $filename, $matches); if (isset($matches[2])) { - $update_script_exist = ($matches[2] == App::version()); + $update_script_exist = ($matches[2] == config('app.version')); } else { continue; } @@ -49,7 +38,7 @@ switch ($step) { if (!$update_script_exist) { // if update script is not given - Option::set('version', App::version()); + Option::set('version', config('app.version')); } View::show('setup.updates.success');