From: Carsten K. <car...@us...> - 2003-12-21 00:29:48
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv17826 Modified Files: AllUsers.php Log Message: Minor bugfix: Fixed broken debug argument. Internal changes: Only create a DebugTimer when actually called for; moved debug message out of page content and into deferred page error notification via trigger_error. Memory management: Only include_once lib/PageList when absolutely necessary (at this time, this will probably only benefit the PluginManager as an incremental speedup & slightly reduced memory). Index: AllUsers.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/AllUsers.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -2 -b -p -d -r1.6 -r1.7 --- AllUsers.php 27 Feb 2003 20:10:31 -0000 1.6 +++ AllUsers.php 21 Dec 2003 00:29:45 -0000 1.7 @@ -21,6 +21,4 @@ rcs_id('$Id$'); */ -require_once('lib/PageList.php'); - /** * Based on AllPages. @@ -69,4 +67,5 @@ extends WikiPlugin $request->setArg('sortby',$sortby); + include_once('lib/PageList.php'); $pagelist = new PageList($info, $exclude); if (!$noheader) @@ -77,4 +76,8 @@ extends WikiPlugin $pagelist->_addColumn('version'); + if (defined('DEBUG') and DEBUG) + $debug = true; + + if ($debug) $timer = new DebugTimer; @@ -85,19 +88,27 @@ extends WikiPlugin } - if (defined('DEBUG') and DEBUG) { - return HTML($pagelist, - HTML::p(fmt("Elapsed time: %s s", $timer->getStats()))); - } else { - return $pagelist; - } + if ($debug) { + // Not totally localization-friendly but it's only a + // DEBUGging message + trigger_error("DEBUG: " . get_class($this) . ": " + . sprintf(_("Elapsed time: %s s"), + $timer->getStats()), + E_USER_NOTICE); } - - function getmicrotime(){ - list($usec, $sec) = explode(" ", microtime()); - return (float)$usec + (float)$sec; + return $pagelist; } }; // $Log$ +// Revision 1.7 2003/12/21 00:29:45 carstenklapp +// Minor bugfix: Fixed broken debug argument. +// +// Internal changes: Only create a DebugTimer when actually called for; +// moved debug message out of page content and into deferred page error +// notification via trigger_error. Memory management: Only include_once +// lib/PageList when absolutely necessary (at this time, this will +// probably only benefit the PluginManager as an incremental speedup & +// slightly reduced memory). +// // Revision 1.6 2003/02/27 20:10:31 dairiki // Disable profiling output when DEBUG is defined but false. |