aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Config.php
Commit message (Collapse)AuthorAgeFilesLines
* fix(config): Suppress error at install timejtr/fix-45671Josh2024-09-271-1/+2
| | | Signed-off-by: Josh <josh.t.richards@gmail.com>
* chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-191-3/+3
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* Merge branch 'master' into fix-nc-env-inclusionfix-nc-env-inclusionRobin Appelman2024-09-161-2/+2
|\ | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * fix(config): Avoid error messages for restricted opcache APIJosh2024-08-281-1/+1
| | | | | | | | | | | | | | Make changes recently added via #44230 match #8188 to avoid failures in restricted hosting environments. Fixes #47562 Signed-off-by: Josh <josh.t.richards@gmail.com>
| * style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-251-1/+1
| | | | | | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | fix: switch from explode to substr (faster)Josh Richards2024-07-081-1/+2
| | | | | | | | Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
* | fix(config): Add missing handling for envCache in getKeys()Josh Richards2024-07-081-5/+12
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | NC_ env variable overrides were not appearing in the output of `occ config:list system` nor `occ config:system:get xxx`. This was creating nearly impossible to diagnose configuration/ behavior disprepancies. - Refactored readData() so that we aren't saving the entire environment in the envCache anymore (only those prefixed "NC_") and so that we save NC_ provided config values under their real key. - Refactored getValue() to accommodate readData() refactor - Fixed getKeys() to properly return envCache keys too Environment provided config variables now appear in `occ config:list system` as expected. Environment provided config variables now appear when queried via `occ config:system:get KEY` envCache is now free of non-NC stuff. Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
* chore: Add SPDX headerAndy Scherzinger2024-05-241-35/+4
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix: regression with updating read-only configSam Bull2024-04-181-4/+0
| | | | Signed-off-by: Sam Bull <git@sambull.org>
* fix(config): correctness issues in readingVarun Patil2024-03-251-13/+26
| | | | Signed-off-by: Varun Patil <varunpatil@ucla.edu>
* 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