1
0
Fork 0

Remove get_server() in favor of Search::getGlobalDirectory()

This commit is contained in:
Philipp Holzer 2020-01-04 23:59:20 +01:00
commit 48baa0be4b
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
10 changed files with 25 additions and 23 deletions

View file

@ -272,7 +272,7 @@ class Search
$return = GContact::searchByName($search, $mode);
} else {
$p = $page > 1 ? 'p=' . $page : '';
$curlResult = Network::curl(get_server() . '/search/people?' . $p . '&q=' . urlencode($search), false, ['accept_content' => 'application/json']);
$curlResult = Network::curl(self::getGlobalDirectory() . '/search/people?' . $p . '&q=' . urlencode($search), false, ['accept_content' => 'application/json']);
if ($curlResult->isSuccess()) {
$searchResult = json_decode($curlResult->getBody(), true);
if (!empty($searchResult['profiles'])) {
@ -283,4 +283,14 @@ class Search
return $return ?? [];
}
/**
* Returns the global directory name, used in this node
*
* @return string
*/
public static function getGlobalDirectory()
{
return Config::get('system', 'directory', self::DEFAULT_DIRECTORY);
}
}

View file

@ -290,7 +290,6 @@ class System
function notice($s)
function info($s)
function is_site_admin()
function get_server()
function get_temppath()
function get_cachefile($file, $writemode = true)
function get_itemcachepath()