Skip to content

Commit

Permalink
Merge pull request #660 from gdamjan/custom-config-dir
Browse files Browse the repository at this point in the history
introduce NEXTCLOUD_CONFIG_DIR env variable (see #300)
  • Loading branch information
MorrisJobke authored Aug 9, 2016
2 parents 3a26def + 4d55926 commit 4277051
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/Controller/SetupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SetupController {
* @param Setup $setupHelper
*/
function __construct(Setup $setupHelper) {
$this->autoConfigFile = \OC::$SERVERROOT.'/config/autoconfig.php';
$this->autoConfigFile = \OC::$configDir.'autoconfig.php';
$this->setupHelper = $setupHelper;
}

Expand Down
2 changes: 1 addition & 1 deletion cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
exit(0);
}
$user = posix_getpwuid(posix_getuid());
$configUser = posix_getpwuid(fileowner(OC::$SERVERROOT . '/config/config.php'));
$configUser = posix_getpwuid(fileowner(OC::$configDir . 'config.php'));
if ($user['name'] !== $configUser['name']) {
echo "Console has to be executed with the same user as the web server is operated" . PHP_EOL;
echo "Current user: " . $user['name'] . PHP_EOL;
Expand Down
4 changes: 3 additions & 1 deletion lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ public static function initPaths() {
self::$configDir = OC::$SERVERROOT . '/' . PHPUNIT_CONFIG_DIR . '/';
} elseif(defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT . '/tests/config/')) {
self::$configDir = OC::$SERVERROOT . '/tests/config/';
} elseif($dir = getenv('NEXTCLOUD_CONFIG_DIR')) {
self::$configDir = rtrim($dir, '/') . '/';
} else {
self::$configDir = OC::$SERVERROOT . '/config/';
}
Expand Down Expand Up @@ -216,7 +218,7 @@ public static function initPaths() {
// set the right include path
set_include_path(
OC::$SERVERROOT . '/lib/private' . PATH_SEPARATOR .
OC::$SERVERROOT . '/config' . PATH_SEPARATOR .
self::$configDir . PATH_SEPARATOR .
OC::$SERVERROOT . '/3rdparty' . PATH_SEPARATOR .
implode(PATH_SEPARATOR, $paths) . PATH_SEPARATOR .
get_include_path() . PATH_SEPARATOR .
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ public function __construct($webRoot, \OC\Config $config) {
$this->registerService('MimeTypeDetector', function (Server $c) {
return new \OC\Files\Type\Detection(
$c->getURLGenerator(),
\OC::$SERVERROOT . '/config/',
\OC::$configDir,
\OC::$SERVERROOT . '/resources/config/'
);
});
Expand Down

0 comments on commit 4277051

Please sign in to comment.