From 589fb9f97f425b3d4d5ec2304b39b070bc60c6c7 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 4 Mar 2010 23:33:23 -0700 Subject: [PATCH] This function already exists in Horde_Date --- framework/Util/lib/Horde/Util.php | 61 --------------------------------------- framework/Util/package.xml | 3 +- 2 files changed, 2 insertions(+), 62 deletions(-) diff --git a/framework/Util/lib/Horde/Util.php b/framework/Util/lib/Horde/Util.php index c6a09199d..2a9549d4f 100644 --- a/framework/Util/lib/Horde/Util.php +++ b/framework/Util/lib/Horde/Util.php @@ -35,28 +35,6 @@ class Horde_Util ); /** - * TODO - * - * @var array - */ - static public $dateSymbols = array( - 'a', 'A', 'd', 'D', 'F', 'g', 'G', 'h', 'H', 'i', 'j', 'l', 'm', 'M', - 'n', 'r', 's', 'T', 'w', 'W', 'y', 'Y', 'z', 'm/d/Y', 'M', "\n", - 'g:i a', 'G:i', "\t", 'H:i:s', '%' - ); - - /** - * TODO - * - * @var array - */ - static public $strftimeSymbols = array( - '%p', '%p', '%d', '%a', '%B', '%I', '%H', '%I', '%H', '%M', '%e', - '%A', '%m', '%b', '%m', '%a, %e %b %Y %T %Z', '%S', '%Z', '%w', '%V', - '%y', '%Y', '%j', '%D', '%h', '%n', '%r', '%R', '%t', '%T', '%%' - ); - - /** * Temp directory locations. * * @var array @@ -775,45 +753,6 @@ class Horde_Util } /** - * Returns a format string to be used by strftime(). - * - * @param string $format A format string as used by date(). - * - * @return string A format string as similar as possible to $format. - */ - static public function date2strftime($format) - { - $f_len = strlen($format); - $result = ''; - - for ($pos = 0; $pos < $f_len;) { - for ($symbol = 0, $symcount = count(self::$dateSymbols); $symbol < $symcount; ++$symbol) { - if (strpos($format, self::$dateSymbols[$symbol], $pos) === $pos) { - $result .= self::$strftimeSymbols[$symbol]; - $pos += strlen(self::$dateSymbols[$symbol]); - continue 2; - } - } - $result .= substr($format, $pos, 1); - ++$pos; - } - - return $result; - } - - /** - * Returns a format string to be used by date(). - * - * @param string $format A format string as used by strftime(). - * - * @return string A format string as similar as possible to $format. - */ - static public function strftime2date($format) - { - return str_replace(self::$strftimeSymbols, self::$dateSymbols, $format); - } - - /** * Utility function to obtain PATH_INFO information. * * @return string The PATH_INFO string. diff --git a/framework/Util/package.xml b/framework/Util/package.xml index b00b6432c..4246f2efb 100644 --- a/framework/Util/package.xml +++ b/framework/Util/package.xml @@ -29,7 +29,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> beta LGPL - * Removed Horde_Util::closeWindowJs() and Horde_Util::nocacheUrl(). + * Removed Horde_Util::strftime2date() and Horde_Util::date2strftime(). + * Removed Horde_Util::closeWindowJs() and Horde_Util::nocacheUrl(). * Added Horde_Util::convertToUtf8(). * Added Horde_Util::abbreviate(). * Removed Horde_Array::combine() and Horde_Util::hmac(). -- 2.11.0