mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
Remove unused "extends"-code
This commit is contained in:
parent
7095ad5bc7
commit
28e1b3119c
@ -173,18 +173,13 @@ class IniEditor
|
|||||||
* Create the section if it does not exist and set the properties
|
* Create the section if it does not exist and set the properties
|
||||||
*
|
*
|
||||||
* @param string $section The section name
|
* @param string $section The section name
|
||||||
* @param array $extend The section that should be extended by this section
|
|
||||||
*/
|
*/
|
||||||
public function setSection($section, $extend = null)
|
public function setSection($section)
|
||||||
{
|
{
|
||||||
if (false !== strpos($section, '[') || false !== strpos($section, ']')) {
|
if (false !== strpos($section, '[') || false !== strpos($section, ']')) {
|
||||||
throw new ConfigurationError('Brackets not allowed in section: %s', $section);
|
throw new ConfigurationError('Brackets not allowed in section: %s', $section);
|
||||||
}
|
}
|
||||||
if (isset($extend)) {
|
$decl = '[' . $section . ']';
|
||||||
$decl = '[' . $section . ' : ' . $extend . ']';
|
|
||||||
} else {
|
|
||||||
$decl = '[' . $section . ']';
|
|
||||||
}
|
|
||||||
$line = $this->getSectionLine($section);
|
$line = $this->getSectionLine($section);
|
||||||
if ($line !== -1) {
|
if ($line !== -1) {
|
||||||
$this->deleteLine($line);
|
$this->deleteLine($line);
|
||||||
|
@ -151,10 +151,7 @@ class IniWriter extends Zend_Config_Writer_FileAbstract
|
|||||||
if ($value instanceof Zend_Config) {
|
if ($value instanceof Zend_Config) {
|
||||||
// The value is a nested Zend_Config, handle it recursively
|
// The value is a nested Zend_Config, handle it recursively
|
||||||
if ($section === null) {
|
if ($section === null) {
|
||||||
// Update the section declaration
|
$editor->setSection($key);
|
||||||
$extends = $newconfig->getExtends();
|
|
||||||
$extend = array_key_exists($key, $extends) ? $extends[$key] : null;
|
|
||||||
$editor->setSection($key, $extend);
|
|
||||||
}
|
}
|
||||||
if ($oldvalue === null) {
|
if ($oldvalue === null) {
|
||||||
$oldvalue = new Zend_Config(array());
|
$oldvalue = new Zend_Config(array());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user