From aa2a035cd0c52f404548b6c6c072ecf2fd35457e Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Sun, 25 Jan 2009 22:44:14 -0500 Subject: [PATCH] - note about componentFactory - static method for one-shot parsing --- framework/Date_Parser/lib/Horde/Date/Parser.php | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; -- 2.11.0