@@ 430-444 (lines=15) @@ | ||
427 | * |
|
428 | * @throws \InvalidArgumentException if undefined configuration section is specified |
|
429 | */ |
|
430 | public function getConfigOf($configSection) |
|
431 | { |
|
432 | $this->assertConfigSection($configSection); |
|
433 | ||
434 | $key = self::CONFIG_PREFIX . $configSection; |
|
435 | if (!$this->has($key)) { |
|
436 | if (!$this->has($this->getConfigKey())) { |
|
437 | $this->loadConfig(); |
|
438 | } else { |
|
439 | $this->setConfigOf($configSection, null); |
|
440 | } |
|
441 | } |
|
442 | ||
443 | return $this->get($key); |
|
444 | } |
|
445 | ||
446 | /** |
|
447 | * Sets a configuration for the given section. |
|
@@ 454-466 (lines=13) @@ | ||
451 | * |
|
452 | * @throws \InvalidArgumentException if undefined configuration section is specified |
|
453 | */ |
|
454 | public function setConfigOf($configSection, $config) |
|
455 | { |
|
456 | $this->assertConfigSection($configSection); |
|
457 | ||
458 | $this->set(self::CONFIG_PREFIX . $configSection, $config); |
|
459 | ||
460 | // make sure that all config sections, including a main section, are added to the context |
|
461 | $key = $this->getConfigKey(); |
|
462 | if (!$this->has($key)) { |
|
463 | $this->set($key, null); |
|
464 | } |
|
465 | $this->ensureAllConfigSectionsSet(); |
|
466 | } |
|
467 | ||
468 | /** |
|
469 | * Gets a list of requests for configuration data. |