mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-26 17:16:07 +08:00
Improved #1197
This commit is contained in:
parent
2f746cb262
commit
eab3d8d938
1 changed files with 7 additions and 2 deletions
|
@ -94,12 +94,17 @@ class InstallStep implements IRepairStep
|
|||
// check if admins provided additional/custom initial config file
|
||||
// https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#setting-a-single-configuration-value
|
||||
// ex: php occ config:app:set snappymail custom_config_file --value="/path/to/config.php"
|
||||
// https://github.com/the-djmaze/snappymail/pull/1197
|
||||
try {
|
||||
/** @var IConfig $ncConfig */
|
||||
$ncConfig = \OC::$server->get(IConfig::class);
|
||||
$customConfigFile = $ncConfig->getAppValue(Application::APP_ID, 'custom_config_file');
|
||||
if ($customConfigFile && strpos($customConfigFile, ':') === false) {
|
||||
include $customConfigFile;
|
||||
if ($customConfigFile) {
|
||||
if (!\str_contains($customConfigFile, ':') && \is_readable($customConfigFile)) {
|
||||
require $customConfigFile;
|
||||
} else {
|
||||
throw new \Exception("not found {$customConfigFile}");
|
||||
}
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
$output->warning("custom config error: " . $e->getMessage());
|
||||
|
|
Loading…
Reference in a new issue