aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Config.php
Commit message (Collapse)AuthorAgeFilesLines
* add a check for disk_free_space in Config.phpSimon L2023-03-071-4/+6
| | | | Signed-off-by: Simon L <szaimen@e.mail.de>
* Fix integer overflow on 32-bit systems when testing free space for writing a ↵Sergei Golovan2023-02-201-1/+1
| | | | config file.
* address review by JoasSimon L2023-02-151-2/+3
| | | | Signed-off-by: Simon L <szaimen@e.mail.de>
* add a disk_free_space check before writing configSimon L2023-02-131-0/+6
| | | | Signed-off-by: Simon L <szaimen@e.mail.de>
* Revert "Make config file saving safe against write failures"Joas Schilling2022-09-191-29/+25
|
* Merge pull request #34009 from andrey-utkin/safe-config-updateCôme Chilliet2022-09-151-25/+29
|\ | | | | Make config file saving safe against write failures
| * Make config file saving safe against write failuresAndriy Utkin2022-09-091-25/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of disk space depletion, writing a new version of config fails, leaving the config file empty. This patch improves safety of updates to config.php by saving the new version of the config into a randomly-named temporary file in the same directory, and then renaming it to config.php, which renaming is atomic in POSIX-compliant filesystems and shouldn't involve disk space allocation. If writing the new config version is impossible, the current config remains unchanged. This patch drops the use of file locking as unnecessary. File locking merely established order in which the concurrent independent processes attempted file writing. In the end, the process which was last to update the file "wins" - their changes persist and the changes of previous writers are dropped as there's no conflict detection or change merging mechanism anyway. With the current change, there is still some resulting ordering, and the last writer still wins in the same way. Readers don't need file locking as well, as opening config.php for reading always provides a certain consistent version of the file. Signed-off-by: Andriy Utkin <dev@autkin.net>
* | Do not empty config.php file if reading failed for any reasonCôme Chilliet2022-09-061-0/+4
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Detect leading spaces in config filesVincent Petry2022-08-031-0/+8
| | | | | | | Because those will cause PHP to output to stdout and will cause unrelated error messages. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Don't write to config file if `config_is_read_only` is setJonas Meurer2021-12-131-0/+26
| | | | | | | | Also don't write to cache in this case to prevent cache and config file being out of sync. Fixes: #29901 Signed-off-by: Jonas Meurer <jonas@freesources.org>
* Migrate HintException to OCPGary Kim2021-06-301-0/+2
| | | | Signed-off-by: Gary Kim <gary@garykim.dev>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-2/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Update all license headers for Nextcloud 21Christoph Wurst2020-12-161-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Read the env variables only onceRoeland Jago Douma2020-11-021-3/+7
| | | | | | | We read config.php an awefull lot of times. So it only makes sense to kill this as much as wel can. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update license headers for 19Christoph Wurst2020-04-291-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add visibility to all constantsChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-6/+5
| | | | | | | | | | | | | | | 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>
* Remove spaces after method or function callChristoph Wurst2020-04-091-3/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #20241 from nextcloud/fix/license-headers-19Roeland Jago Douma2020-04-011-0/+1
|\ | | | | Update the license headers for Nextcloud 19
| * Update the license headers for Nextcloud 19Christoph Wurst2020-03-311-0/+1
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Update Config.phpJohn Molakvoæ2020-03-281-4/+1
|/
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-051-1/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Some php-cs fixesRoeland Jago Douma2019-11-221-1/+0
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Remove deleteFromOpcodeCache & clearOpcodeCacheDaniel Kesselberg2019-01-301-4/+2
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Fix some typosMorris Jobke2018-03-211-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update license headersMorris Jobke2017-11-061-0/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Fix escaped HTML on error pagesMorris Jobke2017-05-081-2/+1
| | | | | | * fixes #4655 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Check for boolean false and add testsMorris Jobke2017-04-041-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* OC_ -> NC_Morris Jobke2017-04-041-2/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Override config.php values through ENV variables (#26570)Philipp Schaffrath2017-04-041-2/+12
| | | | | | | | * added functionality to override config.php values with 'OC_' prefixed environment variables * use getenv to read environment variables since apache does not set $_ENV variables, fixed test Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update with robinJoas Schilling2016-07-211-1/+1
|
* Fix othersJoas Schilling2016-07-211-2/+3
|
* Show error message if config file is not readableMorris Jobke2016-06-211-3/+3
| | | | | | * when the config file is not writable there is a error message shown * same happens now if the config file is not readable * fixes #180
* Update license headersLukas Reschke2016-05-261-2/+2
|
* Moved some files in \OC to PSR-4Roeland Jago Douma2016-04-291-0/+264
* \OC\ActivityManager * \OC\AllConfig * \OC\AppConfig * \OC\AppHelper * \OC\Avatar * \OC\AvatarManager * \OC\CapabilitiesManager * \OC\Config * \OC\ContactsManager * \OC\DatabaseException * \OC\DatabaseSetupException