wiki.techinc.nl/includes/ProfilerStub.php
Alexandre Emsenhuber 4b453dbb59 * Update some documentation
* Moved ProfilerSimple::debug() to Profiler class so that it can also be used there
2008-05-06 16:03:03 +00:00

47 lines
952 B
PHP

<?php
/**
* Stub profiling functions
* @addtogroup Profiler
*/
/** backward compatibility */
$wgProfiling = false;
/** is setproctitle function aviable ? */
$haveProctitle = function_exists( 'setproctitle' );
/**
* Begin profiling of a function
* @param string $fn
*/
function wfProfileIn( $fn = '' ) {
global $hackwhere, $wgDBname, $haveProctitle;
if( $haveProctitle ){
$hackwhere[] = $fn;
setproctitle( $fn . " [$wgDBname]" );
}
}
/**
* Stop profiling of a function
* @param string $fn
*/
function wfProfileOut( $fn = '' ) {
global $hackwhere, $wgDBname, $haveProctitle;
if( !$haveProctitle )
return;
if( count( $hackwhere ) )
array_pop( $hackwhere );
if( count( $hackwhere ) )
setproctitle( $hackwhere[count( $hackwhere )-1] . " [$wgDBname]" );
}
/**
* Does nothing, just for compatibility
*/
function wfGetProfilingOutput( $s, $e ) {}
/**
* Does nothing, just for compatibility
*/
function wfProfileClose() {}