cvs: pear /Benchmark Profiler.php package.xml

From: Date: Wed, 01 Mar 2006 19:26:09 +0000
Subject: cvs: pear /Benchmark Profiler.php package.xml
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-38807@lists.php.net to get a copy of this message
anant Wed Mar 1 19:26:09 2006 UTC Modified files: /pear/Benchmark Profiler.php package.xml Log: Fixed minor text formatting issues: release 1.2.6, and added self as maintainer. http://cvs.php.net/viewcvs.cgi/pear/Benchmark/Profiler.php?r1=1.18&r2=1.19&diff_format=u Index: pear/Benchmark/Profiler.php diff -u pear/Benchmark/Profiler.php:1.18 pear/Benchmark/Profiler.php:1.19 --- pear/Benchmark/Profiler.php:1.18 Wed Mar 1 13:41:39 2006 +++ pear/Benchmark/Profiler.php Wed Mar 1 19:26:09 2006 @@ -14,7 +14,7 @@ // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // -// $Id: Profiler.php,v 1.18 2006/03/01 13:41:39 matthias Exp $ +// $Id: Profiler.php,v 1.19 2006/03/01 19:26:09 anant Exp $ // require_once 'PEAR.php'; @@ -237,6 +237,20 @@ * @access private */ function _getOutput($format) { + + /* Quickly find out the maximun length: Ineffecient, but will do for now! */ + $informations = $this->getAllSectionsInformations(); + $names = array_keys($informations); + + $maxLength = 0; + foreach ($names as $name) + { + if ($maxLength < strlen($name)) { + $maxLength = strlen($name); + } + } + $this->_maxStringLength = $maxLength; + if ($format == 'auto') { if (function_exists('version_compare') && version_compare(phpversion(), '4.1', 'ge')) { @@ -256,17 +270,15 @@ '<td align="center"><b>calls</b></td><td align="center"><b>callers</b></td></tr>'. "\n"; } else { - $dashes = $out = str_pad("\n", ($this->_maxStringLength + 52), '-', STR_PAD_LEFT); - $out .= str_pad('section', $this->_maxStringLength); - $out .= str_pad("total ex time", 22); - $out .= str_pad("netto ex time", 22); - $out .= str_pad("#calls", 22); - $out .= "perct\n"; + $dashes = $out = str_pad("\n", ($this->_maxStringLength + 75), '-', STR_PAD_LEFT); + $out .= str_pad('Section', $this->_maxStringLength + 10); + $out .= str_pad("Total Ex Time", 22); + $out .= str_pad("Netto Ex Time", 22); + $out .= str_pad("#Calls", 10); + $out .= "Percentage\n"; $out .= $dashes; } - - $informations = $this->getAllSectionsInformations(); - + foreach($informations as $name => $values) { $percentage = $values['percentage']; $calls_str = ""; @@ -298,10 +310,10 @@ } $out .= "<td>$calls_str</td><td>$callers_str</td></tr>"; } else { - $out .= str_pad($name, $this->_maxStringLength); + $out .= str_pad($name, $this->_maxStringLength + 10); $out .= str_pad($values['time'], 22); $out .= str_pad($values['netto_time'], 22); - $out .= str_pad($values['num_calls'], 22); + $out .= str_pad($values['num_calls'], 10); if (is_numeric($values['percentage'])) { $out .= str_pad($values['percentage']."%\n", 8, ' ', STR_PAD_LEFT); } else { @@ -309,8 +321,12 @@ } } } - - return $out . '</table>'; + + if ($format == 'html') { + return $out . '</table>'; + } else { + return $out; + } } /** http://cvs.php.net/viewcvs.cgi/pear/Benchmark/package.xml?r1=1.20&r2=1.21&diff_format=u Index: pear/Benchmark/package.xml diff -u pear/Benchmark/package.xml:1.20 pear/Benchmark/package.xml:1.21 --- pear/Benchmark/package.xml:1.20 Fri Feb 17 16:29:44 2006 +++ pear/Benchmark/package.xml Wed Mar 1 19:26:09 2006 @@ -6,6 +6,12 @@ <description>Framework to benchmark PHP scripts or function calls.</description> <maintainers> <maintainer> + <user>anant</user> + <role>lead</role> + <name>Anant Narayanan</name> + <email>anant@kix.in</email> + </maintainer> + <maintainer> <user>toggg</user> <role>lead</role> <name>Bertrand Gugger</name> @@ -14,12 +20,13 @@ </maintainers> <license>New BSD</license> <release> - <version>1.2.5</version> - <date>2006-02-17</date> + <version>1.2.6</version> + <date>2006-03-02</date> <state>stable</state> <notes> -- Bumped to 2006 -- Put out out nasty "?&gt;" end script tags +- Fixed extra table tag for text input +- Formatted text output properly (bug #6972) +- Added Anant Narayanan as maintainer </notes> <filelist> <dir name="/" baseinstalldir="Benchmark"> @@ -39,14 +46,23 @@ </release> <changelog> <release> - <version>1.2.4</version> - <date>2005-11-05</date> - <state>stable</state> - <notes> + <version>1.2.6</version> + <date>2006-03-02</date> + <state>stable</state> + <notes> +- Fixed extra table tag for text input +- Formatted text output properly (bug #6972) + </notes> + </release> + <release> + <version>1.2.4</version> + <date>2005-11-05</date> + <state>stable</state> + <notes> - Change licence to the new BSD License (see http://www.opensource.org/licenses/bsd-license.php) - </notes> - </release> + </notes> + </release> <release> <version>1.2.3</version> <date>2005-06-11</date>

« previous php.pear.cvs (#38807) next »