Skip to content
Permalink
Browse files

Add support for out-of-app config directory.

If the NEXTCLOUD_CONFIG_DIR environment variable is set, it'll be
used as the config directory.

Signed-off-by: Kyle Fazzari <kyle@canonical.com>
  • Loading branch information...
kyrofa committed Jun 14, 2016
1 parent 7bef3f1 commit 6d700a313075b153a7d3377559b874d31f6720e2
Showing with 12 additions and 2 deletions.
  1. +6 −1 core/controller/setupcontroller.php
  2. +6 −1 lib/base.php
@@ -39,7 +39,12 @@ class SetupController {
* @param Setup $setupHelper
*/
function __construct(Setup $setupHelper) {
$this->autoConfigFile = \OC::$SERVERROOT.'/config/autoconfig.php';
$config_directory = getenv('NEXTCLOUD_CONFIG_DIR');
if ($config_directory) {
$this->autoConfigFile = $config_directory.'/autoconfig.php';
} else {
$this->autoConfigFile = \OC::$SERVERROOT.'/config/autoconfig.php';
}
$this->setupHelper = $setupHelper;
}
@@ -128,7 +128,12 @@ public static function initPaths() {
} elseif(defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT . '/tests/config/')) {
self::$configDir = OC::$SERVERROOT . '/tests/config/';
} else {
self::$configDir = OC::$SERVERROOT . '/config/';
$config_directory = getenv('NEXTCLOUD_CONFIG_DIR');
if($config_directory) {
self::$configDir = $config_directory.'/';
} else {
self::$configDir = OC::$SERVERROOT . '/config/';
}
}
self::$config = new \OC\Config(self::$configDir);

0 comments on commit 6d700a3

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.