haveProctitle = function_exists( 'setproctitle' ); } /** * Begin profiling of a function * @param $fn string */ public function profileIn( $fn ) { global $wgDBname; if( $this->haveProctitle ){ $this->hackWhere[] = $fn; setproctitle( $fn . " [$wgDBname]" ); } } /** * Stop profiling of a function * @param $fn string */ public function profileOut( $fn ) { global $wgDBname; if( !$this->haveProctitle ) { return; } if( count( $this->hackWhere ) ) { array_pop( $this->hackWhere ); } if( count( $this->hackWhere ) ) { setproctitle( $this->hackWhere[count( $this->hackWhere )-1] . " [$wgDBname]" ); } } /** * Does nothing, just for compatibility */ public function getOutput() {} public function close() {} }