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();
28 public function logData() {
29 if($this->mTemplated
) {
31 uasort($this->mCollated
,array('self','sort'));
32 array_walk($this->mCollated
,array('self','format'));
34 print '<pre>'.self
::$out.'</pre>';
36 print "<!--\n".self
::$out."\n-->\n";
42 static function sort($a,$b) { return $a['real']<$b['real']; /* sort descending by time elapsed */ }
43 static function format($item,$key) { self
::$out .= sprintf("%3.6f %6d - %s\n",$item['real'],$item['count'], $key); }