IcingaConfigFile: remove different implementations

One size fits all ;)
This commit is contained in:
Thomas Gelf 2015-06-17 10:03:31 +02:00
parent 774174052a
commit ed8e472cba
7 changed files with 10 additions and 37 deletions

View File

@ -1,8 +0,0 @@
<?php
namespace Icinga\Module\Director\IcingaConfig;
class IcingaCommandsConfigFile extends IcingaConfigFile
{
protected $content = "library \"methods\"\n\n";
}

View File

@ -48,7 +48,10 @@ class IcingaConfig
$class = 'Icinga\\Module\\Director\\IcingaConfig\\Icinga' $class = 'Icinga\\Module\\Director\\IcingaConfig\\Icinga'
. ucfirst($type) . ucfirst($type)
. 'sConfigFile'; . 'sConfigFile';
$file = new $class(); $file = new IcingaConfigFile();
if ($type === 'command') {
$file->prepend("library \"methods\"\n\n");
}
$file->addObjects($objects); $file->addObjects($objects);
$this->files[$type . 's.conf'] = $file; $this->files[$type . 's.conf'] = $file;
} }

View File

@ -8,6 +8,12 @@ class IcingaConfigFile
{ {
protected $content; protected $content;
public function prepend($content)
{
$this->content = $content . $this->content;
return $this;
}
public function getContent() public function getContent()
{ {
return $this->content; return $this->content;

View File

@ -1,7 +0,0 @@
<?php
namespace Icinga\Module\Director\IcingaConfig;
class IcingaHostsConfigFile extends IcingaConfigFile
{
}

View File

@ -1,7 +0,0 @@
<?php
namespace Icinga\Module\Director\IcingaConfig;
class IcingaServicesConfigFile extends IcingaConfigFile
{
}

View File

@ -1,7 +0,0 @@
<?php
namespace Icinga\Module\Director\IcingaConfig;
class IcingaUsersConfigFile extends IcingaConfigFile
{
}

View File

@ -1,7 +0,0 @@
<?php
namespace Icinga\Module\Director\IcingaConfig;
class IcingaZonesConfigFile extends IcingaConfigFile
{
}