From: Jan Schneider Date: Thu, 29 Oct 2009 14:17:11 +0000 (+0100) Subject: Use Horde_String. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7526f22f42431f48d21de485033e65c0065894e6;p=horde.git Use Horde_String. --- diff --git a/framework/Notification/lib/Horde/Notification/Handler/Base.php b/framework/Notification/lib/Horde/Notification/Handler/Base.php index 1b687aa77..be66de113 100644 --- a/framework/Notification/lib/Horde/Notification/Handler/Base.php +++ b/framework/Notification/lib/Horde/Notification/Handler/Base.php @@ -12,8 +12,7 @@ * @author Jan Schneider * @package Horde_Notification */ -class Horde_Notification_Handler_Base -implements Horde_Notification_Handler +class Horde_Notification_Handler_Base implements Horde_Notification_Handler { /** * Hash containing all attached listener objects. @@ -69,13 +68,13 @@ implements Horde_Notification_Handler */ public function attach($listener, array $params = array(), $class = null) { - $listener = strtolower(basename($listener)); + $listener = Horde_String::lower(basename($listener)); if (!empty($this->_listeners[$listener])) { return $this->_listeners[$listener]; } if (is_null($class)) { - $class = 'Horde_Notification_Listener_' . ucfirst($listener); + $class = 'Horde_Notification_Listener_' . Horde_String::ucfirst($listener); } if (class_exists($class)) { @@ -99,7 +98,7 @@ implements Horde_Notification_Handler */ public function detach($listener) { - $listener = strtolower(basename($listener)); + $listener = Horde_String::lower(basename($listener)); if (!isset($this->_listeners[$listener])) { throw new Horde_Exception(sprintf('Notification listener %s not found.', $listener)); } @@ -122,7 +121,7 @@ implements Horde_Notification_Handler */ public function replace($listener, array $params = array(), $class = null) { - $listener = strtolower(basename($listener)); + $listener = Horde_String::lower(basename($listener)); unset($this->_listeners[$listener]); return $this->attach($listener, $params, $class); } @@ -201,7 +200,7 @@ implements Horde_Notification_Handler } elseif (!is_array($options['listeners'])) { $options['listeners'] = array($options['listeners']); } - $options['listeners'] = array_map('strtolower', $options['listeners']); + $options['listeners'] = array_map(array('Horde_String', 'lower'), $options['listeners']); } /** @@ -243,7 +242,7 @@ implements Horde_Notification_Handler } return $count; } else { - return @count($this->_storage[$this->_listeners[strtolower($my_listener)]->getName()]); + return @count($this->_storage[$this->_listeners[Horde_String::lower($my_listener)]->getName()]); } } diff --git a/framework/Notification/package.xml b/framework/Notification/package.xml index ee6a5aa4c..d80e2b688 100644 --- a/framework/Notification/package.xml +++ b/framework/Notification/package.xml @@ -97,6 +97,10 @@ http://pear.php.net/dtd/package-2.0.xsd"> gettext + + Util + pear.horde.org +