diff --git a/modules/monitoring/application/clicommands/ListCommand.php b/modules/monitoring/application/clicommands/ListCommand.php index 5cf804a77..9020c6ec2 100644 --- a/modules/monitoring/application/clicommands/ListCommand.php +++ b/modules/monitoring/application/clicommands/ListCommand.php @@ -25,8 +25,7 @@ class ListCommand extends Command public function init() { - $this->app->setupZendAutoloader(); - $this->backend = Backend::createBackend($this->params->shift('backend')); + $this->backend = Backend::instance($this->params->shift('backend')); $this->dumpSql = $this->params->shift('showsql'); } diff --git a/modules/monitoring/application/controllers/ConfigController.php b/modules/monitoring/application/controllers/ConfigController.php index 92444b654..7c4e4315e 100644 --- a/modules/monitoring/application/controllers/ConfigController.php +++ b/modules/monitoring/application/controllers/ConfigController.php @@ -215,7 +215,7 @@ class ConfigController extends Controller $form->setTitle(sprintf($this->translate('Edit Command Transport %s'), $transportName)); $form->setIniConfig($this->Config('commandtransports')); $form->setInstanceNames( - Backend::createBackend()->select()->from('instance', array('instance_name'))->fetchColumn() + Backend::instance()->select()->from('instance', array('instance_name'))->fetchColumn() ); $form->setOnSuccess(function (TransportConfigForm $form) use ($transportName) { try { @@ -259,7 +259,7 @@ class ConfigController extends Controller $form->setTitle($this->translate('Create New Command Transport')); $form->setIniConfig($this->Config('commandtransports')); $form->setInstanceNames( - Backend::createBackend()->select()->from('instance', array('instance_name'))->fetchColumn() + Backend::instance()->select()->from('instance', array('instance_name'))->fetchColumn() ); $form->setOnSuccess(function (TransportConfigForm $form) { try { diff --git a/modules/monitoring/library/Monitoring/Controller.php b/modules/monitoring/library/Monitoring/Controller.php index dc3c75973..5af6ebb63 100644 --- a/modules/monitoring/library/Monitoring/Controller.php +++ b/modules/monitoring/library/Monitoring/Controller.php @@ -28,7 +28,7 @@ class Controller extends IcingaWebController protected function moduleInit() { - $this->backend = Backend::createBackend($this->_getParam('backend')); + $this->backend = Backend::instance($this->_getParam('backend')); $this->view->url = Url::fromRequest(); } diff --git a/modules/monitoring/test/php/regression/Bug7043Test.php b/modules/monitoring/test/php/regression/Bug7043Test.php index ba9291be6..949925f7c 100644 --- a/modules/monitoring/test/php/regression/Bug7043Test.php +++ b/modules/monitoring/test/php/regression/Bug7043Test.php @@ -53,7 +53,7 @@ class Bug7043Test extends BaseTestCase ) ))); - $defaultBackend = Backend::createBackend(); + $defaultBackend = Backend::instance(); $this->assertEquals('backendName', $defaultBackend->getName(), 'Default backend has name set'); }