mirror of
https://github.com/LDAPAccountManager/lam.git
synced 2025-10-06 03:49:56 +02:00
refactoring
This commit is contained in:
parent
70a8f60026
commit
68095d3c40
1 changed files with 4 additions and 14 deletions
|
@ -585,24 +585,14 @@ class ServerProfilePersistenceStrategyFiles implements ServerProfilePersistenceS
|
|||
// search keywords
|
||||
$parts = explode(': ', $line);
|
||||
$keyword = $parts[0];
|
||||
$keyword = trim($keyword, ':');
|
||||
$startIndex = strlen($keyword) + 2;
|
||||
if (sizeof($parts) == 1) {
|
||||
// empty global settings
|
||||
$value = (sizeof($parts) > 1) ? substr($line, $startIndex) : '';
|
||||
if (!in_array($keyword, ['modules', 'types', 'tools', 'jobs'])) {
|
||||
try {
|
||||
$property = $reflectionConfig->getProperty($keyword);
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($config, '');
|
||||
}
|
||||
catch (ReflectionException) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
elseif ((sizeof($parts) > 1) && !in_array($keyword, ['modules', 'types', 'tools', 'jobs'])) {
|
||||
// global setting with value
|
||||
try {
|
||||
$property = $reflectionConfig->getProperty($keyword);
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($config, substr($line, $startIndex));
|
||||
$property->setValue($config, $value);
|
||||
}
|
||||
catch (ReflectionException) {
|
||||
// ignore
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue