diff options
author | herbrechtsmeier <stefan@herbrechtsmeier.net> | 2013-02-02 10:02:10 +0100 |
---|---|---|
committer | herbrechtsmeier <stefan@herbrechtsmeier.net> | 2013-02-02 12:07:18 +0100 |
commit | 37e6ac9a2aac288147efce7dc87e42edde14ba68 (patch) | |
tree | 633d0e341e419e28254b6f602a79eb0cff8aa92e | |
parent | 23166aa016a85c237de6f4f532578dfbef0fe09b (diff) | |
download | nextcloud-server-37e6ac9a2aac288147efce7dc87e42edde14ba68.tar.gz nextcloud-server-37e6ac9a2aac288147efce7dc87e42edde14ba68.zip |
initPaths: set include path before any owncloud function is called
Ensure we can find basic owncloud classes while detecting the owncloud
paths in function initPaths by add OC::$SERVERROOT . '/lib' to include
path before any owncloud function is called.
This fix a bug with XAMPP that cannot find the class OC_Config in
function OC_Request::scriptName when called from function
OC_Base::initPaths.
-rw-r--r-- | lib/base.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/base.php b/lib/base.php index 4f89a70db94..90e64f13af6 100644 --- a/lib/base.php +++ b/lib/base.php @@ -125,6 +125,13 @@ class OC { public static function initPaths() { // calculate the root directories OC::$SERVERROOT = str_replace("\\", '/', substr(__DIR__, 0, -4)); + + // ensure we can find OC_Config + set_include_path( + OC::$SERVERROOT . '/lib' . PATH_SEPARATOR . + get_include_path() + ); + OC::$SUBURI = str_replace("\\", "/", substr(realpath($_SERVER["SCRIPT_FILENAME"]), strlen(OC::$SERVERROOT))); $scriptName = OC_Request::scriptName(); if (substr($scriptName, -1) == '/') { @@ -144,12 +151,6 @@ class OC { OC::$WEBROOT = '/' . OC::$WEBROOT; } - // ensure we can find OC_Config - set_include_path( - OC::$SERVERROOT . '/lib' . PATH_SEPARATOR . - get_include_path() - ); - // search the 3rdparty folder if (OC_Config::getValue('3rdpartyroot', '') <> '' and OC_Config::getValue('3rdpartyurl', '') <> '') { OC::$THIRDPARTYROOT = OC_Config::getValue('3rdpartyroot', ''); |