diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-04-07 15:42:43 -0500 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-04-09 21:43:01 -0500 |
commit | 5b4adf66e51e21b3ecbd683397a362b60f792a50 (patch) | |
tree | 8bdc129ac9fd6575ee41be438ff667e49f7110a2 /lib/private/Server.php | |
parent | ca9d25169dcdd2923a356e2a797d8704506a3787 (diff) | |
download | nextcloud-server-5b4adf66e51e21b3ecbd683397a362b60f792a50.tar.gz nextcloud-server-5b4adf66e51e21b3ecbd683397a362b60f792a50.zip |
Move OC_Defaults to OCP\Defaults
* currently there are two ways to access default values:
OCP\Defaults or OC_Defaults (which is extended by
OCA\Theming\ThemingDefaults)
* our code used a mixture of both of them, which made
it hard to work on theme values
* this extended the public interface with the missing
methods and uses them everywhere to only rely on the
public interface
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r-- | lib/private/Server.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php index 0d05bfe0dc8..9b2380ac7ac 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -95,6 +95,7 @@ use OC\Session\CryptoWrapper; use OC\Tagging\TagMapper; use OCA\Theming\ThemingDefaults; use OCP\App\IAppManager; +use OCP\Defaults; use OCP\Federation\ICloudIdManager; use OCP\Authentication\LoginCredentials\IStore; use OCP\ICacheFactory; @@ -726,7 +727,7 @@ class Server extends ServerContainer implements IServerContainer { return new Mailer( $c->getConfig(), $c->getLogger(), - $c->getThemingDefaults() + $c->query(Defaults::class) ); }); $this->registerAlias('Mailer', \OCP\Mail\IMailer::class); @@ -955,6 +956,13 @@ class Server extends ServerContainer implements IServerContainer { $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); + $this->registerService(Defaults::class, function (Server $c) { + return new Defaults( + $c->getThemingDefaults() + ); + }); + $this->registerAlias('Defaults', \OCP\Defaults::class); + $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { return $c->query(\OCP\IUserSession::class)->getSession(); }); |