5c826090e06e05bd5d1103ff3706f358994dba18
3 * Stub profiling functions
7 class ProfilerStub
extends Profiler
{
10 * is setproctitle function available?
13 private $haveProctitle;
14 private $hackWhere = array();
17 * Constructor. Check for proctitle.
19 public function __construct() {
20 $this->haveProctitle
= function_exists( 'setproctitle' );
23 public function isStub() {
28 * Begin profiling of a function
31 public function profileIn( $fn ) {
33 if( $this->haveProctitle
){
34 $this->hackWhere
[] = $fn;
35 setproctitle( $fn . " [$wgDBname]" );
40 * Stop profiling of a function
43 public function profileOut( $fn ) {
45 if( !$this->haveProctitle
) {
48 if( count( $this->hackWhere
) ) {
49 array_pop( $this->hackWhere
);
51 if( count( $this->hackWhere
) ) {
52 setproctitle( $this->hackWhere
[count( $this->hackWhere
)-1] . " [$wgDBname]" );
57 * Does nothing, just for compatibility
59 public function getOutput() {}
60 public function close() {}