Browse Source

Upgrade the database on page load if necessary

pull/11/head
Toby Zerner 9 years ago
parent
commit
0ff233e8a1
  1. 14
      flarum/bootstrap.php

14
flarum/bootstrap.php

@ -107,6 +107,20 @@ foreach ($serviceProviders as $provider) {
}
if (Core::isInstalled()) {
$settings = $app->make('Flarum\Core\Settings\SettingsRepository');
// 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.
if ($settings->get('version') !== $app::VERSION) {
$input = new \Symfony\Component\Console\Input\StringInput('');
$output = new \Symfony\Component\Console\Output\BufferedOutput;
app('Flarum\Console\UpgradeCommand')->run($input, $output);
$settings->set('version', $app::VERSION);
}
$app->register(new \Flarum\Core\CoreServiceProvider($app));
$config->set('mail.driver', Core::config('mail_driver'));

Loading…
Cancel
Save