fix bootstrapers at update page
This commit is contained in:
parent
7e23d08285
commit
bd1579d7fb
|
|
@ -48,9 +48,8 @@
|
|||
</table>
|
||||
|
||||
|
||||
@if (session()->has('msg'))
|
||||
<div class="alert alert-warning" role="alert">{{ session('msg') }}</div>
|
||||
<?php session()->forget('msg'); ?>
|
||||
@if (isset($_SESSION['msg']))
|
||||
<div class="alert alert-warning" role="alert">{{ $_SESSION['msg'] }}</div> <?php unset($_SESSION['msg']); ?>
|
||||
@endif
|
||||
|
||||
<p class="step">
|
||||
|
|
|
|||
|
|
@ -56,9 +56,8 @@
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
@if (session()->has('msg'))
|
||||
<div class="alert alert-warning" role="alert">{{ session('msg') }}</div>
|
||||
<?php session()->forget('msg'); ?>
|
||||
@if (isset($_SESSION['msg']))
|
||||
<div class="alert alert-warning" role="alert">{{ $_SESSION['msg'] }}</div> <?php unset($_SESSION['msg']); ?>
|
||||
@endif
|
||||
|
||||
<p class="step">
|
||||
|
|
|
|||
|
|
@ -26,9 +26,8 @@
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
@if (session()->has('msg'))
|
||||
<div class="alert alert-warning" role="alert">{{ session('msg') }}</div>
|
||||
<?php session()->forget('msg'); ?>
|
||||
@if (isset($_SESSION['msg']))
|
||||
<div class="alert alert-warning" role="alert">{{ $_SESSION['msg'] }}</div> <?php unset($_SESSION['msg']); ?>
|
||||
@endif
|
||||
|
||||
<p class="step">
|
||||
|
|
|
|||
|
|
@ -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'];
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
* Installation of Blessing Skin Server
|
||||
*/
|
||||
|
||||
// Register Composer Auto Loader
|
||||
require __DIR__."/bootstrap.php";
|
||||
|
||||
// If already installed
|
||||
|
|
|
|||
|
|
@ -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'];
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user