@@ -161,7 +161,7 @@ |
||
| 161 | 161 | */ |
| 162 | 162 | private function doMigration($version) |
| 163 | 163 | { |
| 164 | - $sqlFile = 'migrations/' . $version . '.sql'; |
|
| 164 | + $sqlFile = 'migrations/'.$version.'.sql'; |
|
| 165 | 165 | |
| 166 | 166 | if (!$this->filesystem->has($sqlFile)) |
| 167 | 167 | { |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $container->alias('db', DatabaseDriver::class) |
| 31 | 31 | ->share( |
| 32 | 32 | DatabaseDriver::class, |
| 33 | - function (Container $container) |
|
| 33 | + function(Container $container) |
|
| 34 | 34 | { |
| 35 | 35 | /** @var \Joomla\Registry\Registry $config */ |
| 36 | 36 | $config = $container->get('config'); |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | $container->alias('db.migrations', Migrations::class) |
| 48 | 48 | ->set(Migrations::class, |
| 49 | - function (Container $container) |
|
| 49 | + function(Container $container) |
|
| 50 | 50 | { |
| 51 | 51 | return new Migrations( |
| 52 | 52 | $container->get('db'), |
| 53 | - new Filesystem(new Local(APPROOT . '/etc')) |
|
| 53 | + new Filesystem(new Local(APPROOT.'/etc')) |
|
| 54 | 54 | ); |
| 55 | 55 | }, true, true |
| 56 | 56 | ); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | ->out('1) Yes') |
| 63 | 63 | ->out('2) No') |
| 64 | 64 | ->out() |
| 65 | - ->out('<question>' . g11n3t('Select:') . '</question>', false); |
|
| 65 | + ->out('<question>'.g11n3t('Select:').'</question>', false); |
|
| 66 | 66 | |
| 67 | 67 | $in = trim($this->getApplication()->in()); |
| 68 | 68 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $this->out('No database found.') |
| 85 | 85 | ->out('Creating the database...', false); |
| 86 | 86 | |
| 87 | - $this->db->setQuery('CREATE DATABASE ' . $this->db->quoteName($this->getApplication()->get('database.name'))) |
|
| 87 | + $this->db->setQuery('CREATE DATABASE '.$this->db->quoteName($this->getApplication()->get('database.name'))) |
|
| 88 | 88 | ->execute(); |
| 89 | 89 | |
| 90 | 90 | $this->db->select($this->getApplication()->get('database.name')); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $dbType = 'mysql'; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - $fName = APPROOT . '/etc/' . $dbType . '.sql'; |
|
| 155 | + $fName = APPROOT.'/etc/'.$dbType.'.sql'; |
|
| 156 | 156 | |
| 157 | 157 | if (!file_exists($fName)) |
| 158 | 158 | { |
@@ -75,8 +75,7 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | $this->cleanDatabase($tables); |
| 78 | - } |
|
| 79 | - catch (\RuntimeException $e) |
|
| 78 | + } catch (\RuntimeException $e) |
|
| 80 | 79 | { |
| 81 | 80 | // Check if the message is "Could not connect to database." Odds are, this means the DB isn't there or the server is down. |
| 82 | 81 | if (strpos($e->getMessage(), 'Could not connect to database.') !== false) |
@@ -90,8 +89,7 @@ discard block |
||
| 90 | 89 | $this->db->select($this->getApplication()->get('database.name')); |
| 91 | 90 | |
| 92 | 91 | $this->out('<info>Database created.</info>'); |
| 93 | - } |
|
| 94 | - else |
|
| 92 | + } else |
|
| 95 | 93 | { |
| 96 | 94 | throw $e; |
| 97 | 95 | } |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Stats\Commands; |
| 4 | 4 | |
| 5 | 5 | use Joomla\Controller\AbstractController; |
| 6 | -use Joomla\Database\DatabaseDriver; |
|
| 7 | 6 | use Stats\CommandInterface; |
| 8 | 7 | |
| 9 | 8 | /** |
@@ -30,12 +30,12 @@ |
||
| 30 | 30 | $this->getApplication()->out('<info>Updating server to git HEAD</info>'); |
| 31 | 31 | |
| 32 | 32 | // Pull from remote repo |
| 33 | - $this->runCommand('cd ' . APPROOT . ' && git pull 2>&1'); |
|
| 33 | + $this->runCommand('cd '.APPROOT.' && git pull 2>&1'); |
|
| 34 | 34 | |
| 35 | 35 | $this->getApplication()->out('<info>Updating Composer resources</info>'); |
| 36 | 36 | |
| 37 | 37 | // Run Composer install |
| 38 | - $this->runCommand('cd ' . APPROOT . ' && composer install --no-dev -o 2>&1'); |
|
| 38 | + $this->runCommand('cd '.APPROOT.' && composer install --no-dev -o 2>&1'); |
|
| 39 | 39 | |
| 40 | 40 | $this->getApplication()->out('<info>Update complete</info>'); |
| 41 | 41 | |
@@ -57,8 +57,7 @@ |
||
| 57 | 57 | if ($recordExists) |
| 58 | 58 | { |
| 59 | 59 | $db->updateObject('#__jstats', $data, ['unique_id']); |
| 60 | - } |
|
| 61 | - else |
|
| 60 | + } else |
|
| 62 | 61 | { |
| 63 | 62 | $db->insertObject('#__jstats', $data, ['unique_id']); |
| 64 | 63 | } |
@@ -87,15 +87,15 @@ |
||
| 87 | 87 | |
| 88 | 88 | // Allow the next patch release after this one |
| 89 | 89 | $nextPatch = $explodedVersion[2] + 1; |
| 90 | - $versions[] = $explodedVersion[0] . '.' . $explodedVersion[1] . '.' . $nextPatch; |
|
| 90 | + $versions[] = $explodedVersion[0].'.'.$explodedVersion[1].'.'.$nextPatch; |
|
| 91 | 91 | |
| 92 | 92 | // And allow the next minor release after this one |
| 93 | 93 | $nextMinor = $explodedVersion[1] + 1; |
| 94 | - $versions[] = $explodedVersion[0] . '.' . $nextMinor . '.0'; |
|
| 94 | + $versions[] = $explodedVersion[0].'.'.$nextMinor.'.0'; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | // Store the version data now |
| 98 | - $path = APPROOT . '/versions/joomla.json'; |
|
| 98 | + $path = APPROOT.'/versions/joomla.json'; |
|
| 99 | 99 | |
| 100 | 100 | if (file_put_contents($path, json_encode($versions)) === false) |
| 101 | 101 | { |
@@ -95,15 +95,15 @@ |
||
| 95 | 95 | |
| 96 | 96 | // Allow the next patch release after this one |
| 97 | 97 | $nextPatch = $explodedVersion[2] + 1; |
| 98 | - $versions[] = $explodedVersion[0] . '.' . $explodedVersion[1] . '.' . $nextPatch; |
|
| 98 | + $versions[] = $explodedVersion[0].'.'.$explodedVersion[1].'.'.$nextPatch; |
|
| 99 | 99 | |
| 100 | 100 | // And allow the next minor release after this one |
| 101 | 101 | $nextMinor = $explodedVersion[1] + 1; |
| 102 | - $versions[] = $explodedVersion[0] . '.' . $nextMinor . '.0'; |
|
| 102 | + $versions[] = $explodedVersion[0].'.'.$nextMinor.'.0'; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | // Store the version data now |
| 106 | - $path = APPROOT . '/versions/php.json'; |
|
| 106 | + $path = APPROOT.'/versions/php.json'; |
|
| 107 | 107 | |
| 108 | 108 | if (file_put_contents($path, json_encode($versions)) === false) |
| 109 | 109 | { |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | // Import the valid release listing |
| 158 | - $path = APPROOT . '/versions/joomla.json'; |
|
| 158 | + $path = APPROOT.'/versions/joomla.json'; |
|
| 159 | 159 | |
| 160 | 160 | if (!file_exists($path)) |
| 161 | 161 | { |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | // Import the valid release listing |
| 223 | - $path = APPROOT . '/versions/php.json'; |
|
| 223 | + $path = APPROOT.'/versions/php.json'; |
|
| 224 | 224 | |
| 225 | 225 | if (!file_exists($path)) |
| 226 | 226 | { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $container->alias(CliApplication::class, JoomlaApplication\AbstractCliApplication::class) |
| 54 | 54 | ->share( |
| 55 | 55 | JoomlaApplication\AbstractCliApplication::class, |
| 56 | - function (Container $container) |
|
| 56 | + function(Container $container) |
|
| 57 | 57 | { |
| 58 | 58 | $application = new CliApplication( |
| 59 | 59 | $container->get(Cli::class), |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $container->alias(WebApplication::class, JoomlaApplication\AbstractWebApplication::class) |
| 76 | 76 | ->share( |
| 77 | 77 | JoomlaApplication\AbstractWebApplication::class, |
| 78 | - function (Container $container) |
|
| 78 | + function(Container $container) |
|
| 79 | 79 | { |
| 80 | 80 | $application = new WebApplication($container->get(Input::class), $container->get('config')); |
| 81 | 81 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | $container->share( |
| 93 | 93 | Input::class, |
| 94 | - function () |
|
| 94 | + function() |
|
| 95 | 95 | { |
| 96 | 96 | return new Input($_REQUEST); |
| 97 | 97 | }, |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | $container->share( |
| 102 | 102 | Cli::class, |
| 103 | - function () |
|
| 103 | + function() |
|
| 104 | 104 | { |
| 105 | 105 | return new Cli; |
| 106 | 106 | }, |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | $container->share( |
| 111 | 111 | Console::class, |
| 112 | - function (Container $container) |
|
| 112 | + function(Container $container) |
|
| 113 | 113 | { |
| 114 | 114 | $console = new Console; |
| 115 | 115 | $console->setContainer($container); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | $container->share( |
| 122 | 122 | JoomlaApplication\Cli\Output\Processor\ColorProcessor::class, |
| 123 | - function (Container $container) |
|
| 123 | + function(Container $container) |
|
| 124 | 124 | { |
| 125 | 125 | $processor = new JoomlaApplication\Cli\Output\Processor\ColorProcessor; |
| 126 | 126 | |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | $container->share( |
| 143 | 143 | JoomlaApplication\Cli\CliInput::class, |
| 144 | - function (Container $container) |
|
| 144 | + function(Container $container) |
|
| 145 | 145 | { |
| 146 | 146 | return new JoomlaApplication\Cli\CliInput; |
| 147 | 147 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $container->alias(JoomlaApplication\Cli\CliOutput::class, JoomlaApplication\Cli\Output\Stdout::class) |
| 151 | 151 | ->share( |
| 152 | 152 | JoomlaApplication\Cli\Output\Stdout::class, |
| 153 | - function (Container $container) |
|
| 153 | + function(Container $container) |
|
| 154 | 154 | { |
| 155 | 155 | return new JoomlaApplication\Cli\Output\Stdout($container->get(JoomlaApplication\Cli\Output\Processor\ColorProcessor::class)); |
| 156 | 156 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | $container->share( |
| 160 | 160 | Analytics::class, |
| 161 | - function () |
|
| 161 | + function() |
|
| 162 | 162 | { |
| 163 | 163 | return new Analytics(true); |
| 164 | 164 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | $container->share( |
| 168 | 168 | Router::class, |
| 169 | - function (Container $container) |
|
| 169 | + function(Container $container) |
|
| 170 | 170 | { |
| 171 | 171 | $router = (new Router($container->get(Input::class))) |
| 172 | 172 | ->setContainer($container) |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $container->share( |
| 184 | 184 | HelpCommand::class, |
| 185 | - function (Container $container) |
|
| 185 | + function(Container $container) |
|
| 186 | 186 | { |
| 187 | 187 | $command = new HelpCommand; |
| 188 | 188 | |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | $container->share( |
| 198 | 198 | InstallCommand::class, |
| 199 | - function (Container $container) |
|
| 199 | + function(Container $container) |
|
| 200 | 200 | { |
| 201 | 201 | $command = new InstallCommand($container->get(DatabaseDriver::class)); |
| 202 | 202 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | |
| 211 | 211 | $container->share( |
| 212 | 212 | SnapshotCommand::class, |
| 213 | - function (Container $container) |
|
| 213 | + function(Container $container) |
|
| 214 | 214 | { |
| 215 | 215 | $command = new SnapshotCommand($container->get(StatsJsonView::class)); |
| 216 | 216 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | $container->share( |
| 226 | 226 | UpdateCommand::class, |
| 227 | - function (Container $container) |
|
| 227 | + function(Container $container) |
|
| 228 | 228 | { |
| 229 | 229 | $command = new UpdateCommand; |
| 230 | 230 | |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | $container->share( |
| 240 | 240 | ClearCommand::class, |
| 241 | - function (Container $container) |
|
| 241 | + function(Container $container) |
|
| 242 | 242 | { |
| 243 | 243 | $command = new ClearCommand($container->get(Cache::class)); |
| 244 | 244 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | $container->share( |
| 254 | 254 | MigrateCommand::class, |
| 255 | - function (Container $container) |
|
| 255 | + function(Container $container) |
|
| 256 | 256 | { |
| 257 | 257 | $command = new MigrateCommand($container->get(Migrations::class)); |
| 258 | 258 | |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | $container->share( |
| 269 | 269 | StatusCommand::class, |
| 270 | - function (Container $container) |
|
| 270 | + function(Container $container) |
|
| 271 | 271 | { |
| 272 | 272 | $command = new StatusCommand($container->get(Migrations::class)); |
| 273 | 273 | |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | $container->share( |
| 283 | 283 | JoomlaCommand::class, |
| 284 | - function (Container $container) |
|
| 284 | + function(Container $container) |
|
| 285 | 285 | { |
| 286 | 286 | $command = new JoomlaCommand($container->get(GitHub::class)); |
| 287 | 287 | |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | |
| 296 | 296 | $container->share( |
| 297 | 297 | PhpCommand::class, |
| 298 | - function (Container $container) |
|
| 298 | + function(Container $container) |
|
| 299 | 299 | { |
| 300 | 300 | $command = new PhpCommand($container->get(GitHub::class)); |
| 301 | 301 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | |
| 310 | 310 | $container->share( |
| 311 | 311 | DisplayControllerGet::class, |
| 312 | - function (Container $container) |
|
| 312 | + function(Container $container) |
|
| 313 | 313 | { |
| 314 | 314 | $controller = new DisplayControllerGet( |
| 315 | 315 | $container->get(StatsJsonView::class), |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | |
| 327 | 327 | $container->share( |
| 328 | 328 | SubmitControllerCreate::class, |
| 329 | - function (Container $container) |
|
| 329 | + function(Container $container) |
|
| 330 | 330 | { |
| 331 | 331 | $controller = new SubmitControllerCreate( |
| 332 | 332 | $container->get(StatsModel::class) |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | |
| 343 | 343 | $container->share( |
| 344 | 344 | SubmitControllerGet::class, |
| 345 | - function (Container $container) |
|
| 345 | + function(Container $container) |
|
| 346 | 346 | { |
| 347 | 347 | $controller = new SubmitControllerGet; |
| 348 | 348 | |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | |
| 357 | 357 | $container->share( |
| 358 | 358 | StatsModel::class, |
| 359 | - function (Container $container) |
|
| 359 | + function(Container $container) |
|
| 360 | 360 | { |
| 361 | 361 | return new StatsModel( |
| 362 | 362 | $container->get(DatabaseDriver::class) |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | |
| 368 | 368 | $container->share( |
| 369 | 369 | StatsJsonView::class, |
| 370 | - function (Container $container) |
|
| 370 | + function(Container $container) |
|
| 371 | 371 | { |
| 372 | 372 | return new StatsJsonView( |
| 373 | 373 | $container->get(StatsModel::class) |