mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-31 18:59:34 -05:00
ShipConfigFiles: director hook sample
This commit is contained in:
parent
90a19fee4d
commit
3a704a0c52
2 changed files with 29 additions and 0 deletions
25
library/Businessprocess/Director/ShipConfigFiles.php
Normal file
25
library/Businessprocess/Director/ShipConfigFiles.php
Normal 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
4
run.php
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
|
||||
$this->registerHook('Director\\ShipConfigFiles', '\\Icinga\\Module\\Businessprocess\\Director\\ShipConfigFiles');
|
||||
|
||||
Loading…
Reference in a new issue