*/
use Friendica\App;
-use Friendica\BaseObject;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\Protocol;
use Friendica\Core\System;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Term;
use Friendica\Util\BasePath;
define('FRIENDICA_PLATFORM', 'Friendica');
define('FRIENDICA_CODENAME', 'Dalmatian Bellflower');
-define('FRIENDICA_VERSION', '2019.12-dev');
+define('FRIENDICA_VERSION', '2020.03-dev');
define('DFRN_PROTOCOL_VERSION', '2.23');
define('NEW_UPDATE_ROUTINE_VERSION', 1170);
define('CURLE_OPERATION_TIMEDOUT', CURLE_OPERATION_TIMEOUTED);
}
-/**
- * @brief Retrieve the App structure
- *
- * Useful in functions which require it but don't get it passed to them
- *
- * @deprecated since version 2018.09
- * @see BaseObject::getApp()
- * @return App
- */
-function get_app()
-{
- return BaseObject::getApp();
-}
-
-/**
- * @brief Used to end the current process, after saving session state.
- * @deprecated
- */
-function killme()
-{
- exit();
-}
-
/**
* @brief Returns the user id of locally logged in user or false.
*
return;
}
- $a = \get_app();
+ $a = DI::app();
if (empty($_SESSION['sysmsg'])) {
$_SESSION['sysmsg'] = [];
}
*/
function info($s)
{
- $a = \get_app();
+ $a = DI::app();
if (local_user() && PConfig::get(local_user(), 'system', 'ignore_info')) {
return;
*/
function is_site_admin()
{
- $a = \get_app();
+ $a = DI::app();
$admin_email = Config::get('config', 'admin_email');
return $pageURL;
}
-function get_server()
-{
- $server = Config::get("system", "directory");
-
- if ($server == "") {
- $server = "https://dir.friendica.social";
- }
-
- return $server;
-}
-
function get_temppath()
{
- $a = \get_app();
-
$temppath = Config::get("system", "temppath");
if (($temppath != "") && System::isDirectoryUsable($temppath)) {
$temppath = BasePath::getRealPath($temppath);
// To avoid any interferences with other systems we create our own directory
- $new_temppath = $temppath . "/" . $a->getHostName();
+ $new_temppath = $temppath . "/" . DI::baseUrl()->getHostname();
if (!is_dir($new_temppath)) {
/// @TODO There is a mkdir()+chmod() upwards, maybe generalize this (+ configurable) into a function/method?
mkdir($new_temppath);
// Simply return flag
return $valid;
}
-
-/**
- * PHP 5 compatible dirname() with count parameter
- *
- * @see http://php.net/manual/en/function.dirname.php#113193
- *
- * @deprecated with PHP 7
- * @param string $path
- * @param int $levels
- * @return string
- */
-function rdirname($path, $levels = 1)
-{
- if ($levels > 1) {
- return dirname(rdirname($path, --$levels));
- } else {
- return dirname($path);
- }
-}