mirror of
https://github.com/friendica/friendica
synced 2024-12-22 18:00:16 +00:00
Extract config methods into AppHelper
This commit is contained in:
parent
0fc9f7f0b4
commit
470c47f45c
2 changed files with 41 additions and 3 deletions
12
src/App.php
12
src/App.php
|
@ -240,21 +240,25 @@ class App
|
|||
/**
|
||||
* Returns the current config cache of this node
|
||||
*
|
||||
* @deprecated 2024.12 Use AppHelper::getConfigCache() instead
|
||||
*
|
||||
* @return Cache
|
||||
*/
|
||||
public function getConfigCache()
|
||||
{
|
||||
return $this->config->getCache();
|
||||
return $this->appHelper->getConfigCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* The basepath of this app
|
||||
*
|
||||
* @deprecated 2024.12 Use AppHelper::getBasePath() instead
|
||||
*
|
||||
* @return string Base path from configuration
|
||||
*/
|
||||
public function getBasePath(): string
|
||||
{
|
||||
return $this->config->get('system', 'basepath');
|
||||
return $this->appHelper->getBasePath();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -414,12 +418,14 @@ class App
|
|||
/**
|
||||
* Provide a sane default if nothing is chosen or the specified theme does not exist.
|
||||
*
|
||||
* @deprecated 2024.12 Use AppHelper::getCurrentThemeStylesheetPath() instead
|
||||
*
|
||||
* @return string Current theme's stylesheet path
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getCurrentThemeStylesheetPath(): string
|
||||
{
|
||||
return Core\Theme::getStylesheetPath($this->appHelper->getCurrentTheme());
|
||||
return $this->appHelper->getCurrentThemeStylesheetPath();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,6 +11,7 @@ use DateTimeZone;
|
|||
use Exception;
|
||||
use Friendica\App\Mode;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Core\Config\ValueObject\Cache;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||
|
@ -265,6 +266,37 @@ final class AppHelper
|
|||
return $this->theme_info[$index] ?? $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a sane default if nothing is chosen or the specified theme does not exist.
|
||||
*
|
||||
* @return string Current theme's stylesheet path
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getCurrentThemeStylesheetPath(): string
|
||||
{
|
||||
return Theme::getStylesheetPath($this->getCurrentTheme());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current config cache of this node
|
||||
*
|
||||
* @return Cache
|
||||
*/
|
||||
public function getConfigCache(): Cache
|
||||
{
|
||||
return $this->config->getCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* The basepath of this app
|
||||
*
|
||||
* @return string Base path from configuration
|
||||
*/
|
||||
public function getBasePath(): string
|
||||
{
|
||||
return $this->config->get('system', 'basepath');
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes the current theme name based on the node settings, the page owner settings and the user settings
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue