+++ /dev/null
-<?php
-/**
- * The Horde_Notification_Handler:: interfaces describes the handlers that
- * notify the listeners.
- *
- * Copyright 2001-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @author Jan Schneider <jan@horde.org>
- * @package Horde_Notification
- */
-interface Horde_Notification_Handler
-{
- /**
- * Registers a listener with the notification object and includes
- * the necessary library file dynamically.
- *
- * @param string $listener The name of the listener to attach. These
- * names must be unique; further listeners with
- * the same name will be ignored.
- * @param array $params A hash containing any additional configuration
- * or connection parameters a listener driver
- * might need.
- * @param string $class The class name from which the driver was
- * instantiated if not the default one. If given
- * you have to include the library file
- * containing this class yourself. This is useful
- * if you want the listener driver to be
- * overriden by an application's implementation.
- *
- * @return Horde_Notification_Listener The listener object.
- * @throws Horde_Exception
- */
- public function attach($listener, $params = null, $class = null);
-
- /**
- * Remove a listener from the notification list. This will discard any
- * notifications in this listeners stack.
- *
- * @param string $listner The name of the listener to detach.
- *
- * @throws Horde_Exception
- */
- public function detach($listener);
-
- /**
- * Replaces a listener in the notification list. This preserves all
- * notifications in this listeners stack. If the listener does not exist,
- * the new listener will be added automatically.
- *
- * @param string $listener See attach().
- * @param array $params See attach().
- * @param string $class See attach().
- *
- * @return Horde_Notification_Listener See attach()
- * @throws Horde_Exception
- */
- public function replace($listener, array $params = array(), $class = null);
-
- /**
- * Add an event to the Horde message stack.
- *
- * The event type parameter should begin with 'horde.' unless the
- * application defines its own Horde_Notification_Listener subclass that
- * handles additional codes.
- *
- * @param mixed $event Horde_Notification_Event object or message string.
- * @param integer $type The type of message: 'horde.error',
- * 'horde.warning', 'horde.success', or
- * 'horde.message'.
- * @param array $flags Array of optional flags that will be passed to the
- * registered listeners.
- */
- public function push($event, $type = null, array $flags = array());
-
- /**
- * Passes the message stack to all listeners and asks them to
- * handle their messages.
- *
- * @param array $options An array containing display options for the
- * listeners.
- */
- public function notify(array $options = array());
-
- /**
- * Convert the 'listeners' option into the format expected by the
- * notification handler.
- *
- * @param array $options An array containing display options for the
- * listeners.
- */
- public function setNotificationListeners(array &$options);
-
- /**
- * Passes the message stack to all listeners and asks them to
- * handle their messages.
- *
- * @param array $options An array containing display options for the
- * listeners. This array is required to contain the
- * correct lowercased listener names as array in the
- * entry 'listeners'.
- */
- public function notifyListeners(array $options);
-
- /**
- * Return the number of notification messages in the stack.
- *
- * @author David Ulevitch <davidu@everydns.net>
- *
- * @param string $my_listener The name of the listener.
- *
- * @return integer The number of messages in the stack.
- */
- public function count($my_listener = null);
-}
* @package Horde_Notification
*/
class Horde_Notification_Handler_Alarm
-implements Horde_Notification_Handler
+implements Horde_Notification_Handler_Interface
{
/**
* The notification handler decorated by this instance.
* @param Horde_Alarm $alarm The alarm system to notify.
*/
public function __construct(
- Horde_Notification_Handler $handler,
+ Horde_Notification_Handler_Interface $handler,
Horde_Alarm $alarm
) {
$this->_handler = $handler;
* @author Jan Schneider <jan@horde.org>
* @package Horde_Notification
*/
-class Horde_Notification_Handler_Base implements Horde_Notification_Handler
+class Horde_Notification_Handler_Base
+implements Horde_Notification_Handler_Interface
{
/**
* Hash containing all attached listener objects.
*
* @param Horde_Notification_Storage $storage The storage location to use.
*/
- public function __construct(Horde_Notification_Storage $storage)
- {
+ public function __construct(
+ Horde_Notification_Storage_Interface $storage
+ ) {
$this->_storage = $storage;
}
* @package Horde_Notification
*/
class Horde_Notification_Handler_Hordelog
-implements Horde_Notification_Handler
+implements Horde_Notification_Handler_Interface
{
/**
* The notification handler decorated by this instance.
* @param Horde_Notification_Handler $handler The handler this instance
* provides with logging.
*/
- public function __construct(Horde_Notification_Handler $handler)
- {
+ public function __construct(
+ Horde_Notification_Handler_Interface $handler
+ ) {
$this->_handler = $handler;
}
--- /dev/null
+<?php
+/**
+ * The Horde_Notification_Handler:: interfaces describes the handlers that
+ * notify the listeners.
+ *
+ * Copyright 2001-2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @author Jan Schneider <jan@horde.org>
+ * @package Horde_Notification
+ */
+interface Horde_Notification_Handler_Interface
+{
+ /**
+ * Registers a listener with the notification object and includes
+ * the necessary library file dynamically.
+ *
+ * @param string $listener The name of the listener to attach. These
+ * names must be unique; further listeners with
+ * the same name will be ignored.
+ * @param array $params A hash containing any additional configuration
+ * or connection parameters a listener driver
+ * might need.
+ * @param string $class The class name from which the driver was
+ * instantiated if not the default one. If given
+ * you have to include the library file
+ * containing this class yourself. This is useful
+ * if you want the listener driver to be
+ * overriden by an application's implementation.
+ *
+ * @return Horde_Notification_Listener The listener object.
+ * @throws Horde_Exception
+ */
+ public function attach($listener, $params = null, $class = null);
+
+ /**
+ * Remove a listener from the notification list. This will discard any
+ * notifications in this listeners stack.
+ *
+ * @param string $listner The name of the listener to detach.
+ *
+ * @throws Horde_Exception
+ */
+ public function detach($listener);
+
+ /**
+ * Replaces a listener in the notification list. This preserves all
+ * notifications in this listeners stack. If the listener does not exist,
+ * the new listener will be added automatically.
+ *
+ * @param string $listener See attach().
+ * @param array $params See attach().
+ * @param string $class See attach().
+ *
+ * @return Horde_Notification_Listener See attach()
+ * @throws Horde_Exception
+ */
+ public function replace($listener, array $params = array(), $class = null);
+
+ /**
+ * Add an event to the Horde message stack.
+ *
+ * The event type parameter should begin with 'horde.' unless the
+ * application defines its own Horde_Notification_Listener subclass that
+ * handles additional codes.
+ *
+ * @param mixed $event Horde_Notification_Event object or message string.
+ * @param integer $type The type of message: 'horde.error',
+ * 'horde.warning', 'horde.success', or
+ * 'horde.message'.
+ * @param array $flags Array of optional flags that will be passed to the
+ * registered listeners.
+ */
+ public function push($event, $type = null, array $flags = array());
+
+ /**
+ * Passes the message stack to all listeners and asks them to
+ * handle their messages.
+ *
+ * @param array $options An array containing display options for the
+ * listeners.
+ */
+ public function notify(array $options = array());
+
+ /**
+ * Convert the 'listeners' option into the format expected by the
+ * notification handler.
+ *
+ * @param array $options An array containing display options for the
+ * listeners.
+ */
+ public function setNotificationListeners(array &$options);
+
+ /**
+ * Passes the message stack to all listeners and asks them to
+ * handle their messages.
+ *
+ * @param array $options An array containing display options for the
+ * listeners. This array is required to contain the
+ * correct lowercased listener names as array in the
+ * entry 'listeners'.
+ */
+ public function notifyListeners(array $options);
+
+ /**
+ * Return the number of notification messages in the stack.
+ *
+ * @author David Ulevitch <davidu@everydns.net>
+ *
+ * @param string $my_listener The name of the listener.
+ *
+ * @return integer The number of messages in the stack.
+ */
+ public function count($my_listener = null);
+}
* @package Horde_Notification
*/
class Horde_Notification_Handler_Logged
-implements Horde_Notification_Handler
+implements Horde_Notification_Handler_Interface
{
/**
* The notification handler decorated by this instance.
* common Logger here (PEAR Log,
* Horde_Log_Logger, or Zend_Log).
*/
- public function __construct(Horde_Notification_Handler $handler, $logger)
- {
+ public function __construct(
+ Horde_Notification_Handler_Interface $handler,
+ $logger
+ ) {
$this->_handler = $handler;
$this->_logger = $logger;
}
+++ /dev/null
-<?php
-/**
- * An interface describing a storage location for notification messages.
- *
- * PHP version 5
- *
- * @category Horde
- * @package Notification
- * @author Gunnar Wrobel <wrobel@pardus.de>
- * @license http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link http://pear.horde.org/index.php?package=Notification
- */
-
-/**
- * An interface describing a storage location for notification messages.
- *
- * Copyright 2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @category Horde
- * @package Notification
- * @author Gunnar Wrobel <wrobel@pardus.de>
- * @license http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link http://pear.horde.org/index.php?package=Notification
- */
-interface Horde_Notification_Storage extends ArrayAccess
-{
- /**
- * Store a new event.
- *
- * @param string $listener The event will be stored for this listener.
- * @param array $event The event to store.
- *
- * @return NULL
- */
- public function push($listener, array $event);
-}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * An interface describing a storage location for notification messages.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package Notification
+ * @author Gunnar Wrobel <wrobel@pardus.de>
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link http://pear.horde.org/index.php?package=Notification
+ */
+
+/**
+ * An interface describing a storage location for notification messages.
+ *
+ * Copyright 2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Horde
+ * @package Notification
+ * @author Gunnar Wrobel <wrobel@pardus.de>
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link http://pear.horde.org/index.php?package=Notification
+ */
+interface Horde_Notification_Storage_Interface extends ArrayAccess
+{
+ /**
+ * Store a new event.
+ *
+ * @param string $listener The event will be stored for this listener.
+ * @param array $event The event to store.
+ *
+ * @return NULL
+ */
+ public function push($listener, array $event);
+}
\ No newline at end of file
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Notification
*/
-class Horde_Notification_Storage_Session implements Horde_Notification_Storage
+class Horde_Notification_Storage_Session
+implements Horde_Notification_Storage_Interface
{
/**
* The stack name.
<dir name="lib">
<dir name="Horde">
<dir name="Notification">
- <file name="Handler.php" role="php" />
<dir name="Handler">
<file name="Alarm.php" role="php" />
<file name="Base.php" role="php" />
<file name="Hordelog.php" role="php" />
+ <file name="Interface.php" role="php" />
<file name="Logged.php" role="php" />
</dir> <!-- /lib/Horde/Notification/Handler -->
<dir name="Listener">
</dir> <!-- /lib/Horde/Notification/Listener -->
<file name="Event.php" role="php" />
<file name="Listener.php" role="php" />
- <file name="Storage.php" role="php" />
<dir name="Storage">
+ <file name="Interface.php" role="php" />
<file name="Session.php" role="php" />
</dir> <!-- /lib/Horde/Notification/Storage -->
</dir> <!-- /lib/Horde/Notification -->
</dependencies>
<phprelease>
<filelist>
- <install name="lib/Horde/Notification/Handler.php" as="Horde/Notification/Handler.php" />
<install name="lib/Horde/Notification/Handler/Alarm.php" as="Horde/Notification/Handler/Alarm.php" />
<install name="lib/Horde/Notification/Handler/Base.php" as="Horde/Notification/Handler/Base.php" />
<install name="lib/Horde/Notification/Handler/Hordelog.php" as="Horde/Notification/Handler/Hordelog.php" />
+ <install name="lib/Horde/Notification/Handler/Interface.php" as="Horde/Notification/Handler/Interface.php" />
<install name="lib/Horde/Notification/Handler/Logged.php" as="Horde/Notification/Handler/Logged.php" />
<install name="lib/Horde/Notification/Listener/Audio.php" as="Horde/Notification/Listener/Audio.php" />
<install name="lib/Horde/Notification/Listener/Javascript.php" as="Horde/Notification/Listener/Javascript.php" />
<install name="lib/Horde/Notification/Listener/Status.php" as="Horde/Notification/Listener/Status.php" />
<install name="lib/Horde/Notification/Event.php" as="Horde/Notification/Event.php" />
<install name="lib/Horde/Notification/Listener.php" as="Horde/Notification/Listener.php" />
- <install name="lib/Horde/Notification/Storage.php" as="Horde/Notification/Storage.php" />
+ <install name="lib/Horde/Notification/Storage/Interface.php" as="Horde/Notification/Storage/Interface.php" />
<install name="lib/Horde/Notification/Storage/Session.php" as="Horde/Notification/Storage/Session.php" />
<install name="lib/Horde/Notification.php" as="Horde/Notification.php" />
<install name="test/Horde/Notification/AllTests.php" as="Horde/Notification/AllTests.php" />