8 * The least sophisticated profiler output class possible, view your source! :)
10 * Put the following 2 lines in StartProfiler.php:
12 * $wgProfiler['class'] = 'ProfilerSimpleText';
13 * $wgProfiler['visible'] = true;
17 class ProfilerSimpleText
extends ProfilerSimple
{
18 public $visible=false; /* Show as <PRE> or <!-- ? */
21 public function __construct( $profileConfig ) {
22 if( isset( $profileConfig['visible'] ) && $profileConfig['visible'] ) {
23 $this->visible
= true;
25 parent
::__construct( $profileConfig );
28 public function logData() {
29 if($this->mTemplated
) {
30 uasort($this->mCollated
,array('self','sort'));
31 array_walk($this->mCollated
,array('self','format'));
33 print '<pre>'.self
::$out.'</pre>';
35 print "<!--\n".self
::$out."\n-->\n";
41 static function sort($a,$b) { return $a['real']<$b['real']; /* sort descending by time elapsed */ }
42 static function format($item,$key) { self
::$out .= sprintf("%3.6f %6d - %s\n",$item['real'],$item['count'], $key); }