Skip to content
Snippets Groups Projects
Commit a3b92276 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #1416 from herbrechtsmeier/set_include_path_early

initPaths: set include path before any owncloud function is called
parents 743c330f 37e6ac9a
No related branches found
No related tags found
No related merge requests found
...@@ -125,6 +125,13 @@ class OC { ...@@ -125,6 +125,13 @@ class OC {
public static function initPaths() { public static function initPaths() {
// calculate the root directories // calculate the root directories
OC::$SERVERROOT = str_replace("\\", '/', substr(__DIR__, 0, -4)); 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))); OC::$SUBURI = str_replace("\\", "/", substr(realpath($_SERVER["SCRIPT_FILENAME"]), strlen(OC::$SERVERROOT)));
$scriptName = OC_Request::scriptName(); $scriptName = OC_Request::scriptName();
if (substr($scriptName, -1) == '/') { if (substr($scriptName, -1) == '/') {
...@@ -144,12 +151,6 @@ class OC { ...@@ -144,12 +151,6 @@ class OC {
OC::$WEBROOT = '/' . OC::$WEBROOT; 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 // search the 3rdparty folder
if (OC_Config::getValue('3rdpartyroot', '') <> '' and OC_Config::getValue('3rdpartyurl', '') <> '') { if (OC_Config::getValue('3rdpartyroot', '') <> '' and OC_Config::getValue('3rdpartyurl', '') <> '') {
OC::$THIRDPARTYROOT = OC_Config::getValue('3rdpartyroot', ''); OC::$THIRDPARTYROOT = OC_Config::getValue('3rdpartyroot', '');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment