|
|
|
@ -57,6 +57,9 @@ class OC { |
|
|
|
|
* web path in 'url' |
|
|
|
|
*/ |
|
|
|
|
public static $APPSROOTS = array(); |
|
|
|
|
|
|
|
|
|
public static $configDir; |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
* requested app |
|
|
|
|
*/ |
|
|
|
@ -100,6 +103,13 @@ class OC { |
|
|
|
|
get_include_path() |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if(defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT . '/test_config/')) { |
|
|
|
|
self::$configDir = OC::$SERVERROOT . '/test_config/'; |
|
|
|
|
} else { |
|
|
|
|
self::$configDir = OC::$SERVERROOT . '/config/'; |
|
|
|
|
} |
|
|
|
|
OC_Config::$object = new \OC\Config(self::$configDir); |
|
|
|
|
|
|
|
|
|
OC::$SUBURI = str_replace("\\", "/", substr(realpath($_SERVER["SCRIPT_FILENAME"]), strlen(OC::$SERVERROOT))); |
|
|
|
|
$scriptName = OC_Request::scriptName(); |
|
|
|
|
if (substr($scriptName, -1) == '/') { |
|
|
|
@ -175,8 +185,8 @@ class OC { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static function checkConfig() { |
|
|
|
|
if (file_exists(OC::$SERVERROOT . "/config/config.php") |
|
|
|
|
and !is_writable(OC::$SERVERROOT . "/config/config.php") |
|
|
|
|
if (file_exists(self::$configDir . "/config.php") |
|
|
|
|
and !is_writable(self::$configDir . "/config.php") |
|
|
|
|
) { |
|
|
|
|
$defaults = new OC_Defaults(); |
|
|
|
|
if (self::$CLI) { |
|
|
|
|