aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-10-10 09:22:43 +0200
committerGitHub <noreply@github.com>2016-10-10 09:22:43 +0200
commit195fc041dabec4dc4d60ea1892d21d673e829b8b (patch)
treee82fd2291014675048330ae228d09a05e7f166dd /lib/private/legacy
parentce9e33bd3cdf179ffa276c67101934d82cb4c0e7 (diff)
parent0c2b17c80f54027aaebbc43b8efb21fdaffe8d45 (diff)
downloadnextcloud-server-195fc041dabec4dc4d60ea1892d21d673e829b8b.tar.gz
nextcloud-server-195fc041dabec4dc4d60ea1892d21d673e829b8b.zip
Merge pull request #1663 from nextcloud/dont-reparse-info-xml
Dont reparse info xml + cache AppInfo XML
Diffstat (limited to 'lib/private/legacy')
-rw-r--r--lib/private/legacy/app.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index c3d2d1d6ad4..5e05884f5c0 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -47,6 +47,7 @@
*
*/
use OC\App\DependencyAnalyzer;
+use OC\App\InfoParser;
use OC\App\Platform;
use OC\Installer;
use OC\OCSClient;
@@ -681,7 +682,7 @@ class OC_App {
$file = $appPath . '/appinfo/info.xml';
}
- $parser = new \OC\App\InfoParser(\OC::$server->getURLGenerator());
+ $parser = new InfoParser(\OC::$server->getMemCacheFactory()->create('core.appinfo'));
$data = $parser->parse($file);
if (is_array($data)) {
@@ -847,6 +848,7 @@ class OC_App {
$blacklist = \OC::$server->getAppManager()->getAlwaysEnabledApps();
$appList = array();
$langCode = \OC::$server->getL10N('core')->getLanguageCode();
+ $urlGenerator = \OC::$server->getURLGenerator();
foreach ($installedApps as $app) {
if (array_search($app, $blacklist) === false) {
@@ -900,6 +902,19 @@ class OC_App {
}
}
}
+ // fix documentation
+ if (isset($info['documentation']) && is_array($info['documentation'])) {
+ foreach ($info['documentation'] as $key => $url) {
+ // If it is not an absolute URL we assume it is a key
+ // i.e. admin-ldap will get converted to go.php?to=admin-ldap
+ if (stripos($url, 'https://') !== 0 && stripos($url, 'http://') !== 0) {
+ $url = $urlGenerator->linkToDocs($url);
+ }
+
+ $info['documentation'][$key] = $url;
+ }
+ }
+
$info['version'] = OC_App::getAppVersion($app);
$appList[] = $info;
}