Merge pull request #530 from nextcloud/fix-theme-loading

Make sure we try to autoload the class
This commit is contained in:
Morris Jobke 2016-07-25 08:37:13 +02:00 committed by GitHub
commit de4236bc4a
2 changed files with 10 additions and 2 deletions

View file

@ -631,7 +631,14 @@ class Server extends ServerContainer implements IServerContainer {
return $factory->getManager();
});
$this->registerService('ThemingDefaults', function(Server $c) {
if(class_exists('OCA\Theming\Template', false) && $this->getConfig()->getSystemValue('installed', false) && $this->getAppManager()->isInstalled('theming')) {
try {
$classExists = class_exists('OCA\Theming\Template');
} catch (\OCP\AutoloadNotAllowedException $e) {
// App disabled or in maintenance mode
$classExists = false;
}
if ($classExists && $this->getConfig()->getSystemValue('installed', false) && $this->getAppManager()->isInstalled('theming')) {
return new Template(
$this->getConfig(),
$this->getL10N('theming'),

View file

@ -30,7 +30,8 @@
*/
namespace OC;
use OCP\Defaults;
use OCP\ICacheFactory;
use OCP\IConfig;
use OCP\IURLGenerator;