mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-02-04 01:09:25 -05:00
Storage: cosmetics
This commit is contained in:
parent
f769fd3855
commit
fc117217dd
3 changed files with 20 additions and 2 deletions
|
|
@ -5,8 +5,8 @@ namespace Icinga\Module\Businessprocess\Storage;
|
|||
use Icinga\Application\Benchmark;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
use Icinga\Exception\SystemPermissionException;
|
||||
use Icinga\Module\Businessprocess\BpNode;
|
||||
use Icinga\Module\Businessprocess\BpConfig;
|
||||
use Icinga\Module\Businessprocess\BpNode;
|
||||
use Icinga\Module\Businessprocess\Metadata;
|
||||
|
||||
class LegacyConfigParser
|
||||
|
|
@ -42,6 +42,12 @@ class LegacyConfigParser
|
|||
return $this->config;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @param $filename
|
||||
*
|
||||
* @return BpConfig
|
||||
*/
|
||||
public static function parseFile($name, $filename)
|
||||
{
|
||||
Benchmark::measure('Loading business process ' . $name);
|
||||
|
|
@ -51,6 +57,12 @@ class LegacyConfigParser
|
|||
return $parser->getParsedConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @param $string
|
||||
*
|
||||
* @return BpConfig
|
||||
*/
|
||||
public static function parseString($name, $string)
|
||||
{
|
||||
Benchmark::measure('Loading BP config from file: ' . $name);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class LegacyConfigRenderer
|
|||
continue;
|
||||
}
|
||||
|
||||
$str .= sprintf("# %-11s : %s\n", $key, $value);
|
||||
$str .= sprintf("# %-15s : %s\n", $key, $value);
|
||||
}
|
||||
|
||||
$str .= "#\n###################################\n\n";
|
||||
|
|
|
|||
|
|
@ -162,6 +162,12 @@ class LegacyStorage extends Storage
|
|||
return $this->getConfigDir() . '/' . $name . '.conf';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @param $string
|
||||
*
|
||||
* @return BpConfig
|
||||
*/
|
||||
public function loadFromString($name, $string)
|
||||
{
|
||||
return LegacyConfigParser::parseString($name, $string);
|
||||
|
|
|
|||
Loading…
Reference in a new issue