Flush cache/assets when upgrading

pull/11/head
Toby Zerner 2015-09-14 18:40:51 +09:30
parent 0ff233e8a1
commit 38b832bbf7
1 changed files with 10 additions and 2 deletions

View File

@ -109,6 +109,8 @@ foreach ($serviceProviders as $provider) {
if (Core::isInstalled()) {
$settings = $app->make('Flarum\Core\Settings\SettingsRepository');
$app->register(new \Flarum\Core\CoreServiceProvider($app));
// If the version stored in the database doesn't match the version of the
// code, then run the upgrade script (migrations). This is temporary - a
// proper, more secure upgrade method is planned.
@ -119,9 +121,15 @@ if (Core::isInstalled()) {
app('Flarum\Console\UpgradeCommand')->run($input, $output);
$settings->set('version', $app::VERSION);
}
$app->register(new \Flarum\Core\CoreServiceProvider($app));
app('flarum.formatter')->flush();
$forum = app('Flarum\Forum\Actions\ClientAction');
$forum->flushAssets();
$admin = app('Flarum\Admin\Actions\ClientAction');
$admin->flushAssets();
}
$config->set('mail.driver', Core::config('mail_driver'));
$config->set('mail.host', Core::config('mail_host'));