throw new \Asika\SimpleConsole\CommandArgsException('The version number must be numeric');
}
- DI::keyValue()->set( 'build', $version);
+ DI::keyValue()->set('build', $version);
echo DI::l10n()->t('The database version had been set to %s.', $version);
}
public static function performUpdate(bool $enable_maintenance_mode = true, bool $verbose = false): string
{
if ($enable_maintenance_mode) {
- DI::keyValue()->set( 'maintenance', 1);
+ DI::keyValue()->set('maintenance', 1);
}
$status = self::update($verbose, true);
if ($enable_maintenance_mode) {
- DI::keyValue()->set( 'maintenance', 0);
- DI::keyValue()->set( 'maintenance_reason', '');
+ DI::keyValue()->set('maintenance', 0);
+ DI::keyValue()->set('maintenance_reason', '');
}
return $status;
*/
private static function update(bool $verbose, bool $action, bool $install = false, array $tables = null, array $definition = null): string
{
- $in_maintenance_mode = DI::keyValue()->get('system', 'maintenance');
+ $in_maintenance_mode = DI::keyValue()->get('system', 'maintenance');
if ($action && !$install && self::isUpdating()) {
return DI::l10n()->t('Another database update is currently running.');
if ($action && !$install) {
if ($errors) {
- DI::config()->set('system', 'dbupdate', self::UPDATE_FAILED);
+ DI::config()->set('system', 'dbupdate', self::UPDATE_FAILED);
} else {
- DI::config()->set( 'system', 'dbupdate', self::UPDATE_SUCCESSFUL);
+ DI::config()->set('system', 'dbupdate', self::UPDATE_SUCCESSFUL);
}
}
$warningtext[] = DI::l10n()->t('The last update failed. Please run "php bin/console.php dbstructure update" from the command line and have a look at the errors that might appear. (Some of the errors are possibly inside the logfile.)');
}
- $last_worker_call = DI::keyValue()->get('last_worker_execution') ?? false;
+ $last_worker_call = DI::keyValue()->get('last_worker_execution');
if (!$last_worker_call) {
$warningtext[] = DI::l10n()->t('The worker was never executed. Please check your database structure!');
} elseif ((strtotime(DateTimeFormat::utcNow()) - strtotime($last_worker_call)) > 60 * 60) {