From d63c9414217e77d2b6a43f0b3ef9496c4ac9b6b3 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 29 Jun 2013 16:23:29 +0400 Subject: [PATCH] Using script filename instead of __FILE__ The server variable script_filename contains the requested file path without symlink resolution. __FILE__ is the 'real' file path with symlink resolution. If a user (like me) uses a git repo for plugin management and symlinks the fever directory to the plugin directory the inclusion and chdir'ing previously failed. --- fever/index.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fever/index.php b/fever/index.php index de8a0be..86e3e9b 100755 --- a/fever/index.php +++ b/fever/index.php @@ -9,14 +9,15 @@ error_reporting(E_ERROR | E_PARSE); - require_once "../../config.php"; + $tt_root = dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME']))).'/'; + require_once $tt_root."config.php"; set_include_path(dirname(__FILE__) . PATH_SEPARATOR . - dirname(dirname(dirname(__FILE__))) . PATH_SEPARATOR . - dirname(dirname(dirname(__FILE__))) . "/include" . PATH_SEPARATOR . + $tt_root . PATH_SEPARATOR . + $tt_root . "/include" . PATH_SEPARATOR . get_include_path()); - chdir("../.."); + chdir($tt_root); define('NO_SESSION_AUTOSTART', true);