From a47b7e5abcae6ba23dbe45442cd0d3a0dc9f53ca Mon Sep 17 00:00:00 2001 From: Dominik Blunk Date: Thu, 23 Apr 2009 18:06:02 +0200 Subject: [PATCH] Minor enhancement when using symlinks with Apache (g_absolute_path) --- config_defaults_inc.php | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/config_defaults_inc.php b/config_defaults_inc.php index 82f16f4..89f09db 100644 --- a/config_defaults_inc.php +++ b/config_defaults_inc.php @@ -171,9 +171,15 @@ /** * absolute path to your installation. Requires trailing / or \ + * with apache use SCRIPT_FILENAME because __FILE__ does resolve symbolic links * @global string $g_absolute_path */ - $g_absolute_path = dirname( __FILE__ ) . DIRECTORY_SEPARATOR; + if( isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'apache' ) ) { + $g_absolute_path = dirname( $_SERVER['SCRIPT_FILENAME'] ) . DIRECTORY_SEPARATOR; + } + else { + $g_absolute_path = dirname( __FILE__ ) . DIRECTORY_SEPARATOR; + } /** * absolute patch to your core files. The default is usually OK, -- 1.6.2.2.1669.g7eaf8