aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-09-25 18:43:04 +0200
committerLukas Reschke <lukas@owncloud.com>2014-09-30 15:53:27 +0200
commit68cf6681e5efc79610eec2199e8850ba88cc1808 (patch)
treee5684a139fe6f5a404c00b1d5f9bdc813102774a /lib/private/legacy
parent5292a14cdfa9efe6d9220b341f3261fe72c39b17 (diff)
downloadnextcloud-server-68cf6681e5efc79610eec2199e8850ba88cc1808.tar.gz
nextcloud-server-68cf6681e5efc79610eec2199e8850ba88cc1808.zip
Add flock to config
This adds a file lock to the config in hope that this prevents race conditions as reported in https://github.com/owncloud/core/issues/11070 Testplan: - [ ] Delete config.php and make it read-only => Error is thrown that it is not writeable - [ ] Installation still works - [ ] Changing config settings works (i.e. using the SMTP config switches in the administration menu) - [ ] Your PC didn't blow up - [ ] Installing the news app and the "Disable AppCode checker" app did not destroy your installation Only skip the main config Otherwise read only additional configs might not be processed Test on tmpdir
Diffstat (limited to 'lib/private/legacy')
-rw-r--r--lib/private/legacy/config.php38
1 files changed, 8 insertions, 30 deletions
diff --git a/lib/private/legacy/config.php b/lib/private/legacy/config.php
index 4d6fefc4e17..13ff0dbe040 100644
--- a/lib/private/legacy/config.php
+++ b/lib/private/legacy/config.php
@@ -6,32 +6,9 @@
* @author Jakob Sack
* @copyright 2012 Frank Karlitschek frank@owncloud.org
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-/*
- *
- * An example of config.php
- *
- * <?php
- * $CONFIG = array(
- * "database" => "mysql",
- * "firstrun" => false,
- * "pi" => 3.14
- * );
- * ?>
- *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
*/
/**
@@ -42,11 +19,13 @@
*/
class OC_Config {
- /**
- * @var \OC\Config
- */
+ /** @var \OC\Config */
public static $object;
+ /**
+ * Returns the config instance
+ * @return \OC\Config
+ */
public static function getObject() {
return self::$object;
}
@@ -92,7 +71,6 @@ class OC_Config {
* @param string $key key
*
* This function removes a key from the config.php.
- *
*/
public static function deleteKey($key) {
self::$object->deleteKey($key);