From: Chuck Hagenbuch Date: Mon, 26 Jan 2009 03:44:14 +0000 (-0500) Subject: - note about componentFactory X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=aa2a035cd0c52f404548b6c6c072ecf2fd35457e;p=horde.git - note about componentFactory - static method for one-shot parsing --- diff --git a/framework/Date_Parser/lib/Horde/Date/Parser.php b/framework/Date_Parser/lib/Horde/Date/Parser.php index 6406ce56d..4a1b6d315 100644 --- a/framework/Date_Parser/lib/Horde/Date/Parser.php +++ b/framework/Date_Parser/lib/Horde/Date/Parser.php @@ -4,6 +4,13 @@ */ class Horde_Date_Parser { + public static $debug = false; + + public static function parse($text, $args = array()) + { + return self::factory($args)->parse($text, $args); + } + public static function factory($args = array()) { $locale = isset($args['locale']) ? $args['locale'] : null; @@ -26,6 +33,10 @@ class Horde_Date_Parser return new Horde_Date_Parser_Locale_Base($args); } + /** + * @TODO this should be an instance method of one of the base classes, and + * should already known the locale + */ public static function componentFactory($component, $args = array()) { $locale = isset($args['locale']) ? $args['locale'] : null;