aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2023-05-31 21:15:51 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2023-06-01 11:31:27 +0200
commite76d525a43c639d9c32e66dc7bd93fc8cc3bb4e3 (patch)
treed993825893f4c435477018c5a13980c0bf87b0ab
parentcf6e2fa1b79c63581aa145d0a7c7ee2051fbbde2 (diff)
downloadnextcloud-server-e76d525a43c639d9c32e66dc7bd93fc8cc3bb4e3.tar.gz
nextcloud-server-e76d525a43c639d9c32e66dc7bd93fc8cc3bb4e3.zip
chore: Drop \OC_App::getAppInfo
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r--apps/updatenotification/lib/Notification/Notifier.php3
-rw-r--r--lib/private/AppFramework/App.php3
-rw-r--r--lib/private/Installer.php4
-rw-r--r--lib/private/legacy/OC_App.php19
-rw-r--r--tests/lib/InfoXmlTest.php4
5 files changed, 11 insertions, 22 deletions
diff --git a/apps/updatenotification/lib/Notification/Notifier.php b/apps/updatenotification/lib/Notification/Notifier.php
index 9ce233ed721..add5437655f 100644
--- a/apps/updatenotification/lib/Notification/Notifier.php
+++ b/apps/updatenotification/lib/Notification/Notifier.php
@@ -26,6 +26,7 @@ declare(strict_types=1);
*/
namespace OCA\UpdateNotification\Notification;
+use OCP\App\IAppManager;
use OCP\IConfig;
use OCP\IGroupManager;
use OCP\IURLGenerator;
@@ -200,6 +201,6 @@ class Notifier implements INotifier {
}
protected function getAppInfo($appId, $languageCode) {
- return \OC_App::getAppInfo($appId, false, $languageCode);
+ return \OCP\Server::get(IAppManager::class)->getAppInfo($appId, false, $languageCode);
}
}
diff --git a/lib/private/AppFramework/App.php b/lib/private/AppFramework/App.php
index abf8a08a44b..b2f14b8dde4 100644
--- a/lib/private/AppFramework/App.php
+++ b/lib/private/AppFramework/App.php
@@ -34,6 +34,7 @@ namespace OC\AppFramework;
use OC\AppFramework\DependencyInjection\DIContainer;
use OC\AppFramework\Http\Dispatcher;
use OC\AppFramework\Http\Request;
+use OCP\App\IAppManager;
use OCP\Profiler\IProfiler;
use OC\Profiler\RoutingDataCollector;
use OCP\AppFramework\QueryException;
@@ -68,7 +69,7 @@ class App {
return $topNamespace . self::$nameSpaceCache[$appId];
}
- $appInfo = \OC_App::getAppInfo($appId);
+ $appInfo = \OCP\Server::get(IAppManager::class)->getAppInfo($appId);
if (isset($appInfo['namespace'])) {
self::$nameSpaceCache[$appId] = trim($appInfo['namespace']);
} else {
diff --git a/lib/private/Installer.php b/lib/private/Installer.php
index 492efbbe4b4..9b286cc85b0 100644
--- a/lib/private/Installer.php
+++ b/lib/private/Installer.php
@@ -114,7 +114,7 @@ class Installer {
}
$l = \OC::$server->getL10N('core');
- $info = OC_App::getAppInfo($basedir.'/appinfo/info.xml', true, $l->getLanguageCode());
+ $info = \OCP\Server::get(IAppManager::class)->getAppInfo($basedir . '/appinfo/info.xml', true, $l->getLanguageCode());
if (!is_array($info)) {
throw new \Exception(
@@ -594,7 +594,7 @@ class Installer {
//run appinfo/install.php
self::includeAppScript("$appPath/appinfo/install.php");
- $info = OC_App::getAppInfo($app);
+ $info = \OCP\Server::get(IAppManager::class)->getAppInfo($app);
if (is_null($info)) {
return false;
}
diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php
index 505bd93e0b6..ef416f2342f 100644
--- a/lib/private/legacy/OC_App.php
+++ b/lib/private/legacy/OC_App.php
@@ -394,21 +394,6 @@ class OC_App {
return isset($appData['version']) ? $appData['version'] : '';
}
-
- /**
- * Read all app metadata from the info.xml file
- *
- * @param string $appId id of the app or the path of the info.xml file
- * @param bool $path
- * @param string $lang
- * @return array|null
- * @note all data is read from info.xml, not just pre-defined fields
- * @deprecated 14.0.0 use \OC::$server->getAppManager()->getAppInfo()
- */
- public static function getAppInfo(string $appId, bool $path = false, string $lang = null) {
- return \OC::$server->getAppManager()->getAppInfo($appId, $path, $lang);
- }
-
/**
* Returns the navigation
*
@@ -609,7 +594,7 @@ class OC_App {
foreach ($installedApps as $app) {
if (array_search($app, $blacklist) === false) {
- $info = OC_App::getAppInfo($app, false, $langCode);
+ $info = $appManager->getAppInfo($app, false, $langCode);
if (!is_array($info)) {
\OCP\Util::writeLog('core', 'Could not read app info file for app "' . $app . '"', ILogger::ERROR);
continue;
@@ -801,7 +786,7 @@ class OC_App {
\OC::$server->getAppManager()->clearAppsCache();
$l = \OC::$server->getL10N('core');
- $appData = self::getAppInfo($appId, false, $l->getLanguageCode());
+ $appData = \OCP\Server::get(\OCP\App\IAppManager::class)->getAppInfo($appId, false, $l->getLanguageCode());
$ignoreMaxApps = \OC::$server->getConfig()->getSystemValue('app_install_overwrite', []);
$ignoreMax = in_array($appId, $ignoreMaxApps, true);
diff --git a/tests/lib/InfoXmlTest.php b/tests/lib/InfoXmlTest.php
index 9dbeadf45d3..f613138bf87 100644
--- a/tests/lib/InfoXmlTest.php
+++ b/tests/lib/InfoXmlTest.php
@@ -21,6 +21,8 @@
namespace Test;
+use OCP\App\IAppManager;
+
/**
* Class InfoXmlTest
*
@@ -58,7 +60,7 @@ class InfoXmlTest extends TestCase {
* @param string $app
*/
public function testClasses($app) {
- $appInfo = \OC_App::getAppInfo($app);
+ $appInfo = \OCP\Server::get(IAppManager::class)->getAppInfo($app);
$appPath = \OC_App::getAppPath($app);
\OC_App::registerAutoloading($app, $appPath);