fdd12ccbcea647ee6194097356719eb4c056ce88

Author: AD7six

Date: 2009-05-27 15:35:17 +0200

changing all __ lookups to be __d('debug_kit' Adding locale files Minor whitespace changes

diff --git a/controllers/components/toolbar.php b/controllers/components/toolbar.php index 92aad6c..02fff3f 100644 --- a/controllers/components/toolbar.php +++ b/controllers/components/toolbar.php @@ -19,18 +19,21 @@ **/ class ToolbarComponent extends Object { var $settings = array(); + /** * Controller instance reference * * @var object */ var $controller; + /** * Components used by DebugToolbar * * @var array */ var $components = array('RequestHandler'); + /** * The default panels the toolbar uses. * which panels are used can be configured when attaching the component @@ -38,12 +41,14 @@ class ToolbarComponent extends Object { * @var array */ var $_defaultPanels = array('history', 'session', 'request', 'sqlLog', 'timer', 'log', 'variables'); + /** * Loaded panel objects. * * @var array */ var $panels = array(); + /** * javascript files component will be using * @@ -83,7 +88,7 @@ class ToolbarComponent extends Object { } App::import('Vendor', 'DebugKit.DebugKitDebugger'); - DebugKitDebugger::startTimer('componentInit', __('Component initialization and startup', true)); + DebugKitDebugger::startTimer('componentInit', __d('debug_kit', 'Component initialization and startup', true)); $panels = $this->_defaultPanels; if (isset($settings['panels'])) { @@ -132,7 +137,7 @@ class ToolbarComponent extends Object { $this->panels[$panelName]->startup($controller); } DebugKitDebugger::stopTimer('componentInit'); - DebugKitDebugger::startTimer('controllerAction', __('Controller Action', true)); + DebugKitDebugger::startTimer('controllerAction', __d('debug_kit', 'Controller Action', true)); } /** @@ -159,7 +164,7 @@ class ToolbarComponent extends Object { $this->_saveState($controller, $vars); $controller->set(array('debugToolbarPanels' => $vars, 'debugToolbarJavascript' => $this->javascript)); - DebugKitDebugger::startTimer('controllerRender', __('Render Controller Action', true)); + DebugKitDebugger::startTimer('controllerRender', __d('debug_kit', 'Render Controller Action', true)); } /** @@ -223,7 +228,7 @@ class ToolbarComponent extends Object { foreach ($panels as $panel) { $className = $panel . 'Panel'; if (!class_exists($className) && !App::import('Vendor', $className)) { - trigger_error(sprintf(__('Could not load DebugToolbar panel %s', true), $panel), E_USER_WARNING); + trigger_error(sprintf(__d('debug_kit', 'Could not load DebugToolbar panel %s', true), $panel), E_USER_WARNING); continue; } $panelObj =& new $className($settings); @@ -251,6 +256,7 @@ class ToolbarComponent extends Object { eval($class); } } + /** * Save the current state of the toolbar varibles to the cache file. * @@ -285,12 +291,14 @@ class ToolbarComponent extends Object { * @package cake.debug_kit */ class DebugPanel extends Object { + /** * Defines which plugin this panel is from so the element can be located. * * @var string */ var $plugin = null; + /** * startup the panel * @@ -319,12 +327,14 @@ class DebugPanel extends Object { **/ class HistoryPanel extends DebugPanel { var $plugin = 'debug_kit'; + /** * Number of history elements to keep * * @var string **/ var $history = 5; + /** * Constructor * @@ -336,6 +346,7 @@ class HistoryPanel extends DebugPanel { $this->history = $settings['history']; } } + /** * beforeRender callback function * @@ -380,6 +391,7 @@ class HistoryPanel extends DebugPanel { **/ class VariablesPanel extends DebugPanel { var $plugin = 'debug_kit'; + /** * beforeRender callback * @@ -399,6 +411,7 @@ class VariablesPanel extends DebugPanel { **/ class SessionPanel extends DebugPanel { var $plugin = 'debug_kit'; + /** * beforeRender callback * @@ -421,6 +434,7 @@ class SessionPanel extends DebugPanel { **/ class RequestPanel extends DebugPanel { var $plugin = 'debug_kit'; + /** * beforeRender callback - grabs request params * @@ -447,6 +461,7 @@ class RequestPanel extends DebugPanel { **/ class TimerPanel extends DebugPanel { var $plugin = 'debug_kit'; + /** * startup - add in necessary helpers * @@ -471,6 +486,7 @@ class TimerPanel extends DebugPanel { **/ class SqlLogPanel extends DebugPanel { var $plugin = 'debug_kit'; + /** * Minimum number of Rows Per Millisecond that must be returned by a query before an explain * is done. @@ -478,6 +494,7 @@ class SqlLogPanel extends DebugPanel { * @var int **/ var $slowRate = 20; + /** * Get Sql Logs for each DB config * @@ -530,6 +547,7 @@ class SqlLogPanel extends DebugPanel { } return $queryLogs; } + /** * get cell values from xml * @@ -547,6 +565,7 @@ class SqlLogPanel extends DebugPanel { } return $tds; } + /** * Run an explain query for a slow query. * @@ -581,12 +600,14 @@ class SqlLogPanel extends DebugPanel { */ class LogPanel extends DebugPanel { var $plugin = 'debug_kit'; + /** * Log files to scan * * @var array */ var $logFiles = array('error.log', 'debug.log'); + /** * startup * @@ -597,6 +618,7 @@ class LogPanel extends DebugPanel { App::import('Core', 'Log'); } } + /** * beforeRender Callback * @@ -615,6 +637,7 @@ class LogPanel extends DebugPanel { } return $out; } + /** * parse a log file and find the relevant entries * diff --git a/controllers/toolbar_access_controller.php b/controllers/toolbar_access_controller.php index 47d6e56..b0e988f 100644 --- a/controllers/toolbar_access_controller.php +++ b/controllers/toolbar_access_controller.php @@ -20,18 +20,21 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) **/ class ToolbarAccessController extends DebugKitAppController { + /** * name * * @var string */ var $name = 'ToolbarAccess'; + /** * uses array * * @var array **/ var $uses = array(); + /** * Helpers * @@ -41,12 +44,14 @@ class ToolbarAccessController extends DebugKitAppController { 'DebugKit.Toolbar' => array('output' => 'DebugKit.HtmlToolbar'), 'Javascript', 'Number', 'DebugKit.SimpleGraph' ); + /** * components * * @var array **/ var $components = array('RequestHandler'); + /** * beforeFilter callback * diff --git a/locale/debug_kit.pot b/locale/debug_kit.pot new file mode 100644 index 0000000..df4988d --- /dev/null +++ b/locale/debug_kit.pot @@ -0,0 +1,138 @@ +# LANGUAGE translation of Debug Kit Application +# Copyright 2008 Andy Dawson <andydawson76@yahoo.co.uk> +# No version information was available in the source files. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: debug_kit-\n" +"POT-Creation-Date: 2009-05-27 09:47+0200\n" +"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n" +"Last-Translator: Andy Dawson <andydawson76@yahoo.co.uk>\n" +"Language-Team:\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Basepath: ../../../\n" + +#: controllers/components/toolbar.php:91 +msgid "Component initialization and startup" +msgstr "" + +#: controllers/components/toolbar.php:140 +msgid "Controller Action" +msgstr "" + +#: controllers/components/toolbar.php:167 +msgid "Render Controller Action" +msgstr "" + +#: controllers/components/toolbar.php:231 +msgid "Could not load DebugToolbar panel %s" +msgstr "" + +#: views/elements/debug_toolbar.ctp:25 +msgid "There are no active panels. You must enable a panel to see its output." +msgstr "" + +#: views/elements/history_panel.ctp:21 +msgid "Request History" +msgstr "" + +#: views/elements/history_panel.ctp:23 +msgid "No previous requests logged." +msgstr "" + +#: views/elements/history_panel.ctp:25 +msgid "previous requests available" +msgstr "" + +#: views/elements/history_panel.ctp:27 +msgid "Restore to current request" +msgstr "" + +#: views/elements/log_panel.ctp:21 +msgid "Logs" +msgstr "" + +#: views/elements/log_panel.ctp:28 +msgid "Time" +msgstr "" + +#: views/elements/log_panel.ctp:28 +#: views/elements/timer_panel.ctp:54 +msgid "Message" +msgstr "" + +#: views/elements/log_panel.ctp:37 +msgid "There were no log entries made this request" +msgstr "" + +#: views/elements/request_panel.ctp:21 +msgid "Request" +msgstr "" + +#: views/elements/request_panel.ctp:35 +msgid "Current Route" +msgstr "" + +#: views/elements/session_panel.ctp:21 +msgid "Session" +msgstr "" + +#: views/elements/sql_log_panel.ctp:21 +msgid "Sql Logs" +msgstr "" + +#: views/elements/sql_log_panel.ctp:31 +msgid "toggle (%s) query explains for %s" +msgstr "" + +#: views/elements/sql_log_panel.ctp:39 +msgid "No slow queries!, or your database does not support EXPLAIN" +msgstr "" + +#: views/elements/sql_log_panel.ctp:44 +msgid "No active database connections" +msgstr "" + +#: views/elements/timer_panel.ctp:33 +msgid "Memory" +msgstr "" + +#: views/elements/timer_panel.ctp:35 +msgid "Current Memory Use" +msgstr "" + +#: views/elements/timer_panel.ctp:39 +msgid "Peak Memory Use" +msgstr "" + +#: views/elements/timer_panel.ctp:43 +msgid "Timers" +msgstr "" + +#: views/elements/timer_panel.ctp:45 +msgid "%s (ms)" +msgstr "" + +#: views/elements/timer_panel.ctp:46 +msgid "Total Request Time:" +msgstr "" + +#: views/elements/timer_panel.ctp:54 +msgid "Time in ms" +msgstr "" + +#: views/elements/timer_panel.ctp:54 +msgid "Graph" +msgstr "" + +#: views/elements/variables_panel.ctp:21 +msgid "View Variables" +msgstr "" + +#: views/helpers/simple_graph.php:79 +msgid "Starting %sms into the request, taking %sms" +msgstr "" + diff --git a/locale/eng/LC_MESSAGES/debug_kit.po b/locale/eng/LC_MESSAGES/debug_kit.po new file mode 100644 index 0000000..9aec832 --- /dev/null +++ b/locale/eng/LC_MESSAGES/debug_kit.po @@ -0,0 +1,135 @@ +# LANGUAGE translation of CakePHP Application +# Copyright YEAR NAME <EMAIL@ADDRESS> +# No version information was available in the source files. +# +#, fuzzy +msgid "" +msgstr "Project-Id-Version: PROJECT VERSION\n" + "POT-Creation-Date: 2009-05-27 09:47+0200\n" + "PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n" + "Last-Translator: NAME <EMAIL@ADDRESS>\n" + "Language-Team: LANGUAGE <EMAIL@ADDRESS>\n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: controllers/components/toolbar.php:91 +msgid "Component initialization and startup" +msgstr "" + +#: controllers/components/toolbar.php:140 +msgid "Controller Action" +msgstr "" + +#: controllers/components/toolbar.php:167 +msgid "Render Controller Action" +msgstr "" + +#: controllers/components/toolbar.php:231 +msgid "Could not load DebugToolbar panel %s" +msgstr "" + +#: views/elements/debug_toolbar.ctp:25 +msgid "There are no active panels. You must enable a panel to see its output." +msgstr "" + +#: views/elements/history_panel.ctp:21 +msgid "Request History" +msgstr "" + +#: views/elements/history_panel.ctp:23 +msgid "No previous requests logged." +msgstr "" + +#: views/elements/history_panel.ctp:25 +msgid "previous requests available" +msgstr "" + +#: views/elements/history_panel.ctp:27 +msgid "Restore to current request" +msgstr "" + +#: views/elements/log_panel.ctp:21 +msgid "Logs" +msgstr "" + +#: views/elements/log_panel.ctp:28 +msgid "Time" +msgstr "" + +#: views/elements/log_panel.ctp:28 views/elements/timer_panel.ctp:54 +msgid "Message" +msgstr "" + +#: views/elements/log_panel.ctp:37 +msgid "There were no log entries made this request" +msgstr "" + +#: views/elements/request_panel.ctp:21 +msgid "Request" +msgstr "" + +#: views/elements/request_panel.ctp:35 +msgid "Current Route" +msgstr "" + +#: views/elements/session_panel.ctp:21 +msgid "Session" +msgstr "" + +#: views/elements/sql_log_panel.ctp:21 +msgid "Sql Logs" +msgstr "" + +#: views/elements/sql_log_panel.ctp:31 +msgid "toggle (%s) query explains for %s" +msgstr "" + +#: views/elements/sql_log_panel.ctp:39 +msgid "No slow queries!, or your database does not support EXPLAIN" +msgstr "" + +#: views/elements/sql_log_panel.ctp:44 +msgid "No active database connections" +msgstr "" + +#: views/elements/timer_panel.ctp:33 +msgid "Memory" +msgstr "" + +#: views/elements/timer_panel.ctp:35 +msgid "Current Memory Use" +msgstr "" + +#: views/elements/timer_panel.ctp:39 +msgid "Peak Memory Use" +msgstr "" + +#: views/elements/timer_panel.ctp:43 +msgid "Timers" +msgstr "" + +#: views/elements/timer_panel.ctp:45 +msgid "%s (ms)" +msgstr "" + +#: views/elements/timer_panel.ctp:46 +msgid "Total Request Time:" +msgstr "" + +#: views/elements/timer_panel.ctp:54 +msgid "Time in ms" +msgstr "" + +#: views/elements/timer_panel.ctp:54 +msgid "Graph" +msgstr "" + +#: views/elements/variables_panel.ctp:21 +msgid "View Variables" +msgstr "" + +#: views/helpers/simple_graph.php:79 +msgid "Starting %sms into the request, taking %sms" +msgstr "" diff --git a/locale/spa/LC_MESSAGES/debug_kit.po b/locale/spa/LC_MESSAGES/debug_kit.po new file mode 100644 index 0000000..0833a49 --- /dev/null +++ b/locale/spa/LC_MESSAGES/debug_kit.po @@ -0,0 +1,135 @@ +# LANGUAGE translation of CakePHP Application +# Copyright YEAR NAME <EMAIL@ADDRESS> +# No version information was available in the source files. +# +#, fuzzy +msgid "" +msgstr "Project-Id-Version: PROJECT VERSION\n" + "POT-Creation-Date: 2009-05-27 09:47+0200\n" + "PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n" + "Last-Translator: NAME <EMAIL@ADDRESS>\n" + "Language-Team: LANGUAGE <EMAIL@ADDRESS>\n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: controllers/components/toolbar.php:91 +msgid "Component initialization and startup" +msgstr "" + +#: controllers/components/toolbar.php:140 +msgid "Controller Action" +msgstr "" + +#: controllers/components/toolbar.php:167 +msgid "Render Controller Action" +msgstr "" + +#: controllers/components/toolbar.php:231 +msgid "Could not load DebugToolbar panel %s" +msgstr "" + +#: views/elements/debug_toolbar.ctp:25 +msgid "There are no active panels. You must enable a panel to see its output." +msgstr "" + +#: views/elements/history_panel.ctp:21 +msgid "Request History" +msgstr "" + +#: views/elements/history_panel.ctp:23 +msgid "No previous requests logged." +msgstr "" + +#: views/elements/history_panel.ctp:25 +msgid "previous requests available" +msgstr "" + +#: views/elements/history_panel.ctp:27 +msgid "Restore to current request" +msgstr "" + +#: views/elements/log_panel.ctp:21 +msgid "Logs" +msgstr "" + +#: views/elements/log_panel.ctp:28 +msgid "Time" +msgstr "" + +#: views/elements/log_panel.ctp:28 views/elements/timer_panel.ctp:54 +msgid "Message" +msgstr "" + +#: views/elements/log_panel.ctp:37 +msgid "There were no log entries made this request" +msgstr "" + +#: views/elements/request_panel.ctp:21 +msgid "Request" +msgstr "" + +#: views/elements/request_panel.ctp:35 +msgid "Current Route" +msgstr "" + +#: views/elements/session_panel.ctp:21 +msgid "Session" +msgstr "" + +#: views/elements/sql_log_panel.ctp:21 +msgid "Sql Logs" +msgstr "" + +#: views/elements/sql_log_panel.ctp:31 +msgid "toggle (%s) query explains for %s" +msgstr "" + +#: views/elements/sql_log_panel.ctp:39 +msgid "No slow queries!, or your database does not support EXPLAIN" +msgstr "" + +#: views/elements/sql_log_panel.ctp:44 +msgid "No active database connections" +msgstr "" + +#: views/elements/timer_panel.ctp:33 +msgid "Memory" +msgstr "" + +#: views/elements/timer_panel.ctp:35 +msgid "Current Memory Use" +msgstr "" + +#: views/elements/timer_panel.ctp:39 +msgid "Peak Memory Use" +msgstr "" + +#: views/elements/timer_panel.ctp:43 +msgid "Timers" +msgstr "" + +#: views/elements/timer_panel.ctp:45 +msgid "%s (ms)" +msgstr "" + +#: views/elements/timer_panel.ctp:46 +msgid "Total Request Time:" +msgstr "" + +#: views/elements/timer_panel.ctp:54 +msgid "Time in ms" +msgstr "" + +#: views/elements/timer_panel.ctp:54 +msgid "Graph" +msgstr "" + +#: views/elements/variables_panel.ctp:21 +msgid "View Variables" +msgstr "" + +#: views/helpers/simple_graph.php:79 +msgid "Starting %sms into the request, taking %sms" +msgstr "" \ No newline at end of file diff --git a/vendors/debug_kit_debugger.php b/vendors/debug_kit_debugger.php index 11345aa..6ec8eb2 100644 --- a/vendors/debug_kit_debugger.php +++ b/vendors/debug_kit_debugger.php @@ -175,7 +175,7 @@ class DebugKitDebugger extends Debugger { $_end = $now; } $times['Core Processing (Derived)'] = array( - 'message' => __('Core Processing (Derived)', true), + 'message' => __d('debug_kit', 'Core Processing (Derived)', true), 'start' => 0, 'end' => $_end - $start, 'time' => round($_end - $start, 6), diff --git a/vendors/fire_cake.php b/vendors/fire_cake.php index 1146270..7b19901 100644 --- a/vendors/fire_cake.php +++ b/vendors/fire_cake.php @@ -31,6 +31,7 @@ if (!function_exists('firecake')) { } class FireCake extends Object { + /** * Options for FireCake. * @@ -38,6 +39,7 @@ class FireCake extends Object { * @var string */ var $options = array(); + /** * Default Options used in CakeFirePhp * @@ -50,11 +52,12 @@ class FireCake extends Object { 'useNativeJsonEncode' => true, 'includeLineNumbers' => true, ); + /** * Message Levels for messages sent via FirePHP * * @var array - */ + */ var $_levels = array( 'log' => 'LOG', 'info' => 'INFO', @@ -67,8 +70,9 @@ class FireCake extends Object { 'groupStart' => 'GROUP_START', 'groupEnd' => 'GROUP_END', ); - + var $_version = '0.2.1'; + /** * internal messageIndex counter * @@ -76,24 +80,28 @@ class FireCake extends Object { * @access protected */ var $_messageIndex = 1; + /** * stack of objects encoded by stringEncode() * * @var array **/ - var $_encodedObjects = array(); + var $_encodedObjects = array(); + /** * methodIndex to include in tracebacks when using includeLineNumbers * * @var array **/ var $_methodIndex = array('info', 'log', 'warn', 'error', 'table', 'trace'); + /** * FireCake output status * * @var bool **/ var $_enabled = true; + /** * get Instance of the singleton * @@ -116,6 +124,7 @@ class FireCake extends Object { } return $instance[0]; } + /** * setOptions * @@ -132,6 +141,7 @@ class FireCake extends Object { $_this->options = array_merge($_this->options, $options); } } + /** * Return boolean based on presence of FirePHP extension * @@ -145,6 +155,7 @@ class FireCake extends Object { } return true; } + /** * Get the Current UserAgent * @@ -155,8 +166,9 @@ class FireCake extends Object { function getUserAgent() { return env('HTTP_USER_AGENT'); } + /** - * Disable FireCake output + * Disable FireCake output * All subsequent output calls will not be run. * * @return void @@ -165,6 +177,7 @@ class FireCake extends Object { $_this = FireCake::getInstance(); $_this->_enabled = false; } + /** * Enable FireCake output * @@ -174,110 +187,120 @@ class FireCake extends Object { $_this = FireCake::getInstance(); $_this->_enabled = true; } + /** - * Convenience wrapper for LOG messages + * Convenience wrapper for LOG messages * - * @param string $message Message to log + * @param string $message Message to log * @param string $label Label for message (optional) * @access public * @static * @return void - */ + */ function log($message, $label = null) { FireCake::fb($message, $label, 'log'); } + /** - * Convenience wrapper for WARN messages + * Convenience wrapper for WARN messages * - * @param string $message Message to log + * @param string $message Message to log * @param string $label Label for message (optional) * @access public * @static * @return void - */ + */ function warn($message, $label = null) { FireCake::fb($message, $label, 'warn'); } + /** - * Convenience wrapper for INFO messages + * Convenience wrapper for INFO messages * - * @param string $message Message to log + * @param string $message Message to log * @param string $label Label for message (optional) * @access public * @static * @return void - */ + */ function info($message, $label = null) { FireCake::fb($message, $label, 'info'); } + /** - * Convenience wrapper for ERROR messages + * Convenience wrapper for ERROR messages * - * @param string $message Message to log + * @param string $message Message to log * @param string $label Label for message (optional) * @access public * @static * @return void - */ + */ function error($message, $label = null) { FireCake::fb($message, $label, 'error'); } + /** - * Convenience wrapper for TABLE messages + * Convenience wrapper for TABLE messages * - * @param string $message Message to log + * @param string $message Message to log * @param string $label Label for message (optional) * @access public * @static * @return void - */ + */ function table($label, $message) { FireCake::fb($message, $label, 'table'); } + /** - * Convenience wrapper for DUMP messages + * Convenience wrapper for DUMP messages * - * @param string $message Message to log + * @param string $message Message to log * @param string $label Unique label for message * @access public * @static * @return void - */ + */ function dump($label, $message) { FireCake::fb($message, $label, 'dump'); } + /** - * Convenience wrapper for TRACE messages + * Convenience wrapper for TRACE messages * * @param string $label Label for message (optional) * @access public * @return void - */ + */ function trace($label) { FireCake::fb($label, 'trace'); } + /** - * Convenience wrapper for GROUP messages + * Convenience wrapper for GROUP messages * Messages following the group call will be nested in a group block * * @param string $label Label for group (optional) * @access public * @return void - */ + */ function group($label) { FireCake::fb(null, $label, 'groupStart'); } + /** - * Convenience wrapper for GROUPEND messages + * Convenience wrapper for GROUPEND messages * Closes a group block * * @param string $label Label for group (optional) * @access public * @return void - */ + */ function groupEnd() { FireCake::fb(null, null, 'groupEnd'); } + /** * fb - Send messages with FireCake to FirePHP * @@ -285,7 +308,7 @@ class FireCake extends Object { * fb($message) - Just send a message defaults to LOG type * fb($message, $type) - Send a message with a specific type * fb($message, $label, $type) - Send a message with a custom label and type. - * + * * @param mixed $message Message to output. For other parameters see usage above. * @static * @return void @@ -294,13 +317,13 @@ class FireCake extends Object { $_this = FireCake::getInstance(); if (headers_sent($filename, $linenum)) { - trigger_error(sprintf(__('Headers already sent in %s on line %s. Cannot send log data to FirePHP.', true), $filename, $linenum), E_USER_WARNING); + trigger_error(sprintf(__d('debug_kit', 'Headers already sent in %s on line %s. Cannot send log data to FirePHP.', true), $filename, $linenum), E_USER_WARNING); return false; } if (!$_this->_enabled || !$_this->detectClientExtension()) { return false; } - + $args = func_get_args(); $type = $label = null; switch (count($args)) { @@ -315,7 +338,7 @@ class FireCake extends Object { $label = $args[1]; break; default: - trigger_error(__('Incorrect parameter count for FireCake::fb()', true), E_USER_WARNING); + trigger_error(__d('debug_kit', 'Incorrect parameter count for FireCake::fb()', true), E_USER_WARNING); return false; } if (isset($_this->_levels[$type])) { @@ -325,7 +348,7 @@ class FireCake extends Object { } $meta = array(); - $skipFinalObjectEncode = false; + $skipFinalObjectEncode = false; if ($type == $_this->_levels['trace']) { $trace = debug_backtrace(); if (!$trace) { @@ -388,12 +411,13 @@ class FireCake extends Object { } $_this->_messageIndex++; if ($_this->_messageIndex > 99999) { - trigger_error(__('Maximum number (99,999) of messages reached!', true), E_USER_WARNING); + trigger_error(__d('debug_kit', 'Maximum number (99,999) of messages reached!', true), E_USER_WARNING); } } $_this->_sendHeader('X-Wf-1-Index', $_this->_messageIndex - 1); return true; } + /** * Parse a debug backtrace * @@ -422,6 +446,7 @@ class FireCake extends Object { } return $message; } + /** * Fix a trace for use in output * @@ -441,10 +466,11 @@ class FireCake extends Object { } return $trace; } + /** * Encode non string objects to string. * Filter out recursion, so no errors are raised by json_encode or $javascript->object() - * + * * @param mixed $object Object or variable to encode to string. * @param int $objectDepth Current Depth in object chains. * @param int $arrayDepth Current Depth in array chains. @@ -488,6 +514,7 @@ class FireCake extends Object { } return $return; } + /** * Encode an object into JSON * @@ -502,13 +529,14 @@ class FireCake extends Object { if (!$skipEncode) { $object = FireCake::stringEncode($object); } - + if (function_exists('json_encode') && $_this->options['useNativeJsonEncode']) { return json_encode($object); } else { return FireCake::_jsonEncode($object); } } + /** * jsonEncode Helper method for PHP4 compatibility * @@ -525,6 +553,7 @@ class FireCake extends Object { $javascript->useNative = false; return $javascript->object($object); } + /** * Send Headers - write headers. * diff --git a/vendors/shells/benchmark.php b/vendors/shells/benchmark.php index 53c3695..e34a152 100644 --- a/vendors/shells/benchmark.php +++ b/vendors/shells/benchmark.php @@ -2,7 +2,7 @@ /** * Benchmark Shell. * - * Provides basic benchmarking of application requests + * Provides basic benchmarking of application requests * functionally similar to Apache AB * * PHP versions 4 and 5 @@ -31,7 +31,7 @@ * @todo Make calculated results round to leading significant digit position of std dev. */ class BenchmarkShell extends Shell { - + /** * Main execution of shell * @@ -47,25 +47,25 @@ class BenchmarkShell extends Shell { $defaults = array('t' => 100, 'n' => 10); $options = array_merge($defaults, $this->params); $times = array(); - - $this->out(String::insert(__('-> Testing :url', true), compact('url'))); + + $this->out(String::insert(__d('debug_kit', '-> Testing :url', true), compact('url'))); $this->out(""); for ($i = 0; $i < $options['n']; $i++) { if (floor($options['t'] - array_sum($times)) <= 0 || $options['n'] <= 1) { break; } - + $start = microtime(true); file_get_contents($url); $stop = microtime(true); - + $times[] = $stop - $start; } - + $this->_results($times); } - - + + /** * Prints calculated results * @@ -76,43 +76,43 @@ class BenchmarkShell extends Shell { function _results($times) { $duration = array_sum($times); $requests = count($times); - - $this->out(String::insert(__('Total Requests made: :requests', true), compact('requests'))); - $this->out(String::insert(__('Total Time elapsed: :duration (seconds)', true), compact('duration'))); - + + $this->out(String::insert(__d('debug_kit', 'Total Requests made: :requests', true), compact('requests'))); + $this->out(String::insert(__d('debug_kit', 'Total Time elapsed: :duration (seconds)', true), compact('duration'))); + $this->out(""); - - $this->out(String::insert(__('Requests/Second: :rps req/sec', true), array( + + $this->out(String::insert(__d('debug_kit', 'Requests/Second: :rps req/sec', true), array( 'rps' => round($requests / $duration, 3) ))); - - $this->out(String::insert(__('Average request time: :average-time seconds', true), array( + + $this->out(String::insert(__d('debug_kit', 'Average request time: :average-time seconds', true), array( 'average-time' => round($duration / $requests, 3) ))); - - $this->out(String::insert(__('Standard deviation of average request time: :std-dev', true), array( + + $this->out(String::insert(__d('debug_kit', 'Standard deviation of average request time: :std-dev', true), array( 'std-dev' => round($this->_deviation($times, true), 3) ))); - - $this->out(String::insert(__('Longest/shortest request: :longest sec/:shortest sec', true), array( + + $this->out(String::insert(__d('debug_kit', 'Longest/shortest request: :longest sec/:shortest sec', true), array( 'longest' => round(max($times), 3), 'shortest' => round(min($times), 3) ))); - + $this->out(""); - + } - + /** * One-pass, numerically stable calculation of population variance. * - * Donald E. Knuth (1998). - * The Art of Computer Programming, volume 2: Seminumerical Algorithms, 3rd edn., + * Donald E. Knuth (1998). + * The Art of Computer Programming, volume 2: Seminumerical Algorithms, 3rd edn., * p. 232. Boston: Addison-Wesley. * * @param array $times Array of values - * @param boolean $sample If true, calculates an unbiased estimate of the population + * @param boolean $sample If true, calculates an unbiased estimate of the population * variance from a finite sample. * @return float Variance * @access protected @@ -126,12 +126,12 @@ class BenchmarkShell extends Shell { $mean = $mean + $delta/$n; $M2 = $M2 + $delta*($time - $mean); } - + if ($sample) $n -= 1; - + return $M2/$n; } - + /** * Calculate the standard deviation. * @@ -142,7 +142,7 @@ class BenchmarkShell extends Shell { function _deviation($times, $sample = true) { return sqrt($this->_variance($times, $sample)); } - + /** * Help for Benchmark shell * @@ -150,27 +150,27 @@ class BenchmarkShell extends Shell { * @access public */ function help() { - $this->out(__("DebugKit Benchmark Shell", true)); + $this->out(__d('debug_kit', "DebugKit Benchmark Shell", true)); $this->out(""); - $this->out(__("\tAllows you to obtain some rough benchmarking statistics \n\tabout a fully qualified URL.", true)); + $this->out(__d('debug_kit', "\tAllows you to obtain some rough benchmarking statistics \n\tabout a fully qualified URL.", true)); $this->out(""); - $this->out(__("\tUse:", true)); - $this->out(__("\t\tcake benchmark [-n iterations] [-t timeout] url", true)); + $this->out(__d('debug_kit', "\tUse:", true)); + $this->out(__d('debug_kit', "\t\tcake benchmark [-n iterations] [-t timeout] url", true)); $this->out(""); - $this->out(__("\tParams:", true)); - $this->out(__("\t\t-n Number of iterations to perform. Defaults to 10. \n\t\t Must be an integer.", true)); - $this->out(__("\t\t-t Maximum total time for all iterations, in seconds. \n\t\t Defaults to 100. Must be an integer.", true)); + $this->out(__d('debug_kit', "\tParams:", true)); + $this->out(__d('debug_kit', "\t\t-n Number of iterations to perform. Defaults to 10. \n\t\t Must be an integer.", true)); + $this->out(__d('debug_kit', "\t\t-t Maximum total time for all iterations, in seconds. \n\t\t Defaults to 100. Must be an integer.", true)); $this->out(""); - $this->out(__("\tIf a single iteration takes more than the \n\ttimeout specified, only one request will be made.", true)); + $this->out(__d('debug_kit', "\tIf a single iteration takes more than the \n\ttimeout specified, only one request will be made.", true)); $this->out(""); - $this->out(__("\tExample Use:", true)); - $this->out(__("\t\tcake benchmark -n 10 -t 100 http://localhost/testsite", true)); + $this->out(__d('debug_kit', "\tExample Use:", true)); + $this->out(__d('debug_kit', "\t\tcake benchmark -n 10 -t 100 http://localhost/testsite", true)); $this->out(""); - $this->out(__("\tNote that this benchmark does not include browser render time", true)); + $this->out(__d('debug_kit', "\tNote that this benchmark does not include browser render time", true)); $this->out(""); $this->hr(); $this->out(""); } } -?> +?> \ No newline at end of file diff --git a/views/debug.php b/views/debug.php index 5287a72..1919e2b 100644 --- a/views/debug.php +++ b/views/debug.php @@ -21,6 +21,7 @@ **/ App::import('Vendor', 'DebugKit.DebugKitDebugger'); App::import('Component', 'DebugKit.Toolbar'); + /** * DebugView used by DebugKit * @@ -28,12 +29,14 @@ App::import('Component', 'DebugKit.Toolbar'); * @todo Remove workarounds. */ class DebugView extends DoppelGangerView { + /** * The old extension of the current template. * * @var string */ var $_oldExtension = null; + /** * Overload _render to capture filenames and time actual rendering of each view file * @@ -47,7 +50,7 @@ class DebugView extends DoppelGangerView { $___viewFn = substr($___viewFn, 0, -10) . $this->_oldExtension; } if (!isset($___dataForView['disableTimer'])) { - DebugKitDebugger::startTimer('render_' . basename($___viewFn), sprintf(__('Rendering %s', true), Debugger::trimPath($___viewFn))); + DebugKitDebugger::startTimer('render_' . basename($___viewFn), sprintf(__d('debug_kit', 'Rendering %s', true), Debugger::trimPath($___viewFn))); } $out = parent::_render($___viewFn, $___dataForView, $loadHelpers, $cached); @@ -57,7 +60,7 @@ class DebugView extends DoppelGangerView { } return $out; } - + /** * Renders view for given action and layout. If $file is given, that is used * for a view filename (e.g. customFunkyView.ctp). @@ -67,13 +70,13 @@ class DebugView extends DoppelGangerView { * @param string $layout Layout to use * @param string $file Custom filename for view * @return string Rendered Element - */ + */ function render($action = null, $layout = null, $file = null) { - DebugKitDebugger::startTimer('viewRender', __('Rendering View', true)); + DebugKitDebugger::startTimer('viewRender', __d('debug_kit', 'Rendering View', true)); $out = parent::render($action, $layout, $file); DebugKitDebugger::stopTimer('viewRender'); DebugKitDebugger::stopTimer('controllerRender'); - + if (isset($this->loaded['toolbar'])) { $this->loaded['toolbar']->postRender(); } @@ -96,7 +99,7 @@ class DebugView extends DoppelGangerView { $filename = parent::_getViewFileName($name); return $this->_replaceExtension($filename); } - + /** * Workaround _render() limitation in core. Which forces View::_render() for .ctp and .thtml templates * Creates temporary extension to trick View::render() & View::renderLayout() @@ -108,7 +111,7 @@ class DebugView extends DoppelGangerView { $filename = parent::_getLayoutFileName($name); return $this->_replaceExtension($filename); } - + /** * replace the Extension on a filename and set the temporary workaround extension. * diff --git a/views/elements/debug_toolbar.ctp b/views/elements/debug_toolbar.ctp index 760e568..fc992d6 100644 --- a/views/elements/debug_toolbar.ctp +++ b/views/elements/debug_toolbar.ctp @@ -22,7 +22,7 @@ ?> <div id="debug-kit-toolbar"> <?php if (empty($debugToolbarPanels)) :?> - <p class="warning"><?php __('There are no active panels. You must enable a panel to see its output.'); ?></p> + <p class="warning"><?php __d('debug_kit', 'There are no active panels. You must enable a panel to see its output.'); ?></p> <?php else: ?> <ul id="panel-tabs"> <li class="panel-tab icon"> @@ -34,7 +34,7 @@ <?php $panelUnderscore = Inflector::underscore($panelName);?> <li class="panel-tab"> <a href="#<?php echo $panelUnderscore; ?>"> - <?php echo Inflector::humanize($panelUnderscore); ?> + <?php __d('debug_kit', Inflector::humanize($panelUnderscore)); ?> </a> <div class="panel-content" id="<?php echo $panelUnderscore ?>-tab"> <div class="panel-content-data"> diff --git a/views/elements/history_panel.ctp b/views/elements/history_panel.ctp index 4078251..bbd930a 100644 --- a/views/elements/history_panel.ctp +++ b/views/elements/history_panel.ctp @@ -18,13 +18,13 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) **/ ?> -<h2> <?php __('Request History'); ?></h2> +<h2> <?php __d('debug_kit', 'Request History'); ?></h2> <?php if (empty($content)): ?> - <p class="warning"><?php __('No previous requests logged.'); ?></p> + <p class="warning"><?php __d('debug_kit', 'No previous requests logged.'); ?></p> <?php else: ?> - <?php echo count($content); ?> <?php __('previous requests available') ?> + <?php echo count($content); ?> <?php __d('debug_kit', 'previous requests available') ?> <ul class="history-list"> - <li><?php echo $html->link(__('Restore to current request', true), + <li><?php echo $html->link(__d('debug_kit', 'Restore to current request', true), '#', array('class' => 'history-link', 'id' => 'history-restore-current')); ?> </li> <?php foreach ($content as $previous): ?> @@ -43,7 +43,7 @@ DEBUGKIT.historyPanel = function () { Request = DEBUGKIT.Util.Request, historyLinks = []; - // Private methods to handle JSON response and insertion of + // Private methods to handle JSON response and insertion of // new content. var switchHistory = function (response) { try { @@ -91,7 +91,7 @@ DEBUGKIT.historyPanel = function () { // Private method to handle restoration to current request. var restoreCurrentState = function () { var id, i, panelContent, tag; - + for (i in historyLinks) { Element.removeClass(historyLinks[i], 'loading'); } @@ -113,7 +113,7 @@ DEBUGKIT.historyPanel = function () { } } }; - + function handleHistoryLink (event) { event.preventDefault(); @@ -142,7 +142,7 @@ DEBUGKIT.historyPanel = function () { console.log('bailing on history'); return; } - + var anchors = toolbar.panels['history'].content.getElementsByTagName('A'); for (i in anchors) { diff --git a/views/elements/log_panel.ctp b/views/elements/log_panel.ctp index 671f0b5..fbb68c1 100644 --- a/views/elements/log_panel.ctp +++ b/views/elements/log_panel.ctp @@ -18,14 +18,14 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) **/ ?> -<h2><?php __('Logs') ?></h2> +<h2><?php __d('debug_kit', 'Logs') ?></h2> <div class="code-table"> <?php foreach ($content as $logName => $logs): ?> <h3><?php echo $logName ?></h3> - <?php + <?php $len = count($logs); if ($len > 0): - $headers = array(__('Time', true), __('Message', true)); + $headers = array(__d('debug_kit', 'Time', true), __d('debug_kit', 'Message', true)); $rows = array(); for ($i = 0; $i < $len; $i += 2): $rows[] = array( @@ -34,7 +34,7 @@ endfor; echo $toolbar->table($rows, $headers, array('title' => $logName)); else: ?> - <p class="info"><?php __('There were no log entries made this request'); ?></p> + <p class="info"><?php __d('debug_kit', 'There were no log entries made this request'); ?></p> <?php endif; ?> <?php endforeach; ?> </div> \ No newline at end of file diff --git a/views/elements/request_panel.ctp b/views/elements/request_panel.ctp index 95d8d86..3b48f96 100644 --- a/views/elements/request_panel.ctp +++ b/views/elements/request_panel.ctp @@ -18,7 +18,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) **/ ?> -<h2> <?php __('Request'); ?></h2> +<h2> <?php __d('debug_kit', 'Request'); ?></h2> <h4>Cake Params</h4> <?php echo $toolbar->makeNeatArray($content['params']); ?> @@ -32,5 +32,5 @@ <p class="warning">To view Cookies, add CookieComponent to Controller</p> <?php endif; ?> -<h4><?php __('Current Route') ?></h4> +<h4><?php __d('debug_kit', 'Current Route') ?></h4> <?php echo $toolbar->makeNeatArray($content['currentRoute']); ?> \ No newline at end of file diff --git a/views/elements/session_panel.ctp b/views/elements/session_panel.ctp index 70448e7..3b620f8 100644 --- a/views/elements/session_panel.ctp +++ b/views/elements/session_panel.ctp @@ -18,5 +18,5 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) **/ ?> -<h2><?php __('Session'); ?></h2> +<h2><?php __d('debug_kit', 'Session'); ?></h2> <?php echo $toolbar->makeNeatArray($content); ?> \ No newline at end of file diff --git a/views/elements/sql_log_panel.ctp b/views/elements/sql_log_panel.ctp index 0a209a8..76a1ac3 100644 --- a/views/elements/sql_log_panel.ctp +++ b/views/elements/sql_log_panel.ctp @@ -18,7 +18,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) **/ ?> -<h2><?php __('Sql Logs')?></h2> +<h2><?php __d('debug_kit', 'Sql Logs')?></h2> <?php if (!empty($content)) : ?> <?php foreach ($content as $dbName => $queryLog) : ?> <div class="sql-log-panel-query-log"> @@ -28,7 +28,7 @@ echo $toolbar->table($queryLog['queries'], $headers, array('title' => 'SQL Log ' . $dbName)); if (!empty($queryLog['explains'])): - $name = sprintf(__('toggle (%s) query explains for %s', true), count($queryLog['explains']), $dbName); + $name = sprintf(__d('debug_kit', 'toggle (%s) query explains for %s', true), count($queryLog['explains']), $dbName); echo $html->link($name, '#', array('class' => 'show-slow')); echo '<div class="slow-query-container">'; @@ -36,12 +36,12 @@ echo $toolbar->table($queryLog['explains'], $headers, array('title' => 'Slow Queries ' . $dbName)); echo '</div>'; else: - echo $toolbar->message('Warning', __('No slow queries!, or your database does not support EXPLAIN', true)); + echo $toolbar->message('Warning', __d('debug_kit', 'No slow queries!, or your database does not support EXPLAIN', true)); endif; ?> </div> <?php endforeach; ?> <?php else: - echo $toolbar->message('Warning', __('No active database connections', true)); + echo $toolbar->message('Warning', __d('debug_kit', 'No active database connections', true)); endif; ?> <script type="text/javascript"> diff --git a/views/elements/timer_panel.ctp b/views/elements/timer_panel.ctp index 3841211..cf0e070 100644 --- a/views/elements/timer_panel.ctp +++ b/views/elements/timer_panel.ctp @@ -30,20 +30,20 @@ else: endif; ?> <div class="debug-info"> - <h2><?php __('Memory'); ?></h2> + <h2><?php __d('debug_kit', 'Memory'); ?></h2> <div class="current-mem-use"> - <?php echo $toolbar->message(__('Current Memory Use',true), $number->toReadableSize($currentMemory)); ?> + <?php echo $toolbar->message(__d('debug_kit', 'Current Memory Use',true), $number->toReadableSize($currentMemory)); ?> </div> <div class="peak-mem-use"> <?php - echo $toolbar->message(__('Peak Memory Use', true), $number->toReadableSize($peakMemory)); ?> + echo $toolbar->message(__d('debug_kit', 'Peak Memory Use', true), $number->toReadableSize($peakMemory)); ?> </div> </div> <div class="debug-info"> - <h2><?php __('Timers'); ?></h2> + <h2><?php __d('debug_kit', 'Timers'); ?></h2> <div class="request-time"> - <?php $totalTime = sprintf(__('%s (ms)', true), $number->precision($requestTime * 1000, 0)); ?> - <?php echo $toolbar->message(__('Total Request Time:', true), $totalTime)?> + <?php $totalTime = sprintf(__d('debug_kit', '%s (ms)', true), $number->precision($requestTime * 1000, 0)); ?> + <?php echo $toolbar->message(__d('debug_kit', 'Total Request Time:', true), $totalTime)?> </div> </div> @@ -51,7 +51,7 @@ endif; $end = end($timers); $maxTime = $end['end']; -$headers = array(__('Message', true), __('Time in ms', true), __('Graph', true)); +$headers = array(__d('debug_kit', 'Message', true), __d('debug_kit', 'Time in ms', true), __d('debug_kit', 'Graph', true)); $i = 0; $values = array_values($timers); foreach ($timers as $timerName => $timeInfo): diff --git a/views/elements/variables_panel.ctp b/views/elements/variables_panel.ctp index 7923554..88be17e 100644 --- a/views/elements/variables_panel.ctp +++ b/views/elements/variables_panel.ctp @@ -18,6 +18,6 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) **/ ?> -<h2> <?php __('View Variables'); ?></h2> +<h2> <?php __d('debug_kit', 'View Variables'); ?></h2> <?php $content['$this->validationErrors'] = $this->validationErrors; ?> -<?php echo $toolbar->makeNeatArray($content); ?> +<?php echo $toolbar->makeNeatArray($content); ?> \ No newline at end of file