{
$scheme = $this->scheme;
- if (Core\Config::get('system', 'ssl_policy') == SSL_POLICY_FULL) {
+ if ($this->config->get('system', 'ssl_policy') == SSL_POLICY_FULL) {
$scheme = 'https';
}
// Basically, we have $ssl = true on any links which can only be seen by a logged in user
// (and also the login link). Anything seen by an outsider will have it turned off.
- if (Core\Config::get('system', 'ssl_policy') == SSL_POLICY_SELFSIGN) {
+ if ($this->config->get('system', 'ssl_policy') == SSL_POLICY_SELFSIGN) {
if ($ssl) {
$scheme = 'https';
} else {
}
}
- if (Core\Config::get('config', 'hostname') != '') {
- $this->hostname = Core\Config::get('config', 'hostname');
+ if ($this->config->get('config', 'hostname') != '') {
+ $this->hostname = $this->config->get('config', 'hostname');
}
return $scheme . '://' . $this->hostname . (!empty($this->getURLPath()) ? '/' . $this->getURLPath() : '' );
include $this->getBasePath() . '/.htpreconfig.php';
}
- if (Core\Config::get('config', 'hostname') != '') {
- $this->hostname = Core\Config::get('config', 'hostname');
+ if ($this->config->get('config', 'hostname') != '') {
+ $this->hostname = $this->config->get('config', 'hostname');
}
if (!isset($this->hostname) || ($this->hostname == '')) {
public function getHostName()
{
- if (Core\Config::get('config', 'hostname') != '') {
- $this->hostname = Core\Config::get('config', 'hostname');
+ if ($this->config->get('config', 'hostname') != '') {
+ $this->hostname = $this->config->get('config', 'hostname');
}
return $this->hostname;
$this->registerStylesheet($stylesheet);
- $shortcut_icon = Core\Config::get('system', 'shortcut_icon');
+ $shortcut_icon = $this->config->get('system', 'shortcut_icon');
if ($shortcut_icon == '') {
$shortcut_icon = 'images/friendica-32.png';
}
- $touch_icon = Core\Config::get('system', 'touch_icon');
+ $touch_icon = $this->config->get('system', 'touch_icon');
if ($touch_icon == '') {
$touch_icon = 'images/friendica-128.png';
}
'$update_interval' => $interval,
'$shortcut_icon' => $shortcut_icon,
'$touch_icon' => $touch_icon,
- '$block_public' => intval(Core\Config::get('system', 'block_public')),
+ '$block_public' => intval($this->config->get('system', 'block_public')),
'$stylesheets' => $this->stylesheets,
]) . $this->page['htmlhead'];
}
*
if ($this->is_backend()) {
$process = 'backend';
- $max_processes = Core\Config::get('system', 'max_processes_backend');
+ $max_processes = $this->config->get('system', 'max_processes_backend');
if (intval($max_processes) == 0) {
$max_processes = 5;
}
} else {
$process = 'frontend';
- $max_processes = Core\Config::get('system', 'max_processes_frontend');
+ $max_processes = $this->config->get('system', 'max_processes_frontend');
if (intval($max_processes) == 0) {
$max_processes = 20;
}
*/
public function isMinMemoryReached()
{
- $min_memory = Core\Config::get('system', 'min_memory', 0);
+ $min_memory = $this->config->get('system', 'min_memory', 0);
if ($min_memory == 0) {
return false;
}
{
if ($this->isBackend()) {
$process = 'backend';
- $maxsysload = intval(Core\Config::get('system', 'maxloadavg'));
+ $maxsysload = intval($this->config->get('system', 'maxloadavg'));
if ($maxsysload < 1) {
$maxsysload = 50;
}
} else {
$process = 'frontend';
- $maxsysload = intval(Core\Config::get('system', 'maxloadavg_frontend'));
+ $maxsysload = intval($this->config->get('system', 'maxloadavg_frontend'));
if ($maxsysload < 1) {
$maxsysload = 50;
}
*/
public function getSenderEmailAddress()
{
- $sender_email = Core\Config::get('config', 'sender_email');
+ $sender_email = $this->config->get('config', 'sender_email');
if (empty($sender_email)) {
$hostname = $this->getHostName();
if (strpos($hostname, ':')) {
*/
private function computeCurrentTheme()
{
- $system_theme = Core\Config::get('system', 'theme');
+ $system_theme = $this->config->get('system', 'theme');
if (!$system_theme) {
throw new Exception(Core\L10n::t('No system theme config value set.'));
}
// Sane default
$this->currentTheme = $system_theme;
- $allowed_themes = explode(',', Core\Config::get('system', 'allowed_themes', $system_theme));
+ $allowed_themes = explode(',', $this->config->get('system', 'allowed_themes', $system_theme));
$page_theme = null;
// Find the theme that belongs to the user whose stuff we are looking at
// Specific mobile theme override
if (($this->is_mobile || $this->is_tablet) && Core\Session::get('show-mobile', true)) {
- $system_mobile_theme = Core\Config::get('system', 'mobile-theme');
+ $system_mobile_theme = $this->config->get('system', 'mobile-theme');
$user_mobile_theme = Core\Session::get('mobile-theme', $system_mobile_theme);
// --- means same mobile theme as desktop
*/
public function checkURL()
{
- $url = Core\Config::get('system', 'url');
+ $url = $this->config->get('system', 'url');
// if the url isn't set or the stored url is radically different
// than the currently visited url, store the current value accordingly.
// We will only change the url to an ip address if there is no existing setting
if (empty($url) || (!Util\Strings::compareLink($url, $this->getBaseURL())) && (!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/", $this->getHostName()))) {
- Core\Config::set('system', 'url', $this->getBaseURL());
+ $this->config->set('system', 'url', $this->getBaseURL());
}
}
if (!$this->getMode()->isInstall()) {
// Force SSL redirection
- if (Core\Config::get('system', 'force_ssl') && ($this->getScheme() == "http")
- && intval(Core\Config::get('system', 'ssl_policy')) == SSL_POLICY_FULL
+ if ($this->config->get('system', 'force_ssl') && ($this->getScheme() == "http")
+ && intval($this->config->get('system', 'ssl_policy')) == SSL_POLICY_FULL
&& strpos($this->getBaseURL(), 'https://') === 0
&& $_SERVER['REQUEST_METHOD'] == 'GET') {
header('HTTP/1.1 302 Moved Temporarily');
$this->module = "login";
}
- $privateapps = Core\Config::get('config', 'private_addons', false);
+ $privateapps = $this->config->get('config', 'private_addons', false);
if (Core\Addon::isEnabled($this->module) && file_exists("addon/{$this->module}/{$this->module}.php")) {
//Check if module is an app and if public access to apps is allowed or not
if ((!local_user()) && Core\Hook::isAddonApp($this->module) && $privateapps) {
header("X-Friendica-Version: " . FRIENDICA_VERSION);
header("Content-type: text/html; charset=utf-8");
- if (Core\Config::get('system', 'hsts') && (Core\Config::get('system', 'ssl_policy') == SSL_POLICY_FULL)) {
+ if ($this->config->get('system', 'hsts') && ($this->config->get('system', 'ssl_policy') == SSL_POLICY_FULL)) {
header("Strict-Transport-Security: max-age=31536000");
}