diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 14:19:56 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 14:19:56 +0200 |
commit | caff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch) | |
tree | 186d494c2aea5dea7255d3584ef5d595fc6e6194 /lib/private/Config.php | |
parent | edf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff) | |
download | nextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.tar.gz nextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.zip |
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.
This also removes and empty lines from method/function bodies at the
beginning and end.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Config.php')
-rw-r--r-- | lib/private/Config.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/private/Config.php b/lib/private/Config.php index 0c5a9b0320d..1724222f4bb 100644 --- a/lib/private/Config.php +++ b/lib/private/Config.php @@ -42,7 +42,6 @@ namespace OC; * configuration file of Nextcloud. */ class Config { - const ENV_PREFIX = 'NC_'; /** @var array Associative array ($key => $value) */ @@ -200,7 +199,7 @@ class Config { foreach ($configFiles as $file) { $fileExistsAndIsReadable = file_exists($file) && is_readable($file); $filePointer = $fileExistsAndIsReadable ? fopen($file, 'r') : false; - if($file === $this->configFilePath && + if ($file === $this->configFilePath && $filePointer === false) { // Opening the main config might not be possible, e.g. if the wrong // permissions are set (likely on a new installation) @@ -208,13 +207,13 @@ class Config { } // Try to acquire a file lock - if(!flock($filePointer, LOCK_SH)) { + if (!flock($filePointer, LOCK_SH)) { throw new \Exception(sprintf('Could not acquire a shared lock on the config file %s', $file)); } unset($CONFIG); include $file; - if(isset($CONFIG) && is_array($CONFIG)) { + if (isset($CONFIG) && is_array($CONFIG)) { $this->cache = array_merge($this->cache, $CONFIG); } @@ -246,14 +245,14 @@ class Config { chmod($this->configFilePath, 0640); // File does not exist, this can happen when doing a fresh install - if(!is_resource($filePointer)) { + if (!is_resource($filePointer)) { throw new HintException( "Can't write into config directory!", 'This can usually be fixed by giving the webserver write access to the config directory.'); } // Try to acquire a file lock - if(!flock($filePointer, LOCK_EX)) { + if (!flock($filePointer, LOCK_EX)) { throw new \Exception(sprintf('Could not acquire an exclusive lock on the config file %s', $this->configFilePath)); } |