@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $coordinator = \OC::$server->query(\OC\AppFramework\Bootstrap\Coordinator::class); |
154 | 154 | $isBootable = $coordinator->isBootable($app); |
155 | 155 | |
156 | - $hasAppPhpFile = is_file($appPath . '/appinfo/app.php'); |
|
156 | + $hasAppPhpFile = is_file($appPath.'/appinfo/app.php'); |
|
157 | 157 | |
158 | 158 | if ($isBootable && $hasAppPhpFile) { |
159 | 159 | \OC::$server->getLogger()->error('/appinfo/app.php is not loaded when \OCP\AppFramework\Bootstrap\IBootstrap on the application class is used. Migrate everything from app.php to the Application class.', [ |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | \OC::$server->getLogger()->debug('/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.', [ |
164 | 164 | 'app' => $app, |
165 | 165 | ]); |
166 | - \OC::$server->getEventLogger()->start('load_app_' . $app, 'Load app: ' . $app); |
|
166 | + \OC::$server->getEventLogger()->start('load_app_'.$app, 'Load app: '.$app); |
|
167 | 167 | try { |
168 | 168 | self::requireAppFile($app); |
169 | 169 | } catch (Throwable $ex) { |
@@ -172,18 +172,18 @@ discard block |
||
172 | 172 | } |
173 | 173 | if (!\OC::$server->getAppManager()->isShipped($app) && !self::isType($app, ['authentication'])) { |
174 | 174 | \OC::$server->getLogger()->logException($ex, [ |
175 | - 'message' => "App $app threw an error during app.php load and will be disabled: " . $ex->getMessage(), |
|
175 | + 'message' => "App $app threw an error during app.php load and will be disabled: ".$ex->getMessage(), |
|
176 | 176 | ]); |
177 | 177 | |
178 | 178 | // Only disable apps which are not shipped and that are not authentication apps |
179 | 179 | \OC::$server->getAppManager()->disableApp($app, true); |
180 | 180 | } else { |
181 | 181 | \OC::$server->getLogger()->logException($ex, [ |
182 | - 'message' => "App $app threw an error during app.php load: " . $ex->getMessage(), |
|
182 | + 'message' => "App $app threw an error during app.php load: ".$ex->getMessage(), |
|
183 | 183 | ]); |
184 | 184 | } |
185 | 185 | } |
186 | - \OC::$server->getEventLogger()->end('load_app_' . $app); |
|
186 | + \OC::$server->getEventLogger()->end('load_app_'.$app); |
|
187 | 187 | } |
188 | 188 | $coordinator->bootApp($app); |
189 | 189 | |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | * @param bool $force |
251 | 251 | */ |
252 | 252 | public static function registerAutoloading(string $app, string $path, bool $force = false) { |
253 | - $key = $app . '-' . $path; |
|
253 | + $key = $app.'-'.$path; |
|
254 | 254 | if (!$force && isset(self::$alreadyRegistered[$key])) { |
255 | 255 | return; |
256 | 256 | } |
@@ -261,17 +261,17 @@ discard block |
||
261 | 261 | $appNamespace = \OC\AppFramework\App::buildAppNamespace($app); |
262 | 262 | \OC::$server->registerNamespace($app, $appNamespace); |
263 | 263 | |
264 | - if (file_exists($path . '/composer/autoload.php')) { |
|
265 | - require_once $path . '/composer/autoload.php'; |
|
264 | + if (file_exists($path.'/composer/autoload.php')) { |
|
265 | + require_once $path.'/composer/autoload.php'; |
|
266 | 266 | } else { |
267 | - \OC::$composerAutoloader->addPsr4($appNamespace . '\\', $path . '/lib/', true); |
|
267 | + \OC::$composerAutoloader->addPsr4($appNamespace.'\\', $path.'/lib/', true); |
|
268 | 268 | // Register on legacy autoloader |
269 | 269 | \OC::$loader->addValidRoot($path); |
270 | 270 | } |
271 | 271 | |
272 | 272 | // Register Test namespace only when testing |
273 | 273 | if (defined('PHPUNIT_RUN') || defined('CLI_TEST_RUN')) { |
274 | - \OC::$composerAutoloader->addPsr4($appNamespace . '\\Tests\\', $path . '/tests/', true); |
|
274 | + \OC::$composerAutoloader->addPsr4($appNamespace.'\\Tests\\', $path.'/tests/', true); |
|
275 | 275 | } |
276 | 276 | } |
277 | 277 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | */ |
284 | 284 | private static function requireAppFile(string $app) { |
285 | 285 | // encapsulated here to avoid variable scope conflicts |
286 | - require_once $app . '/appinfo/app.php'; |
|
286 | + require_once $app.'/appinfo/app.php'; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | /** |
@@ -376,8 +376,8 @@ discard block |
||
376 | 376 | } else { |
377 | 377 | $apps = $appManager->getEnabledAppsForUser($user); |
378 | 378 | } |
379 | - $apps = array_filter($apps, function ($app) { |
|
380 | - return $app !== 'files';//we add this manually |
|
379 | + $apps = array_filter($apps, function($app) { |
|
380 | + return $app !== 'files'; //we add this manually |
|
381 | 381 | }); |
382 | 382 | sort($apps); |
383 | 383 | array_unshift($apps, 'files'); |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | |
478 | 478 | $possibleApps = []; |
479 | 479 | foreach (OC::$APPSROOTS as $dir) { |
480 | - if (file_exists($dir['path'] . '/' . $appId)) { |
|
480 | + if (file_exists($dir['path'].'/'.$appId)) { |
|
481 | 481 | $possibleApps[] = $dir; |
482 | 482 | } |
483 | 483 | } |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | } else { |
492 | 492 | $versionToLoad = []; |
493 | 493 | foreach ($possibleApps as $possibleApp) { |
494 | - $version = self::getAppVersionByPath($possibleApp['path'] . '/' . $appId); |
|
494 | + $version = self::getAppVersionByPath($possibleApp['path'].'/'.$appId); |
|
495 | 495 | if (empty($versionToLoad) || version_compare($version, $versionToLoad['version'], '>')) { |
496 | 496 | $versionToLoad = [ |
497 | 497 | 'dir' => $possibleApp, |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | } |
520 | 520 | |
521 | 521 | if (($dir = self::findAppInDirectories($appId)) != false) { |
522 | - return $dir['path'] . '/' . $appId; |
|
522 | + return $dir['path'].'/'.$appId; |
|
523 | 523 | } |
524 | 524 | return false; |
525 | 525 | } |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | */ |
535 | 535 | public static function getAppWebPath(string $appId) { |
536 | 536 | if (($dir = self::findAppInDirectories($appId)) != false) { |
537 | - return OC::$WEBROOT . $dir['url'] . '/' . $appId; |
|
537 | + return OC::$WEBROOT.$dir['url'].'/'.$appId; |
|
538 | 538 | } |
539 | 539 | return false; |
540 | 540 | } |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | * @return string |
559 | 559 | */ |
560 | 560 | public static function getAppVersionByPath(string $path): string { |
561 | - $infoFile = $path . '/appinfo/info.xml'; |
|
561 | + $infoFile = $path.'/appinfo/info.xml'; |
|
562 | 562 | $appData = \OC::$server->getAppManager()->getAppInfo($infoFile, true); |
563 | 563 | return isset($appData['version']) ? $appData['version'] : ''; |
564 | 564 | } |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | * @param string $page |
659 | 659 | */ |
660 | 660 | public static function registerAdmin(string $app, string $page) { |
661 | - self::$adminForms[] = $app . '/' . $page . '.php'; |
|
661 | + self::$adminForms[] = $app.'/'.$page.'.php'; |
|
662 | 662 | } |
663 | 663 | |
664 | 664 | /** |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | * @param string $page |
668 | 668 | */ |
669 | 669 | public static function registerPersonal(string $app, string $page) { |
670 | - self::$personalForms[] = $app . '/' . $page . '.php'; |
|
670 | + self::$personalForms[] = $app.'/'.$page.'.php'; |
|
671 | 671 | } |
672 | 672 | |
673 | 673 | /** |
@@ -695,14 +695,14 @@ discard block |
||
695 | 695 | |
696 | 696 | foreach (OC::$APPSROOTS as $apps_dir) { |
697 | 697 | if (!is_readable($apps_dir['path'])) { |
698 | - \OCP\Util::writeLog('core', 'unable to read app folder : ' . $apps_dir['path'], ILogger::WARN); |
|
698 | + \OCP\Util::writeLog('core', 'unable to read app folder : '.$apps_dir['path'], ILogger::WARN); |
|
699 | 699 | continue; |
700 | 700 | } |
701 | 701 | $dh = opendir($apps_dir['path']); |
702 | 702 | |
703 | 703 | if (is_resource($dh)) { |
704 | 704 | while (($file = readdir($dh)) !== false) { |
705 | - if ($file[0] != '.' and is_dir($apps_dir['path'] . '/' . $file) and is_file($apps_dir['path'] . '/' . $file . '/appinfo/info.xml')) { |
|
705 | + if ($file[0] != '.' and is_dir($apps_dir['path'].'/'.$file) and is_file($apps_dir['path'].'/'.$file.'/appinfo/info.xml')) { |
|
706 | 706 | $apps[] = $file; |
707 | 707 | } |
708 | 708 | } |
@@ -736,12 +736,12 @@ discard block |
||
736 | 736 | if (array_search($app, $blacklist) === false) { |
737 | 737 | $info = OC_App::getAppInfo($app, false, $langCode); |
738 | 738 | if (!is_array($info)) { |
739 | - \OCP\Util::writeLog('core', 'Could not read app info file for app "' . $app . '"', ILogger::ERROR); |
|
739 | + \OCP\Util::writeLog('core', 'Could not read app info file for app "'.$app.'"', ILogger::ERROR); |
|
740 | 740 | continue; |
741 | 741 | } |
742 | 742 | |
743 | 743 | if (!isset($info['name'])) { |
744 | - \OCP\Util::writeLog('core', 'App id "' . $app . '" has no name in appinfo', ILogger::ERROR); |
|
744 | + \OCP\Util::writeLog('core', 'App id "'.$app.'" has no name in appinfo', ILogger::ERROR); |
|
745 | 745 | continue; |
746 | 746 | } |
747 | 747 | |
@@ -773,12 +773,12 @@ discard block |
||
773 | 773 | |
774 | 774 | $appPath = self::getAppPath($app); |
775 | 775 | if ($appPath !== false) { |
776 | - $appIcon = $appPath . '/img/' . $app . '.svg'; |
|
776 | + $appIcon = $appPath.'/img/'.$app.'.svg'; |
|
777 | 777 | if (file_exists($appIcon)) { |
778 | - $info['preview'] = $urlGenerator->imagePath($app, $app . '.svg'); |
|
778 | + $info['preview'] = $urlGenerator->imagePath($app, $app.'.svg'); |
|
779 | 779 | $info['previewAsIcon'] = true; |
780 | 780 | } else { |
781 | - $appIcon = $appPath . '/img/app.svg'; |
|
781 | + $appIcon = $appPath.'/img/app.svg'; |
|
782 | 782 | if (file_exists($appIcon)) { |
783 | 783 | $info['preview'] = $urlGenerator->imagePath($app, 'app.svg'); |
784 | 784 | $info['previewAsIcon'] = true; |
@@ -923,8 +923,8 @@ discard block |
||
923 | 923 | self::registerAutoloading($appId, $appPath, true); |
924 | 924 | self::executeRepairSteps($appId, $appData['repair-steps']['pre-migration']); |
925 | 925 | |
926 | - if (file_exists($appPath . '/appinfo/database.xml')) { |
|
927 | - OC_DB::updateDbFromStructure($appPath . '/appinfo/database.xml'); |
|
926 | + if (file_exists($appPath.'/appinfo/database.xml')) { |
|
927 | + OC_DB::updateDbFromStructure($appPath.'/appinfo/database.xml'); |
|
928 | 928 | } else { |
929 | 929 | $ms = new MigrationService($appId, \OC::$server->getDatabaseConnection()); |
930 | 930 | $ms->migrate(); |
@@ -937,9 +937,9 @@ discard block |
||
937 | 937 | \OC::$server->getAppManager()->getAppVersion($appId, false); |
938 | 938 | |
939 | 939 | // run upgrade code |
940 | - if (file_exists($appPath . '/appinfo/update.php')) { |
|
940 | + if (file_exists($appPath.'/appinfo/update.php')) { |
|
941 | 941 | self::loadApp($appId); |
942 | - include $appPath . '/appinfo/update.php'; |
|
942 | + include $appPath.'/appinfo/update.php'; |
|
943 | 943 | } |
944 | 944 | self::setupBackgroundJobs($appData['background-jobs']); |
945 | 945 | |
@@ -950,10 +950,10 @@ discard block |
||
950 | 950 | \OC::$server->getConfig()->deleteAppValue($appId, 'ocsid'); |
951 | 951 | } |
952 | 952 | foreach ($appData['remote'] as $name => $path) { |
953 | - \OC::$server->getConfig()->setAppValue('core', 'remote_' . $name, $appId . '/' . $path); |
|
953 | + \OC::$server->getConfig()->setAppValue('core', 'remote_'.$name, $appId.'/'.$path); |
|
954 | 954 | } |
955 | 955 | foreach ($appData['public'] as $name => $path) { |
956 | - \OC::$server->getConfig()->setAppValue('core', 'public_' . $name, $appId . '/' . $path); |
|
956 | + \OC::$server->getConfig()->setAppValue('core', 'public_'.$name, $appId.'/'.$path); |
|
957 | 957 | } |
958 | 958 | |
959 | 959 | self::setAppTypes($appId); |
@@ -1023,17 +1023,17 @@ discard block |
||
1023 | 1023 | public static function getStorage(string $appId) { |
1024 | 1024 | if (\OC::$server->getAppManager()->isEnabledForUser($appId)) { //sanity check |
1025 | 1025 | if (\OC::$server->getUserSession()->isLoggedIn()) { |
1026 | - $view = new \OC\Files\View('/' . OC_User::getUser()); |
|
1026 | + $view = new \OC\Files\View('/'.OC_User::getUser()); |
|
1027 | 1027 | if (!$view->file_exists($appId)) { |
1028 | 1028 | $view->mkdir($appId); |
1029 | 1029 | } |
1030 | - return new \OC\Files\View('/' . OC_User::getUser() . '/' . $appId); |
|
1030 | + return new \OC\Files\View('/'.OC_User::getUser().'/'.$appId); |
|
1031 | 1031 | } else { |
1032 | - \OCP\Util::writeLog('core', 'Can\'t get app storage, app ' . $appId . ', user not logged in', ILogger::ERROR); |
|
1032 | + \OCP\Util::writeLog('core', 'Can\'t get app storage, app '.$appId.', user not logged in', ILogger::ERROR); |
|
1033 | 1033 | return false; |
1034 | 1034 | } |
1035 | 1035 | } else { |
1036 | - \OCP\Util::writeLog('core', 'Can\'t get app storage, app ' . $appId . ' not enabled', ILogger::ERROR); |
|
1036 | + \OCP\Util::writeLog('core', 'Can\'t get app storage, app '.$appId.' not enabled', ILogger::ERROR); |
|
1037 | 1037 | return false; |
1038 | 1038 | } |
1039 | 1039 | } |
@@ -1070,9 +1070,9 @@ discard block |
||
1070 | 1070 | |
1071 | 1071 | if ($attributeLang === $similarLang) { |
1072 | 1072 | $similarLangFallback = $option['@value']; |
1073 | - } elseif (strpos($attributeLang, $similarLang . '_') === 0) { |
|
1073 | + } elseif (strpos($attributeLang, $similarLang.'_') === 0) { |
|
1074 | 1074 | if ($similarLangFallback === false) { |
1075 | - $similarLangFallback = $option['@value']; |
|
1075 | + $similarLangFallback = $option['@value']; |
|
1076 | 1076 | } |
1077 | 1077 | } |
1078 | 1078 | } else { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * the \OCP\AppFramework\Bootstrap\IBootstrap interface |
92 | 92 | */ |
93 | 93 | $appNameSpace = App::buildAppNamespace($appId); |
94 | - $applicationClassName = $appNameSpace . '\\AppInfo\\Application'; |
|
94 | + $applicationClassName = $appNameSpace.'\\AppInfo\\Application'; |
|
95 | 95 | if (class_exists($applicationClassName) && in_array(IBootstrap::class, class_implements($applicationClassName), true)) { |
96 | 96 | try { |
97 | 97 | /** @var IBootstrap|App $application */ |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $application->register($this->registrationContext->for($appId)); |
105 | 105 | } catch (Throwable $e) { |
106 | 106 | $this->logger->logException($e, [ |
107 | - 'message' => 'Error during app service registration: ' . $e->getMessage(), |
|
107 | + 'message' => 'Error during app service registration: '.$e->getMessage(), |
|
108 | 108 | 'level' => ILogger::FATAL, |
109 | 109 | ]); |
110 | 110 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | public function bootApp(string $appId): void { |
130 | 130 | $appNameSpace = App::buildAppNamespace($appId); |
131 | - $applicationClassName = $appNameSpace . '\\AppInfo\\Application'; |
|
131 | + $applicationClassName = $appNameSpace.'\\AppInfo\\Application'; |
|
132 | 132 | if (!class_exists($applicationClassName)) { |
133 | 133 | // Nothing to boot |
134 | 134 | return; |
@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | } |
151 | 151 | } catch (QueryException $e) { |
152 | 152 | $this->logger->logException($e, [ |
153 | - 'message' => "Could not boot $appId" . $e->getMessage(), |
|
153 | + 'message' => "Could not boot $appId".$e->getMessage(), |
|
154 | 154 | ]); |
155 | 155 | } catch (Throwable $e) { |
156 | 156 | $this->logger->logException($e, [ |
157 | - 'message' => "Could not boot $appId" . $e->getMessage(), |
|
157 | + 'message' => "Could not boot $appId".$e->getMessage(), |
|
158 | 158 | 'level' => ILogger::FATAL, |
159 | 159 | ]); |
160 | 160 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | public function isBootable(string $appId) { |
164 | 164 | $appNameSpace = App::buildAppNamespace($appId); |
165 | - $applicationClassName = $appNameSpace . '\\AppInfo\\Application'; |
|
165 | + $applicationClassName = $appNameSpace.'\\AppInfo\\Application'; |
|
166 | 166 | return class_exists($applicationClassName) && |
167 | 167 | in_array(IBootstrap::class, class_implements($applicationClassName), true); |
168 | 168 | } |