aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-12-07 22:33:16 +0100
committerLukas Reschke <lukas@owncloud.com>2014-12-07 22:33:16 +0100
commite4255e9d54e04e9f9f88e3e05e5ae55076d71cb6 (patch)
tree72e13d39395bbdaf9e89dc580e7d1bbae4621b75
parentd571f428609967256da1a99058e46a416cde5c64 (diff)
parentbd520d2e53475d8e6a311b0a7fb6e605889e2f57 (diff)
downloadnextcloud-server-e4255e9d54e04e9f9f88e3e05e5ae55076d71cb6.tar.gz
nextcloud-server-e4255e9d54e04e9f9f88e3e05e5ae55076d71cb6.zip
Merge pull request #12644 from owncloud/add-hack-for-config
Create config if it does not exists
-rw-r--r--lib/base.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php
index 7d70f98452f..a019e9a0009 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -188,7 +188,15 @@ class OC {
public static function checkConfig() {
$l = \OC::$server->getL10N('lib');
- $configFileWritable = file_exists(self::$configDir . "/config.php") && is_writable(self::$configDir . "/config.php");
+
+ // Create config in case it does not already exists
+ $configFilePath = self::$configDir .'/config.php';
+ if(!file_exists($configFilePath)) {
+ @touch($configFilePath);
+ }
+
+ // Check if config is writable
+ $configFileWritable = is_writable($configFilePath);
if (!$configFileWritable && !OC_Helper::isReadOnlyConfigEnabled()
|| !$configFileWritable && \OCP\Util::needUpgrade()) {
if (self::$CLI) {