[evolvis-commits] r14645: Add Codendi system_event glue↵

mirabilos at evolvis.org mirabilos at evolvis.org
Mon Feb 28 04:41:34 CET 2011


Author: mirabilos
Date: 2011-02-28 04:41:34 +0100 (Mon, 28 Feb 2011)
New Revision: 14645

Added:
   trunk/gforge_base/evolvisforge-5.1/gforge/common/system_event/
   trunk/gforge_base/evolvisforge-5.1/gforge/common/system_event/SystemEvent.class.php
   trunk/gforge_base/evolvisforge-5.1/gforge/common/system_event/SystemEventManager.class.php
Log:
Add Codendi system_event glue


Added: trunk/gforge_base/evolvisforge-5.1/gforge/common/system_event/SystemEvent.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/common/system_event/SystemEvent.class.php	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/common/system_event/SystemEvent.class.php	2011-02-28 03:41:34 UTC (rev 14645)
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
+ *
+ * This file is a part of Codendi.
+ *
+ * Codendi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Codendi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * 
+ */
+
+
+
+/**
+ * System Event class
+ *
+ */
+abstract class SystemEvent {
+
+  const PRIORITY_MEDIUM = 2; 
+}
+
+?>
+

Added: trunk/gforge_base/evolvisforge-5.1/gforge/common/system_event/SystemEventManager.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/common/system_event/SystemEventManager.class.php	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/common/system_event/SystemEventManager.class.php	2011-02-28 03:41:34 UTC (rev 14645)
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
+ *
+ * This file is a part of Codendi.
+ *
+ * Codendi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Codendi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * 
+ */
+
+/**
+* Manager of system events
+*
+* Base class to manage system events
+*/
+class SystemEventManager {
+    
+   
+
+    // Constructor
+    function SystemEventManager() {
+       
+    }
+
+    protected static $_instance;
+    /**
+     * SystemEventManager is singleton
+     */
+    public static function instance() {
+        if (!isset(self::$_instance)) {
+            $c = __CLASS__;
+            self::$_instance = new $c;
+        }
+        return self::$_instance;
+    }
+ 
+    /**
+     * Create a new event, store it in the db and send notifications
+     */
+    public function createEvent($type, $parameters, $priority) {
+        $sql = "INSERT INTO system_event (type, parameters,create_date,log) VALUES ('".$type."','".$parameters['group_list_id']."','".$_SERVER['REQUEST_TIME']."', 'NEW');";
+		return db_query($sql);
+        }
+    
+    
+    
+      
+             
+}
+
+?>
+



More information about the evolvis-commits mailing list