Browse Source

Flush cache/assets when upgrading

pull/11/head
Toby Zerner 9 years ago
parent
commit
38b832bbf7
  1. 12
      flarum/bootstrap.php

12
flarum/bootstrap.php

@ -109,6 +109,8 @@ foreach ($serviceProviders as $provider) {
if (Core::isInstalled()) { if (Core::isInstalled()) {
$settings = $app->make('Flarum\Core\Settings\SettingsRepository'); $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 // 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 // code, then run the upgrade script (migrations). This is temporary - a
// proper, more secure upgrade method is planned. // proper, more secure upgrade method is planned.
@ -119,9 +121,15 @@ if (Core::isInstalled()) {
app('Flarum\Console\UpgradeCommand')->run($input, $output); app('Flarum\Console\UpgradeCommand')->run($input, $output);
$settings->set('version', $app::VERSION); $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.driver', Core::config('mail_driver'));
$config->set('mail.host', Core::config('mail_host')); $config->set('mail.host', Core::config('mail_host'));

Loading…
Cancel
Save