mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 15:37:03 +03: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
|
// 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
|
// 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"
|
// ex: php occ config:app:set snappymail custom_config_file --value="/path/to/config.php"
|
||||||
|
// https://github.com/the-djmaze/snappymail/pull/1197
|
||||||
try {
|
try {
|
||||||
/** @var IConfig $ncConfig */
|
/** @var IConfig $ncConfig */
|
||||||
$ncConfig = \OC::$server->get(IConfig::class);
|
$ncConfig = \OC::$server->get(IConfig::class);
|
||||||
$customConfigFile = $ncConfig->getAppValue(Application::APP_ID, 'custom_config_file');
|
$customConfigFile = $ncConfig->getAppValue(Application::APP_ID, 'custom_config_file');
|
||||||
if ($customConfigFile && strpos($customConfigFile, ':') === false) {
|
if ($customConfigFile) {
|
||||||
include $customConfigFile;
|
if (!\str_contains($customConfigFile, ':') && \is_readable($customConfigFile)) {
|
||||||
|
require $customConfigFile;
|
||||||
|
} else {
|
||||||
|
throw new \Exception("not found {$customConfigFile}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$output->warning("custom config error: " . $e->getMessage());
|
$output->warning("custom config error: " . $e->getMessage());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue