mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-16 02:30:17 +00:00
Compare commits
2 commits
250e5a0c1e
...
3dde66f2e3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3dde66f2e3 | ||
|
|
053391dfb7 |
2 changed files with 15 additions and 3 deletions
3
get-configurable-aio-variables.sh
Executable file
3
get-configurable-aio-variables.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
awk '/^ public [^f][^u][^n]/ { sub(/\$/, "", $3); print $3 }' php/src/Data/ConfigurationManager.php | sort
|
||||
|
|
@ -978,10 +978,19 @@ class ConfigurationManager
|
|||
}
|
||||
$this->setMultiple(function(ConfigurationManager $confManager) use ($input) {
|
||||
foreach ($input as $variable) {
|
||||
if (!is_string($variable) || !str_contains($variable, '=')) {
|
||||
error_log("Invalid input: '$variable' is not a string or does not contain an equal sign ('=')");
|
||||
continue;
|
||||
}
|
||||
$keyWithValue = $confManager->replaceEnvPlaceholders($variable);
|
||||
[$key, $value] = explode('=', $keyWithValue, 2);
|
||||
// Set if there's an attribute corresponding to the key.
|
||||
if (isset($key, $confManager->$key)) {
|
||||
// Pad the result with nulls so psalm is happy (and we don't risk to run into warnings in case
|
||||
// the check for an equal sign from above gets changed).
|
||||
[$key, $value] = explode('=', $keyWithValue, 2) + [null, null];
|
||||
if ($value === null) {
|
||||
error_log("Invalid input: '$keyWithValue' has no value after the equal sign");
|
||||
} else if (!property_exists($confManager, $key)) {
|
||||
error_log("Error: '$key' is not a valid configuration key (in '$keyWithValue')");
|
||||
} else {
|
||||
$confManager->$key = $value;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue