[icinga-checkins] icinga.org: icinga-web/master: * Added socket option in configure (unused)

git at icinga.org git at icinga.org
Fri Sep 10 15:32:30 CEST 2010


Module: icinga-web
Branch: master
Commit: e4c054184966a9175539c62bc003a61794c74263
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=e4c054184966a9175539c62bc003a61794c74263

Author: Marius Hein <marius.hein at netways.de>
Date:   Wed Sep  8 16:35:10 2010 +0200

* Added socket option in configure (unused)
* Fixed some E_STRICT problems

---

 app/config/autoload.xml                            |    2 +
 .../lib/context/AppKitAgaviContext.class.php       |    4 +-
 .../lib/event/AppKitEventDispatcher.class.php      |    2 +-
 .../AppKit/lib/util/AppKitAgaviUtil.class.php      |   23 ++++++++++++++++++++
 .../models/System/CommandSenderModel.class.php     |    6 -----
 configure                                          |   14 ++++++++++++
 configure.ac                                       |    7 ++++++
 pub/index.php                                      |    2 +-
 8 files changed, 50 insertions(+), 10 deletions(-)

diff --git a/app/config/autoload.xml b/app/config/autoload.xml
index 633fe3a..e51e5c9 100755
--- a/app/config/autoload.xml
+++ b/app/config/autoload.xml
@@ -7,5 +7,7 @@
 		<autoload name="IcingaBaseModel">%core.lib_dir%/model/IcingaBaseModel.class.php</autoload>
 		<autoload name="IcingaBaseView">%core.lib_dir%/view/IcingaBaseView.class.php</autoload>
 		
+		<!-- Agavi util -->
+		<autoload name="AppKitAgaviUtil">%core.module_dir%/AppKit/lib/util/AppKitAgaviUtil.class.php</autoload>
 	</ae:configuration>
 </ae:configurations>
diff --git a/app/modules/AppKit/lib/context/AppKitAgaviContext.class.php b/app/modules/AppKit/lib/context/AppKitAgaviContext.class.php
index c1e4775..9488ccf 100755
--- a/app/modules/AppKit/lib/context/AppKitAgaviContext.class.php
+++ b/app/modules/AppKit/lib/context/AppKitAgaviContext.class.php
@@ -39,11 +39,11 @@ class AppKitAgaviContext extends AgaviContext {
 		(array)$list = AgaviConfig::get('org.icinga.appkit.init_modules', array());
 
 		if (array_search('AppKit', $list) == false) {
-			AgaviController::initializeModule('AppKit');
+			AppKitAgaviUtil::initializeModule('AppKit');
 		}
 		
 		foreach ($list as $mod_name) {
-			AgaviController::initializeModule($mod_name);
+			AppKitAgaviUtil::initializeModule($mod_name);
 		}
 
 
diff --git a/app/modules/AppKit/lib/event/AppKitEventDispatcher.class.php b/app/modules/AppKit/lib/event/AppKitEventDispatcher.class.php
index d8ee23c..2ce5af7 100755
--- a/app/modules/AppKit/lib/event/AppKitEventDispatcher.class.php
+++ b/app/modules/AppKit/lib/event/AppKitEventDispatcher.class.php
@@ -53,7 +53,7 @@ class AppKitEventDispatcher extends AppKitSingleton {
 	 * @return boolean
 	 * @author Marius Hein
 	 */
-	public function addListener($name, AppKitEventHandlerInterface &$handler) {
+	public function addListener($name, AppKitEventHandlerInterface $handler) {
 		
 		if (!array_key_exists($name, $this->listeners)) {
 			$this->listeners[$name] = array ();
diff --git a/app/modules/AppKit/lib/util/AppKitAgaviUtil.class.php b/app/modules/AppKit/lib/util/AppKitAgaviUtil.class.php
index d5d47d2..2880ab6 100644
--- a/app/modules/AppKit/lib/util/AppKitAgaviUtil.class.php
+++ b/app/modules/AppKit/lib/util/AppKitAgaviUtil.class.php
@@ -53,6 +53,29 @@ class AppKitAgaviUtil {
 		}
 		return $text;
 	}
+	
+	/**
+	 * Shortcut to initialize modules without strict warnings
+	 * @param AgaviController
+	 */
+	public static function initializeModule($moduleName) {
+		return self::getAgaviControllerInstance()->initializeModule($moduleName);
+	}
+	
+	/**
+	 * Returns a single instance of the Agavi controller to work
+	 * with non-static methods
+	 * @return AgaviController
+	 */
+	public static function getAgaviControllerInstance() {
+		static $agaviController = null;
+		
+		if ($agaviController === null) {
+			$agaviController = new AgaviController();
+		}
+		
+		return $agaviController;
+	}
 
 }
 
diff --git a/app/modules/Cronks/models/System/CommandSenderModel.class.php b/app/modules/Cronks/models/System/CommandSenderModel.class.php
index 6c824ad..8d529b9 100755
--- a/app/modules/Cronks/models/System/CommandSenderModel.class.php
+++ b/app/modules/Cronks/models/System/CommandSenderModel.class.php
@@ -59,12 +59,6 @@ class Cronks_System_CommandSenderModel extends CronksBaseModel {
 		$data = strftime('%Y-%d-%H-').  (date('i') - (date('i') % self::TIME_VALID));
 		$data .= '-'. $this->getContext()->getUser()->getNsmUser()->user_id;
 		$data .= '-'. session_id();
-		
-		// OK, pid is too hard ;-)
-		// $data .= '-'. getmypid();
-		
-		// var_dump($data);
-		
 		return hash_hmac(self::TIME_ALGO, $data, self::TIME_KEY);
 	}
 	
diff --git a/configure b/configure
index ce4bb7e..e25c65e 100755
--- a/configure
+++ b/configure
@@ -574,6 +574,7 @@ api_port
 api_host
 api_subtype
 api_type
+db_socket
 db_pass
 db_user
 db_name
@@ -653,6 +654,7 @@ with_db_port
 with_db_name
 with_db_user
 with_db_pass
+with_db_socket
 with_api_type
 with_api_subtype
 with_api_host
@@ -1293,6 +1295,7 @@ Optional Packages:
   --with-db-name=DBNAME   DB name for icinga (default icinga_web)
   --with-db-user=USER     DB user for icinga (default icinga_web)
   --with-db-pass=PASS     DB pass for icinga (default icinga_web)
+  --with-db-socket=SOCKET DB path to unix socket (default /tmp/mysql.sock)
   --with-api-type=APICON  API type (default CONNECTION_IDO)
   --with-api-subtype=TYPE DB driver or network connection
   --with-api-host=HOST    Host to connect (DB or other) (default localhost)
@@ -2346,6 +2349,16 @@ else
 fi
 
 
+
+# Check whether --with-db_socket was given.
+if test "${with_db_socket+set}" = set; then :
+  withval=$with_db_socket; db_socket=$withval
+else
+  db_socket=/tmp/mysql.sock
+
+fi
+
+
 # Configure the icinga-api
 
 
@@ -2480,6 +2493,7 @@ CFLAGS=""
 
 
 
+
 ac_config_files="$ac_config_files Makefile app/config/databases.xml app/config/icinga.xml app/modules/Web/config/module.xml etc/build.properties etc/tests/test.properties etc/apache2/icinga-web.conf pub/.htaccess pub/soap/.htaccess"
 
 
diff --git a/configure.ac b/configure.ac
index 2b2922d..13c488f 100755
--- a/configure.ac
+++ b/configure.ac
@@ -134,6 +134,12 @@ AC_ARG_WITH([db_pass],
 	db_pass=icinga_web
 )
 
+AC_ARG_WITH([db_socket],
+	AS_HELP_STRING([--with-db-socket=SOCKET], [DB path to unix socket (default /tmp/mysql.sock)]),
+	db_socket=$withval,
+	db_socket=/tmp/mysql.sock
+)
+
 # Configure the icinga-api
 
 AC_ARG_WITH([api_type],
@@ -211,6 +217,7 @@ AC_SUBST(db_port)
 AC_SUBST(db_name)
 AC_SUBST(db_user)
 AC_SUBST(db_pass)
+AC_SUBST(db_socket)
 
 AC_SUBST(api_type)
 AC_SUBST(api_subtype)
diff --git a/pub/index.php b/pub/index.php
index 9ced772..413276c 100755
--- a/pub/index.php
+++ b/pub/index.php
@@ -22,7 +22,7 @@ Agavi::bootstrap('development');
 AgaviConfig::set('core.default_context', 'web');
 
 // Main module
-AgaviController::initializeModule('AppKit');
+AppKitAgaviUtil::initializeModule('AppKit');
 
 // Some kind of agavi like bootstrap
 // hook in





More information about the icinga-checkins mailing list