mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-10 17:14:26 +02:00
Issue-#3873
Replace deprecated functions with new syntax.
This commit is contained in:
parent
9eb1f4b9c3
commit
0dfa57948f
124 changed files with 819 additions and 679 deletions
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Network\Probe;
|
||||
|
@ -50,7 +51,7 @@ function contact_remove($id) {
|
|||
return;
|
||||
}
|
||||
|
||||
$archive = get_pconfig($r[0]['uid'], 'system','archive_removed_contacts');
|
||||
$archive = PConfig::get($r[0]['uid'], 'system','archive_removed_contacts');
|
||||
if ($archive) {
|
||||
q("update contact set `archive` = 1, `network` = 'none', `writable` = 0 where id = %d",
|
||||
intval($id)
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* @brief This file includes the DirSearch class with directory related functions
|
||||
*/
|
||||
|
||||
use Friendica\Core\Config;
|
||||
|
||||
/**
|
||||
* @brief This class handels directory related functions
|
||||
|
@ -22,12 +23,12 @@ class DirSearch {
|
|||
|
||||
if($search) {
|
||||
// check supported networks
|
||||
if (get_config('system','diaspora_enabled'))
|
||||
if (Config::get('system','diaspora_enabled'))
|
||||
$diaspora = NETWORK_DIASPORA;
|
||||
else
|
||||
$diaspora = NETWORK_DFRN;
|
||||
|
||||
if (!get_config('system','ostatus_disabled'))
|
||||
if (!Config::get('system','ostatus_disabled'))
|
||||
$ostatus = NETWORK_OSTATUS;
|
||||
else
|
||||
$ostatus = NETWORK_DFRN;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Friendica\Core\PConfig;
|
||||
|
||||
require_once('include/email.php');
|
||||
|
||||
class Emailer {
|
||||
|
@ -22,7 +24,7 @@ class Emailer {
|
|||
|
||||
$email_textonly = False;
|
||||
if (x($params,"uid")) {
|
||||
$email_textonly = get_pconfig($params['uid'], "system", "email_textonly");
|
||||
$email_textonly = PConfig::get($params['uid'], "system", "email_textonly");
|
||||
}
|
||||
|
||||
$fromName = email_header_encode(html_entity_decode($params['fromName'],ENT_QUOTES,'UTF-8'),'UTF-8');
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* or for formatting notifications
|
||||
*/
|
||||
|
||||
use Friendica\Core\Pconfig;
|
||||
use Friendica\Core\System;
|
||||
|
||||
require_once 'include/html2plain.php';
|
||||
|
@ -781,7 +782,7 @@ class NotificationsManager {
|
|||
'name' => $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'],
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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>(.*?)<\/pre>/ism','self::encode',$s);
|
||||
|
|
|
@ -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'];
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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']));
|
||||
|
||||
|
|
|
@ -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]",
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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'] .= '<div class="side-link" id="side-invite-remain">'
|
||||
. sprintf( tt('%d invitation available', '%d invitations available', $x), $x)
|
||||
|
@ -74,11 +75,11 @@ function unavailable_networks() {
|
|||
$networks[] = NETWORK_TWITTER;
|
||||
}
|
||||
|
||||
if (get_config("system", "ostatus_disabled")) {
|
||||
if (Config::get("system", "ostatus_disabled")) {
|
||||
$networks[] = NETWORK_OSTATUS;
|
||||
}
|
||||
|
||||
if (!get_config("system", "diaspora_enabled")) {
|
||||
if (!Config::get("system", "diaspora_enabled")) {
|
||||
$networks[] = NETWORK_DIASPORA;
|
||||
}
|
||||
|
||||
|
@ -148,7 +149,7 @@ function fileas_widget($baseurl, $selected = '') {
|
|||
return '';
|
||||
}
|
||||
|
||||
$saved = get_pconfig(local_user(), 'system', 'filetags');
|
||||
$saved = PConfig::get(local_user(), 'system', 'filetags');
|
||||
if (! strlen($saved)) {
|
||||
return;
|
||||
}
|
||||
|
@ -182,7 +183,7 @@ function categories_widget($baseurl, $selected = '') {
|
|||
return '';
|
||||
}
|
||||
|
||||
$saved = get_pconfig($a->profile['profile_uid'], 'system', 'filetags');
|
||||
$saved = PConfig::get($a->profile['profile_uid'], 'system', 'filetags');
|
||||
if (! strlen($saved)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
|
||||
require_once "include/bbcode.php";
|
||||
|
@ -517,7 +519,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
|
|||
$arr_blocked = null;
|
||||
|
||||
if (local_user()) {
|
||||
$str_blocked = get_pconfig(local_user(), 'system', 'blocked');
|
||||
$str_blocked = PConfig::get(local_user(), 'system', 'blocked');
|
||||
if ($str_blocked) {
|
||||
$arr_blocked = explode(',', $str_blocked);
|
||||
for ($x = 0; $x < count($arr_blocked); $x ++) {
|
||||
|
@ -1363,7 +1365,7 @@ function get_item_children($arr, $parent) {
|
|||
$a = get_app();
|
||||
foreach ($arr as $item) {
|
||||
if ($item['id'] != $item['parent']) {
|
||||
if (get_config('system', 'thread_allow') && $a->theme_thread_allow) {
|
||||
if (Config::get('system', 'thread_allow') && $a->theme_thread_allow) {
|
||||
// Fallback to parent-uri if thr-parent is not set
|
||||
$thr_parent = $item['thr-parent'];
|
||||
if ($thr_parent == '') {
|
||||
|
|
|
@ -14,9 +14,9 @@ function cron_run(&$argv, &$argc){
|
|||
return;
|
||||
}
|
||||
|
||||
$last = get_config('system', 'last_cron');
|
||||
$last = Config::get('system', 'last_cron');
|
||||
|
||||
$poll_interval = intval(get_config('system', 'cron_interval'));
|
||||
$poll_interval = intval(Config::get('system', 'cron_interval'));
|
||||
if (! $poll_interval) {
|
||||
$poll_interval = 10;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ function cron_run(&$argv, &$argc){
|
|||
Worker::add(PRIORITY_LOW, "cronjobs", "repair_database");
|
||||
|
||||
// once daily run birthday_updates and then expire in background
|
||||
$d1 = get_config('system', 'last_expire_day');
|
||||
$d1 = Config::get('system', 'last_expire_day');
|
||||
$d2 = intval(datetime_convert('UTC', 'UTC', 'now', 'd'));
|
||||
|
||||
if ($d2 != intval($d1)) {
|
||||
|
@ -70,7 +70,7 @@ function cron_run(&$argv, &$argc){
|
|||
|
||||
Worker::add(PRIORITY_LOW, "discover_poco", "suggestions");
|
||||
|
||||
set_config('system', 'last_expire_day', $d2);
|
||||
Config::set('system', 'last_expire_day', $d2);
|
||||
|
||||
Worker::add(PRIORITY_LOW, 'expire');
|
||||
|
||||
|
@ -90,7 +90,7 @@ function cron_run(&$argv, &$argc){
|
|||
|
||||
logger('cron: end');
|
||||
|
||||
set_config('system', 'last_cron', time());
|
||||
Config::set('system', 'last_cron', time());
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ function cron_poll_contacts($argc, $argv) {
|
|||
// and which have a polling address and ignore Diaspora since
|
||||
// we are unable to match those posts with a Diaspora GUID and prevent duplicates.
|
||||
|
||||
$abandon_days = intval(get_config('system', 'account_abandon_days'));
|
||||
$abandon_days = intval(Config::get('system', 'account_abandon_days'));
|
||||
if ($abandon_days < 1) {
|
||||
$abandon_days = 0;
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ function cron_poll_contacts($argc, $argv) {
|
|||
* This also lets us update our subscription to the hub, and add or replace hubs in case it
|
||||
* changed. We will only update hubs once a day, regardless of 'pushpoll_frequency'.
|
||||
*/
|
||||
$poll_interval = get_config('system', 'pushpoll_frequency');
|
||||
$poll_interval = Config::get('system', 'pushpoll_frequency');
|
||||
$contact['priority'] = (($poll_interval !== false) ? intval($poll_interval) : 3);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@ function cronhooks_run(&$argv, &$argc) {
|
|||
return;
|
||||
}
|
||||
|
||||
$last = get_config('system', 'last_cronhook');
|
||||
$last = Config::get('system', 'last_cronhook');
|
||||
|
||||
$poll_interval = intval(get_config('system', 'cronhook_interval'));
|
||||
$poll_interval = intval(Config::get('system', 'cronhook_interval'));
|
||||
if (! $poll_interval) {
|
||||
$poll_interval = 9;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ function cronhooks_run(&$argv, &$argc) {
|
|||
}
|
||||
}
|
||||
|
||||
$a->set_baseurl(get_config('system', 'url'));
|
||||
$a->set_baseurl(Config::get('system', 'url'));
|
||||
|
||||
logger('cronhooks: start');
|
||||
|
||||
|
@ -48,7 +48,7 @@ function cronhooks_run(&$argv, &$argc) {
|
|||
|
||||
logger('cronhooks: end');
|
||||
|
||||
set_config('system', 'last_cronhook', time());
|
||||
Config::set('system', 'last_cronhook', time());
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ function cron_expire_and_remove_users() {
|
|||
*/
|
||||
function cron_clear_cache(App $a) {
|
||||
|
||||
$last = get_config('system','cache_last_cleared');
|
||||
$last = Config::get('system','cache_last_cleared');
|
||||
|
||||
if ($last) {
|
||||
$next = $last + (3600); // Once per hour
|
||||
|
@ -138,10 +138,10 @@ function cron_clear_cache(App $a) {
|
|||
clear_cache($a->get_basepath()."/view/smarty3/compiled", $a->get_basepath()."/view/smarty3/compiled");
|
||||
|
||||
// clear cache for image proxy
|
||||
if (!get_config("system", "proxy_disabled")) {
|
||||
if (!Config::get("system", "proxy_disabled")) {
|
||||
clear_cache($a->get_basepath(), $a->get_basepath()."/proxy");
|
||||
|
||||
$cachetime = get_config('system','proxy_cache_time');
|
||||
$cachetime = Config::get('system','proxy_cache_time');
|
||||
if (!$cachetime) {
|
||||
$cachetime = PROXY_DEFAULT_TIME;
|
||||
}
|
||||
|
@ -155,13 +155,13 @@ function cron_clear_cache(App $a) {
|
|||
q("DELETE FROM `parsed_url` WHERE `created` < NOW() - INTERVAL 3 MONTH");
|
||||
|
||||
// Maximum table size in megabyte
|
||||
$max_tablesize = intval(get_config('system','optimize_max_tablesize')) * 1000000;
|
||||
$max_tablesize = intval(Config::get('system','optimize_max_tablesize')) * 1000000;
|
||||
if ($max_tablesize == 0) {
|
||||
$max_tablesize = 100 * 1000000; // Default are 100 MB
|
||||
}
|
||||
if ($max_tablesize > 0) {
|
||||
// Minimum fragmentation level in percent
|
||||
$fragmentation_level = intval(get_config('system','optimize_fragmentation')) / 100;
|
||||
$fragmentation_level = intval(Config::get('system','optimize_fragmentation')) / 100;
|
||||
if ($fragmentation_level == 0) {
|
||||
$fragmentation_level = 0.3; // Default value is 30%
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ function cron_clear_cache(App $a) {
|
|||
}
|
||||
}
|
||||
|
||||
set_config('system','cache_last_cleared', time());
|
||||
Config::set('system','cache_last_cleared', time());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Friendica\Core\Config;
|
||||
|
||||
require_once 'library/ASNValue.class.php';
|
||||
require_once 'library/asn1.php';
|
||||
|
||||
|
@ -146,7 +148,7 @@ function new_keypair($bits) {
|
|||
'encrypt_key' => false
|
||||
);
|
||||
|
||||
$conf = get_config('system', 'openssl_conf_file');
|
||||
$conf = Config::get('system', 'openssl_conf_file');
|
||||
if ($conf) {
|
||||
$openssl_options['config'] = $conf;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\PConfig;
|
||||
|
||||
/**
|
||||
* @brief Two-level sort for timezones.
|
||||
|
@ -178,7 +179,7 @@ function datetime_convert($from = 'UTC', $to = 'UTC', $s = 'now', $fmt = "Y-m-d
|
|||
function dob($dob) {
|
||||
list($year,$month,$day) = sscanf($dob,'%4d-%2d-%2d');
|
||||
|
||||
$f = get_config('system', 'birthday_input_format');
|
||||
$f = Config::get('system', 'birthday_input_format');
|
||||
if (! $f) {
|
||||
$f = 'ymd';
|
||||
}
|
||||
|
@ -279,7 +280,7 @@ function timesel($format, $h, $m, $id = 'timepicker') {
|
|||
function datetimesel($format, $min, $max, $default, $label, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false) {
|
||||
|
||||
// First day of the week (0 = Sunday)
|
||||
$firstDay = get_pconfig(local_user(), 'system', 'first_day_of_week');
|
||||
$firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week');
|
||||
if ($firstDay === false) {
|
||||
$firstDay=0;
|
||||
}
|
||||
|
|
|
@ -1781,9 +1781,9 @@ function dbstructure_run(&$argv, &$argc) {
|
|||
case "update":
|
||||
update_structure(true, true);
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
|
@ -1798,7 +1798,7 @@ function dbstructure_run(&$argv, &$argc) {
|
|||
}
|
||||
}
|
||||
|
||||
set_config('system','build',DB_UPDATE_VERSION);
|
||||
Config::set('system','build',DB_UPDATE_VERSION);
|
||||
return;
|
||||
case "dumpsql":
|
||||
print_structure(db_definition());
|
||||
|
|
|
@ -335,7 +335,7 @@ function delivery_run(&$argv, &$argc){
|
|||
$x[0]['writable'] = 1;
|
||||
}
|
||||
|
||||
$ssl_policy = get_config('system','ssl_policy');
|
||||
$ssl_policy = Config::get('system','ssl_policy');
|
||||
fix_contact_ssl_policy($x[0],$ssl_policy);
|
||||
|
||||
// If we are setup as a soapbox we aren't accepting top level posts from this person
|
||||
|
@ -375,7 +375,7 @@ function delivery_run(&$argv, &$argc){
|
|||
if ($owner['prvnets']) {
|
||||
break;
|
||||
}
|
||||
if (get_config('system','ostatus_disabled') || get_config('system','dfrn_only')) {
|
||||
if (Config::get('system','ostatus_disabled') || Config::get('system','dfrn_only')) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -386,7 +386,7 @@ function delivery_run(&$argv, &$argc){
|
|||
case NETWORK_MAIL:
|
||||
case NETWORK_MAIL2:
|
||||
|
||||
if (get_config('system','dfrn_only')) {
|
||||
if (Config::get('system','dfrn_only')) {
|
||||
break;
|
||||
}
|
||||
// WARNING: does not currently convert to RFC2047 header encodings, etc.
|
||||
|
@ -489,7 +489,7 @@ function delivery_run(&$argv, &$argc){
|
|||
|
||||
logger('delivery: diaspora batch deliver: '.$loc);
|
||||
|
||||
if (get_config('system','dfrn_only') || (!get_config('system','diaspora_enabled')))
|
||||
if (Config::get('system','dfrn_only') || (!Config::get('system','diaspora_enabled')))
|
||||
break;
|
||||
|
||||
if ($mail) {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
|
||||
|
@ -442,11 +443,11 @@ class dfrn {
|
|||
public static function relocate($owner, $uid) {
|
||||
|
||||
/* get site pubkey. this could be a new installation with no site keys*/
|
||||
$pubkey = get_config('system','site_pubkey');
|
||||
$pubkey = Config::get('system','site_pubkey');
|
||||
if (! $pubkey) {
|
||||
$res = new_keypair(1024);
|
||||
set_config('system','site_prvkey', $res['prvkey']);
|
||||
set_config('system','site_pubkey', $res['pubkey']);
|
||||
Config::set('system','site_prvkey', $res['prvkey']);
|
||||
Config::set('system','site_pubkey', $res['pubkey']);
|
||||
}
|
||||
|
||||
$rp = q("SELECT `resource-id` , `scale`, type FROM `photo`
|
||||
|
@ -478,7 +479,7 @@ class dfrn {
|
|||
xml::add_element($doc, $relocate, "dfrn:confirm", $owner['confirm']);
|
||||
xml::add_element($doc, $relocate, "dfrn:notify", $owner['notify']);
|
||||
xml::add_element($doc, $relocate, "dfrn:poll", $owner['poll']);
|
||||
xml::add_element($doc, $relocate, "dfrn:sitepubkey", get_config('system','site_pubkey'));
|
||||
xml::add_element($doc, $relocate, "dfrn:sitepubkey", Config::get('system','site_pubkey'));
|
||||
|
||||
$root->appendChild($relocate);
|
||||
|
||||
|
@ -1103,12 +1104,12 @@ class dfrn {
|
|||
$idtosend = '1:' . $orig_id;
|
||||
}
|
||||
|
||||
$rino = get_config('system', 'rino_encrypt');
|
||||
$rino = Config::get('system', 'rino_encrypt');
|
||||
$rino = intval($rino);
|
||||
|
||||
logger("Local rino version: ". $rino, LOGGER_DEBUG);
|
||||
|
||||
$ssl_val = intval(get_config('system','ssl_policy'));
|
||||
$ssl_val = intval(Config::get('system','ssl_policy'));
|
||||
$ssl_policy = '';
|
||||
|
||||
switch ($ssl_val) {
|
||||
|
|
|
@ -42,7 +42,7 @@ class Diaspora {
|
|||
*/
|
||||
public static function relay_list() {
|
||||
|
||||
$serverdata = get_config("system", "relay_server");
|
||||
$serverdata = Config::get("system", "relay_server");
|
||||
if ($serverdata == "")
|
||||
return array();
|
||||
|
||||
|
@ -411,7 +411,7 @@ class Diaspora {
|
|||
*/
|
||||
public static function dispatch_public($msg) {
|
||||
|
||||
$enabled = intval(get_config("system", "diaspora_enabled"));
|
||||
$enabled = intval(Config::get("system", "diaspora_enabled"));
|
||||
if (!$enabled) {
|
||||
logger("diaspora is disabled");
|
||||
return false;
|
||||
|
@ -740,7 +740,7 @@ class Diaspora {
|
|||
|
||||
if (!$person || $update) {
|
||||
logger("create or refresh", LOGGER_DEBUG);
|
||||
$r = probe_url($handle, PROBE_DIASPORA);
|
||||
$r = Probe::uri($handle, NETWORK_DIASPORA);
|
||||
|
||||
// Note that Friendica contacts will return a "Diaspora person"
|
||||
// if Diaspora connectivity is enabled on their server
|
||||
|
@ -2151,7 +2151,7 @@ class Diaspora {
|
|||
intval($importer["uid"])
|
||||
);
|
||||
|
||||
if ($r && !$r[0]["hide-friends"] && !$contact["hidden"] && intval(get_pconfig($importer["uid"], "system", "post_newfriend"))) {
|
||||
if ($r && !$r[0]["hide-friends"] && !$contact["hidden"] && intval(PConfig::get($importer["uid"], "system", "post_newfriend"))) {
|
||||
|
||||
$self = q("SELECT * FROM `contact` WHERE `self` AND `uid` = %d LIMIT 1",
|
||||
intval($importer["uid"])
|
||||
|
@ -2942,7 +2942,7 @@ class Diaspora {
|
|||
|
||||
$a = get_app();
|
||||
|
||||
$enabled = intval(get_config("system", "diaspora_enabled"));
|
||||
$enabled = intval(Config::get("system", "diaspora_enabled"));
|
||||
if (!$enabled)
|
||||
return 200;
|
||||
|
||||
|
@ -2958,7 +2958,7 @@ class Diaspora {
|
|||
if (!$queue_run && was_recently_delayed($contact["id"])) {
|
||||
$return_code = 0;
|
||||
} else {
|
||||
if (!intval(get_config("system", "diaspora_test"))) {
|
||||
if (!intval(Config::get("system", "diaspora_test"))) {
|
||||
$content_type = (($public_batch) ? "application/magic-envelope+xml" : "application/json");
|
||||
|
||||
post_url($dest_url."/", $envelope, array("Content-Type: ".$content_type));
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Network\Probe;
|
||||
|
||||
require_once 'include/probe.php';
|
||||
require_once 'include/socgraph.php';
|
||||
|
@ -81,17 +82,17 @@ function discover_poco_run(&$argv, &$argc) {
|
|||
logger($result, LOGGER_DEBUG);
|
||||
} elseif ($mode == 3) {
|
||||
update_suggestions();
|
||||
} elseif (($mode == 2) && get_config('system','poco_completion')) {
|
||||
} elseif (($mode == 2) && Config::get('system','poco_completion')) {
|
||||
discover_users();
|
||||
} elseif (($mode == 1) && ($search != "") && get_config('system','poco_local_search')) {
|
||||
} elseif (($mode == 1) && ($search != "") && Config::get('system','poco_local_search')) {
|
||||
discover_directory($search);
|
||||
gs_search_user($search);
|
||||
} elseif (($mode == 0) && ($search == "") && (get_config('system','poco_discovery') > 0)) {
|
||||
} elseif (($mode == 0) && ($search == "") && (Config::get('system','poco_discovery') > 0)) {
|
||||
// Query Friendica and Hubzilla servers for their users
|
||||
poco_discover();
|
||||
|
||||
// Query GNU Social servers for their users ("statistics" addon has to be enabled on the GS server)
|
||||
if (!get_config('system','ostatus_disabled'))
|
||||
if (!Config::get('system','ostatus_disabled'))
|
||||
gs_discover();
|
||||
}
|
||||
|
||||
|
@ -234,7 +235,7 @@ function discover_directory($search) {
|
|||
logger("Friendica server ".$server_url." seems to be okay.", LOGGER_DEBUG);
|
||||
}
|
||||
|
||||
$data = probe_url($jj->url);
|
||||
$data = Probe::uri($jj->url);
|
||||
if ($data["network"] == NETWORK_DFRN) {
|
||||
logger("Profile ".$jj->url." is reachable (".$search.")", LOGGER_DEBUG);
|
||||
logger("Add profile ".$jj->url." to local directory (".$search.")", LOGGER_DEBUG);
|
||||
|
@ -283,7 +284,7 @@ function gs_search_user($search) {
|
|||
/// @TODO AS is considered as a notation for constants (as they usually being written all upper-case)
|
||||
/// @TODO find all those and convert to all lower-case which is a keyword then
|
||||
foreach ($contacts->data AS $user) {
|
||||
$contact = probe_url($user->site_address."/".$user->name);
|
||||
$contact = Probe::uri($user->site_address."/".$user->name);
|
||||
if ($contact["network"] != NETWORK_PHANTOM) {
|
||||
$contact["about"] = $user->description;
|
||||
update_gcontact($contact);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\System;
|
||||
|
||||
require_once('include/Emailer.php');
|
||||
|
@ -589,7 +590,7 @@ function notification($params) {
|
|||
|
||||
// check whether sending post content in email notifications is allowed
|
||||
// always true for SYSTEM_EMAIL
|
||||
$content_allowed = ((!get_config('system', 'enotify_no_content')) || ($params['type'] == SYSTEM_EMAIL));
|
||||
$content_allowed = ((!Config::get('system', 'enotify_no_content')) || ($params['type'] == SYSTEM_EMAIL));
|
||||
|
||||
// load the template for private message notifications
|
||||
$tpl = get_markup_template('email_notify_html.tpl');
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
|
||||
require_once 'include/bbcode.php';
|
||||
|
@ -435,7 +436,7 @@ function event_store($arr) {
|
|||
function get_event_strings() {
|
||||
|
||||
// First day of the week (0 = Sunday).
|
||||
$firstDay = get_pconfig(local_user(), 'system', 'first_day_of_week');
|
||||
$firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week');
|
||||
if ($firstDay === false) {
|
||||
$firstDay = 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ function expire_run(&$argv, &$argc){
|
|||
logger('Delete expired items - done', LOGGER_DEBUG);
|
||||
|
||||
// make this optional as it could have a performance impact on large sites
|
||||
if (intval(get_config('system', 'optimize_items'))) {
|
||||
if (intval(Config::get('system', 'optimize_items'))) {
|
||||
q("OPTIMIZE TABLE `item`");
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -5,18 +5,21 @@
|
|||
* @brief Features management
|
||||
*/
|
||||
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\PConfig;
|
||||
|
||||
/**
|
||||
* @brief check if feature is enabled
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function feature_enabled($uid, $feature) {
|
||||
$x = get_config('feature_lock', $feature);
|
||||
$x = Config::get('feature_lock', $feature);
|
||||
|
||||
if ($x === false) {
|
||||
$x = get_pconfig($uid, 'feature', $feature);
|
||||
$x = PConfig::get($uid, 'feature', $feature);
|
||||
if ($x === false) {
|
||||
$x = get_config('feature', $feature);
|
||||
$x = Config::get('feature', $feature);
|
||||
if ($x === false) {
|
||||
$x = get_feature_default($feature);
|
||||
}
|
||||
|
@ -64,53 +67,53 @@ function get_features($filtered = true) {
|
|||
'general' => array(
|
||||
t('General Features'),
|
||||
//array('expire', t('Content Expiration'), t('Remove old posts/comments after a period of time')),
|
||||
array('multi_profiles', t('Multiple Profiles'), t('Ability to create multiple profiles'), false, get_config('feature_lock','multi_profiles')),
|
||||
array('photo_location', t('Photo Location'), t('Photo metadata is normally stripped. This extracts the location (if present) prior to stripping metadata and links it to a map.'), false, get_config('feature_lock','photo_location')),
|
||||
array('export_calendar', t('Export Public Calendar'), t('Ability for visitors to download the public calendar'), false, get_config('feature_lock','export_calendar')),
|
||||
array('multi_profiles', t('Multiple Profiles'), t('Ability to create multiple profiles'), false, Config::get('feature_lock','multi_profiles')),
|
||||
array('photo_location', t('Photo Location'), t('Photo metadata is normally stripped. This extracts the location (if present) prior to stripping metadata and links it to a map.'), false, Config::get('feature_lock','photo_location')),
|
||||
array('export_calendar', t('Export Public Calendar'), t('Ability for visitors to download the public calendar'), false, Config::get('feature_lock','export_calendar')),
|
||||
),
|
||||
|
||||
// Post composition
|
||||
'composition' => array(
|
||||
t('Post Composition Features'),
|
||||
array('preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them'), false, get_config('feature_lock','preview')),
|
||||
array('aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, get_config('feature_lock','aclautomention')),
|
||||
array('preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them'), false, Config::get('feature_lock','preview')),
|
||||
array('aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, Config::get('feature_lock','aclautomention')),
|
||||
),
|
||||
|
||||
// Network sidebar widgets
|
||||
'widgets' => array(
|
||||
t('Network Sidebar Widgets'),
|
||||
array('archives', t('Search by Date'), t('Ability to select posts by date ranges'), false, get_config('feature_lock','archives')),
|
||||
array('forumlist_widget', t('List Forums'), t('Enable widget to display the forums your are connected with'), true, get_config('feature_lock','forumlist_widget')),
|
||||
array('groups', t('Group Filter'), t('Enable widget to display Network posts only from selected group'), false, get_config('feature_lock','groups')),
|
||||
array('networks', t('Network Filter'), t('Enable widget to display Network posts only from selected network'), false, get_config('feature_lock','networks')),
|
||||
array('savedsearch', t('Saved Searches'), t('Save search terms for re-use'), false, get_config('feature_lock','savedsearch')),
|
||||
array('archives', t('Search by Date'), t('Ability to select posts by date ranges'), false, Config::get('feature_lock','archives')),
|
||||
array('forumlist_widget', t('List Forums'), t('Enable widget to display the forums your are connected with'), true, Config::get('feature_lock','forumlist_widget')),
|
||||
array('groups', t('Group Filter'), t('Enable widget to display Network posts only from selected group'), false, Config::get('feature_lock','groups')),
|
||||
array('networks', t('Network Filter'), t('Enable widget to display Network posts only from selected network'), false, Config::get('feature_lock','networks')),
|
||||
array('savedsearch', t('Saved Searches'), t('Save search terms for re-use'), false, Config::get('feature_lock','savedsearch')),
|
||||
),
|
||||
|
||||
// Network tabs
|
||||
'net_tabs' => array(
|
||||
t('Network Tabs'),
|
||||
array('personal_tab', t('Network Personal Tab'), t('Enable tab to display only Network posts that you\'ve interacted on'), false, get_config('feature_lock','personal_tab')),
|
||||
array('new_tab', t('Network New Tab'), t('Enable tab to display only new Network posts (from the last 12 hours)'), false, get_config('feature_lock','new_tab')),
|
||||
array('link_tab', t('Network Shared Links Tab'), t('Enable tab to display only Network posts with links in them'), false, get_config('feature_lock','link_tab')),
|
||||
array('personal_tab', t('Network Personal Tab'), t('Enable tab to display only Network posts that you\'ve interacted on'), false, Config::get('feature_lock','personal_tab')),
|
||||
array('new_tab', t('Network New Tab'), t('Enable tab to display only new Network posts (from the last 12 hours)'), false, Config::get('feature_lock','new_tab')),
|
||||
array('link_tab', t('Network Shared Links Tab'), t('Enable tab to display only Network posts with links in them'), false, Config::get('feature_lock','link_tab')),
|
||||
),
|
||||
|
||||
// Item tools
|
||||
'tools' => array(
|
||||
t('Post/Comment Tools'),
|
||||
array('multi_delete', t('Multiple Deletion'), t('Select and delete multiple posts/comments at once'), false, get_config('feature_lock','multi_delete')),
|
||||
array('edit_posts', t('Edit Sent Posts'), t('Edit and correct posts and comments after sending'), false, get_config('feature_lock','edit_posts')),
|
||||
array('commtag', t('Tagging'), t('Ability to tag existing posts'), false, get_config('feature_lock','commtag')),
|
||||
array('categories', t('Post Categories'), t('Add categories to your posts'), false, get_config('feature_lock','categories')),
|
||||
array('filing', t('Saved Folders'), t('Ability to file posts under folders'), false, get_config('feature_lock','filing')),
|
||||
array('dislike', t('Dislike Posts'), t('Ability to dislike posts/comments'), false, get_config('feature_lock','dislike')),
|
||||
array('star_posts', t('Star Posts'), t('Ability to mark special posts with a star indicator'), false, get_config('feature_lock','star_posts')),
|
||||
array('ignore_posts', t('Mute Post Notifications'), t('Ability to mute notifications for a thread'), false, get_config('feature_lock','ignore_posts')),
|
||||
array('multi_delete', t('Multiple Deletion'), t('Select and delete multiple posts/comments at once'), false, Config::get('feature_lock','multi_delete')),
|
||||
array('edit_posts', t('Edit Sent Posts'), t('Edit and correct posts and comments after sending'), false, Config::get('feature_lock','edit_posts')),
|
||||
array('commtag', t('Tagging'), t('Ability to tag existing posts'), false, Config::get('feature_lock','commtag')),
|
||||
array('categories', t('Post Categories'), t('Add categories to your posts'), false, Config::get('feature_lock','categories')),
|
||||
array('filing', t('Saved Folders'), t('Ability to file posts under folders'), false, Config::get('feature_lock','filing')),
|
||||
array('dislike', t('Dislike Posts'), t('Ability to dislike posts/comments'), false, Config::get('feature_lock','dislike')),
|
||||
array('star_posts', t('Star Posts'), t('Ability to mark special posts with a star indicator'), false, Config::get('feature_lock','star_posts')),
|
||||
array('ignore_posts', t('Mute Post Notifications'), t('Ability to mute notifications for a thread'), false, Config::get('feature_lock','ignore_posts')),
|
||||
),
|
||||
|
||||
// Advanced Profile Settings
|
||||
'advanced_profile' => array(
|
||||
t('Advanced Profile Settings'),
|
||||
array('forumlist_profile', t('List Forums'), t('Show visitors public community forums at the Advanced Profile Page'), false, get_config('feature_lock','forumlist_profile')),
|
||||
array('forumlist_profile', t('List Forums'), t('Show visitors public community forums at the Advanced Profile Page'), false, Config::get('feature_lock','forumlist_profile')),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Network\Probe;
|
||||
|
@ -15,7 +16,7 @@ require_once 'include/diaspora.php';
|
|||
|
||||
function update_contact($id) {
|
||||
/*
|
||||
Warning: Never ever fetch the public key via probe_url and write it into the contacts.
|
||||
Warning: Never ever fetch the public key via Probe::uri and write it into the contacts.
|
||||
This will reliably kill your communication with Friendica contacts.
|
||||
*/
|
||||
|
||||
|
@ -23,9 +24,9 @@ function update_contact($id) {
|
|||
if (!$r)
|
||||
return false;
|
||||
|
||||
$ret = probe_url($r[0]["url"]);
|
||||
$ret = Probe::uri($r[0]["url"]);
|
||||
|
||||
// If probe_url fails the network code will be different
|
||||
// If Probe::uri fails the network code will be different
|
||||
if ($ret["network"] != $r[0]["network"])
|
||||
return false;
|
||||
|
||||
|
@ -125,7 +126,7 @@ function new_contact($uid, $url, $interactive = false, $network = '') {
|
|||
|
||||
// NOTREACHED
|
||||
}
|
||||
} elseif (get_config('system','dfrn_only')) {
|
||||
} elseif (Config::get('system','dfrn_only')) {
|
||||
$result['message'] = t('This site is not configured to allow communications with other networks.') . EOL;
|
||||
$result['message'] != t('No compatible communication protocols or feeds were discovered.') . EOL;
|
||||
return $result;
|
||||
|
@ -156,7 +157,7 @@ function new_contact($uid, $url, $interactive = false, $network = '') {
|
|||
return $result;
|
||||
}
|
||||
|
||||
if ($ret['network'] === NETWORK_OSTATUS && get_config('system','ostatus_disabled')) {
|
||||
if ($ret['network'] === NETWORK_OSTATUS && Config::get('system','ostatus_disabled')) {
|
||||
$result['message'] .= t('The profile address specified belongs to a network which has been disabled on this site.') . EOL;
|
||||
$ret['notify'] = '';
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Network\Probe;
|
||||
|
||||
require_once 'include/probe.php';
|
||||
require_once 'include/socgraph.php';
|
||||
|
@ -31,7 +32,7 @@ function gprobe_run(&$argv, &$argc){
|
|||
}
|
||||
}
|
||||
|
||||
$arr = probe_url($url);
|
||||
$arr = Probe::uri($url);
|
||||
|
||||
if (is_null($result)) {
|
||||
Cache::set("gprobe:".$urlparts["host"], $arr);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
use Friendica\Core\PConfig;
|
||||
|
||||
function group_add($uid,$name) {
|
||||
|
||||
|
@ -385,7 +386,7 @@ function get_default_group($uid, $network = "") {
|
|||
$default_group = 0;
|
||||
|
||||
if ($network == NETWORK_OSTATUS)
|
||||
$default_group = get_pconfig($uid, "ostatus", "default_group");
|
||||
$default_group = PConfig::get($uid, "ostatus", "default_group");
|
||||
|
||||
if ($default_group != 0)
|
||||
return $default_group;
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
|
||||
|
@ -71,12 +73,12 @@ function profile_load(App $a, $nickname, $profile = 0, $profiledata = array()) {
|
|||
$a->profile = $pdata;
|
||||
$a->profile_uid = $pdata['profile_uid'];
|
||||
|
||||
$a->profile['mobile-theme'] = get_pconfig($a->profile['profile_uid'], 'system', 'mobile_theme');
|
||||
$a->profile['mobile-theme'] = PConfig::get($a->profile['profile_uid'], 'system', 'mobile_theme');
|
||||
$a->profile['network'] = NETWORK_DFRN;
|
||||
|
||||
$a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename'];
|
||||
|
||||
if (!$profiledata && !get_pconfig(local_user(),'system','always_my_theme'))
|
||||
if (!$profiledata && !PConfig::get(local_user(),'system','always_my_theme'))
|
||||
$_SESSION['theme'] = $a->profile['theme'];
|
||||
|
||||
$_SESSION['mobile-theme'] = $a->profile['mobile-theme'];
|
||||
|
@ -102,7 +104,7 @@ function profile_load(App $a, $nickname, $profile = 0, $profiledata = array()) {
|
|||
));
|
||||
}
|
||||
|
||||
$block = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
|
||||
$block = (((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
|
||||
|
||||
/**
|
||||
* @todo
|
||||
|
@ -929,7 +931,7 @@ function zrl($s, $force = false) {
|
|||
*/
|
||||
function get_theme_uid() {
|
||||
$uid = ((!empty($_REQUEST['puid'])) ? intval($_REQUEST['puid']) : 0);
|
||||
if ((local_user()) && ((get_pconfig(local_user(), 'system', 'always_my_theme')) || (! $uid))) {
|
||||
if ((local_user()) && ((PConfig::get(local_user(), 'system', 'always_my_theme')) || (! $uid))) {
|
||||
return local_user();
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ use Friendica\Core\System;
|
|||
use Friendica\ParseUrl;
|
||||
use Friendica\Util\Lock;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\Worker;
|
||||
|
||||
require_once 'include/bbcode.php';
|
||||
|
@ -1062,7 +1063,7 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
|
|||
|
||||
// update the commented timestamp on the parent
|
||||
// Only update "commented" if it is really a comment
|
||||
if (($arr['verb'] == ACTIVITY_POST) || !get_config("system", "like_no_comment")) {
|
||||
if (($arr['verb'] == ACTIVITY_POST) || !Config::get("system", "like_no_comment")) {
|
||||
dba::update('item', array('commented' => datetime_convert(), 'changed' => datetime_convert()), array('id' => $parent_id));
|
||||
} else {
|
||||
dba::update('item', array('changed' => datetime_convert()), array('id' => $parent_id));
|
||||
|
@ -1783,7 +1784,7 @@ function subscribe_to_hub($url, $importer, $contact, $hubmode = 'subscribe') {
|
|||
return;
|
||||
}
|
||||
|
||||
$push_url = get_config('system','url') . '/pubsub/' . $r[0]['nickname'] . '/' . $contact['id'];
|
||||
$push_url = Config::get('system','url') . '/pubsub/' . $r[0]['nickname'] . '/' . $contact['id'];
|
||||
|
||||
// Use a single verify token, even if multiple hubs
|
||||
$verify_token = ((strlen($contact['hub-verify'])) ? $contact['hub-verify'] : random_string());
|
||||
|
@ -1806,7 +1807,7 @@ function subscribe_to_hub($url, $importer, $contact, $hubmode = 'subscribe') {
|
|||
|
||||
function fix_private_photos($s, $uid, $item = null, $cid = 0) {
|
||||
|
||||
if (get_config('system','disable_embedded')) {
|
||||
if (Config::get('system','disable_embedded')) {
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
@ -1991,7 +1992,7 @@ function item_expire($uid, $days, $network = "", $force = false) {
|
|||
* $expire_network_only = save your own wall posts
|
||||
* and just expire conversations started by others
|
||||
*/
|
||||
$expire_network_only = get_pconfig($uid,'expire', 'network_only');
|
||||
$expire_network_only = PConfig::get($uid,'expire', 'network_only');
|
||||
$sql_extra = ((intval($expire_network_only)) ? " AND wall = 0 " : "");
|
||||
|
||||
if ($network != "") {
|
||||
|
@ -2020,7 +2021,7 @@ function item_expire($uid, $days, $network = "", $force = false) {
|
|||
return;
|
||||
}
|
||||
|
||||
$expire_items = get_pconfig($uid, 'expire', 'items');
|
||||
$expire_items = PConfig::get($uid, 'expire', 'items');
|
||||
$expire_items = (($expire_items === false) ? 1 : intval($expire_items)); // default if not set: 1
|
||||
|
||||
// Forcing expiring of items - but not notes and marked items
|
||||
|
@ -2028,13 +2029,13 @@ function item_expire($uid, $days, $network = "", $force = false) {
|
|||
$expire_items = true;
|
||||
}
|
||||
|
||||
$expire_notes = get_pconfig($uid, 'expire', 'notes');
|
||||
$expire_notes = PConfig::get($uid, 'expire', 'notes');
|
||||
$expire_notes = (($expire_notes === false) ? 1 : intval($expire_notes)); // default if not set: 1
|
||||
|
||||
$expire_starred = get_pconfig($uid, 'expire', 'starred');
|
||||
$expire_starred = PConfig::get($uid, 'expire', 'starred');
|
||||
$expire_starred = (($expire_starred === false) ? 1 : intval($expire_starred)); // default if not set: 1
|
||||
|
||||
$expire_photos = get_pconfig($uid, 'expire', 'photos');
|
||||
$expire_photos = PConfig::get($uid, 'expire', 'photos');
|
||||
$expire_photos = (($expire_photos === false) ? 0 : intval($expire_photos)); // default if not set: 0
|
||||
|
||||
logger('User '.$uid.': expire: # items=' . count($r). "; expire items: $expire_items, expire notes: $expire_notes, expire starred: $expire_starred, expire photos: $expire_photos");
|
||||
|
@ -2385,11 +2386,11 @@ function posted_date_widget($url, $uid, $wall) {
|
|||
// For former Facebook folks that left because of "timeline"
|
||||
/*
|
||||
* @TODO old-lost code?
|
||||
if ($wall && intval(get_pconfig($uid, 'system', 'no_wall_archive_widget')))
|
||||
if ($wall && intval(PConfig::get($uid, 'system', 'no_wall_archive_widget')))
|
||||
return $o;
|
||||
*/
|
||||
|
||||
$visible_years = get_pconfig($uid,'system','archive_visible_years');
|
||||
$visible_years = PConfig::get($uid,'system','archive_visible_years');
|
||||
if (! $visible_years) {
|
||||
$visible_years = 5;
|
||||
}
|
||||
|
|
|
@ -170,7 +170,7 @@ function send_wallmessage($recipient='', $body='', $subject='', $replyto=''){
|
|||
|
||||
require_once 'include/probe.php';
|
||||
|
||||
$me = probe_url($replyto);
|
||||
$me = Probe::uri($replyto);
|
||||
|
||||
if (! $me['name']) {
|
||||
return -2;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\System;
|
||||
|
||||
function nav(App $a) {
|
||||
|
@ -114,7 +115,7 @@ function nav_info(App $a)
|
|||
|
||||
$help_url = 'help';
|
||||
|
||||
if (! get_config('system', 'hide_help')) {
|
||||
if (!Config::get('system', 'hide_help')) {
|
||||
$nav['help'] = array($help_url, t('Help'), '', t('Help and documentation'));
|
||||
}
|
||||
|
||||
|
@ -122,7 +123,7 @@ function nav_info(App $a)
|
|||
$nav['apps'] = array('apps', t('Apps'), '', t('Addon applications, utilities, games'));
|
||||
}
|
||||
|
||||
if (local_user() || !get_config('system', 'local_search')) {
|
||||
if (local_user() || !Config::get('system', 'local_search')) {
|
||||
$nav['search'] = array('search', t('Search'), '', t('Search site content'));
|
||||
|
||||
$nav['searchoption'] = array(
|
||||
|
@ -130,21 +131,21 @@ function nav_info(App $a)
|
|||
t('Tags'),
|
||||
t('Contacts'));
|
||||
|
||||
if (get_config('system', 'poco_local_search')) {
|
||||
if (Config::get('system', 'poco_local_search')) {
|
||||
$nav['searchoption'][] = t('Forums');
|
||||
}
|
||||
}
|
||||
|
||||
$gdirpath = 'directory';
|
||||
|
||||
if (strlen(get_config('system', 'singleuser'))) {
|
||||
$gdir = get_config('system', 'directory');
|
||||
if (strlen(Config::get('system', 'singleuser'))) {
|
||||
$gdir = Config::get('system', 'directory');
|
||||
if (strlen($gdir)) {
|
||||
$gdirpath = zrl($gdir, true);
|
||||
}
|
||||
} elseif (get_config('system', 'community_page_style') == CP_USERS_ON_SERVER) {
|
||||
} elseif (Config::get('system', 'community_page_style') == CP_USERS_ON_SERVER) {
|
||||
$nav['community'] = array('community', t('Community'), '', t('Conversations on this site'));
|
||||
} elseif (get_config('system', 'community_page_style') == CP_GLOBAL_COMMUNITY) {
|
||||
} elseif (Config::get('system', 'community_page_style') == CP_GLOBAL_COMMUNITY) {
|
||||
$nav['community'] = array('community', t('Community'), '', t('Conversations on the network'));
|
||||
}
|
||||
|
||||
|
@ -203,7 +204,7 @@ function nav_info(App $a)
|
|||
$nav['navigation'] = array('navigation/', t('Navigation'), '', t('Site map'));
|
||||
|
||||
// Provide a banner/logo/whatever
|
||||
$banner = get_config('system', 'banner');
|
||||
$banner = Config::get('system', 'banner');
|
||||
if ($banner === false) {
|
||||
$banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
|
||||
}
|
||||
|
|
|
@ -124,26 +124,26 @@ function z_fetch_url($url, $binary = false, &$redirects = 0, $opts = array()) {
|
|||
if (x($opts, 'timeout')) {
|
||||
@curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']);
|
||||
} else {
|
||||
$curl_time = intval(get_config('system', 'curl_timeout'));
|
||||
$curl_time = intval(Config::get('system', 'curl_timeout'));
|
||||
@curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
|
||||
}
|
||||
|
||||
// by default we will allow self-signed certs
|
||||
// but you can override this
|
||||
|
||||
$check_cert = get_config('system', 'verifyssl');
|
||||
$check_cert = Config::get('system', 'verifyssl');
|
||||
@curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
|
||||
|
||||
if ($check_cert) {
|
||||
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
|
||||
}
|
||||
|
||||
$proxy = get_config('system', 'proxy');
|
||||
$proxy = Config::get('system', 'proxy');
|
||||
|
||||
if (strlen($proxy)) {
|
||||
@curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
|
||||
@curl_setopt($ch, CURLOPT_PROXY, $proxy);
|
||||
$proxyuser = @get_config('system', 'proxyuser');
|
||||
$proxyuser = @Config::get('system', 'proxyuser');
|
||||
|
||||
if (strlen($proxyuser)) {
|
||||
@curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyuser);
|
||||
|
@ -299,7 +299,7 @@ function post_url($url, $params, $headers = null, &$redirects = 0, $timeout = 0)
|
|||
if (intval($timeout)) {
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
|
||||
} else {
|
||||
$curl_time = intval(get_config('system', 'curl_timeout'));
|
||||
$curl_time = intval(Config::get('system', 'curl_timeout'));
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
|
||||
}
|
||||
|
||||
|
@ -317,19 +317,19 @@ function post_url($url, $params, $headers = null, &$redirects = 0, $timeout = 0)
|
|||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
}
|
||||
|
||||
$check_cert = get_config('system', 'verifyssl');
|
||||
$check_cert = Config::get('system', 'verifyssl');
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
|
||||
|
||||
if ($check_cert) {
|
||||
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
|
||||
}
|
||||
|
||||
$proxy = get_config('system', 'proxy');
|
||||
$proxy = Config::get('system', 'proxy');
|
||||
|
||||
if (strlen($proxy)) {
|
||||
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
|
||||
curl_setopt($ch, CURLOPT_PROXY, $proxy);
|
||||
$proxyuser = get_config('system', 'proxyuser');
|
||||
$proxyuser = Config::get('system', 'proxyuser');
|
||||
if (strlen($proxyuser)) {
|
||||
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyuser);
|
||||
}
|
||||
|
@ -465,7 +465,7 @@ function http_status_exit($val, $description = array()) {
|
|||
* @return boolean True if it's a valid URL, fals if something wrong with it
|
||||
*/
|
||||
function validate_url(&$url) {
|
||||
if (get_config('system','disable_url_validation'))
|
||||
if (Config::get('system','disable_url_validation'))
|
||||
return true;
|
||||
|
||||
// no naked subdomains (allow localhost for tests)
|
||||
|
@ -493,7 +493,7 @@ function validate_url(&$url) {
|
|||
*/
|
||||
function validate_email($addr) {
|
||||
|
||||
if (get_config('system','disable_email_validation'))
|
||||
if (Config::get('system','disable_email_validation'))
|
||||
return true;
|
||||
|
||||
if (! strpos($addr,'@'))
|
||||
|
@ -598,7 +598,7 @@ function allowed_email($email) {
|
|||
return false;
|
||||
}
|
||||
|
||||
$str_allowed = get_config('system','allowed_email');
|
||||
$str_allowed = Config::get('system','allowed_email');
|
||||
if (! $str_allowed) {
|
||||
return true;
|
||||
}
|
||||
|
@ -658,7 +658,7 @@ function parse_xml_string($s, $strict = true) {
|
|||
function scale_external_images($srctext, $include_link = true, $scale_replace = false) {
|
||||
|
||||
// Suppress "view full size"
|
||||
if (intval(get_config('system','no_view_full_size'))) {
|
||||
if (intval(Config::get('system','no_view_full_size'))) {
|
||||
$include_link = false;
|
||||
}
|
||||
|
||||
|
@ -915,11 +915,11 @@ function original_url($url, $depth = 1, $fetchbody = false) {
|
|||
function short_link($url) {
|
||||
require_once('library/slinky.php');
|
||||
$slinky = new Slinky($url);
|
||||
$yourls_url = get_config('yourls','url1');
|
||||
$yourls_url = Config::get('yourls','url1');
|
||||
if ($yourls_url) {
|
||||
$yourls_username = get_config('yourls','username1');
|
||||
$yourls_password = get_config('yourls', 'password1');
|
||||
$yourls_ssl = get_config('yourls', 'ssl1');
|
||||
$yourls_username = Config::get('yourls','username1');
|
||||
$yourls_password = Config::get('yourls', 'password1');
|
||||
$yourls_ssl = Config::get('yourls', 'ssl1');
|
||||
$yourls = new Slinky_YourLS();
|
||||
$yourls->set('username', $yourls_username);
|
||||
$yourls->set('password', $yourls_password);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Network\Probe;
|
||||
|
||||
require_once 'include/queue_fn.php';
|
||||
require_once 'include/html2plain.php';
|
||||
|
@ -426,7 +427,7 @@ function notifier_run(&$argv, &$argc){
|
|||
if (dbm::is_result($r)) {
|
||||
$probed_contact = $r[0];
|
||||
} else {
|
||||
$probed_contact = probe_url($thr_parent[0]['author-link']);
|
||||
$probed_contact = Probe::uri($thr_parent[0]['author-link']);
|
||||
}
|
||||
|
||||
if ($probed_contact["notify"] != "") {
|
||||
|
@ -441,7 +442,7 @@ function notifier_run(&$argv, &$argc){
|
|||
if (dbm::is_result($r)) {
|
||||
$probed_contact = $r[0];
|
||||
} else {
|
||||
$probed_contact = probe_url($thr_parent[0]['owner-link']);
|
||||
$probed_contact = Probe::uri($thr_parent[0]['owner-link']);
|
||||
}
|
||||
|
||||
if ($probed_contact["notify"] != "") {
|
||||
|
@ -455,7 +456,7 @@ function notifier_run(&$argv, &$argc){
|
|||
//logger('Checking tag '.$x, LOGGER_DEBUG);
|
||||
$matches = null;
|
||||
if (preg_match('/@\[url=([^\]]*)\]/',$x,$matches)) {
|
||||
$probed_contact = probe_url($matches[1]);
|
||||
$probed_contact = Probe::uri($matches[1]);
|
||||
if ($probed_contact["notify"] != "") {
|
||||
logger('Notify mentioned user '.$probed_contact["url"].': '.$probed_contact["notify"]);
|
||||
$url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
|
||||
|
@ -474,7 +475,7 @@ function notifier_run(&$argv, &$argc){
|
|||
|
||||
// If this is a public message and pubmail is set on the parent, include all your email contacts
|
||||
|
||||
$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);
|
||||
|
||||
if (! $mail_disabled) {
|
||||
if ((! strlen($target_item['allow_cid'])) && (! strlen($target_item['allow_gid']))
|
||||
|
@ -524,7 +525,7 @@ function notifier_run(&$argv, &$argc){
|
|||
// They are especially used for notifications to OStatus users that don't follow us.
|
||||
|
||||
if ($slap && count($url_recipients) && ($public_message || $push_notify) && $normal_mode) {
|
||||
if (!get_config('system','dfrn_only')) {
|
||||
if (!Config::get('system','dfrn_only')) {
|
||||
foreach ($url_recipients as $url) {
|
||||
if ($url) {
|
||||
logger('notifier: urldelivery: ' . $url);
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
|
||||
define('REQUEST_TOKEN_DURATION', 300);
|
||||
|
@ -92,7 +94,7 @@ class FKOAuthDataStore extends OAuthDataStore {
|
|||
$ret=Null;
|
||||
|
||||
// get user for this verifier
|
||||
$uverifier = get_config("oauth", $verifier);
|
||||
$uverifier = Config::get("oauth", $verifier);
|
||||
logger(__function__.":".$verifier.",".$uverifier);
|
||||
if (is_null($verifier) || ($uverifier!==false)){
|
||||
|
||||
|
@ -115,10 +117,10 @@ class FKOAuthDataStore extends OAuthDataStore {
|
|||
|
||||
if (!is_null($ret) && $uverifier!==false){
|
||||
del_config("oauth", $verifier);
|
||||
/* $apps = get_pconfig($uverifier, "oauth", "apps");
|
||||
/* $apps = PConfig::get($uverifier, "oauth", "apps");
|
||||
if ($apps===false) $apps=array();
|
||||
$apps[] = $consumer->key;
|
||||
set_pconfig($uverifier, "oauth", "apps", $apps);*/
|
||||
PConfig::set($uverifier, "oauth", "apps", $apps);*/
|
||||
}
|
||||
|
||||
return $ret;
|
||||
|
@ -148,7 +150,7 @@ class FKOAuth1 extends OAuthServer {
|
|||
}
|
||||
$_SESSION['uid'] = $record['uid'];
|
||||
$_SESSION['theme'] = $record['theme'];
|
||||
$_SESSION['mobile-theme'] = get_pconfig($record['uid'], 'system', 'mobile_theme');
|
||||
$_SESSION['mobile-theme'] = PConfig::get($record['uid'], 'system', 'mobile_theme');
|
||||
$_SESSION['authenticated'] = 1;
|
||||
$_SESSION['page_flags'] = $record['page-flags'];
|
||||
$_SESSION['my_url'] = System::baseUrl() . '/profile/' . $record['nickname'];
|
||||
|
|
|
@ -1513,7 +1513,7 @@ class ostatus {
|
|||
$contact = owner;
|
||||
|
||||
if (!isset($contact["poll"])) {
|
||||
$data = probe_url($url);
|
||||
$data = Probe::uri($url);
|
||||
$contact["poll"] = $data["poll"];
|
||||
|
||||
if (!$contact["alias"])
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* @brief translation support
|
||||
*
|
||||
* Get the language setting directly from system variables, bypassing get_config()
|
||||
* Get the language setting directly from system variables, bypassing Config::get()
|
||||
* as database may not yet be configured.
|
||||
*
|
||||
* If possible, we use the value from the browser.
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
use Friendica\App;
|
||||
use Friendica\ParseUrl;
|
||||
use Friendica\Core\PConfig;
|
||||
|
||||
require_once("include/Photo.php");
|
||||
require_once("include/bbcode.php");
|
||||
|
@ -449,7 +450,7 @@ function plaintext(App $a, $b, $limit = 0, $includedlinks = false, $htmlmode = 2
|
|||
// Which purpose has this line? It is now uncommented, but left as a reminder
|
||||
//} elseif (strpos($b["body"], "[share") !== false) {
|
||||
// $post["url"] = $b["plink"];
|
||||
} elseif (get_pconfig($b["uid"], "system", "no_intelligent_shortening")) {
|
||||
} elseif (PConfig::get($b["uid"], "system", "no_intelligent_shortening")) {
|
||||
$post["url"] = $b["plink"];
|
||||
}
|
||||
$msg = shortenmsg($msg, $limit);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\System;
|
||||
|
||||
/**
|
||||
|
@ -72,7 +73,7 @@ function install_plugin($plugin) {
|
|||
|
||||
if (! function_exists('reload_plugins')) {
|
||||
function reload_plugins() {
|
||||
$plugins = get_config('system','addon');
|
||||
$plugins = Config::get('system','addon');
|
||||
if (strlen($plugins)) {
|
||||
|
||||
$r = q("SELECT * FROM `addon` WHERE `installed` = 1");
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
* @file include/post_update.php
|
||||
*/
|
||||
|
||||
use Friendica\Core\Config;
|
||||
|
||||
/**
|
||||
* @brief Calls the post update functions
|
||||
*/
|
||||
|
@ -33,7 +35,7 @@ function post_update() {
|
|||
function post_update_1192() {
|
||||
|
||||
// Was the script completed?
|
||||
if (get_config("system", "post_update_version") >= 1192)
|
||||
if (Config::get("system", "post_update_version") >= 1192)
|
||||
return true;
|
||||
|
||||
// Check if the first step is done (Setting "gcontact-id" in the item table)
|
||||
|
@ -46,7 +48,7 @@ function post_update_1192() {
|
|||
(`thread`.`uid` IN (SELECT `uid` from `user`) OR `thread`.`uid` = 0)");
|
||||
|
||||
if ($r && ($r[0]["total"] == 0)) {
|
||||
set_config("system", "post_update_version", 1192);
|
||||
Config::set("system", "post_update_version", 1192);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -85,23 +87,23 @@ function post_update_1192() {
|
|||
function post_update_1194() {
|
||||
|
||||
// Was the script completed?
|
||||
if (get_config("system", "post_update_version") >= 1194)
|
||||
if (Config::get("system", "post_update_version") >= 1194)
|
||||
return true;
|
||||
|
||||
logger("Start", LOGGER_DEBUG);
|
||||
|
||||
$end_id = get_config("system", "post_update_1194_end");
|
||||
$end_id = Config::get("system", "post_update_1194_end");
|
||||
if (!$end_id) {
|
||||
$r = q("SELECT `id` FROM `item` WHERE `uid` != 0 ORDER BY `id` DESC LIMIT 1");
|
||||
if ($r) {
|
||||
set_config("system", "post_update_1194_end", $r[0]["id"]);
|
||||
$end_id = get_config("system", "post_update_1194_end");
|
||||
Config::set("system", "post_update_1194_end", $r[0]["id"]);
|
||||
$end_id = Config::get("system", "post_update_1194_end");
|
||||
}
|
||||
}
|
||||
|
||||
logger("End ID: ".$end_id, LOGGER_DEBUG);
|
||||
|
||||
$start_id = get_config("system", "post_update_1194_start");
|
||||
$start_id = Config::get("system", "post_update_1194_start");
|
||||
|
||||
$query1 = "SELECT `item`.`id` FROM `item` ";
|
||||
|
||||
|
@ -119,12 +121,12 @@ function post_update_1194() {
|
|||
intval($start_id), intval($end_id),
|
||||
dbesc(NETWORK_DFRN), dbesc(NETWORK_DIASPORA), dbesc(NETWORK_OSTATUS));
|
||||
if (!$r) {
|
||||
set_config("system", "post_update_version", 1194);
|
||||
Config::set("system", "post_update_version", 1194);
|
||||
logger("Update is done", LOGGER_DEBUG);
|
||||
return true;
|
||||
} else {
|
||||
set_config("system", "post_update_1194_start", $r[0]["id"]);
|
||||
$start_id = get_config("system", "post_update_1194_start");
|
||||
Config::set("system", "post_update_1194_start", $r[0]["id"]);
|
||||
$start_id = Config::get("system", "post_update_1194_start");
|
||||
}
|
||||
|
||||
logger("Start ID: ".$start_id, LOGGER_DEBUG);
|
||||
|
@ -157,7 +159,7 @@ function post_update_1194() {
|
|||
function post_update_1198() {
|
||||
|
||||
// Was the script completed?
|
||||
if (get_config("system", "post_update_version") >= 1198)
|
||||
if (Config::get("system", "post_update_version") >= 1198)
|
||||
return true;
|
||||
|
||||
logger("Start", LOGGER_DEBUG);
|
||||
|
@ -172,7 +174,7 @@ function post_update_1198() {
|
|||
(`thread`.`uid` IN (SELECT `uid` from `user`) OR `thread`.`uid` = 0)");
|
||||
|
||||
if ($r && ($r[0]["total"] == 0)) {
|
||||
set_config("system", "post_update_version", 1198);
|
||||
Config::set("system", "post_update_version", 1198);
|
||||
logger("Done", LOGGER_DEBUG);
|
||||
return true;
|
||||
}
|
||||
|
@ -186,7 +188,7 @@ function post_update_1198() {
|
|||
|
||||
logger("Updated threads", LOGGER_DEBUG);
|
||||
if (dbm::is_result($r)) {
|
||||
set_config("system", "post_update_version", 1198);
|
||||
Config::set("system", "post_update_version", 1198);
|
||||
logger("Done", LOGGER_DEBUG);
|
||||
return true;
|
||||
}
|
||||
|
@ -234,7 +236,7 @@ function post_update_1198() {
|
|||
*/
|
||||
function post_update_1206() {
|
||||
// Was the script completed?
|
||||
if (get_config("system", "post_update_version") >= 1206)
|
||||
if (Config::get("system", "post_update_version") >= 1206)
|
||||
return true;
|
||||
|
||||
logger("Start", LOGGER_DEBUG);
|
||||
|
@ -254,7 +256,7 @@ function post_update_1206() {
|
|||
}
|
||||
}
|
||||
|
||||
set_config("system", "post_update_version", 1206);
|
||||
Config::set("system", "post_update_version", 1206);
|
||||
logger("Done", LOGGER_DEBUG);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Friendica\Core\Config;
|
||||
|
||||
function update_queue_time($id) {
|
||||
logger('queue: requeue item ' . $id);
|
||||
q("UPDATE `queue` SET `last` = '%s' WHERE `id` = %d",
|
||||
|
@ -48,12 +50,12 @@ function was_recently_delayed($cid) {
|
|||
|
||||
function add_to_queue($cid,$network,$msg,$batch = false) {
|
||||
|
||||
$max_queue = get_config('system','max_contact_queue');
|
||||
$max_queue = Config::get('system','max_contact_queue');
|
||||
if ($max_queue < 1) {
|
||||
$max_queue = 500;
|
||||
}
|
||||
|
||||
$batch_queue = get_config('system','max_batch_queue');
|
||||
$batch_queue = Config::get('system','max_batch_queue');
|
||||
if ($batch_queue < 1) {
|
||||
$batch_queue = 1000;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
|
||||
/**
|
||||
|
@ -11,7 +13,7 @@ use Friendica\Core\System;
|
|||
* @return string Hashed data
|
||||
*/
|
||||
function cookie_hash($user) {
|
||||
return(hash("sha256", get_config("system", "site_prvkey").
|
||||
return(hash("sha256", Config::get("system", "site_prvkey").
|
||||
$user["uprvkey"].
|
||||
$user["password"]));
|
||||
}
|
||||
|
@ -38,7 +40,7 @@ function new_cookie($time, $user = array()) {
|
|||
}
|
||||
|
||||
setcookie("Friendica", $value, $time, "/", "",
|
||||
(get_config('system', 'ssl_policy') == SSL_POLICY_FULL), true);
|
||||
(Config::get('system', 'ssl_policy') == SSL_POLICY_FULL), true);
|
||||
|
||||
}
|
||||
|
||||
|
@ -48,7 +50,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
|
|||
|
||||
$_SESSION['uid'] = $user_record['uid'];
|
||||
$_SESSION['theme'] = $user_record['theme'];
|
||||
$_SESSION['mobile-theme'] = get_pconfig($user_record['uid'], 'system', 'mobile_theme');
|
||||
$_SESSION['mobile-theme'] = PConfig::get($user_record['uid'], 'system', 'mobile_theme');
|
||||
$_SESSION['authenticated'] = 1;
|
||||
$_SESSION['page_flags'] = $user_record['page-flags'];
|
||||
$_SESSION['my_url'] = System::baseUrl() . '/profile/' . $user_record['nickname'];
|
||||
|
|
|
@ -115,7 +115,7 @@ if (Config::get('system', 'ssl_policy') == SSL_POLICY_FULL) {
|
|||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
|
||||
if (!get_config('system', 'disable_database_session')) {
|
||||
if (!Config::get('system', 'disable_database_session')) {
|
||||
session_set_save_handler('ref_session_open', 'ref_session_close',
|
||||
'ref_session_read', 'ref_session_write',
|
||||
'ref_session_destroy', 'ref_session_gc');
|
||||
|
|
|
@ -1556,11 +1556,11 @@ function suggestion_query($uid, $start = 0, $limit = 80) {
|
|||
|
||||
$network = array(NETWORK_DFRN);
|
||||
|
||||
if (get_config('system','diaspora_enabled')) {
|
||||
if (Config::get('system','diaspora_enabled')) {
|
||||
$network[] = NETWORK_DIASPORA;
|
||||
}
|
||||
|
||||
if (!get_config('system','ostatus_disabled')) {
|
||||
if (!Config::get('system','ostatus_disabled')) {
|
||||
$network[] = NETWORK_OSTATUS;
|
||||
}
|
||||
|
||||
|
@ -1648,7 +1648,7 @@ function update_suggestions() {
|
|||
|
||||
$done[] = System::baseUrl() . '/poco';
|
||||
|
||||
if (strlen(get_config('system','directory'))) {
|
||||
if (strlen(Config::get('system','directory'))) {
|
||||
$x = fetch_url(get_server()."/pubsites");
|
||||
if ($x) {
|
||||
$j = json_decode($x);
|
||||
|
@ -1709,7 +1709,7 @@ function poco_fetch_serverlist($poco) {
|
|||
}
|
||||
|
||||
function poco_discover_federation() {
|
||||
$last = get_config('poco','last_federation_discovery');
|
||||
$last = Config::get('poco','last_federation_discovery');
|
||||
|
||||
if ($last) {
|
||||
$next = $last + (24 * 60 * 60);
|
||||
|
@ -1746,7 +1746,7 @@ function poco_discover_federation() {
|
|||
// Currently disabled, since the service isn't available anymore.
|
||||
// It is not removed since I hope that there will be a successor.
|
||||
// Discover GNU Social Servers.
|
||||
//if (!get_config('system','ostatus_disabled')) {
|
||||
//if (!Config::get('system','ostatus_disabled')) {
|
||||
// $serverdata = "http://gstools.org/api/get_open_instances/";
|
||||
|
||||
// $result = z_fetch_url($serverdata);
|
||||
|
@ -1758,7 +1758,7 @@ function poco_discover_federation() {
|
|||
// }
|
||||
//}
|
||||
|
||||
set_config('poco','last_federation_discovery', time());
|
||||
Config::set('poco','last_federation_discovery', time());
|
||||
}
|
||||
|
||||
function poco_discover_single_server($id) {
|
||||
|
@ -1783,9 +1783,9 @@ function poco_discover_single_server($id) {
|
|||
|
||||
poco_discover_server($data, 2);
|
||||
|
||||
if (get_config('system','poco_discovery') > 1) {
|
||||
if (Config::get('system','poco_discovery') > 1) {
|
||||
|
||||
$timeframe = get_config('system','poco_discovery_since');
|
||||
$timeframe = Config::get('system','poco_discovery_since');
|
||||
if ($timeframe == 0) {
|
||||
$timeframe = 30;
|
||||
}
|
||||
|
@ -1803,7 +1803,7 @@ function poco_discover_single_server($id) {
|
|||
$success = poco_discover_server(json_decode($retdata["body"]));
|
||||
}
|
||||
|
||||
if (!$success && (get_config('system','poco_discovery') > 2)) {
|
||||
if (!$success && (Config::get('system','poco_discovery') > 2)) {
|
||||
logger("Fetch contacts from users of the server ".$server["nurl"], LOGGER_DEBUG);
|
||||
poco_discover_server_users($data, $server);
|
||||
}
|
||||
|
@ -1830,7 +1830,7 @@ function poco_discover($complete = false) {
|
|||
|
||||
$no_of_queries = 5;
|
||||
|
||||
$requery_days = intval(get_config("system", "poco_requery_days"));
|
||||
$requery_days = intval(Config::get("system", "poco_requery_days"));
|
||||
|
||||
if ($requery_days == 0) {
|
||||
$requery_days = 7;
|
||||
|
@ -2036,7 +2036,7 @@ function clean_contact_url($url) {
|
|||
*/
|
||||
function fix_alternate_contact_address(&$contact) {
|
||||
if (($contact["network"] == NETWORK_OSTATUS) && poco_alternate_ostatus_url($contact["url"])) {
|
||||
$data = probe_url($contact["url"]);
|
||||
$data = Probe::uri($contact["url"]);
|
||||
if ($contact["network"] == NETWORK_OSTATUS) {
|
||||
logger("Fix primary url from ".$contact["url"]." to ".$data["url"]." - Called by: ".System::callstack(), LOGGER_DEBUG);
|
||||
$contact["url"] = $data["url"];
|
||||
|
@ -2294,7 +2294,7 @@ function update_gcontact($contact) {
|
|||
* @param str $url profile link
|
||||
*/
|
||||
function update_gcontact_from_probe($url) {
|
||||
$data = probe_url($url);
|
||||
$data = Probe::uri($url);
|
||||
|
||||
if (in_array($data["network"], array(NETWORK_PHANTOM))) {
|
||||
logger("Invalid network for contact url ".$data["url"]." - Called by: ".System::callstack(), LOGGER_DEBUG);
|
||||
|
@ -2410,7 +2410,7 @@ function gs_fetch_users($server) {
|
|||
*/
|
||||
function gs_discover() {
|
||||
|
||||
$requery_days = intval(get_config("system", "poco_requery_days"));
|
||||
$requery_days = intval(Config::get("system", "poco_requery_days"));
|
||||
|
||||
$last_update = date("c", time() - (60 * 60 * 24 * $requery_days));
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
|
||||
require_once "include/template_processor.php";
|
||||
|
@ -718,9 +720,9 @@ function logger($msg, $level = 0) {
|
|||
return;
|
||||
}
|
||||
|
||||
$debugging = get_config('system','debugging');
|
||||
$logfile = get_config('system','logfile');
|
||||
$loglevel = intval(get_config('system','loglevel'));
|
||||
$debugging = Config::get('system','debugging');
|
||||
$logfile = Config::get('system','logfile');
|
||||
$loglevel = intval(Config::get('system','loglevel'));
|
||||
|
||||
if (
|
||||
! $debugging
|
||||
|
@ -790,7 +792,7 @@ function dlogger($msg, $level = 0) {
|
|||
return;
|
||||
}
|
||||
|
||||
$logfile = get_config('system','dlogfile');
|
||||
$logfile = Config::get('system','dlogfile');
|
||||
|
||||
if (! $logfile) {
|
||||
return;
|
||||
|
@ -934,7 +936,7 @@ function contact_block() {
|
|||
$o = '';
|
||||
$a = get_app();
|
||||
|
||||
$shown = get_pconfig($a->profile['uid'],'system','display_friend_count');
|
||||
$shown = PConfig::get($a->profile['uid'],'system','display_friend_count');
|
||||
if ($shown === false) {
|
||||
$shown = 24;
|
||||
}
|
||||
|
@ -1096,7 +1098,7 @@ function search($s, $id = 'search-box', $url = 'search', $save = false, $aside =
|
|||
t("Tags"),
|
||||
t("Contacts"));
|
||||
|
||||
if (get_config('system','poco_local_search')) {
|
||||
if (Config::get('system','poco_local_search')) {
|
||||
$values['$searchoption'][] = t("Forums");
|
||||
}
|
||||
}
|
||||
|
@ -1114,7 +1116,7 @@ if (! function_exists('valid_email')) {
|
|||
function valid_email($x){
|
||||
|
||||
/// @TODO Removed because Fabio told me so.
|
||||
//if (get_config('system','disable_email_validation'))
|
||||
//if (Config::get('system','disable_email_validation'))
|
||||
// return true;
|
||||
return preg_match('/^[_a-zA-Z0-9\-\+]+(\.[_a-zA-Z0-9\-\+]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/', $x);
|
||||
}}
|
||||
|
@ -1282,7 +1284,7 @@ function redir_private_images($a, &$item)
|
|||
function put_item_in_cache(&$item, $update = false) {
|
||||
|
||||
if (($item["rendered-hash"] != hash("md5", $item["body"])) || ($item["rendered-hash"] == "") ||
|
||||
($item["rendered-html"] == "") || get_config("system", "ignore_cache")) {
|
||||
($item["rendered-html"] == "") || Config::get("system", "ignore_cache")) {
|
||||
|
||||
// The function "redir_private_images" changes the body.
|
||||
// I'm not sure if we should store it permanently, so we save the old value.
|
||||
|
@ -1331,7 +1333,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
|
|||
return $ev;
|
||||
}
|
||||
|
||||
if (!get_config('system','suppress_tags')) {
|
||||
if (!Config::get('system','suppress_tags')) {
|
||||
$taglist = dba::p("SELECT `type`, `term`, `url` FROM `term` WHERE `otype` = ? AND `oid` = ? AND `type` IN (?, ?) ORDER BY `tid`",
|
||||
intval(TERM_OBJ_POST), intval($item['id']), intval(TERM_HASHTAG), intval(TERM_MENTION));
|
||||
|
||||
|
@ -1979,7 +1981,7 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') {
|
|||
if ($file_old == $file_new)
|
||||
return true;
|
||||
|
||||
$saved = get_pconfig($uid,'system','filetags');
|
||||
$saved = PConfig::get($uid,'system','filetags');
|
||||
if (strlen($saved)) {
|
||||
if ($type == 'file') {
|
||||
$lbracket = '[';
|
||||
|
@ -2030,13 +2032,13 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') {
|
|||
}
|
||||
|
||||
if ($saved != $filetags_updated) {
|
||||
set_pconfig($uid, 'system', 'filetags', $filetags_updated);
|
||||
PConfig::set($uid, 'system', 'filetags', $filetags_updated);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
if (strlen($file_new)) {
|
||||
set_pconfig($uid, 'system', 'filetags', $file_new);
|
||||
PConfig::set($uid, 'system', 'filetags', $file_new);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2062,9 +2064,9 @@ function file_tag_save_file($uid, $item, $file) {
|
|||
|
||||
create_files_from_item($item);
|
||||
|
||||
$saved = get_pconfig($uid,'system','filetags');
|
||||
$saved = PConfig::get($uid,'system','filetags');
|
||||
if ((! strlen($saved)) || (! stristr($saved, '[' . file_tag_encode($file) . ']'))) {
|
||||
set_pconfig($uid, 'system', 'filetags', $saved . '[' . file_tag_encode($file) . ']');
|
||||
PConfig::set($uid, 'system', 'filetags', $saved . '[' . file_tag_encode($file) . ']');
|
||||
}
|
||||
info( t('Item filed') );
|
||||
}
|
||||
|
@ -2110,8 +2112,8 @@ function file_tag_unsave_file($uid, $item, $file, $cat = false) {
|
|||
intval($uid));
|
||||
|
||||
if (! dbm::is_result($r)) {
|
||||
$saved = get_pconfig($uid,'system','filetags');
|
||||
set_pconfig($uid, 'system', 'filetags', str_replace($pattern, '', $saved));
|
||||
$saved = PConfig::get($uid,'system','filetags');
|
||||
PConfig::set($uid, 'system', 'filetags', str_replace($pattern, '', $saved));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Network\Probe;
|
||||
|
||||
function update_gcontact_run(&$argv, &$argc) {
|
||||
global $a;
|
||||
|
@ -29,7 +30,7 @@ function update_gcontact_run(&$argv, &$argc) {
|
|||
return;
|
||||
}
|
||||
|
||||
$data = probe_url($r[0]["url"]);
|
||||
$data = Probe::uri($r[0]["url"]);
|
||||
|
||||
if (!in_array($data["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) {
|
||||
if ($r[0]["server_url"] != "")
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\System;
|
||||
|
||||
require_once('include/config.php');
|
||||
|
@ -18,8 +19,8 @@ function create_user($arr) {
|
|||
$a = get_app();
|
||||
$result = array('success' => false, 'user' => null, 'password' => '', 'message' => '');
|
||||
|
||||
$using_invites = get_config('system','invitation_only');
|
||||
$num_invites = get_config('system','number_invites');
|
||||
$using_invites = Config::get('system','invitation_only');
|
||||
$num_invites = Config::get('system','number_invites');
|
||||
|
||||
|
||||
$invite_id = ((x($arr,'invite_id')) ? notags(trim($arr['invite_id'])) : '');
|
||||
|
@ -35,7 +36,7 @@ function create_user($arr) {
|
|||
$verified = ((x($arr,'verified')) ? intval($arr['verified']) : 0);
|
||||
|
||||
$publish = ((x($arr,'profile_publish_reg') && intval($arr['profile_publish_reg'])) ? 1 : 0);
|
||||
$netpublish = ((strlen(get_config('system','directory'))) ? $publish : 0);
|
||||
$netpublish = ((strlen(Config::get('system','directory'))) ? $publish : 0);
|
||||
|
||||
if ($password1 != $confirm) {
|
||||
$result['message'] .= t('Passwords do not match. Password unchanged.') . EOL;
|
||||
|
@ -101,7 +102,7 @@ function create_user($arr) {
|
|||
|
||||
// So now we are just looking for a space in the full name.
|
||||
|
||||
$loose_reg = get_config('system','no_regfullname');
|
||||
$loose_reg = Config::get('system','no_regfullname');
|
||||
if(! $loose_reg) {
|
||||
$username = mb_convert_case($username,MB_CASE_TITLE,'UTF-8');
|
||||
if(! strpos($username,' '))
|
||||
|
@ -268,7 +269,7 @@ function create_user($arr) {
|
|||
);
|
||||
}
|
||||
|
||||
if(get_config('system', 'newuser_private') && $def_gid) {
|
||||
if(Config::get('system', 'newuser_private') && $def_gid) {
|
||||
q("UPDATE `user` SET `allow_gid` = '%s' WHERE `uid` = %d",
|
||||
dbesc("<" . $def_gid . ">"),
|
||||
intval($newuid)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue