@@ -102,14 +102,14 @@ discard block |
||
| 102 | 102 | $dispatcher = \OC::$server->getEventDispatcher(); |
| 103 | 103 | $progress = new ProgressBar($output); |
| 104 | 104 | $progress->setFormat(" %message%\n %current%/%max% [%bar%] %percent:3s%%"); |
| 105 | - $listener = function ($event) use ($progress, $output) { |
|
| 105 | + $listener = function($event) use ($progress, $output) { |
|
| 106 | 106 | if ($event instanceof GenericEvent) { |
| 107 | 107 | $message = $event->getSubject(); |
| 108 | 108 | if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
| 109 | - $output->writeln(' Checking table ' . $message); |
|
| 109 | + $output->writeln(' Checking table '.$message); |
|
| 110 | 110 | } else { |
| 111 | 111 | if (strlen($message) > 60) { |
| 112 | - $message = substr($message, 0, 57) . '...'; |
|
| 112 | + $message = substr($message, 0, 57).'...'; |
|
| 113 | 113 | } |
| 114 | 114 | $progress->setMessage($message); |
| 115 | 115 | if ($event[0] === 1) { |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | }; |
| 128 | - $repairListener = function ($event) use ($progress, $output) { |
|
| 128 | + $repairListener = function($event) use ($progress, $output) { |
|
| 129 | 129 | if (!$event instanceof GenericEvent) { |
| 130 | 130 | return; |
| 131 | 131 | } |
@@ -151,19 +151,19 @@ discard block |
||
| 151 | 151 | break; |
| 152 | 152 | case '\OC\Repair::step': |
| 153 | 153 | if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
| 154 | - $output->writeln('<info>Repair step: ' . $event->getArgument(0) . '</info>'); |
|
| 154 | + $output->writeln('<info>Repair step: '.$event->getArgument(0).'</info>'); |
|
| 155 | 155 | } |
| 156 | 156 | break; |
| 157 | 157 | case '\OC\Repair::info': |
| 158 | 158 | if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
| 159 | - $output->writeln('<info>Repair info: ' . $event->getArgument(0) . '</info>'); |
|
| 159 | + $output->writeln('<info>Repair info: '.$event->getArgument(0).'</info>'); |
|
| 160 | 160 | } |
| 161 | 161 | break; |
| 162 | 162 | case '\OC\Repair::warning': |
| 163 | - $output->writeln('<error>Repair warning: ' . $event->getArgument(0) . '</error>'); |
|
| 163 | + $output->writeln('<error>Repair warning: '.$event->getArgument(0).'</error>'); |
|
| 164 | 164 | break; |
| 165 | 165 | case '\OC\Repair::error': |
| 166 | - $output->writeln('<error>Repair error: ' . $event->getArgument(0) . '</error>'); |
|
| 166 | + $output->writeln('<error>Repair error: '.$event->getArgument(0).'</error>'); |
|
| 167 | 167 | break; |
| 168 | 168 | } |
| 169 | 169 | }; |
@@ -179,17 +179,17 @@ discard block |
||
| 179 | 179 | $dispatcher->addListener('\OC\Repair::error', $repairListener); |
| 180 | 180 | |
| 181 | 181 | |
| 182 | - $updater->listen('\OC\Updater', 'maintenanceEnabled', function () use ($output) { |
|
| 182 | + $updater->listen('\OC\Updater', 'maintenanceEnabled', function() use ($output) { |
|
| 183 | 183 | $output->writeln('<info>Turned on maintenance mode</info>'); |
| 184 | 184 | }); |
| 185 | - $updater->listen('\OC\Updater', 'maintenanceDisabled', function () use ($output) { |
|
| 185 | + $updater->listen('\OC\Updater', 'maintenanceDisabled', function() use ($output) { |
|
| 186 | 186 | $output->writeln('<info>Turned off maintenance mode</info>'); |
| 187 | 187 | }); |
| 188 | - $updater->listen('\OC\Updater', 'maintenanceActive', function () use ($output) { |
|
| 188 | + $updater->listen('\OC\Updater', 'maintenanceActive', function() use ($output) { |
|
| 189 | 189 | $output->writeln('<info>Maintenance mode is kept active</info>'); |
| 190 | 190 | }); |
| 191 | 191 | $updater->listen('\OC\Updater', 'updateEnd', |
| 192 | - function ($success) use ($output, $self) { |
|
| 192 | + function($success) use ($output, $self) { |
|
| 193 | 193 | if ($success) { |
| 194 | 194 | $message = "<info>Update successful</info>"; |
| 195 | 195 | } else { |
@@ -197,46 +197,46 @@ discard block |
||
| 197 | 197 | } |
| 198 | 198 | $output->writeln($message); |
| 199 | 199 | }); |
| 200 | - $updater->listen('\OC\Updater', 'dbUpgradeBefore', function () use ($output) { |
|
| 200 | + $updater->listen('\OC\Updater', 'dbUpgradeBefore', function() use ($output) { |
|
| 201 | 201 | $output->writeln('<info>Updating database schema</info>'); |
| 202 | 202 | }); |
| 203 | - $updater->listen('\OC\Updater', 'dbUpgrade', function () use ($output) { |
|
| 203 | + $updater->listen('\OC\Updater', 'dbUpgrade', function() use ($output) { |
|
| 204 | 204 | $output->writeln('<info>Updated database</info>'); |
| 205 | 205 | }); |
| 206 | - $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use ($output) { |
|
| 207 | - $output->writeln('<comment>Disabled incompatible app: ' . $app . '</comment>'); |
|
| 206 | + $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function($app) use ($output) { |
|
| 207 | + $output->writeln('<comment>Disabled incompatible app: '.$app.'</comment>'); |
|
| 208 | 208 | }); |
| 209 | - $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($output) { |
|
| 210 | - $output->writeln('<info>Checking for update of app ' . $app . ' in appstore</info>'); |
|
| 209 | + $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function($app) use ($output) { |
|
| 210 | + $output->writeln('<info>Checking for update of app '.$app.' in appstore</info>'); |
|
| 211 | 211 | }); |
| 212 | - $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($output) { |
|
| 213 | - $output->writeln('<info>Update app ' . $app . ' from appstore</info>'); |
|
| 212 | + $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function($app) use ($output) { |
|
| 213 | + $output->writeln('<info>Update app '.$app.' from appstore</info>'); |
|
| 214 | 214 | }); |
| 215 | - $updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($output) { |
|
| 216 | - $output->writeln('<info>Checked for update of app "' . $app . '" in appstore </info>'); |
|
| 215 | + $updater->listen('\OC\Updater', 'checkAppStoreApp', function($app) use ($output) { |
|
| 216 | + $output->writeln('<info>Checked for update of app "'.$app.'" in appstore </info>'); |
|
| 217 | 217 | }); |
| 218 | - $updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($output) { |
|
| 218 | + $updater->listen('\OC\Updater', 'appSimulateUpdate', function($app) use ($output) { |
|
| 219 | 219 | $output->writeln("<info>Checking whether the database schema for <$app> can be updated (this can take a long time depending on the database size)</info>"); |
| 220 | 220 | }); |
| 221 | - $updater->listen('\OC\Updater', 'appUpgradeStarted', function ($app, $version) use ($output) { |
|
| 221 | + $updater->listen('\OC\Updater', 'appUpgradeStarted', function($app, $version) use ($output) { |
|
| 222 | 222 | $output->writeln("<info>Updating <$app> ...</info>"); |
| 223 | 223 | }); |
| 224 | - $updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($output) { |
|
| 224 | + $updater->listen('\OC\Updater', 'appUpgrade', function($app, $version) use ($output) { |
|
| 225 | 225 | $output->writeln("<info>Updated <$app> to $version</info>"); |
| 226 | 226 | }); |
| 227 | - $updater->listen('\OC\Updater', 'failure', function ($message) use ($output, $self) { |
|
| 227 | + $updater->listen('\OC\Updater', 'failure', function($message) use ($output, $self) { |
|
| 228 | 228 | $output->writeln("<error>$message</error>"); |
| 229 | 229 | }); |
| 230 | - $updater->listen('\OC\Updater', 'setDebugLogLevel', function ($logLevel, $logLevelName) use ($output) { |
|
| 230 | + $updater->listen('\OC\Updater', 'setDebugLogLevel', function($logLevel, $logLevelName) use ($output) { |
|
| 231 | 231 | $output->writeln("<info>Setting log level to debug</info>"); |
| 232 | 232 | }); |
| 233 | - $updater->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use ($output) { |
|
| 233 | + $updater->listen('\OC\Updater', 'resetLogLevel', function($logLevel, $logLevelName) use ($output) { |
|
| 234 | 234 | $output->writeln("<info>Resetting log level</info>"); |
| 235 | 235 | }); |
| 236 | - $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use ($output) { |
|
| 236 | + $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function() use ($output) { |
|
| 237 | 237 | $output->writeln("<info>Starting code integrity check...</info>"); |
| 238 | 238 | }); |
| 239 | - $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use ($output) { |
|
| 239 | + $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function() use ($output) { |
|
| 240 | 240 | $output->writeln("<info>Finished code integrity check</info>"); |
| 241 | 241 | }); |
| 242 | 242 | |
@@ -274,8 +274,8 @@ discard block |
||
| 274 | 274 | $trustedDomains = $this->config->getSystemValue('trusted_domains', []); |
| 275 | 275 | if (empty($trustedDomains)) { |
| 276 | 276 | $output->write( |
| 277 | - '<warning>The setting "trusted_domains" could not be ' . |
|
| 278 | - 'set automatically by the upgrade script, ' . |
|
| 277 | + '<warning>The setting "trusted_domains" could not be '. |
|
| 278 | + 'set automatically by the upgrade script, '. |
|
| 279 | 279 | 'please set it manually</warning>' |
| 280 | 280 | ); |
| 281 | 281 | } |
@@ -90,16 +90,16 @@ discard block |
||
| 90 | 90 | $this->eventSource->send('success', $this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $this->currentStep])); |
| 91 | 91 | break; |
| 92 | 92 | case '\OC\Repair::step': |
| 93 | - $this->eventSource->send('success', $this->l10n->t('Repair step:') . ' ' . $event->getArgument(0)); |
|
| 93 | + $this->eventSource->send('success', $this->l10n->t('Repair step:').' '.$event->getArgument(0)); |
|
| 94 | 94 | break; |
| 95 | 95 | case '\OC\Repair::info': |
| 96 | - $this->eventSource->send('success', $this->l10n->t('Repair info:') . ' ' . $event->getArgument(0)); |
|
| 96 | + $this->eventSource->send('success', $this->l10n->t('Repair info:').' '.$event->getArgument(0)); |
|
| 97 | 97 | break; |
| 98 | 98 | case '\OC\Repair::warning': |
| 99 | - $this->eventSource->send('notice', $this->l10n->t('Repair warning:') . ' ' . $event->getArgument(0)); |
|
| 99 | + $this->eventSource->send('notice', $this->l10n->t('Repair warning:').' '.$event->getArgument(0)); |
|
| 100 | 100 | break; |
| 101 | 101 | case '\OC\Repair::error': |
| 102 | - $this->eventSource->send('notice', $this->l10n->t('Repair error:') . ' ' . $event->getArgument(0)); |
|
| 102 | + $this->eventSource->send('notice', $this->l10n->t('Repair error:').' '.$event->getArgument(0)); |
|
| 103 | 103 | break; |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -128,12 +128,12 @@ discard block |
||
| 128 | 128 | $incompatibleApps = []; |
| 129 | 129 | |
| 130 | 130 | $dispatcher = \OC::$server->getEventDispatcher(); |
| 131 | - $dispatcher->addListener('\OC\DB\Migrator::executeSql', function ($event) use ($eventSource, $l) { |
|
| 131 | + $dispatcher->addListener('\OC\DB\Migrator::executeSql', function($event) use ($eventSource, $l) { |
|
| 132 | 132 | if ($event instanceof GenericEvent) { |
| 133 | 133 | $eventSource->send('success', $l->t('[%d / %d]: %s', [$event[0], $event[1], $event->getSubject()])); |
| 134 | 134 | } |
| 135 | 135 | }); |
| 136 | - $dispatcher->addListener('\OC\DB\Migrator::checkTable', function ($event) use ($eventSource, $l) { |
|
| 136 | + $dispatcher->addListener('\OC\DB\Migrator::checkTable', function($event) use ($eventSource, $l) { |
|
| 137 | 137 | if ($event instanceof GenericEvent) { |
| 138 | 138 | $eventSource->send('success', $l->t('[%d / %d]: Checking table %s', [$event[0], $event[1], $event->getSubject()])); |
| 139 | 139 | } |
@@ -147,54 +147,54 @@ discard block |
||
| 147 | 147 | $dispatcher->addListener('\OC\Repair::warning', [$feedBack, 'handleRepairFeedback']); |
| 148 | 148 | $dispatcher->addListener('\OC\Repair::error', [$feedBack, 'handleRepairFeedback']); |
| 149 | 149 | |
| 150 | - $updater->listen('\OC\Updater', 'maintenanceEnabled', function () use ($eventSource, $l) { |
|
| 150 | + $updater->listen('\OC\Updater', 'maintenanceEnabled', function() use ($eventSource, $l) { |
|
| 151 | 151 | $eventSource->send('success', $l->t('Turned on maintenance mode')); |
| 152 | 152 | }); |
| 153 | - $updater->listen('\OC\Updater', 'maintenanceDisabled', function () use ($eventSource, $l) { |
|
| 153 | + $updater->listen('\OC\Updater', 'maintenanceDisabled', function() use ($eventSource, $l) { |
|
| 154 | 154 | $eventSource->send('success', $l->t('Turned off maintenance mode')); |
| 155 | 155 | }); |
| 156 | - $updater->listen('\OC\Updater', 'maintenanceActive', function () use ($eventSource, $l) { |
|
| 156 | + $updater->listen('\OC\Updater', 'maintenanceActive', function() use ($eventSource, $l) { |
|
| 157 | 157 | $eventSource->send('success', $l->t('Maintenance mode is kept active')); |
| 158 | 158 | }); |
| 159 | - $updater->listen('\OC\Updater', 'dbUpgradeBefore', function () use ($eventSource, $l) { |
|
| 159 | + $updater->listen('\OC\Updater', 'dbUpgradeBefore', function() use ($eventSource, $l) { |
|
| 160 | 160 | $eventSource->send('success', $l->t('Updating database schema')); |
| 161 | 161 | }); |
| 162 | - $updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource, $l) { |
|
| 162 | + $updater->listen('\OC\Updater', 'dbUpgrade', function() use ($eventSource, $l) { |
|
| 163 | 163 | $eventSource->send('success', $l->t('Updated database')); |
| 164 | 164 | }); |
| 165 | - $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($eventSource, $l) { |
|
| 165 | + $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function($app) use ($eventSource, $l) { |
|
| 166 | 166 | $eventSource->send('success', $l->t('Checking for update of app "%s" in appstore', [$app])); |
| 167 | 167 | }); |
| 168 | - $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($eventSource, $l) { |
|
| 168 | + $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function($app) use ($eventSource, $l) { |
|
| 169 | 169 | $eventSource->send('success', $l->t('Update app "%s" from appstore', [$app])); |
| 170 | 170 | }); |
| 171 | - $updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($eventSource, $l) { |
|
| 171 | + $updater->listen('\OC\Updater', 'checkAppStoreApp', function($app) use ($eventSource, $l) { |
|
| 172 | 172 | $eventSource->send('success', $l->t('Checked for update of app "%s" in appstore', [$app])); |
| 173 | 173 | }); |
| 174 | - $updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($eventSource, $l) { |
|
| 174 | + $updater->listen('\OC\Updater', 'appSimulateUpdate', function($app) use ($eventSource, $l) { |
|
| 175 | 175 | $eventSource->send('success', $l->t('Checking whether the database schema for %s can be updated (this can take a long time depending on the database size)', [$app])); |
| 176 | 176 | }); |
| 177 | - $updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($eventSource, $l) { |
|
| 177 | + $updater->listen('\OC\Updater', 'appUpgrade', function($app, $version) use ($eventSource, $l) { |
|
| 178 | 178 | $eventSource->send('success', $l->t('Updated "%1$s" to %2$s', [$app, $version])); |
| 179 | 179 | }); |
| 180 | - $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use (&$incompatibleApps) { |
|
| 180 | + $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function($app) use (&$incompatibleApps) { |
|
| 181 | 181 | $incompatibleApps[] = $app; |
| 182 | 182 | }); |
| 183 | - $updater->listen('\OC\Updater', 'failure', function ($message) use ($eventSource, $config) { |
|
| 183 | + $updater->listen('\OC\Updater', 'failure', function($message) use ($eventSource, $config) { |
|
| 184 | 184 | $eventSource->send('failure', $message); |
| 185 | 185 | $eventSource->close(); |
| 186 | 186 | $config->setSystemValue('maintenance', false); |
| 187 | 187 | }); |
| 188 | - $updater->listen('\OC\Updater', 'setDebugLogLevel', function ($logLevel, $logLevelName) use ($eventSource, $l) { |
|
| 188 | + $updater->listen('\OC\Updater', 'setDebugLogLevel', function($logLevel, $logLevelName) use ($eventSource, $l) { |
|
| 189 | 189 | $eventSource->send('success', $l->t('Set log level to debug')); |
| 190 | 190 | }); |
| 191 | - $updater->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use ($eventSource, $l) { |
|
| 191 | + $updater->listen('\OC\Updater', 'resetLogLevel', function($logLevel, $logLevelName) use ($eventSource, $l) { |
|
| 192 | 192 | $eventSource->send('success', $l->t('Reset log level')); |
| 193 | 193 | }); |
| 194 | - $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use ($eventSource, $l) { |
|
| 194 | + $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function() use ($eventSource, $l) { |
|
| 195 | 195 | $eventSource->send('success', $l->t('Starting code integrity check')); |
| 196 | 196 | }); |
| 197 | - $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use ($eventSource, $l) { |
|
| 197 | + $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function() use ($eventSource, $l) { |
|
| 198 | 198 | $eventSource->send('success', $l->t('Finished code integrity check')); |
| 199 | 199 | }); |
| 200 | 200 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | 'level' => ILogger::ERROR, |
| 206 | 206 | 'app' => 'update', |
| 207 | 207 | ]); |
| 208 | - $eventSource->send('failure', get_class($e) . ': ' . $e->getMessage()); |
|
| 208 | + $eventSource->send('failure', get_class($e).': '.$e->getMessage()); |
|
| 209 | 209 | $eventSource->close(); |
| 210 | 210 | exit(); |
| 211 | 211 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $this->logAllEvents(); |
| 107 | 107 | |
| 108 | 108 | $logLevel = $this->config->getSystemValue('loglevel', ILogger::WARN); |
| 109 | - $this->emit('\OC\Updater', 'setDebugLogLevel', [ $logLevel, $this->logLevelNames[$logLevel] ]); |
|
| 109 | + $this->emit('\OC\Updater', 'setDebugLogLevel', [$logLevel, $this->logLevelNames[$logLevel]]); |
|
| 110 | 110 | $this->config->setSystemValue('loglevel', ILogger::DEBUG); |
| 111 | 111 | |
| 112 | 112 | $wasMaintenanceModeEnabled = $this->config->getSystemValueBool('maintenance'); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | // Clear CAN_INSTALL file if not on git |
| 120 | 120 | if (\OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir.'/CAN_INSTALL')) { |
| 121 | - if (!unlink(\OC::$configDir . '/CAN_INSTALL')) { |
|
| 121 | + if (!unlink(\OC::$configDir.'/CAN_INSTALL')) { |
|
| 122 | 122 | $this->log->error('Could not cleanup CAN_INSTALL from your config folder. Please remove this file manually.'); |
| 123 | 123 | } |
| 124 | 124 | } |
@@ -126,18 +126,18 @@ discard block |
||
| 126 | 126 | $installedVersion = $this->config->getSystemValue('version', '0.0.0'); |
| 127 | 127 | $currentVersion = implode('.', \OCP\Util::getVersion()); |
| 128 | 128 | |
| 129 | - $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, ['app' => 'core']); |
|
| 129 | + $this->log->debug('starting upgrade from '.$installedVersion.' to '.$currentVersion, ['app' => 'core']); |
|
| 130 | 130 | |
| 131 | 131 | $success = true; |
| 132 | 132 | try { |
| 133 | 133 | $this->doUpgrade($currentVersion, $installedVersion); |
| 134 | 134 | } catch (HintException $exception) { |
| 135 | 135 | $this->log->logException($exception, ['app' => 'core']); |
| 136 | - $this->emit('\OC\Updater', 'failure', [$exception->getMessage() . ': ' .$exception->getHint()]); |
|
| 136 | + $this->emit('\OC\Updater', 'failure', [$exception->getMessage().': '.$exception->getHint()]); |
|
| 137 | 137 | $success = false; |
| 138 | 138 | } catch (\Exception $exception) { |
| 139 | 139 | $this->log->logException($exception, ['app' => 'core']); |
| 140 | - $this->emit('\OC\Updater', 'failure', [get_class($exception) . ': ' .$exception->getMessage()]); |
|
| 140 | + $this->emit('\OC\Updater', 'failure', [get_class($exception).': '.$exception->getMessage()]); |
|
| 141 | 141 | $success = false; |
| 142 | 142 | } |
| 143 | 143 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $this->emit('\OC\Updater', 'maintenanceActive'); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - $this->emit('\OC\Updater', 'resetLogLevel', [ $logLevel, $this->logLevelNames[$logLevel] ]); |
|
| 153 | + $this->emit('\OC\Updater', 'resetLogLevel', [$logLevel, $this->logLevelNames[$logLevel]]); |
|
| 154 | 154 | $this->config->setSystemValue('loglevel', $logLevel); |
| 155 | 155 | $this->config->setSystemValue('installed', true); |
| 156 | 156 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | */ |
| 165 | 165 | private function getAllowedPreviousVersions() { |
| 166 | 166 | // this should really be a JSON file |
| 167 | - require \OC::$SERVERROOT . '/version.php'; |
|
| 167 | + require \OC::$SERVERROOT.'/version.php'; |
|
| 168 | 168 | /** @var array $OC_VersionCanBeUpgradedFrom */ |
| 169 | 169 | return $OC_VersionCanBeUpgradedFrom; |
| 170 | 170 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | private function getVendor() { |
| 178 | 178 | // this should really be a JSON file |
| 179 | - require \OC::$SERVERROOT . '/version.php'; |
|
| 179 | + require \OC::$SERVERROOT.'/version.php'; |
|
| 180 | 180 | /** @var string $vendor */ |
| 181 | 181 | return (string) $vendor; |
| 182 | 182 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | */ |
| 191 | 191 | public function isUpgradePossible($oldVersion, $newVersion, array $allowedPreviousVersions) { |
| 192 | 192 | $version = explode('.', $oldVersion); |
| 193 | - $majorMinor = $version[0] . '.' . $version[1]; |
|
| 193 | + $majorMinor = $version[0].'.'.$version[1]; |
|
| 194 | 194 | |
| 195 | 195 | $currentVendor = $this->config->getAppValue('core', 'vendor', ''); |
| 196 | 196 | |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | // create empty file in data dir, so we can later find |
| 242 | 242 | // out that this is indeed an ownCloud data directory |
| 243 | 243 | // (in case it didn't exist before) |
| 244 | - file_put_contents($this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/.ocdata', ''); |
|
| 244 | + file_put_contents($this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/.ocdata', ''); |
|
| 245 | 245 | |
| 246 | 246 | // pre-upgrade repairs |
| 247 | 247 | $repair = new Repair(Repair::getBeforeUpgradeRepairSteps(), \OC::$server->getEventDispatcher(), \OC::$server->get(LoggerInterface::class)); |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | foreach ($errors as $appId => $exception) { |
| 274 | 274 | /** @var \Exception $exception */ |
| 275 | 275 | $this->log->logException($exception, ['app' => $appId]); |
| 276 | - $this->emit('\OC\Updater', 'failure', [$appId . ': ' . $exception->getMessage()]); |
|
| 276 | + $this->emit('\OC\Updater', 'failure', [$appId.': '.$exception->getMessage()]); |
|
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | // post-upgrade repairs |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | $info = OC_App::getAppInfo($app); |
| 372 | 372 | if ($info === null || !OC_App::isAppCompatible($version, $info)) { |
| 373 | 373 | if ($appManager->isShipped($app)) { |
| 374 | - throw new \UnexpectedValueException('The files of the app "' . $app . '" were not correctly replaced before running the update'); |
|
| 374 | + throw new \UnexpectedValueException('The files of the app "'.$app.'" were not correctly replaced before running the update'); |
|
| 375 | 375 | } |
| 376 | 376 | \OC::$server->getAppManager()->disableApp($app, true); |
| 377 | 377 | $this->emit('\OC\Updater', 'incompatibleAppDisabled', [$app]); |
@@ -434,22 +434,22 @@ discard block |
||
| 434 | 434 | */ |
| 435 | 435 | private function emitRepairEvents() { |
| 436 | 436 | $dispatcher = \OC::$server->getEventDispatcher(); |
| 437 | - $dispatcher->addListener('\OC\Repair::warning', function ($event) { |
|
| 437 | + $dispatcher->addListener('\OC\Repair::warning', function($event) { |
|
| 438 | 438 | if ($event instanceof GenericEvent) { |
| 439 | 439 | $this->emit('\OC\Updater', 'repairWarning', $event->getArguments()); |
| 440 | 440 | } |
| 441 | 441 | }); |
| 442 | - $dispatcher->addListener('\OC\Repair::error', function ($event) { |
|
| 442 | + $dispatcher->addListener('\OC\Repair::error', function($event) { |
|
| 443 | 443 | if ($event instanceof GenericEvent) { |
| 444 | 444 | $this->emit('\OC\Updater', 'repairError', $event->getArguments()); |
| 445 | 445 | } |
| 446 | 446 | }); |
| 447 | - $dispatcher->addListener('\OC\Repair::info', function ($event) { |
|
| 447 | + $dispatcher->addListener('\OC\Repair::info', function($event) { |
|
| 448 | 448 | if ($event instanceof GenericEvent) { |
| 449 | 449 | $this->emit('\OC\Updater', 'repairInfo', $event->getArguments()); |
| 450 | 450 | } |
| 451 | 451 | }); |
| 452 | - $dispatcher->addListener('\OC\Repair::step', function ($event) { |
|
| 452 | + $dispatcher->addListener('\OC\Repair::step', function($event) { |
|
| 453 | 453 | if ($event instanceof GenericEvent) { |
| 454 | 454 | $this->emit('\OC\Updater', 'repairStep', $event->getArguments()); |
| 455 | 455 | } |
@@ -460,49 +460,49 @@ discard block |
||
| 460 | 460 | $log = $this->log; |
| 461 | 461 | |
| 462 | 462 | $dispatcher = \OC::$server->getEventDispatcher(); |
| 463 | - $dispatcher->addListener('\OC\DB\Migrator::executeSql', function ($event) use ($log) { |
|
| 463 | + $dispatcher->addListener('\OC\DB\Migrator::executeSql', function($event) use ($log) { |
|
| 464 | 464 | if (!$event instanceof GenericEvent) { |
| 465 | 465 | return; |
| 466 | 466 | } |
| 467 | - $log->info('\OC\DB\Migrator::executeSql: ' . $event->getSubject() . ' (' . $event->getArgument(0) . ' of ' . $event->getArgument(1) . ')', ['app' => 'updater']); |
|
| 467 | + $log->info('\OC\DB\Migrator::executeSql: '.$event->getSubject().' ('.$event->getArgument(0).' of '.$event->getArgument(1).')', ['app' => 'updater']); |
|
| 468 | 468 | }); |
| 469 | - $dispatcher->addListener('\OC\DB\Migrator::checkTable', function ($event) use ($log) { |
|
| 469 | + $dispatcher->addListener('\OC\DB\Migrator::checkTable', function($event) use ($log) { |
|
| 470 | 470 | if (!$event instanceof GenericEvent) { |
| 471 | 471 | return; |
| 472 | 472 | } |
| 473 | - $log->info('\OC\DB\Migrator::checkTable: ' . $event->getSubject() . ' (' . $event->getArgument(0) . ' of ' . $event->getArgument(1) . ')', ['app' => 'updater']); |
|
| 473 | + $log->info('\OC\DB\Migrator::checkTable: '.$event->getSubject().' ('.$event->getArgument(0).' of '.$event->getArgument(1).')', ['app' => 'updater']); |
|
| 474 | 474 | }); |
| 475 | 475 | |
| 476 | - $repairListener = function ($event) use ($log) { |
|
| 476 | + $repairListener = function($event) use ($log) { |
|
| 477 | 477 | if (!$event instanceof GenericEvent) { |
| 478 | 478 | return; |
| 479 | 479 | } |
| 480 | 480 | switch ($event->getSubject()) { |
| 481 | 481 | case '\OC\Repair::startProgress': |
| 482 | - $log->info('\OC\Repair::startProgress: Starting ... ' . $event->getArgument(1) . ' (' . $event->getArgument(0) . ')', ['app' => 'updater']); |
|
| 482 | + $log->info('\OC\Repair::startProgress: Starting ... '.$event->getArgument(1).' ('.$event->getArgument(0).')', ['app' => 'updater']); |
|
| 483 | 483 | break; |
| 484 | 484 | case '\OC\Repair::advance': |
| 485 | 485 | $desc = $event->getArgument(1); |
| 486 | 486 | if (empty($desc)) { |
| 487 | 487 | $desc = ''; |
| 488 | 488 | } |
| 489 | - $log->info('\OC\Repair::advance: ' . $desc . ' (' . $event->getArgument(0) . ')', ['app' => 'updater']); |
|
| 489 | + $log->info('\OC\Repair::advance: '.$desc.' ('.$event->getArgument(0).')', ['app' => 'updater']); |
|
| 490 | 490 | |
| 491 | 491 | break; |
| 492 | 492 | case '\OC\Repair::finishProgress': |
| 493 | 493 | $log->info('\OC\Repair::finishProgress', ['app' => 'updater']); |
| 494 | 494 | break; |
| 495 | 495 | case '\OC\Repair::step': |
| 496 | - $log->info('\OC\Repair::step: Repair step: ' . $event->getArgument(0), ['app' => 'updater']); |
|
| 496 | + $log->info('\OC\Repair::step: Repair step: '.$event->getArgument(0), ['app' => 'updater']); |
|
| 497 | 497 | break; |
| 498 | 498 | case '\OC\Repair::info': |
| 499 | - $log->info('\OC\Repair::info: Repair info: ' . $event->getArgument(0), ['app' => 'updater']); |
|
| 499 | + $log->info('\OC\Repair::info: Repair info: '.$event->getArgument(0), ['app' => 'updater']); |
|
| 500 | 500 | break; |
| 501 | 501 | case '\OC\Repair::warning': |
| 502 | - $log->warning('\OC\Repair::warning: Repair warning: ' . $event->getArgument(0), ['app' => 'updater']); |
|
| 502 | + $log->warning('\OC\Repair::warning: Repair warning: '.$event->getArgument(0), ['app' => 'updater']); |
|
| 503 | 503 | break; |
| 504 | 504 | case '\OC\Repair::error': |
| 505 | - $log->error('\OC\Repair::error: Repair error: ' . $event->getArgument(0), ['app' => 'updater']); |
|
| 505 | + $log->error('\OC\Repair::error: Repair error: '.$event->getArgument(0), ['app' => 'updater']); |
|
| 506 | 506 | break; |
| 507 | 507 | } |
| 508 | 508 | }; |
@@ -516,62 +516,62 @@ discard block |
||
| 516 | 516 | $dispatcher->addListener('\OC\Repair::error', $repairListener); |
| 517 | 517 | |
| 518 | 518 | |
| 519 | - $this->listen('\OC\Updater', 'maintenanceEnabled', function () use ($log) { |
|
| 519 | + $this->listen('\OC\Updater', 'maintenanceEnabled', function() use ($log) { |
|
| 520 | 520 | $log->info('\OC\Updater::maintenanceEnabled: Turned on maintenance mode', ['app' => 'updater']); |
| 521 | 521 | }); |
| 522 | - $this->listen('\OC\Updater', 'maintenanceDisabled', function () use ($log) { |
|
| 522 | + $this->listen('\OC\Updater', 'maintenanceDisabled', function() use ($log) { |
|
| 523 | 523 | $log->info('\OC\Updater::maintenanceDisabled: Turned off maintenance mode', ['app' => 'updater']); |
| 524 | 524 | }); |
| 525 | - $this->listen('\OC\Updater', 'maintenanceActive', function () use ($log) { |
|
| 525 | + $this->listen('\OC\Updater', 'maintenanceActive', function() use ($log) { |
|
| 526 | 526 | $log->info('\OC\Updater::maintenanceActive: Maintenance mode is kept active', ['app' => 'updater']); |
| 527 | 527 | }); |
| 528 | - $this->listen('\OC\Updater', 'updateEnd', function ($success) use ($log) { |
|
| 528 | + $this->listen('\OC\Updater', 'updateEnd', function($success) use ($log) { |
|
| 529 | 529 | if ($success) { |
| 530 | 530 | $log->info('\OC\Updater::updateEnd: Update successful', ['app' => 'updater']); |
| 531 | 531 | } else { |
| 532 | 532 | $log->error('\OC\Updater::updateEnd: Update failed', ['app' => 'updater']); |
| 533 | 533 | } |
| 534 | 534 | }); |
| 535 | - $this->listen('\OC\Updater', 'dbUpgradeBefore', function () use ($log) { |
|
| 535 | + $this->listen('\OC\Updater', 'dbUpgradeBefore', function() use ($log) { |
|
| 536 | 536 | $log->info('\OC\Updater::dbUpgradeBefore: Updating database schema', ['app' => 'updater']); |
| 537 | 537 | }); |
| 538 | - $this->listen('\OC\Updater', 'dbUpgrade', function () use ($log) { |
|
| 538 | + $this->listen('\OC\Updater', 'dbUpgrade', function() use ($log) { |
|
| 539 | 539 | $log->info('\OC\Updater::dbUpgrade: Updated database', ['app' => 'updater']); |
| 540 | 540 | }); |
| 541 | - $this->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use ($log) { |
|
| 542 | - $log->info('\OC\Updater::incompatibleAppDisabled: Disabled incompatible app: ' . $app, ['app' => 'updater']); |
|
| 541 | + $this->listen('\OC\Updater', 'incompatibleAppDisabled', function($app) use ($log) { |
|
| 542 | + $log->info('\OC\Updater::incompatibleAppDisabled: Disabled incompatible app: '.$app, ['app' => 'updater']); |
|
| 543 | 543 | }); |
| 544 | - $this->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($log) { |
|
| 545 | - $log->info('\OC\Updater::checkAppStoreAppBefore: Checking for update of app "' . $app . '" in appstore', ['app' => 'updater']); |
|
| 544 | + $this->listen('\OC\Updater', 'checkAppStoreAppBefore', function($app) use ($log) { |
|
| 545 | + $log->info('\OC\Updater::checkAppStoreAppBefore: Checking for update of app "'.$app.'" in appstore', ['app' => 'updater']); |
|
| 546 | 546 | }); |
| 547 | - $this->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($log) { |
|
| 548 | - $log->info('\OC\Updater::upgradeAppStoreApp: Update app "' . $app . '" from appstore', ['app' => 'updater']); |
|
| 547 | + $this->listen('\OC\Updater', 'upgradeAppStoreApp', function($app) use ($log) { |
|
| 548 | + $log->info('\OC\Updater::upgradeAppStoreApp: Update app "'.$app.'" from appstore', ['app' => 'updater']); |
|
| 549 | 549 | }); |
| 550 | - $this->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($log) { |
|
| 551 | - $log->info('\OC\Updater::checkAppStoreApp: Checked for update of app "' . $app . '" in appstore', ['app' => 'updater']); |
|
| 550 | + $this->listen('\OC\Updater', 'checkAppStoreApp', function($app) use ($log) { |
|
| 551 | + $log->info('\OC\Updater::checkAppStoreApp: Checked for update of app "'.$app.'" in appstore', ['app' => 'updater']); |
|
| 552 | 552 | }); |
| 553 | - $this->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($log) { |
|
| 554 | - $log->info('\OC\Updater::appSimulateUpdate: Checking whether the database schema for <' . $app . '> can be updated (this can take a long time depending on the database size)', ['app' => 'updater']); |
|
| 553 | + $this->listen('\OC\Updater', 'appSimulateUpdate', function($app) use ($log) { |
|
| 554 | + $log->info('\OC\Updater::appSimulateUpdate: Checking whether the database schema for <'.$app.'> can be updated (this can take a long time depending on the database size)', ['app' => 'updater']); |
|
| 555 | 555 | }); |
| 556 | - $this->listen('\OC\Updater', 'appUpgradeStarted', function ($app) use ($log) { |
|
| 557 | - $log->info('\OC\Updater::appUpgradeStarted: Updating <' . $app . '> ...', ['app' => 'updater']); |
|
| 556 | + $this->listen('\OC\Updater', 'appUpgradeStarted', function($app) use ($log) { |
|
| 557 | + $log->info('\OC\Updater::appUpgradeStarted: Updating <'.$app.'> ...', ['app' => 'updater']); |
|
| 558 | 558 | }); |
| 559 | - $this->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($log) { |
|
| 560 | - $log->info('\OC\Updater::appUpgrade: Updated <' . $app . '> to ' . $version, ['app' => 'updater']); |
|
| 559 | + $this->listen('\OC\Updater', 'appUpgrade', function($app, $version) use ($log) { |
|
| 560 | + $log->info('\OC\Updater::appUpgrade: Updated <'.$app.'> to '.$version, ['app' => 'updater']); |
|
| 561 | 561 | }); |
| 562 | - $this->listen('\OC\Updater', 'failure', function ($message) use ($log) { |
|
| 563 | - $log->error('\OC\Updater::failure: ' . $message, ['app' => 'updater']); |
|
| 562 | + $this->listen('\OC\Updater', 'failure', function($message) use ($log) { |
|
| 563 | + $log->error('\OC\Updater::failure: '.$message, ['app' => 'updater']); |
|
| 564 | 564 | }); |
| 565 | - $this->listen('\OC\Updater', 'setDebugLogLevel', function () use ($log) { |
|
| 565 | + $this->listen('\OC\Updater', 'setDebugLogLevel', function() use ($log) { |
|
| 566 | 566 | $log->info('\OC\Updater::setDebugLogLevel: Set log level to debug', ['app' => 'updater']); |
| 567 | 567 | }); |
| 568 | - $this->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use ($log) { |
|
| 569 | - $log->info('\OC\Updater::resetLogLevel: Reset log level to ' . $logLevelName . '(' . $logLevel . ')', ['app' => 'updater']); |
|
| 568 | + $this->listen('\OC\Updater', 'resetLogLevel', function($logLevel, $logLevelName) use ($log) { |
|
| 569 | + $log->info('\OC\Updater::resetLogLevel: Reset log level to '.$logLevelName.'('.$logLevel.')', ['app' => 'updater']); |
|
| 570 | 570 | }); |
| 571 | - $this->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use ($log) { |
|
| 571 | + $this->listen('\OC\Updater', 'startCheckCodeIntegrity', function() use ($log) { |
|
| 572 | 572 | $log->info('\OC\Updater::startCheckCodeIntegrity: Starting code integrity check...', ['app' => 'updater']); |
| 573 | 573 | }); |
| 574 | - $this->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use ($log) { |
|
| 574 | + $this->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function() use ($log) { |
|
| 575 | 575 | $log->info('\OC\Updater::finishedCheckCodeIntegrity: Finished code integrity check', ['app' => 'updater']); |
| 576 | 576 | }); |
| 577 | 577 | } |