From: Chuck Hagenbuch Date: Fri, 22 May 2009 02:18:11 +0000 (-0400) Subject: add a stub debug() method to aid in debugging X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=3c8a37a215ca469db6ed0749ef4c37af5a566810;p=horde.git add a stub debug() method to aid in debugging --- diff --git a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base.php b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base.php index 4e6527060..5cf3388fe 100644 --- a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base.php +++ b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base.php @@ -258,6 +258,7 @@ class Horde_Date_Parser_Locale_Base foreach ($this->definitions['date'] as $handler) { if ($handler->match($tokens, $this->definitions)) { $goodTokens = array_values(array_filter($tokens, create_function('$o', 'return !$o->getTag("separator");'))); + $this->debug($handler->handlerMethod, $goodTokens, $options); return call_user_func(array($this, $handler->handlerMethod), $goodTokens, $options); } } @@ -266,6 +267,7 @@ class Horde_Date_Parser_Locale_Base foreach ($this->definitions['anchor'] as $handler) { if ($handler->match($tokens, $this->definitions)) { $goodTokens = array_values(array_filter($tokens, create_function('$o', 'return !$o->getTag("separator");'))); + $this->debug($handler->handlerMethod, $goodTokens, $options); return call_user_func(array($this, $handler->handlerMethod), $goodTokens, $options); } } @@ -274,6 +276,7 @@ class Horde_Date_Parser_Locale_Base foreach ($this->definitions['arrow'] as $handler) { if ($handler->match($tokens, $this->definitions)) { $goodTokens = array_values(array_filter($tokens, create_function('$o', 'return !$o->getTag("separator_at") && !$o->getTag("separator_slash_or_dash") && !$o->getTag("separator_comma");'))); + $this->debug($handler->handlerMethod, $goodTokens, $options); return call_user_func(array($this, $handler->handlerMethod), $goodTokens, $options); } } @@ -282,6 +285,7 @@ class Horde_Date_Parser_Locale_Base foreach ($this->definitions['narrow'] as $handler) { if ($handler->match($tokens, $this->definitions)) { //good_tokens = tokens.select { |o| !o.get_tag Separator } + $this->debug($handler->handlerMethod, $tokens, $options); return call_user_func(array($this, $handler->handlerMethod), $tokens, $options); } } @@ -289,7 +293,6 @@ class Horde_Date_Parser_Locale_Base return null; } - public function dayOrTime($dayStart, $timeTokens, $options) { $outerSpan = new Horde_Date_Span($dayStart, $dayStart->add(array('day' => 1))); @@ -498,6 +501,18 @@ class Horde_Date_Parser_Locale_Base /*########################################################################## + # Logging Methods + ##########################################################################*/ + + public function debug($method, $args) + { + $args = func_get_args(); + $method = array_shift($args); + // echo "$method\n"; + } + + + /*########################################################################## # Support Methods ##########################################################################*/