diff --git a/boot.php b/boot.php index 2adafac60..4458e3d75 100644 --- a/boot.php +++ b/boot.php @@ -23,6 +23,7 @@ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'a use Friendica\App; use Friendica\Core\System; use Friendica\Core\Config; +use Friendica\Core\PConfig; use Friendica\Util\Lock; require_once 'include/config.php'; @@ -603,9 +604,9 @@ function is_ajax() { */ function check_db($via_worker) { - $build = get_config('system', 'build'); + $build = Config::get('system', 'build'); if (!x($build)) { - set_config('system', 'build', DB_UPDATE_VERSION); + Config::set('system', 'build', DB_UPDATE_VERSION); $build = DB_UPDATE_VERSION; } if ($build != DB_UPDATE_VERSION) { @@ -622,7 +623,7 @@ function check_db($via_worker) { */ function check_url(App $a) { - $url = get_config('system', 'url'); + $url = 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. @@ -631,10 +632,10 @@ function check_url(App $a) { // We will only change the url to an ip address if there is no existing setting if (!x($url)) { - $url = set_config('system', 'url', System::baseUrl()); + $url = Config::set('system', 'url', System::baseUrl()); } if ((!link_compare($url, System::baseUrl())) && (!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/", $a->get_hostname))) { - $url = set_config('system', 'url', System::baseUrl()); + $url = Config::set('system', 'url', System::baseUrl()); } return; @@ -644,9 +645,9 @@ function check_url(App $a) { * @brief Automatic database updates */ function update_db(App $a) { - $build = get_config('system', 'build'); + $build = Config::get('system', 'build'); if (!x($build)) { - $build = set_config('system', 'build', DB_UPDATE_VERSION); + $build = Config::set('system', 'build', DB_UPDATE_VERSION); } if ($build != DB_UPDATE_VERSION) { @@ -664,12 +665,12 @@ function update_db(App $a) { if (DB_UPDATE_VERSION == UPDATE_VERSION) { // Compare the current structure with the defined structure - $t = get_config('database', 'dbupdate_' . DB_UPDATE_VERSION); + $t = Config::get('database', 'dbupdate_' . DB_UPDATE_VERSION); if ($t !== false) { return; } - set_config('database', 'dbupdate_' . DB_UPDATE_VERSION, time()); + Config::set('database', 'dbupdate_' . DB_UPDATE_VERSION, time()); // run old update routine (wich could modify the schema and // conflits with new routine) @@ -693,7 +694,7 @@ function update_db(App $a) { ); return; } else { - set_config('database', 'dbupdate_' . DB_UPDATE_VERSION, 'success'); + Config::set('database', 'dbupdate_' . DB_UPDATE_VERSION, 'success'); } // run any left update_nnnn functions in update.php @@ -720,11 +721,11 @@ function run_update_function($x) { // If the update fails or times-out completely you may need to // delete the config entry to try again. - $t = get_config('database', 'update_' . $x); + $t = Config::get('database', 'update_' . $x); if ($t !== false) { return false; } - set_config('database', 'update_' . $x, time()); + Config::set('database', 'update_' . $x, time()); // call the specific update @@ -739,13 +740,13 @@ function run_update_function($x) { ); return false; } else { - set_config('database', 'update_' . $x, 'success'); - set_config('system', 'build', $x + 1); + Config::set('database', 'update_' . $x, 'success'); + Config::set('system', 'build', $x + 1); return true; } } else { - set_config('database', 'update_' . $x, 'success'); - set_config('system', 'build', $x + 1); + Config::set('database', 'update_' . $x, 'success'); + Config::set('system', 'build', $x + 1); return true; } return true; @@ -774,7 +775,7 @@ function check_plugins(App $a) { $installed = array(); } - $plugins = get_config('system', 'addon'); + $plugins = Config::get('system', 'addon'); $plugins_arr = array(); if ($plugins) { @@ -852,7 +853,7 @@ function login($register = false, $hiddens = false) { ); } - $noid = get_config('system', 'no_openid'); + $noid = Config::get('system', 'no_openid'); $dest_url = $a->query_string; @@ -1007,7 +1008,7 @@ function notice($s) { function info($s) { $a = get_app(); - if (local_user() && get_pconfig(local_user(), 'system', 'ignore_info')) { + if (local_user() && PConfig::get(local_user(), 'system', 'ignore_info')) { return; } @@ -1063,7 +1064,7 @@ function current_theme() { // This works only if the user is on the same server if ($page_theme && local_user() && (local_user() != $a->profile_uid)) { - if (get_pconfig(local_user(), 'system', 'always_my_theme')) { + if (PConfig::get(local_user(), 'system', 'always_my_theme')) { $page_theme = null; } } @@ -1304,7 +1305,7 @@ function random_digits($digits) { } function get_server() { - $server = get_config("system", "directory"); + $server = Config::get("system", "directory"); if ($server == "") { $server = "http://dir.friendica.social"; @@ -1316,7 +1317,7 @@ function get_server() { function get_temppath() { $a = get_app(); - $temppath = get_config("system", "temppath"); + $temppath = Config::get("system", "temppath"); if (($temppath != "") && App::directory_usable($temppath)) { // We have a temp path and it is usable @@ -1340,7 +1341,7 @@ function get_temppath() { if (App::directory_usable($new_temppath)) { // The new path is usable, we are happy - set_config("system", "temppath", $new_temppath); + Config::set("system", "temppath", $new_temppath); return $new_temppath; } else { // We can't create a subdirectory, strange. @@ -1389,7 +1390,7 @@ function clear_cache($basepath = "", $path = "") { return; } - $cachetime = (int) get_config('system', 'itemcache_duration'); + $cachetime = (int) Config::get('system', 'itemcache_duration'); if ($cachetime == 0) { $cachetime = 86400; } @@ -1412,12 +1413,12 @@ function clear_cache($basepath = "", $path = "") { function get_itemcachepath() { // Checking, if the cache is deactivated - $cachetime = (int) get_config('system', 'itemcache_duration'); + $cachetime = (int) Config::get('system', 'itemcache_duration'); if ($cachetime < 0) { return ""; } - $itemcache = get_config('system', 'itemcache'); + $itemcache = Config::get('system', 'itemcache'); if (($itemcache != "") && App::directory_usable($itemcache)) { return App::realpath($itemcache); } @@ -1431,7 +1432,7 @@ function get_itemcachepath() { } if (App::directory_usable($itemcache)) { - set_config("system", "itemcache", $itemcache); + Config::set("system", "itemcache", $itemcache); return $itemcache; } } @@ -1444,7 +1445,7 @@ function get_itemcachepath() { * @return string Spool path */ function get_spoolpath() { - $spoolpath = get_config('system', 'spoolpath'); + $spoolpath = Config::get('system', 'spoolpath'); if (($spoolpath != "") && App::directory_usable($spoolpath)) { // We have a spool path and it is usable return $spoolpath; @@ -1462,7 +1463,7 @@ function get_spoolpath() { if (App::directory_usable($spoolpath)) { // The new path is usable, we are happy - set_config("system", "spoolpath", $spoolpath); + Config::set("system", "spoolpath", $spoolpath); return $spoolpath; } else { // We can't create a subdirectory, strange. @@ -1574,7 +1575,7 @@ function argv($x) { */ function infinite_scroll_data($module) { - if (get_pconfig(local_user(), 'system', 'infinite_scroll') + if (PConfig::get(local_user(), 'system', 'infinite_scroll') && ($module == "network") && ($_GET["mode"] != "minimal")) { // get the page number diff --git a/doc/themes.md b/doc/themes.md index 589c882c6..fc21b19d6 100644 --- a/doc/themes.md +++ b/doc/themes.md @@ -130,7 +130,7 @@ The selected 1st part will be saved in the database by the theme_post function. // if the one specific submit button was pressed then proceed if (isset($_POST['duepuntozero-settings-submit'])){ // and save the selection key into the personal config of the user - set_pconfig(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']); + PConfig::set(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']); } } @@ -138,9 +138,9 @@ Now that this information is set in the database, what should friendica do with For this, have a look at the theme.php file of the *duepunto zero*. There you'll find somethink alike - $colorset = get_pconfig( local_user(), 'duepuntozero','colorset'); + $colorset = PConfig::get( local_user(), 'duepuntozero','colorset'); if (!$colorset) - $colorset = get_config('duepuntozero', 'colorset'); + $colorset = Config::get('duepuntozero', 'colorset'); if ($colorset) { if ($colorset == 'greenzero') $a->page['htmlhead'] .= ''."\n"; diff --git a/include/Contact.php b/include/Contact.php index cbc6e6211..a7a22671f 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -1,6 +1,7 @@ $it['fname'], 'url' => zrl($it['furl']), 'hidden' => $it['hidden'] == 1, - 'post_newfriend' => (intval(get_pconfig(local_user(),'system','post_newfriend')) ? '1' : 0), + 'post_newfriend' => (intval(PConfig::get(local_user(),'system','post_newfriend')) ? '1' : 0), 'knowyou' => $knowyou, 'note' => $it['note'], @@ -814,7 +815,7 @@ class NotificationsManager { 'keywords' => $it['gkeywords'], 'gender' => $it['ggender'], 'hidden' => $it['hidden'] == 1, - 'post_newfriend' => (intval(get_pconfig(local_user(),'system','post_newfriend')) ? '1' : 0), + 'post_newfriend' => (intval(PConfig::get(local_user(),'system','post_newfriend')) ? '1' : 0), 'url' => $it['url'], 'zrl' => zrl($it['url']), 'addr' => $it['gaddr'], diff --git a/include/Photo.php b/include/Photo.php index 343082d1d..9b9e02142 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -5,6 +5,7 @@ */ use Friendica\App; +use Friendica\Core\Config; use Friendica\Core\System; require_once("include/photos.php"); @@ -119,7 +120,7 @@ class Photo { */ switch($this->getType()){ case "image/png": - $quality = get_config('system', 'png_quality'); + $quality = Config::get('system', 'png_quality'); if ((! $quality) || ($quality > 9)) { $quality = PNG_QUALITY; } @@ -135,7 +136,7 @@ class Photo { $this->image->setCompressionQuality($quality); break; case "image/jpeg": - $quality = get_config('system', 'jpeg_quality'); + $quality = Config::get('system', 'jpeg_quality'); if ((! $quality) || ($quality > 100)) { $quality = JPEG_QUALITY; } @@ -605,14 +606,14 @@ class Photo { switch($this->getType()){ case "image/png": - $quality = get_config('system', 'png_quality'); + $quality = Config::get('system', 'png_quality'); if ((!$quality) || ($quality > 9)) { $quality = PNG_QUALITY; } imagepng($this->image, null, $quality); break; case "image/jpeg": - $quality = get_config('system', 'jpeg_quality'); + $quality = Config::get('system', 'jpeg_quality'); if ((!$quality) || ($quality > 100)) { $quality = JPEG_QUALITY; } @@ -940,7 +941,7 @@ function store_photo(App $a, $uid, $imagedata = "", $url = "") { $a->save_timestamp($stamp1, "file"); } - $maximagesize = get_config('system', 'maximagesize'); + $maximagesize = Config::get('system', 'maximagesize'); if (($maximagesize) && (strlen($imagedata) > $maximagesize)) { logger("Image exceeds size limit of ".$maximagesize, LOGGER_DEBUG); @@ -972,7 +973,7 @@ function store_photo(App $a, $uid, $imagedata = "", $url = "") { $ph->orient($tempfile); unlink($tempfile); - $max_length = get_config('system', 'max_image_length'); + $max_length = Config::get('system', 'max_image_length'); if (! $max_length) { $max_length = MAX_IMAGE_LENGTH; } diff --git a/include/Smilies.php b/include/Smilies.php index a2d7637c7..28fd59db0 100644 --- a/include/Smilies.php +++ b/include/Smilies.php @@ -14,6 +14,8 @@ */ use Friendica\App; +use Friendica\Core\Config; +use Friendica\Core\PConfig; use Friendica\Core\System; /** @@ -156,8 +158,8 @@ class Smilies { * @return string HML Output of the Smilie */ public static function replace($s, $sample = false, $no_images = false) { - if(intval(get_config('system','no_smilies')) - || (local_user() && intval(get_pconfig(local_user(),'system','no_smilies')))) + if(intval(Config::get('system','no_smilies')) + || (local_user() && intval(PConfig::get(local_user(),'system','no_smilies')))) return $s; $s = preg_replace_callback('/
(.*?)<\/pre>/ism','self::encode',$s);
diff --git a/include/acl_selectors.php b/include/acl_selectors.php
index 32348c233..a5bb1a9cd 100644
--- a/include/acl_selectors.php
+++ b/include/acl_selectors.php
@@ -5,6 +5,7 @@
  */
 
 use Friendica\App;
+use Friendica\Core\Config;
 
 require_once "include/contact_selectors.php";
 require_once "include/contact_widgets.php";
@@ -332,7 +333,7 @@ function populate_acl($user = null, $show_jotnets = false) {
 
 	$jotnets = '';
 	if ($show_jotnets) {
-		$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
+		$mail_disabled = ((function_exists('imap_open') && (! Config::get('system','imap_disabled'))) ? 0 : 1);
 
 		$mail_enabled = false;
 		$pubmail_enabled = false;
@@ -757,12 +758,12 @@ function navbar_complete(App $a) {
 
 //	logger('navbar_complete');
 
-	if ((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+	if ((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) {
 		return;
 	}
 
 	// check if searching in the local global contact table is enabled
-	$localsearch = get_config('system','poco_local_search');
+	$localsearch = Config::get('system','poco_local_search');
 
 	$search = $prefix.notags(trim($_REQUEST['search']));
 	$mode = $_REQUEST['smode'];
diff --git a/include/api.php b/include/api.php
index 153e6c7ee..d677206b4 100644
--- a/include/api.php
+++ b/include/api.php
@@ -297,7 +297,7 @@ $called_api = null;
 					$duration = (float) (microtime(true) - $stamp);
 					logger("API call duration: " . round($duration, 2) . "\t" . $a->query_string, LOGGER_DEBUG);
 
-					if (get_config("system", "profiler")) {
+					if (Config::get("system", "profiler")) {
 						$duration = microtime(true)-$a->performance["start"];
 
 						/// @TODO round() really everywhere?
@@ -312,7 +312,7 @@ $called_api = null;
 							LOGGER_DEBUG
 						);
 
-						if (get_config("rendertime", "callstack")) {
+						if (Config::get("rendertime", "callstack")) {
 							$o = "Database Read:\n";
 							foreach ($a->callstack["database"] AS $func => $time) {
 								$time = round($time, 3);
@@ -1084,7 +1084,7 @@ $called_api = null;
 			$_REQUEST['type'] = 'net-comment';
 		} else {
 			// Check for throttling (maximum posts per day, week and month)
-			$throttle_day = get_config('system','throttle_limit_day');
+			$throttle_day = Config::get('system','throttle_limit_day');
 			if ($throttle_day > 0) {
 				$datefrom = date("Y-m-d H:i:s", time() - 24*60*60);
 
@@ -1105,7 +1105,7 @@ $called_api = null;
 				}
 			}
 
-			$throttle_week = get_config('system','throttle_limit_week');
+			$throttle_week = Config::get('system','throttle_limit_week');
 			if ($throttle_week > 0) {
 				$datefrom = date("Y-m-d H:i:s", time() - 24*60*60*7);
 
@@ -1126,7 +1126,7 @@ $called_api = null;
 				}
 			}
 
-			$throttle_month = get_config('system','throttle_limit_month');
+			$throttle_month = Config::get('system','throttle_limit_month');
 			if ($throttle_month > 0) {
 				$datefrom = date("Y-m-d H:i:s", time() - 24*60*60*30);
 
@@ -2464,7 +2464,7 @@ $called_api = null;
 				if ($image) {
 					// If image cache is activated, then use the following sizes:
 					// thumb  (150), small (340), medium (600) and large (1024)
-					if (!get_config("system", "proxy_disabled")) {
+					if (!Config::get("system", "proxy_disabled")) {
 						$media_url = proxy_url($url);
 
 						$sizes = array();
@@ -3761,7 +3761,7 @@ $called_api = null;
 		// Update global directory in background
 		//$user = api_get_user(get_app());
 		$url = System::baseUrl() . '/profile/' . get_app()->user['nickname'];
-		if ($url && strlen(get_config('system', 'directory'))) {
+		if ($url && strlen(Config::get('system', 'directory'))) {
 			Worker::add(PRIORITY_LOW, "directory", $url);
 		}
 
@@ -3854,7 +3854,7 @@ $called_api = null;
 			throw new InternalServerErrorException("image size exceeds PHP config settings, file was rejected by server");
 		}
 		// check against max upload size within Friendica instance
-		$maximagesize = get_config('system', 'maximagesize');
+		$maximagesize = Config::get('system', 'maximagesize');
 		if (($maximagesize) && ($filesize > $maximagesize)) {
 			$formattedBytes = formatBytes($maximagesize);
 			throw new InternalServerErrorException("image size exceeds Friendica config setting (uploaded size: $formattedBytes)");
@@ -3872,7 +3872,7 @@ $called_api = null;
 		@unlink($src);
 
 		// check max length of images on server
-		$max_length = get_config('system', 'max_image_length');
+		$max_length = Config::get('system', 'max_image_length');
 		if (! $max_length) {
 			$max_length = MAX_IMAGE_LENGTH;
 		}
@@ -4947,7 +4947,7 @@ $called_api = null;
 
 		// retrieve general information about profiles for user
 		$multi_profiles = feature_enabled(api_user(),'multi_profiles');
-		$directory = get_config('system', 'directory');
+		$directory = Config::get('system', 'directory');
 
 		// get data of the specified profile id or all profiles of the user if not specified
 		if ($profileid != 0) {
diff --git a/include/auth.php b/include/auth.php
index f220e1685..763596365 100644
--- a/include/auth.php
+++ b/include/auth.php
@@ -33,7 +33,7 @@ if (isset($_COOKIE["Friendica"])) {
 			if (!isset($_SESSION) || !isset($_SESSION['authenticated'])) {
 				authenticate_success($r[0]);
 
-				if (get_config('system','paranoia'))
+				if (Config::get('system','paranoia'))
 					$_SESSION['addr'] = $data->ip;
 			}
 		}
@@ -67,7 +67,7 @@ if (isset($_SESSION) && x($_SESSION,'authenticated') && (!x($_POST,'auth-params'
 
 		// already logged in user returning
 
-		$check = get_config('system','paranoia');
+		$check = Config::get('system','paranoia');
 		// extra paranoia - if the IP changed, log them out
 		if ($check && ($_SESSION['addr'] != $_SERVER['REMOTE_ADDR'])) {
 			logger('Session address changed. Paranoid setting in effect, blocking session. '.
@@ -109,7 +109,7 @@ if (isset($_SESSION) && x($_SESSION,'authenticated') && (!x($_POST,'auth-params'
 		if ((x($_POST,'openid_url')) && strlen($_POST['openid_url']) ||
 		   (x($_POST,'username')) && strlen($_POST['username'])) {
 
-			$noid = get_config('system','no_openid');
+			$noid = Config::get('system','no_openid');
 
 			$openid_url = trim((strlen($_POST['openid_url'])?$_POST['openid_url']:$_POST['username']));
 
diff --git a/include/bbcode.php b/include/bbcode.php
index ee740e18c..daabd21b9 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -913,7 +913,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
 	$Text = str_replace("\r\n", "\n", $Text);
 
 	// removing multiplicated newlines
-	if (get_config("system", "remove_multiplicated_lines")) {
+	if (Config::get("system", "remove_multiplicated_lines")) {
 		$search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]", "[/li]\n", "\n[li]", "\n[ul]", "[/ul]\n", "\n\n[share ", "[/attachment]\n",
 				"\n[h1]", "[/h1]\n", "\n[h2]", "[/h2]\n", "\n[h3]", "[/h3]\n", "\n[h4]", "[/h4]\n", "\n[h5]", "[/h5]\n", "\n[h6]", "[/h6]\n");
 		$replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]", "[/li]", "[li]", "[ul]", "[/ul]", "\n[share ", "[/attachment]",
diff --git a/include/cache.php b/include/cache.php
index 1f8058363..9571eb8d9 100644
--- a/include/cache.php
+++ b/include/cache.php
@@ -154,7 +154,7 @@ class Cache {
 	public static function clear($max_level = CACHE_MONTH) {
 
 		// Clear long lasting cache entries only once a day
-		if (get_config("system", "cache_cleared_day") < time() - self::duration(CACHE_DAY)) {
+		if (Config::get("system", "cache_cleared_day") < time() - self::duration(CACHE_DAY)) {
 			if ($max_level == CACHE_MONTH) {
 				q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
 					dbesc(datetime_convert('UTC','UTC',"now - 30 days")), intval(CACHE_MONTH));
@@ -169,42 +169,42 @@ class Cache {
 				q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
 				dbesc(datetime_convert('UTC','UTC',"now - 1 days")), intval(CACHE_DAY));
 			}
-			set_config("system", "cache_cleared_day", time());
+			Config::set("system", "cache_cleared_day", time());
 		}
 
-		if (($max_level <= CACHE_HOUR) && (get_config("system", "cache_cleared_hour")) < time() - self::duration(CACHE_HOUR)) {
+		if (($max_level <= CACHE_HOUR) && (Config::get("system", "cache_cleared_hour")) < time() - self::duration(CACHE_HOUR)) {
 			q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
 				dbesc(datetime_convert('UTC','UTC',"now - 1 hours")), intval(CACHE_HOUR));
 
-			set_config("system", "cache_cleared_hour", time());
+			Config::set("system", "cache_cleared_hour", time());
 		}
 
-		if (($max_level <= CACHE_HALF_HOUR) && (get_config("system", "cache_cleared_half_hour")) < time() - self::duration(CACHE_HALF_HOUR)) {
+		if (($max_level <= CACHE_HALF_HOUR) && (Config::get("system", "cache_cleared_half_hour")) < time() - self::duration(CACHE_HALF_HOUR)) {
 			q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
 				dbesc(datetime_convert('UTC','UTC',"now - 30 minutes")), intval(CACHE_HALF_HOUR));
 
-			set_config("system", "cache_cleared_half_hour", time());
+			Config::set("system", "cache_cleared_half_hour", time());
 		}
 
-		if (($max_level <= CACHE_QUARTER_HOUR) && (get_config("system", "cache_cleared_quarter_hour")) < time() - self::duration(CACHE_QUARTER_HOUR)) {
+		if (($max_level <= CACHE_QUARTER_HOUR) && (Config::get("system", "cache_cleared_quarter_hour")) < time() - self::duration(CACHE_QUARTER_HOUR)) {
 			q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
 				dbesc(datetime_convert('UTC','UTC',"now - 15 minutes")), intval(CACHE_QUARTER_HOUR));
 
-			set_config("system", "cache_cleared_quarter_hour", time());
+			Config::set("system", "cache_cleared_quarter_hour", time());
 		}
 
-		if (($max_level <= CACHE_FIVE_MINUTES) && (get_config("system", "cache_cleared_five_minute")) < time() - self::duration(CACHE_FIVE_MINUTES)) {
+		if (($max_level <= CACHE_FIVE_MINUTES) && (Config::get("system", "cache_cleared_five_minute")) < time() - self::duration(CACHE_FIVE_MINUTES)) {
 			q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
 				dbesc(datetime_convert('UTC','UTC',"now - 5 minutes")), intval(CACHE_FIVE_MINUTES));
 
-			set_config("system", "cache_cleared_five_minute", time());
+			Config::set("system", "cache_cleared_five_minute", time());
 		}
 
-		if (($max_level <= CACHE_MINUTE) && (get_config("system", "cache_cleared_minute")) < time() - self::duration(CACHE_MINUTE)) {
+		if (($max_level <= CACHE_MINUTE) && (Config::get("system", "cache_cleared_minute")) < time() - self::duration(CACHE_MINUTE)) {
 			q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
 				dbesc(datetime_convert('UTC','UTC',"now - 1 minutes")), intval(CACHE_MINUTE));
 
-			set_config("system", "cache_cleared_minute", time());
+			Config::set("system", "cache_cleared_minute", time());
 		}
 	}
 }
diff --git a/include/cli_startup.php b/include/cli_startup.php
index 645e5eddd..8cbc7db37 100644
--- a/include/cli_startup.php
+++ b/include/cli_startup.php
@@ -23,7 +23,7 @@ function cli_startup() {
 
 	Config::load();
 
-	$a->set_baseurl(get_config('system','url'));
+	$a->set_baseurl(Config::get('system','url'));
 
 	load_hooks();
 }
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
index b359781ff..01329513b 100644
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -3,6 +3,7 @@
 use Friendica\App;
 use Friendica\Core\System;
 use Friendica\Core\Config;
+use Friendica\Core\PConfig;
 
 require_once 'include/contact_selectors.php';
 
@@ -24,8 +25,8 @@ function findpeople_widget() {
 	$a = get_app();
 	$global_dir = Config::get('system', 'directory');
 
-	if (get_config('system', 'invitation_only')) {
-		$x = get_pconfig(local_user(), 'system', 'invites_remaining');
+	if (Config::get('system', 'invitation_only')) {
+		$x = PConfig::get(local_user(), 'system', 'invites_remaining');
 		if ($x || is_site_admin()) {
 			$a->page['aside'] .= '