Skip to content

Commit 9b97ca5

Browse files
committed
Fixed calling Classes when generate config
1 parent c3d6710 commit 9b97ca5

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/apply.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126

127127
if (strstr($line, 'has no services associated with it!')) {
128128
preg_match("/\'(.*)\'/", $line, $keywords);
129-
$host = & $generator->IEClasses['host'];
129+
$host = & $generator->Classes['host'];
130130
$host->setmyKeyColumn($host->nameColumn);
131131
$host->loadFromSQL($keywords[1]);
132132
$host->resetObjectIdentity();

src/classes/engine/Importer.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Importer extends Configurator
2222
* Pole parsovacích tříd
2323
* @var array
2424
*/
25-
public $IEClasses = [];
25+
public $Classes = [];
2626

2727
/**
2828
* Třída pro hromadné operace s konfigurací
@@ -32,14 +32,14 @@ class Importer extends Configurator
3232
public function __construct($params = null)
3333
{
3434
parent::__construct();
35-
$this->registerClass('\Icinga\Editor\Engine\IETimeperiod');
36-
$this->registerClass('\Icinga\Editor\Engine\IECommand');
37-
$this->registerClass('\Icinga\Editor\Engine\IEService');
38-
$this->registerClass('\Icinga\Editor\Engine\IEServicegroup');
39-
$this->registerClass('\Icinga\Editor\Engine\IEContact');
40-
$this->registerClass('\Icinga\Editor\Engine\IEContactgroup');
41-
$this->registerClass('\Icinga\Editor\Engine\IEHost');
42-
$this->registerClass('\Icinga\Editor\Engine\IEHostgroup');
35+
$this->registerClass('\Icinga\Editor\Engine\Timeperiod');
36+
$this->registerClass('\Icinga\Editor\Engine\Command');
37+
$this->registerClass('\Icinga\Editor\Engine\Service');
38+
$this->registerClass('\Icinga\Editor\Engine\Servicegroup');
39+
$this->registerClass('\Icinga\Editor\Engine\Contact');
40+
$this->registerClass('\Icinga\Editor\Engine\Contactgroup');
41+
$this->registerClass('\Icinga\Editor\Engine\Host');
42+
$this->registerClass('\Icinga\Editor\Engine\Hostgroup');
4343
if (is_array($params)) {
4444
$this->setData($params);
4545
}
@@ -53,15 +53,15 @@ public function __construct($params = null)
5353
public function registerClass($className)
5454
{
5555
$newClass = new $className;
56-
$this->IEClasses[$newClass->keyword] = new $className;
56+
$this->Classes[$newClass->keyword] = new $className;
5757
}
5858

5959
/**
6060
* Znovu vytvoří struktury tabulek obejktů
6161
*/
6262
public function dbInit()
6363
{
64-
foreach ($this->IEClasses as $IEClass) {
64+
foreach ($this->Classes as $IEClass) {
6565
$IEClass->dbInit();
6666
}
6767
}
@@ -117,7 +117,7 @@ public function importCfg($cfg)
117117
$this->setDataValue('register', 1);
118118
}
119119

120-
foreach ($this->IEClasses as $IEClass) {
120+
foreach ($this->Classes as $IEClass) {
121121
$doneCount += $IEClass->importArray($cfg, $this->getData());
122122
}
123123
if ($doneCount) {
@@ -137,7 +137,7 @@ public function importCfg($cfg)
137137
*/
138138
public function writeConfigs($fileName)
139139
{
140-
foreach ($this->IEClasses as $ieClass) {
140+
foreach ($this->Classes as $ieClass) {
141141
if ($ieClass->writeConfig($fileName)) {
142142
$this->addStatusMessage($ieClass->keyword.': '._('konfigurace byla vygenerována'),
143143
'success');

src/importer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
if ($oPage->isPosted() && $class) {
1616
$data = $_POST;
1717
$importer = new Engine\Importer();
18-
$recorder = $importer->IEClasses[$class];
18+
$recorder = $importer->Classes[$class];
1919
unset($data[$recorder->myKeyColumn]);
2020
unset($data[$recorder->userColumn]);
2121
$recorder->importDataRow($data);
@@ -24,7 +24,7 @@
2424
$recorder->restoreObjectIdentity();
2525
if ($iresult) {
2626
$recorder->loadFromSql($recorder->getName());
27-
echo $importer->IEClasses[$class]->keyword . ': ' . $iresult . ' (#' . $recorder->getId() . ')';
27+
echo $importer->Classes[$class]->keyword . ': ' . $iresult . ' (#' . $recorder->getId() . ')';
2828
} else {
2929
echo 'false';
3030
}

src/regenall.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132

133133
if (strstr($line, 'has no services associated with it!')) {
134134
preg_match("/\'(.*)\'/", $line, $keywords);
135-
$host = & $generator->IEClasses['host'];
135+
$host = & $generator->Classes['host'];
136136
$host->setmyKeyColumn($host->nameColumn);
137137
$host->loadFromSQL($keywords[1]);
138138
$host->resetObjectIdentity();

0 commit comments

Comments
 (0)