Skip to content

Commit

Permalink
Merge pull request #1556 from jmolivas/update-remove-drupal-wrapper
Browse files Browse the repository at this point in the history
[update:execute] Remove Drupal service wrapper class
  • Loading branch information
jmolivas committed Dec 22, 2015
2 parents 666068d + fcc682b commit 95f1e46
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Command/Update/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$updates = update_get_update_list();
if ($module != 'all') {
if (!isset($updates[$module])) {
$io->error(sprintf(
$io->error(
sprintf(
$this->trans('commands.update.execute.messages.no-module-updates'),
$module
)
Expand All @@ -53,7 +54,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$updates = [$module => $updates[$module]];

if ($update_n && !isset($updates[$module]['pending'][$update_n])) {
$io->info(sprintf(
$io->info(
sprintf(
$this->trans('commands.update.execute.messages.module-update-function-not-found'),
$module,
$update_n
Expand All @@ -64,7 +66,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$io->info($this->trans('commands.site.maintenance.description'));
\Drupal::state()->set('system.maintenance_mode', true);

$state = $this->hasGetService('state');
$state->set('system.maintenance_mode', true);

foreach ($updates as $module_name => $module_updates) {
foreach ($module_updates['pending'] as $update_number => $update) {
Expand All @@ -77,7 +81,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$io->info($this->trans('commands.update.execute.messages.executing-required-previous-updates'));
}
for ($update_index=$module_updates['start']; $update_index<=$update_number; $update_index++) {
$io->info(sprintf(
$io->info(
sprintf(
$this->trans('commands.update.execute.messages.executing-update'),
$update_index,
$module_name
Expand All @@ -97,7 +102,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}

\Drupal::state()->set('system.maintenance_mode', false);
$state->set('system.maintenance_mode', false);
$io->info($this->trans('commands.site.maintenance.messages.maintenance-off'));

$this->getChain()->addCommand('cache:rebuild', ['cache' => 'all']);
Expand Down

0 comments on commit 95f1e46

Please sign in to comment.