[icinga-checkins] icinga.org: icingaweb2-module-director/master: Hooks: get rid of legacy pre 2.1 hook classes

git at icinga.org git at icinga.org
Wed Feb 17 10:52:08 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: 7b65efee23846beb10603bff115c8b75bb7c66fc
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=7b65efee23846beb10603bff115c8b75bb7c66fc

Author: Thomas Gelf <thomas at gelf.net>
Date:   Wed Feb 17 10:49:28 2016 +0100

Hooks: get rid of legacy pre 2.1 hook classes

In case you already implemented such you have to adjust your implementations.
Just replace Director/Web/Hook with Director/Hook. Sorry for the inconvenience.
Compat classes would have been possible, but as Director isn't stable yet I'd
like to avoid doing so.

---

 library/Director/DataType/DataTypeDatalist.php          |    2 +-
 library/Director/DataType/DataTypeNumber.php            |    2 +-
 library/Director/DataType/DataTypeSqlQuery.php          |    2 +-
 library/Director/DataType/DataTypeString.php            |    2 +-
 library/Director/DataType/DataTypeTime.php              |    2 +-
 library/Director/{Web => }/Hook/DataTypeHook.php        |    2 +-
 library/Director/{Web => }/Hook/ImportSourceHook.php    |    2 +-
 .../Director/{Web => }/Hook/PropertyModifierHook.php    |    2 +-
 library/Director/{Web => }/Hook/ShipConfigFilesHook.php |    2 +-
 library/Director/Import/ImportSourceCoreApi.php         |    2 +-
 library/Director/Import/ImportSourceLdap.php            |    2 +-
 library/Director/Import/ImportSourceSql.php             |    2 +-
 run.php                                                 |   15 ++++++++-------
 13 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/library/Director/DataType/DataTypeDatalist.php b/library/Director/DataType/DataTypeDatalist.php
index 37df534..6f38e56 100644
--- a/library/Director/DataType/DataTypeDatalist.php
+++ b/library/Director/DataType/DataTypeDatalist.php
@@ -2,8 +2,8 @@
 
 namespace Icinga\Module\Director\DataType;
 
+use Icinga\Module\Director\Hook\DataTypeHook;
 use Icinga\Module\Director\Web\Form\QuickForm;
-use Icinga\Module\Director\Web\Hook\DataTypeHook;
 
 class DataTypeDatalist extends DataTypeHook
 {
diff --git a/library/Director/DataType/DataTypeNumber.php b/library/Director/DataType/DataTypeNumber.php
index 5f54dbd..d0c26b6 100644
--- a/library/Director/DataType/DataTypeNumber.php
+++ b/library/Director/DataType/DataTypeNumber.php
@@ -2,8 +2,8 @@
 
 namespace Icinga\Module\Director\DataType;
 
+use Icinga\Module\Director\Hook\DataTypeHook;
 use Icinga\Module\Director\Web\Form\QuickForm;
-use Icinga\Module\Director\Web\Hook\DataTypeHook;
 
 class DataTypeNumber extends DataTypeHook
 {
diff --git a/library/Director/DataType/DataTypeSqlQuery.php b/library/Director/DataType/DataTypeSqlQuery.php
index 84df22e..01d18bc 100644
--- a/library/Director/DataType/DataTypeSqlQuery.php
+++ b/library/Director/DataType/DataTypeSqlQuery.php
@@ -4,8 +4,8 @@ namespace Icinga\Module\Director\DataType;
 
 use Exception;
 use Icinga\Data\Db\DbConnection;
+use Icinga\Module\Director\Hook\DataTypeHook;
 use Icinga\Module\Director\Web\Form\QuickForm;
-use Icinga\Module\Director\Web\Hook\DataTypeHook;
 use Icinga\Module\Director\Util;
 
 class DataTypeSqlQuery extends DataTypeHook
diff --git a/library/Director/DataType/DataTypeString.php b/library/Director/DataType/DataTypeString.php
index 73ebcb2..db6a284 100644
--- a/library/Director/DataType/DataTypeString.php
+++ b/library/Director/DataType/DataTypeString.php
@@ -2,8 +2,8 @@
 
 namespace Icinga\Module\Director\DataType;
 
+use Icinga\Module\Director\Hook\DataTypeHook;
 use Icinga\Module\Director\Web\Form\QuickForm;
-use Icinga\Module\Director\Web\Hook\DataTypeHook;
 
 class DataTypeString extends DataTypeHook
 {
diff --git a/library/Director/DataType/DataTypeTime.php b/library/Director/DataType/DataTypeTime.php
index f360782..13b9635 100644
--- a/library/Director/DataType/DataTypeTime.php
+++ b/library/Director/DataType/DataTypeTime.php
@@ -2,8 +2,8 @@
 
 namespace Icinga\Module\Director\DataType;
 
+use Icinga\Module\Director\Hook\DataTypeHook;
 use Icinga\Module\Director\Web\Form\QuickForm;
-use Icinga\Module\Director\Web\Hook\DataTypeHook;
 
 class DataTypeTime extends DataTypeHook
 {
diff --git a/library/Director/Web/Hook/DataTypeHook.php b/library/Director/Hook/DataTypeHook.php
similarity index 95%
rename from library/Director/Web/Hook/DataTypeHook.php
rename to library/Director/Hook/DataTypeHook.php
index 3bb3dab..3ed41dc 100644
--- a/library/Director/Web/Hook/DataTypeHook.php
+++ b/library/Director/Hook/DataTypeHook.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Icinga\Module\Director\Web\Hook;
+namespace Icinga\Module\Director\Hook;
 
 use Icinga\Module\Director\Web\Form\QuickForm;
 
diff --git a/library/Director/Web/Hook/ImportSourceHook.php b/library/Director/Hook/ImportSourceHook.php
similarity index 98%
rename from library/Director/Web/Hook/ImportSourceHook.php
rename to library/Director/Hook/ImportSourceHook.php
index b834ff2..d2dfcc0 100644
--- a/library/Director/Web/Hook/ImportSourceHook.php
+++ b/library/Director/Hook/ImportSourceHook.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Icinga\Module\Director\Web\Hook;
+namespace Icinga\Module\Director\Hook;
 
 use Icinga\Module\Director\Web\Form\QuickForm;
 use Icinga\Module\Director\Db;
diff --git a/library/Director/Web/Hook/PropertyModifierHook.php b/library/Director/Hook/PropertyModifierHook.php
similarity index 97%
rename from library/Director/Web/Hook/PropertyModifierHook.php
rename to library/Director/Hook/PropertyModifierHook.php
index cda685f..98fd2b0 100644
--- a/library/Director/Web/Hook/PropertyModifierHook.php
+++ b/library/Director/Hook/PropertyModifierHook.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Icinga\Module\Director\Web\Hook;
+namespace Icinga\Module\Director\Hook;
 
 use Icinga\Module\Director\Web\Form\QuickForm;
 use Icinga\Module\Director\Db;
diff --git a/library/Director/Web/Hook/ShipConfigFilesHook.php b/library/Director/Hook/ShipConfigFilesHook.php
similarity index 72%
rename from library/Director/Web/Hook/ShipConfigFilesHook.php
rename to library/Director/Hook/ShipConfigFilesHook.php
index 6430fb9..0026c59 100644
--- a/library/Director/Web/Hook/ShipConfigFilesHook.php
+++ b/library/Director/Hook/ShipConfigFilesHook.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Icinga\Module\Director\Web\Hook;
+namespace Icinga\Module\Director\Hook;
 
 abstract class ShipConfigFilesHook
 {
diff --git a/library/Director/Import/ImportSourceCoreApi.php b/library/Director/Import/ImportSourceCoreApi.php
index 7d57419..9bec635 100644
--- a/library/Director/Import/ImportSourceCoreApi.php
+++ b/library/Director/Import/ImportSourceCoreApi.php
@@ -6,9 +6,9 @@ use Icinga\Application\Config;
 use Icinga\Module\Director\Db;
 use Icinga\Module\Director\Core\CoreApi;
 use Icinga\Module\Director\Core\RestApiClient;
+use Icinga\Module\Director\Hook\ImportSourceHook;
 use Icinga\Module\Director\Util;
 use Icinga\Module\Director\Web\Form\QuickForm;
-use Icinga\Module\Director\Web\Hook\ImportSourceHook;
 
 class ImportSourceCoreApi extends ImportSourceHook
 {
diff --git a/library/Director/Import/ImportSourceLdap.php b/library/Director/Import/ImportSourceLdap.php
index 3af8527..829a456 100644
--- a/library/Director/Import/ImportSourceLdap.php
+++ b/library/Director/Import/ImportSourceLdap.php
@@ -3,9 +3,9 @@
 namespace Icinga\Module\Director\Import;
 
 use Icinga\Data\ResourceFactory;
+use Icinga\Module\Director\Hook\ImportSourceHook;
 use Icinga\Module\Director\Util;
 use Icinga\Module\Director\Web\Form\QuickForm;
-use Icinga\Module\Director\Web\Hook\ImportSourceHook;
 
 class ImportSourceLdap extends ImportSourceHook
 {
diff --git a/library/Director/Import/ImportSourceSql.php b/library/Director/Import/ImportSourceSql.php
index 77b9c97..4070936 100644
--- a/library/Director/Import/ImportSourceSql.php
+++ b/library/Director/Import/ImportSourceSql.php
@@ -3,9 +3,9 @@
 namespace Icinga\Module\Director\Import;
 
 use Icinga\Data\Db\DbConnection;
+use Icinga\Module\Director\Hook\ImportSourceHook;
 use Icinga\Module\Director\Util;
 use Icinga\Module\Director\Web\Form\QuickForm;
-use Icinga\Module\Director\Web\Hook\ImportSourceHook;
 
 class ImportSourceSql extends ImportSourceHook
 {
diff --git a/run.php b/run.php
index d6da070..7295950 100644
--- a/run.php
+++ b/run.php
@@ -2,12 +2,13 @@
 
 $this->provideHook('monitoring/HostActions');
 $this->provideHook('monitoring/ServiceActions');
-$this->registerHook('Director\\ImportSource', '\\Icinga\\Module\\Director\\Import\\ImportSourceSql', 'sql');
-$this->registerHook('Director\\ImportSource', '\\Icinga\\Module\\Director\\Import\\ImportSourceLdap', 'ldap');
+
+$this->provideHook('director/ImportSource', '\\Icinga\\Module\\Director\\Import\\ImportSourceSql');
+$this->provideHook('director/ImportSource', '\\Icinga\\Module\\Director\\Import\\ImportSourceLdap');
 $this->provideHook('director/ImportSource', '\\Icinga\\Module\\Director\\Import\\ImportSourceCoreApi');
 
-$this->registerHook('Director\\DataType', '\\Icinga\\Module\\Director\\DataType\\DataTypeString', 'string');
-$this->registerHook('Director\\DataType', '\\Icinga\\Module\\Director\\DataType\\DataTypeNumber', 'number');
-$this->registerHook('Director\\DataType', '\\Icinga\\Module\\Director\\DataType\\DataTypeTime', 'time');
-$this->registerHook('Director\\DataType', '\\Icinga\\Module\\Director\\DataType\\DataTypeDatalist', 'datalist');
-$this->registerHook('Director\\DataType', '\\Icinga\\Module\\Director\\DataType\\DataTypeSqlQuery', 'sqlquery');
+$this->provideHook('director/DataType', '\\Icinga\\Module\\Director\\DataType\\DataTypeString');
+$this->provideHook('director/DataType', '\\Icinga\\Module\\Director\\DataType\\DataTypeNumber');
+$this->provideHook('director/DataType', '\\Icinga\\Module\\Director\\DataType\\DataTypeTime');
+$this->provideHook('director/DataType', '\\Icinga\\Module\\Director\\DataType\\DataTypeDatalist');
+$this->provideHook('director/DataType', '\\Icinga\\Module\\Director\\DataType\\DataTypeSqlQuery');



More information about the icinga-checkins mailing list