* @category Horde * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @package Notification */ class Horde_Notification { /** * Horde_Notification instances. * * @var Horde_Notification */ protected static $_instances = array(); /** * Returns a reference to the global notification handler, only * creating it if it doesn't already exist. * * This method must be invoked as: * $notification = Horde_Notification::singleton([$stack]); * * @param string $stack The name of the message stack to use. * * return Horde_Notification_Handler The Horde Notification handler. */ public static function singleton($stack = 'horde_notification_stacks') { if (!isset(self::$_instances[$stack])) { self::$_instances[$stack] = new Horde_Notification_Handler(new Horde_Notification_Storage_Session($stack)); } return self::$_instances[$stack]; } }