From 0dc959d9fe40bddce5e99b8162bb0e770fc28ed9 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 24 Mar 2024 09:58:21 +0000 Subject: Deprecate *_config() functions in core. --- include/network.php | 89 +++++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 44 deletions(-) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index a5c14f9d1..a7a11ff6e 100644 --- a/include/network.php +++ b/include/network.php @@ -1,6 +1,7 @@ intval(get_config('system','force_queue_threshold',3000)) && (! $force)) { + if(intval($x[0]['total']) > intval(Config::Get('system','force_queue_threshold',3000)) && (! $force)) { logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO); foreach($deliveries as $d) { Queue::update($d); @@ -1482,9 +1483,9 @@ function do_delivery($deliveries, $force = false) { */ - $interval = get_config('queueworker', 'queue_interval', 500000); + $interval = Config::Get('queueworker', 'queue_interval', 500000); - $deliveries_per_process = intval(get_config('system','delivery_batch_count')); + $deliveries_per_process = intval(Config::Get('system','delivery_batch_count')); if($deliveries_per_process <= 0) $deliveries_per_process = 1; @@ -1542,9 +1543,9 @@ function get_site_info() { $admin = false; } - $def_service_class = get_config('system','default_service_class'); + $def_service_class = Config::Get('system','default_service_class'); if($def_service_class) - $service_class = get_config('service_class',$def_service_class); + $service_class = Config::Get('service_class',$def_service_class); else $service_class = false; @@ -1555,9 +1556,9 @@ function get_site_info() { if(! isset($commit) || strlen($commit) > 16) $commit = ''; - $site_info = get_config('system','info'); - $site_name = get_config('system','sitename'); - if(! get_config('system','hidden_version_siteinfo')) { + $site_info = Config::Get('system','info'); + $site_name = Config::Get('system','sitename'); + if(! Config::Get('system','hidden_version_siteinfo')) { $version = Zotlabs\Lib\System::get_project_version(); $tag = Zotlabs\Lib\System::get_std_version(); @@ -1573,15 +1574,15 @@ function get_site_info() { } //Statistics - $channels_total_stat = intval(get_config('system','channels_total_stat')); - $channels_active_halfyear_stat = intval(get_config('system','channels_active_halfyear_stat')); - $channels_active_monthly_stat = intval(get_config('system','channels_active_monthly_stat')); - $local_posts_stat = intval(get_config('system','local_posts_stat')); - $local_comments_stat = intval(get_config('system','local_comments_stat')); - $hide_in_statistics = intval(get_config('system','hide_in_statistics')); - $site_expire = intval(get_config('system', 'default_expire_days')); - - load_config('feature_lock'); + $channels_total_stat = intval(Config::Get('system','channels_total_stat')); + $channels_active_halfyear_stat = intval(Config::Get('system','channels_active_halfyear_stat')); + $channels_active_monthly_stat = intval(Config::Get('system','channels_active_monthly_stat')); + $local_posts_stat = intval(Config::Get('system','local_posts_stat')); + $local_comments_stat = intval(Config::Get('system','local_comments_stat')); + $hide_in_statistics = intval(Config::Get('system','hide_in_statistics')); + $site_expire = intval(Config::Get('system', 'default_expire_days')); + + Config::Load('feature_lock'); $locked_features = array(); if(is_array(App::$config['feature_lock']) && count(App::$config['feature_lock'])) { foreach(App::$config['feature_lock'] as $k => $v) { @@ -1602,18 +1603,18 @@ function get_site_info() { 'server_role' => Zotlabs\Lib\System::get_server_role(), 'commit' => $commit, 'plugins' => $visible_plugins, - 'register_policy' => $register_policy[get_config('system','register_policy')], - 'invitation_only' => (bool) intval(get_config('system','invitation_only')), - 'directory_mode' => $directory_mode[get_config('system','directory_mode')], - 'directory_server' => get_config('system','directory_server'), - 'language' => get_config('system','language'), - 'rss_connections' => (bool) intval(get_config('system','feed_contacts')), + 'register_policy' => $register_policy[Config::Get('system','register_policy')], + 'invitation_only' => (bool) intval(Config::Get('system','invitation_only')), + 'directory_mode' => $directory_mode[Config::Get('system','directory_mode')], + 'directory_server' => Config::Get('system','directory_server'), + 'language' => Config::Get('system','language'), + 'rss_connections' => (bool) intval(Config::Get('system','feed_contacts')), 'expiration' => $site_expire, 'default_service_restrictions' => $service_class, 'locked_features' => $locked_features, 'admin' => $admin, 'dbdriver' => DBA::$dba->getdriver() . ' ' . ((ACTIVE_DBTYPE == DBTYPE_POSTGRES) ? 'postgres' : 'mysql'), - 'lastpoll' => get_config('system','lastpoll'), + 'lastpoll' => Config::Get('system','lastpoll'), 'info' => (($site_info) ? $site_info : ''), 'channels_total' => $channels_total_stat, 'hide_in_statistics' => $hide_in_statistics @@ -1651,7 +1652,7 @@ function check_siteallowed($url) { if(array_key_exists('allowed',$arr)) return $arr['allowed']; - $bl1 = get_config('system','whitelisted_sites'); + $bl1 = Config::Get('system','whitelisted_sites'); if(is_array($bl1) && $bl1) { foreach($bl1 as $bl) { if($bl1 === '*') @@ -1660,7 +1661,7 @@ function check_siteallowed($url) { return true; } } - $bl1 = get_config('system','blacklisted_sites'); + $bl1 = Config::Get('system','blacklisted_sites'); if(is_array($bl1) && $bl1) { foreach($bl1 as $bl) { if($bl1 === '*') @@ -1696,7 +1697,7 @@ function check_channelallowed($hash) { if(array_key_exists('allowed',$arr)) return $arr['allowed']; - $bl1 = get_config('system','whitelisted_channels'); + $bl1 = Config::Get('system','whitelisted_channels'); if(is_array($bl1) && $bl1) { foreach($bl1 as $bl) { if($bl1 === '*') @@ -1705,7 +1706,7 @@ function check_channelallowed($hash) { return true; } } - $bl1 = get_config('system','blacklisted_channels'); + $bl1 = Config::Get('system','blacklisted_channels'); if(is_array($bl1) && $bl1) { foreach($bl1 as $bl) { if($bl1 === '*') @@ -1810,17 +1811,17 @@ function network_to_name($s) { function z_mail($params) { if(! $params['fromEmail']) { - $params['fromEmail'] = get_config('system','from_email'); + $params['fromEmail'] = Config::Get('system','from_email'); if(! $params['fromEmail']) $params['fromEmail'] = 'Administrator' . '@' . App::get_hostname(); } if(! $params['fromName']) { - $params['fromName'] = get_config('system','from_email_name'); + $params['fromName'] = Config::Get('system','from_email_name'); if(! $params['fromName']) $params['fromName'] = Zotlabs\Lib\System::get_site_name(); } if(! $params['replyTo']) { - $params['replyTo'] = get_config('system','reply_address'); + $params['replyTo'] = Config::Get('system','reply_address'); if(! $params['replyTo']) $params['replyTo'] = 'noreply' . '@' . App::get_hostname(); } -- cgit v1.2.3