Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2016-08-24 15:17:51 +0300
committerGitHub <noreply@github.com>2016-08-24 15:17:51 +0300
commit43ce8b13c1422ed82f42886b5918159f05b36967 (patch)
treedf6a976cf97d97941372af00383ec4319c757150
parent95fb14f5b046879a395da8002356cfd56d4dd70a (diff)
parentb59f5fc72517ce7f89d5b9955bca8200c1582c8a (diff)
Merge pull request #1034 from nextcloud/stable10_1033v10.0.0
[Stable10] Fix theming autoloader magic
-rw-r--r--apps/theming/lib/Settings/Admin.php5
-rw-r--r--lib/private/Server.php14
2 files changed, 12 insertions, 7 deletions
diff --git a/apps/theming/lib/Settings/Admin.php b/apps/theming/lib/Settings/Admin.php
index d0a9f554084..1f79449e658 100644
--- a/apps/theming/lib/Settings/Admin.php
+++ b/apps/theming/lib/Settings/Admin.php
@@ -29,21 +29,20 @@ use OCP\IConfig;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\Settings\ISettings;
-use \OC_Defaults;
class Admin implements ISettings {
/** @var IConfig */
private $config;
/** @var IL10N */
private $l;
- /** @var ThemingDefaults|OC_Defaults */
+ /** @var ThemingDefaults */
private $themingDefaults;
/** @var IURLGenerator */
private $urlGenerator;
public function __construct(IConfig $config,
IL10N $l,
- OC_Defaults $themingDefaults,
+ ThemingDefaults $themingDefaults,
IURLGenerator $urlGenerator) {
$this->config = $config;
$this->l = $l;
diff --git a/lib/private/Server.php b/lib/private/Server.php
index d3da028a27c..55fe71d50a2 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -642,10 +642,16 @@ class Server extends ServerContainer implements IServerContainer {
return $factory->getManager();
});
$this->registerService('ThemingDefaults', function(Server $c) {
- try {
- $classExists = class_exists('OCA\Theming\ThemingDefaults');
- } catch (\OCP\AutoloadNotAllowedException $e) {
- // App disabled or in maintenance mode
+ /*
+ * Dark magic for autoloader.
+ * If we do a class_exists it will try to load the class which will
+ * make composer cache the result. Resulting in errors when enabling
+ * the theming app.
+ */
+ $prefixes = \OC::$composerAutoloader->getPrefixesPsr4();
+ if (isset($prefixes['OCA\\Theming\\'])) {
+ $classExists = true;
+ } else {
$classExists = false;
}