mirror of
https://github.com/flarum/core.git
synced 2025-10-19 10:46:06 +02:00
Add Interface suffix to SettingsRepository
This commit is contained in:
@@ -107,18 +107,8 @@ abstract class AbstractServer
|
||||
$app->register('Illuminate\View\ViewServiceProvider');
|
||||
$app->register('Illuminate\Validation\ValidationServiceProvider');
|
||||
|
||||
if ($app->isInstalled()) {
|
||||
$settings = $app->make('Flarum\Settings\SettingsRepository');
|
||||
|
||||
try {
|
||||
$version = $settings->get('version');
|
||||
} finally {
|
||||
if (! isset($version) || $version !== $app->version()) {
|
||||
die('run upgrade script');
|
||||
// $command = $app->make('Flarum\Console\Command\UpgradeCommand');
|
||||
// $command->upgrade();
|
||||
}
|
||||
}
|
||||
if ($app->isInstalled() && $app->isUpToDate()) {
|
||||
$settings = $app->make('Flarum\Settings\SettingsRepositoryInterface');
|
||||
|
||||
$config->set('mail.driver', $settings->get('mail_driver'));
|
||||
$config->set('mail.host', $settings->get('mail_host'));
|
||||
|
@@ -110,6 +110,17 @@ class Application extends Container implements ApplicationContract
|
||||
return $this->bound('flarum.config');
|
||||
}
|
||||
|
||||
public function isUpToDate()
|
||||
{
|
||||
$settings = $this->make('Flarum\Settings\SettingsRepositoryInterface');
|
||||
|
||||
try {
|
||||
$version = $settings->get('version');
|
||||
} finally {
|
||||
return isset($version) && $version === $this->version();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @param mixed $default
|
||||
@@ -600,7 +611,7 @@ class Application extends Container implements ApplicationContract
|
||||
*/
|
||||
public function isDownForMaintenance()
|
||||
{
|
||||
return file_exists($this->storagePath().'/framework/down');
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user