@@ -183,7 +183,7 @@ public static function isType(string $app, array $types): bool {
183183 * read app types from info.xml and cache them in the database
184184 */
185185 public static function setAppTypes (string $ app ) {
186- $ appManager = \OC ::$ server ->getAppManager ( );
186+ $ appManager = \OC ::$ server ->get (IAppManager::class );
187187 $ appData = $ appManager ->getAppInfo ($ app );
188188 if (!is_array ($ appData )) {
189189 return ;
@@ -221,7 +221,7 @@ public static function getEnabledApps(bool $forceRefresh = false, bool $all = fa
221221 }
222222 // in incognito mode or when logged out, $user will be false,
223223 // which is also the case during an upgrade
224- $ appManager = \OC ::$ server ->getAppManager ( );
224+ $ appManager = \OC ::$ server ->get (IAppManager::class );
225225 if ($ all ) {
226226 $ user = null ;
227227 } else {
@@ -264,7 +264,7 @@ public function enable(string $appId,
264264
265265 $ installer ->installApp ($ appId );
266266
267- $ appManager = \OC ::$ server ->getAppManager ( );
267+ $ appManager = \OC ::$ server ->get (IAppManager::class );
268268 if ($ groups !== []) {
269269 $ groupManager = \OC ::$ server ->getGroupManager ();
270270 $ groupsList = [];
@@ -354,7 +354,7 @@ public static function findAppInDirectories(string $appId, bool $ignoreCache = f
354354 * @param string $appId
355355 * @param bool $refreshAppPath should be set to true only during install/upgrade
356356 * @return string|false
357- * @deprecated 11.0.0 use \OC::$server->getAppManager( )->getAppPath()
357+ * @deprecated 11.0.0 use \OC::$server->get(\OCP\App\IAppManager::class )->getAppPath()
358358 */
359359 public static function getAppPath (string $ appId , bool $ refreshAppPath = false ) {
360360 if ($ appId === null || trim ($ appId ) === '' ) {
@@ -373,7 +373,7 @@ public static function getAppPath(string $appId, bool $refreshAppPath = false) {
373373 *
374374 * @param string $appId
375375 * @return string|false
376- * @deprecated 18.0.0 use \OC::$server->getAppManager( )->getAppWebPath()
376+ * @deprecated 18.0.0 use \OC::$server->get(\OCP\App\IAppManager::class )->getAppWebPath()
377377 */
378378 public static function getAppWebPath (string $ appId ) {
379379 if (($ dir = self ::findAppInDirectories ($ appId )) != false ) {
@@ -390,7 +390,7 @@ public static function getAppWebPath(string $appId) {
390390 */
391391 public static function getAppVersionByPath (string $ path ): string {
392392 $ infoFile = $ path . '/appinfo/info.xml ' ;
393- $ appData = \OC ::$ server ->getAppManager ( )->getAppInfo ($ infoFile , true );
393+ $ appData = \OC ::$ server ->get (IAppManager::class )->getAppInfo ($ infoFile , true );
394394 return isset ($ appData ['version ' ]) ? $ appData ['version ' ] : '' ;
395395 }
396396
@@ -556,7 +556,7 @@ public function getSupportedApps(): array {
556556 public function listAllApps (): array {
557557 $ installedApps = OC_App::getAllApps ();
558558
559- $ appManager = \OC ::$ server ->getAppManager ( );
559+ $ appManager = \OC ::$ server ->get (IAppManager::class );
560560 //we don't want to show configuration for these
561561 $ blacklist = $ appManager ->getAlwaysEnabledApps ();
562562 $ appList = [];
@@ -756,7 +756,7 @@ public static function updateApp(string $appId): bool {
756756 return false ;
757757 }
758758
759- \OC ::$ server ->getAppManager ( )->clearAppsCache ();
759+ \OC ::$ server ->get (IAppManager::class )->clearAppsCache ();
760760 $ l = \OC ::$ server ->getL10N ('core ' );
761761 $ appData = \OCP \Server::get (\OCP \App \IAppManager::class)->getAppInfo ($ appId , false , $ l ->getLanguageCode ());
762762
@@ -778,8 +778,8 @@ public static function updateApp(string $appId): bool {
778778 self ::executeRepairSteps ($ appId , $ appData ['repair-steps ' ]['post-migration ' ]);
779779 self ::setupLiveMigrations ($ appId , $ appData ['repair-steps ' ]['live-migration ' ]);
780780 // update appversion in app manager
781- \OC ::$ server ->getAppManager ( )->clearAppsCache ();
782- \OC ::$ server ->getAppManager ( )->getAppVersion ($ appId , false );
781+ \OC ::$ server ->get (IAppManager::class )->clearAppsCache ();
782+ \OC ::$ server ->get (IAppManager::class )->getAppVersion ($ appId , false );
783783
784784 self ::setupBackgroundJobs ($ appData ['background-jobs ' ]);
785785
@@ -862,7 +862,7 @@ private static function setupLiveMigrations(string $appId, array $steps) {
862862 * @return \OC\Files\View|false
863863 */
864864 public static function getStorage (string $ appId ) {
865- if (\OC ::$ server ->getAppManager ( )->isEnabledForUser ($ appId )) { //sanity check
865+ if (\OC ::$ server ->get (IAppManager::class )->isEnabledForUser ($ appId )) { //sanity check
866866 if (\OC ::$ server ->getUserSession ()->isLoggedIn ()) {
867867 $ view = new \OC \Files \View ('/ ' . OC_User::getUser ());
868868 if (!$ view ->file_exists ($ appId )) {
0 commit comments