@ -744,30 +744,39 @@ class AppManager implements IAppManager {
*/
*/
public function getAppInfo(string $appId, bool $path = false, $lang = null) {
public function getAppInfo(string $appId, bool $path = false, $lang = null) {
if ($path) {
if ($path) {
$file = $appId;
throw new \InvalidArgumentException('Calling IAppManager::getAppInfo() with a path is no longer supported. Please call IAppManager::getAppInfoByPath() instead and verify that the path is good before calling.');
} else {
}
if ($lang === null && isset($this->appInfos[$appId])) {
if ($lang === null && isset($this->appInfos[$appId])) {
return $this->appInfos[$appId];
return $this->appInfos[$appId];
}
}
try {
try {
$appPath = $this->getAppPath($appId);
$appPath = $this->getAppPath($appId);
} catch (AppPathNotFoundException $e) {
} catch (AppPathNotFoundException) {
return null;
return null;
}
}
$file = $appPath . '/appinfo/info.xml';
$file = $appPath . '/appinfo/info.xml';
$data = $this->getAppInfoByPath($file, $lang);
if ($lang === null) {
$this->appInfos[$appId] = $data;
}
return $data;
}
public function getAppInfoByPath(string $path, ?string $lang = null): ?array {
if (!str_ends_with($path, '/appinfo/info.xml')) {
return null;
}
}
$parser = new InfoParser($this->memCacheFactory->createLocal('core.appinfo'));
$parser = new InfoParser($this->memCacheFactory->createLocal('core.appinfo'));