mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
commit
fc93dd2b58
@ -98,11 +98,11 @@ abstract class IniRepository extends Repository implements Extensible, Updatable
|
|||||||
}
|
}
|
||||||
|
|
||||||
$newSection = null;
|
$newSection = null;
|
||||||
foreach (iterator_to_array($this->ds) as $section => $config) {
|
|
||||||
if ($filter !== null && !$filter->matches($config)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$query = $this->ds->select();
|
||||||
|
$query->addFilter($filter);
|
||||||
|
|
||||||
|
foreach ($query as $section => $config) {
|
||||||
if ($newSection !== null) {
|
if ($newSection !== null) {
|
||||||
throw new StatementException(
|
throw new StatementException(
|
||||||
t('Cannot update. Column "%s" holds a section\'s name which must be unique'),
|
t('Cannot update. Column "%s" holds a section\'s name which must be unique'),
|
||||||
@ -150,12 +150,13 @@ abstract class IniRepository extends Repository implements Extensible, Updatable
|
|||||||
$filter = $this->requireFilter($target, $filter);
|
$filter = $this->requireFilter($target, $filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (iterator_to_array($this->ds) as $section => $config) {
|
$query = $this->ds->select();
|
||||||
if ($filter === null || $filter->matches($config)) {
|
$query->addFilter($filter);
|
||||||
$this->ds->removeSection($section);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
foreach ($query as $section => $config) {
|
||||||
|
$this->ds->removeSection($section);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->ds->saveIni();
|
$this->ds->saveIni();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user