Skip to content

Commit 301e481

Browse files
committed
loadConfig returns config that was actually applied
1 parent 54415c1 commit 301e481

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/PhpWord/Settings.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,19 +424,21 @@ public static function loadConfig($filename = null)
424424
if ($configFile !== null) {
425425
$config = @parse_ini_file($configFile);
426426
if ($config === false) {
427-
return $config;
427+
return array();
428428
}
429429
}
430430

431431
// Set config value
432+
$appliedConfig = array();
432433
foreach ($config as $key => $value) {
433434
$method = "set{$key}";
434435
if (method_exists(__CLASS__, $method)) {
435436
self::$method($value);
437+
$appliedConfig[$key] = $value;
436438
}
437439
}
438440

439-
return $config;
441+
return $appliedConfig;
440442
}
441443

442444
/**

0 commit comments

Comments
 (0)