diff --git a/application/forms/DeployConfigForm.php b/application/forms/DeployConfigForm.php index e0e88468..e387394a 100644 --- a/application/forms/DeployConfigForm.php +++ b/application/forms/DeployConfigForm.php @@ -3,7 +3,7 @@ namespace Icinga\Module\Director\Forms; use Icinga\Exception\IcingaException; -use Icinga\Module\Director\Core\CoreApi; +use Icinga\Module\Director\Core\DeploymentApiInterface; use Icinga\Module\Director\Db; use Icinga\Module\Director\IcingaConfig\IcingaConfig; // use Icinga\Module\Director\Objects\DirectorDeploymentLog; @@ -12,7 +12,7 @@ use Icinga\Module\Director\Web\Form\QuickForm; class DeployConfigForm extends QuickForm { - /** @var CoreApi */ + /** @var DeploymentApiInterface */ private $api; /** @var Db */ @@ -114,7 +114,7 @@ class DeployConfigForm extends QuickForm return $this; } - public function setApi(CoreApi $api) + public function setApi(DeploymentApiInterface $api) { $this->api = $api; return $this; diff --git a/library/Director/Core/CoreApi.php b/library/Director/Core/CoreApi.php index 535c2607..328479db 100644 --- a/library/Director/Core/CoreApi.php +++ b/library/Director/Core/CoreApi.php @@ -11,7 +11,7 @@ use Icinga\Module\Director\Objects\IcingaCommand; use Icinga\Module\Director\Objects\DirectorDeploymentLog; use Icinga\Module\Director\Objects\IcingaZone; -class CoreApi +class CoreApi implements DeploymentApiInterface { protected $client; @@ -614,7 +614,7 @@ constants $this->client->request('post', $url, null, false, true); } - public function dumpConfig(IcingaConfig $config, $db, $moduleName = 'director') + public function dumpConfig(IcingaConfig $config, Db $db, $moduleName = 'director') { $start = microtime(true); $deployment = DirectorDeploymentLog::create(array( diff --git a/library/Director/Core/DeploymentApiInterface.php b/library/Director/Core/DeploymentApiInterface.php new file mode 100644 index 00000000..1e42e97c --- /dev/null +++ b/library/Director/Core/DeploymentApiInterface.php @@ -0,0 +1,75 @@ +