Browse Source

Merge pull request #2585 from fabrixxm/update_config_classes

Update config classes
pull/2586/head
rabuzarus 5 years ago
committed by GitHub
parent
commit
710822dca7
4 changed files with 26 additions and 28 deletions
  1. +10
    -8
      include/Core/Config.php
  2. +10
    -8
      include/Core/PConfig.php
  3. +1
    -0
      include/autoloader/autoload_psr4.php
  4. +5
    -12
      include/config.php

include/Config.php → include/Core/Config.php View File


include/PConfig.php → include/Core/PConfig.php View File


+ 1
- 0
include/autoloader/autoload_psr4.php View File

@ -6,4 +6,5 @@ $vendorDir = dirname(dirname(dirname(__FILE__)))."/library";
$baseDir = dirname($vendorDir);
return array(
'Friendica\\' => array($baseDir . '/include'),
);

+ 5
- 12
include/config.php View File

@ -1,8 +1,4 @@
<?php
require_once("include/PConfig.php");
require_once("include/Config.php");
/**
* @file include/config.php
*
@ -16,6 +12,9 @@ require_once("include/Config.php");
* configurations need to be fixed as of 10/08/2011.
*/
use \Friendica\Core\Config;
use \Friendica\Core\PConfig;
/**
* @brief (Deprecated) Loads all configuration values of family into a cached storage.
*
@ -44,10 +43,7 @@ function load_config($family) {
* @return mixed Stored value or false if it does not exist
*/
function get_config($family, $key, $refresh = false) {
$v = Config::get($family, $key, $refresh);
if(is_null($v))
$v = false;
$v = Config::get($family, $key, false, $refresh);
return $v;
}
@ -115,10 +111,7 @@ function load_pconfig($uid,$family) {
* @return mixed Stored value or false if it does not exist
*/
function get_pconfig($uid, $family, $key, $refresh = false) {
$v = PConfig::get($uid, $family, $key, $refresh);
if(is_null($v))
$v = false;
$v = PConfig::get($uid, $family, $key, false, $refresh);
return $v;
}


Loading…
Cancel
Save