From ad854d5d401b34758cabb5c5ec18d46c79b7565d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 9 Mar 2019 23:21:19 -0500 Subject: [PATCH] Define absolute paths for various includes - Fix errors running local tests in IDE --- include/items.php | 3 ++- src/BaseObject.php | 2 +- src/Render/FriendicaSmartyEngine.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/items.php b/include/items.php index 88eec1dc4..a28e19a05 100644 --- a/include/items.php +++ b/include/items.php @@ -24,7 +24,8 @@ use Friendica\Util\ParseUrl; use Friendica\Util\Strings; use Friendica\Util\Temporal; -require_once 'mod/share.php'; +require_once __DIR__ . '/../mod/share.php'; + function add_page_info_data(array $data, $no_photos = false) { Hook::callAll('page_info_data', $data); diff --git a/src/BaseObject.php b/src/BaseObject.php index 4a6fa12d2..7e90478a9 100644 --- a/src/BaseObject.php +++ b/src/BaseObject.php @@ -4,7 +4,7 @@ */ namespace Friendica; -require_once 'boot.php'; +require_once __DIR__ . '/../boot.php'; use Friendica\Network\HTTPException\InternalServerErrorException; diff --git a/src/Render/FriendicaSmartyEngine.php b/src/Render/FriendicaSmartyEngine.php index 69a34ae56..36e46435f 100644 --- a/src/Render/FriendicaSmartyEngine.php +++ b/src/Render/FriendicaSmartyEngine.php @@ -17,7 +17,7 @@ class FriendicaSmartyEngine implements ITemplateEngine public function __construct() { - if (!is_writable('view/smarty3/')) { + if (!is_writable(__DIR__ . '/../../view/smarty3/')) { echo "ERROR: folder view/smarty3/ must be writable by webserver."; exit(); }