@@ -32,65 +32,65 @@ |
||
| 32 | 32 | |
| 33 | 33 | class Check extends Command { |
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * @var Installer $installer |
|
| 37 | - */ |
|
| 38 | - private $installer; |
|
| 35 | + /** |
|
| 36 | + * @var Installer $installer |
|
| 37 | + */ |
|
| 38 | + private $installer; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @var AppManager $appManager |
|
| 42 | - */ |
|
| 43 | - private $appManager; |
|
| 40 | + /** |
|
| 41 | + * @var AppManager $appManager |
|
| 42 | + */ |
|
| 43 | + private $appManager; |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * @var UpdateChecker $updateChecker |
|
| 47 | - */ |
|
| 48 | - private $updateChecker; |
|
| 45 | + /** |
|
| 46 | + * @var UpdateChecker $updateChecker |
|
| 47 | + */ |
|
| 48 | + private $updateChecker; |
|
| 49 | 49 | |
| 50 | - public function __construct(AppManager $appManager, UpdateChecker $updateChecker, Installer $installer) { |
|
| 51 | - parent::__construct(); |
|
| 52 | - $this->installer = $installer; |
|
| 53 | - $this->appManager = $appManager; |
|
| 54 | - $this->updateChecker = $updateChecker; |
|
| 55 | - } |
|
| 50 | + public function __construct(AppManager $appManager, UpdateChecker $updateChecker, Installer $installer) { |
|
| 51 | + parent::__construct(); |
|
| 52 | + $this->installer = $installer; |
|
| 53 | + $this->appManager = $appManager; |
|
| 54 | + $this->updateChecker = $updateChecker; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - protected function configure() { |
|
| 58 | - $this |
|
| 59 | - ->setName('update:check') |
|
| 60 | - ->setDescription('Check for server and app updates') |
|
| 61 | - ; |
|
| 62 | - } |
|
| 57 | + protected function configure() { |
|
| 58 | + $this |
|
| 59 | + ->setName('update:check') |
|
| 60 | + ->setDescription('Check for server and app updates') |
|
| 61 | + ; |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 65 | - $updatesAvailableCount = 0; |
|
| 64 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 65 | + $updatesAvailableCount = 0; |
|
| 66 | 66 | |
| 67 | - // Server |
|
| 68 | - $r = $this->updateChecker->getUpdateState(); |
|
| 69 | - if (isset($r['updateAvailable']) && $r['updateAvailable']) { |
|
| 70 | - $output->writeln($r['updateVersion'] . ' is available. Get more information on how to update at '. $r['updateLink'] . '.'); |
|
| 71 | - $updatesAvailableCount += 1; |
|
| 72 | - } |
|
| 67 | + // Server |
|
| 68 | + $r = $this->updateChecker->getUpdateState(); |
|
| 69 | + if (isset($r['updateAvailable']) && $r['updateAvailable']) { |
|
| 70 | + $output->writeln($r['updateVersion'] . ' is available. Get more information on how to update at '. $r['updateLink'] . '.'); |
|
| 71 | + $updatesAvailableCount += 1; |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | 74 | |
| 75 | - // Apps |
|
| 76 | - $apps = $this->appManager->getInstalledApps(); |
|
| 77 | - foreach ($apps as $app) { |
|
| 78 | - $update = $this->installer->isUpdateAvailable($app); |
|
| 79 | - if ($update !== false) { |
|
| 80 | - $output->writeln('Update for ' . $app . ' to version ' . $update . ' is available.'); |
|
| 81 | - $updatesAvailableCount += 1; |
|
| 82 | - } |
|
| 83 | - } |
|
| 75 | + // Apps |
|
| 76 | + $apps = $this->appManager->getInstalledApps(); |
|
| 77 | + foreach ($apps as $app) { |
|
| 78 | + $update = $this->installer->isUpdateAvailable($app); |
|
| 79 | + if ($update !== false) { |
|
| 80 | + $output->writeln('Update for ' . $app . ' to version ' . $update . ' is available.'); |
|
| 81 | + $updatesAvailableCount += 1; |
|
| 82 | + } |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | - // Report summary |
|
| 86 | - if ($updatesAvailableCount === 0) { |
|
| 87 | - $output->writeln('<info>Everything up to date</info>'); |
|
| 88 | - } else if ($updatesAvailableCount === 1) { |
|
| 89 | - $output->writeln('<comment>1 update available</comment>'); |
|
| 90 | - } else { |
|
| 91 | - $output->writeln('<comment>' . $updatesAvailableCount . ' updates available</comment>'); |
|
| 92 | - } |
|
| 85 | + // Report summary |
|
| 86 | + if ($updatesAvailableCount === 0) { |
|
| 87 | + $output->writeln('<info>Everything up to date</info>'); |
|
| 88 | + } else if ($updatesAvailableCount === 1) { |
|
| 89 | + $output->writeln('<comment>1 update available</comment>'); |
|
| 90 | + } else { |
|
| 91 | + $output->writeln('<comment>' . $updatesAvailableCount . ' updates available</comment>'); |
|
| 92 | + } |
|
| 93 | 93 | |
| 94 | - return 0; |
|
| 95 | - } |
|
| 94 | + return 0; |
|
| 95 | + } |
|
| 96 | 96 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | // Server |
| 68 | 68 | $r = $this->updateChecker->getUpdateState(); |
| 69 | 69 | if (isset($r['updateAvailable']) && $r['updateAvailable']) { |
| 70 | - $output->writeln($r['updateVersion'] . ' is available. Get more information on how to update at '. $r['updateLink'] . '.'); |
|
| 70 | + $output->writeln($r['updateVersion'].' is available. Get more information on how to update at '.$r['updateLink'].'.'); |
|
| 71 | 71 | $updatesAvailableCount += 1; |
| 72 | 72 | } |
| 73 | 73 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | foreach ($apps as $app) { |
| 78 | 78 | $update = $this->installer->isUpdateAvailable($app); |
| 79 | 79 | if ($update !== false) { |
| 80 | - $output->writeln('Update for ' . $app . ' to version ' . $update . ' is available.'); |
|
| 80 | + $output->writeln('Update for '.$app.' to version '.$update.' is available.'); |
|
| 81 | 81 | $updatesAvailableCount += 1; |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | } else if ($updatesAvailableCount === 1) { |
| 89 | 89 | $output->writeln('<comment>1 update available</comment>'); |
| 90 | 90 | } else { |
| 91 | - $output->writeln('<comment>' . $updatesAvailableCount . ' updates available</comment>'); |
|
| 91 | + $output->writeln('<comment>'.$updatesAvailableCount.' updates available</comment>'); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | return 0; |
@@ -6,35 +6,35 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ComposerStaticInitUpdateNotification |
| 8 | 8 | { |
| 9 | - public static $prefixLengthsPsr4 = array ( |
|
| 9 | + public static $prefixLengthsPsr4 = array( |
|
| 10 | 10 | 'O' => |
| 11 | - array ( |
|
| 11 | + array( |
|
| 12 | 12 | 'OCA\\UpdateNotification\\' => 23, |
| 13 | 13 | ), |
| 14 | 14 | ); |
| 15 | 15 | |
| 16 | - public static $prefixDirsPsr4 = array ( |
|
| 16 | + public static $prefixDirsPsr4 = array( |
|
| 17 | 17 | 'OCA\\UpdateNotification\\' => |
| 18 | - array ( |
|
| 19 | - 0 => __DIR__ . '/..' . '/../lib', |
|
| 18 | + array( |
|
| 19 | + 0 => __DIR__.'/..'.'/../lib', |
|
| 20 | 20 | ), |
| 21 | 21 | ); |
| 22 | 22 | |
| 23 | - public static $classMap = array ( |
|
| 24 | - 'OCA\\UpdateNotification\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', |
|
| 25 | - 'OCA\\UpdateNotification\\Command\\Check' => __DIR__ . '/..' . '/../lib/Command/Check.php', |
|
| 26 | - 'OCA\\UpdateNotification\\Controller\\APIController' => __DIR__ . '/..' . '/../lib/Controller/APIController.php', |
|
| 27 | - 'OCA\\UpdateNotification\\Controller\\AdminController' => __DIR__ . '/..' . '/../lib/Controller/AdminController.php', |
|
| 28 | - 'OCA\\UpdateNotification\\Notification\\BackgroundJob' => __DIR__ . '/..' . '/../lib/Notification/BackgroundJob.php', |
|
| 29 | - 'OCA\\UpdateNotification\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php', |
|
| 30 | - 'OCA\\UpdateNotification\\ResetTokenBackgroundJob' => __DIR__ . '/..' . '/../lib/ResetTokenBackgroundJob.php', |
|
| 31 | - 'OCA\\UpdateNotification\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php', |
|
| 32 | - 'OCA\\UpdateNotification\\UpdateChecker' => __DIR__ . '/..' . '/../lib/UpdateChecker.php', |
|
| 23 | + public static $classMap = array( |
|
| 24 | + 'OCA\\UpdateNotification\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', |
|
| 25 | + 'OCA\\UpdateNotification\\Command\\Check' => __DIR__.'/..'.'/../lib/Command/Check.php', |
|
| 26 | + 'OCA\\UpdateNotification\\Controller\\APIController' => __DIR__.'/..'.'/../lib/Controller/APIController.php', |
|
| 27 | + 'OCA\\UpdateNotification\\Controller\\AdminController' => __DIR__.'/..'.'/../lib/Controller/AdminController.php', |
|
| 28 | + 'OCA\\UpdateNotification\\Notification\\BackgroundJob' => __DIR__.'/..'.'/../lib/Notification/BackgroundJob.php', |
|
| 29 | + 'OCA\\UpdateNotification\\Notification\\Notifier' => __DIR__.'/..'.'/../lib/Notification/Notifier.php', |
|
| 30 | + 'OCA\\UpdateNotification\\ResetTokenBackgroundJob' => __DIR__.'/..'.'/../lib/ResetTokenBackgroundJob.php', |
|
| 31 | + 'OCA\\UpdateNotification\\Settings\\Admin' => __DIR__.'/..'.'/../lib/Settings/Admin.php', |
|
| 32 | + 'OCA\\UpdateNotification\\UpdateChecker' => __DIR__.'/..'.'/../lib/UpdateChecker.php', |
|
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | 35 | public static function getInitializer(ClassLoader $loader) |
| 36 | 36 | { |
| 37 | - return \Closure::bind(function () use ($loader) { |
|
| 37 | + return \Closure::bind(function() use ($loader) { |
|
| 38 | 38 | $loader->prefixLengthsPsr4 = ComposerStaticInitUpdateNotification::$prefixLengthsPsr4; |
| 39 | 39 | $loader->prefixDirsPsr4 = ComposerStaticInitUpdateNotification::$prefixDirsPsr4; |
| 40 | 40 | $loader->classMap = ComposerStaticInitUpdateNotification::$classMap; |
@@ -6,13 +6,13 @@ |
||
| 6 | 6 | $baseDir = $vendorDir; |
| 7 | 7 | |
| 8 | 8 | return array( |
| 9 | - 'OCA\\UpdateNotification\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
| 10 | - 'OCA\\UpdateNotification\\Command\\Check' => $baseDir . '/../lib/Command/Check.php', |
|
| 11 | - 'OCA\\UpdateNotification\\Controller\\APIController' => $baseDir . '/../lib/Controller/APIController.php', |
|
| 12 | - 'OCA\\UpdateNotification\\Controller\\AdminController' => $baseDir . '/../lib/Controller/AdminController.php', |
|
| 13 | - 'OCA\\UpdateNotification\\Notification\\BackgroundJob' => $baseDir . '/../lib/Notification/BackgroundJob.php', |
|
| 14 | - 'OCA\\UpdateNotification\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php', |
|
| 15 | - 'OCA\\UpdateNotification\\ResetTokenBackgroundJob' => $baseDir . '/../lib/ResetTokenBackgroundJob.php', |
|
| 16 | - 'OCA\\UpdateNotification\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php', |
|
| 17 | - 'OCA\\UpdateNotification\\UpdateChecker' => $baseDir . '/../lib/UpdateChecker.php', |
|
| 9 | + 'OCA\\UpdateNotification\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
| 10 | + 'OCA\\UpdateNotification\\Command\\Check' => $baseDir.'/../lib/Command/Check.php', |
|
| 11 | + 'OCA\\UpdateNotification\\Controller\\APIController' => $baseDir.'/../lib/Controller/APIController.php', |
|
| 12 | + 'OCA\\UpdateNotification\\Controller\\AdminController' => $baseDir.'/../lib/Controller/AdminController.php', |
|
| 13 | + 'OCA\\UpdateNotification\\Notification\\BackgroundJob' => $baseDir.'/../lib/Notification/BackgroundJob.php', |
|
| 14 | + 'OCA\\UpdateNotification\\Notification\\Notifier' => $baseDir.'/../lib/Notification/Notifier.php', |
|
| 15 | + 'OCA\\UpdateNotification\\ResetTokenBackgroundJob' => $baseDir.'/../lib/ResetTokenBackgroundJob.php', |
|
| 16 | + 'OCA\\UpdateNotification\\Settings\\Admin' => $baseDir.'/../lib/Settings/Admin.php', |
|
| 17 | + 'OCA\\UpdateNotification\\UpdateChecker' => $baseDir.'/../lib/UpdateChecker.php', |
|
| 18 | 18 | ); |