ShipConfigFiles: director hook sample

This commit is contained in:
Thomas Gelf 2015-10-16 22:53:04 +02:00
parent 90a19fee4d
commit 3a704a0c52
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,25 @@
<?php
namespace Icinga\Module\Businessprocess\Director;
use Icinga\Application\Config;
use Icinga\Module\Director\Web\Hook\ShipConfigFilesHook;
use Icinga\Module\Businessprocess\Storage\LegacyStorage;
class ShipConfigFiles extends ShipConfigFilesHook
{
public function fetchFiles()
{
$files = array();
$storage = new LegacyStorage(
Config::module('businessprocess')->getSection('global')
);
foreach ($storage->listProcesses() as $name => $title) {
$files['processes/' . $name . '.bp'] = $storage->getSource($name);
}
return $files;
}
}

4
run.php Normal file
View file

@ -0,0 +1,4 @@
<?php
$this->registerHook('Director\\ShipConfigFiles', '\\Icinga\\Module\\Businessprocess\\Director\\ShipConfigFiles');