Use __DIR__ instead of __FILE__ to get SERVERROOT

This commit is contained in:
Bart Visscher 2012-09-28 15:29:41 +02:00
parent d525654fcd
commit fe40277ec2
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ class OC{
public static function initPaths() {
// calculate the root directories
OC::$SERVERROOT=str_replace("\\", '/', substr(__FILE__, 0, -13));
OC::$SERVERROOT=str_replace("\\", '/', substr(__DIR__, 0, -4));
OC::$SUBURI= str_replace("\\", "/", substr(realpath($_SERVER["SCRIPT_FILENAME"]), strlen(OC::$SERVERROOT)));
$scriptName=$_SERVER["SCRIPT_NAME"];
if(substr($scriptName, -1)=='/') {