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' );
24 * Begin profiling of a function
27 public function profileIn( $fn = '' ) {
29 if( $this->haveProctitle
){
30 $this->hackWhere
[] = $fn;
31 setproctitle( $fn . " [$wgDBname]" );
36 * Stop profiling of a function
39 public function profileOut( $fn = '' ) {
41 if( !$this->haveProctitle
) {
44 if( count( $this->hackWhere
) ) {
45 array_pop( $this->hackWhere
);
47 if( count( $this->hackWhere
) ) {
48 setproctitle( $this->hackWhere
[count( $this->hackWhere
)-1] . " [$wgDBname]" );
53 * Does nothing, just for compatibility
55 public function getOutput() {}
56 public function close() {}