Merge pull request #1416 from herbrechtsmeier/set_include_path_early

initPaths: set include path before any owncloud function is called
This commit is contained in:
Thomas Müller 2013-02-03 00:25:21 -08:00
commit a3b922763e
1 changed files with 7 additions and 6 deletions

View File

@ -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', '');