Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberroland committed Nov 19, 2024
1 parent 70a8f60 commit 68095d3
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions lam/lib/config.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 68095d3

Please sign in to comment.