Skip to content

Commit

Permalink
Merge pull request #40125 from summersab/refactor/OC-Server-getThemin…
Browse files Browse the repository at this point in the history
…gDefaults
  • Loading branch information
skjnldsv authored Mar 15, 2024
2 parents d395715 + bbb7955 commit 27886aa
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function __construct(string $appName, array $urlParams = [], ServerContai
});

$this->registerService('OC_Defaults', function (ContainerInterface $c) {
return $c->get(IServerContainer::class)->getThemingDefaults();
return $c->get(IServerContainer::class)->get('ThemingDefaults');
});

$this->registerService('Protocol', function (ContainerInterface $c) {
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function __construct(IConfig $config,
IRequest $request,
LoggerInterface $logger,
MemoryInfo $memoryInfo) {
$defaults = \OC::$server->getThemingDefaults();
$defaults = \OC::$server->get('ThemingDefaults');
$this->config = $config;
$this->application = new SymfonyApplication($defaults->getName(), \OC_Util::getVersionString());
$this->dispatcher = $dispatcher;
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ public function __construct($webRoot, \OC\Config $config) {

$this->registerService(Defaults::class, function (Server $c) {
return new Defaults(
$c->getThemingDefaults()
$c->get('ThemingDefaults')
);
});
/** @deprecated 19.0.0 */
Expand Down
4 changes: 2 additions & 2 deletions lib/private/URLGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function imagePath(string $appName, string $file): string {
$themingEnabled = $this->config->getSystemValueBool('installed', false) && $this->getAppManager()->isEnabledForUser('theming');
$themingImagePath = false;
if ($themingEnabled) {
$themingDefaults = \OC::$server->getThemingDefaults();
$themingDefaults = \OC::$server->get('ThemingDefaults');
if ($themingDefaults instanceof ThemingDefaults) {
$themingImagePath = $themingDefaults->replaceImagePath($appName, $file);
}
Expand Down Expand Up @@ -299,7 +299,7 @@ public function getAbsoluteURL(string $url): string {
* @return string url to the online documentation
*/
public function linkToDocs(string $key): string {
$theme = \OC::$server->getThemingDefaults();
$theme = \OC::$server->get('ThemingDefaults');
return $theme->buildDocLinkToKey($key);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/public/Defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Defaults {
*/
public function __construct(\OC_Defaults $defaults = null) {
if ($defaults === null) {
$defaults = \OC::$server->getThemingDefaults();
$defaults = \OC::$server->get('ThemingDefaults');
}
$this->defaults = $defaults;
}
Expand Down

0 comments on commit 27886aa

Please sign in to comment.