summaryrefslogtreecommitdiff
path: root/includes/ProfilerStub.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2008-08-15 01:29:47 +0200
committerPierre Schmitz <pierre@archlinux.de>2008-08-15 01:29:47 +0200
commit370e83bb0dfd0c70de268c93bf07ad5ee0897192 (patch)
tree491674f4c242e4d6ba0d04eafa305174c35a3391 /includes/ProfilerStub.php
parentf4debf0f12d0524d2b2427c55ea3f16b680fad97 (diff)
Update auf 1.13.0
Diffstat (limited to 'includes/ProfilerStub.php')
-rw-r--r--includes/ProfilerStub.php46
1 files changed, 34 insertions, 12 deletions
diff --git a/includes/ProfilerStub.php b/includes/ProfilerStub.php
index c41845a4..100cb8df 100644
--- a/includes/ProfilerStub.php
+++ b/includes/ProfilerStub.php
@@ -1,26 +1,48 @@
<?php
+/**
+ * Stub profiling functions
+ * @file
+ * @ingroup Profiler
+ */
-# Stub profiling functions
+/** backward compatibility */
+$wgProfiling = false;
+
+/** is setproctitle function available ? */
+$haveProctitle = function_exists( 'setproctitle' );
-$haveProctitle=function_exists("setproctitle");
+/**
+ * Begin profiling of a function
+ * @param $fn string
+ */
function wfProfileIn( $fn = '' ) {
global $hackwhere, $wgDBname, $haveProctitle;
- if ($haveProctitle) {
+ if( $haveProctitle ){
$hackwhere[] = $fn;
- setproctitle($fn . " [$wgDBname]");
+ setproctitle( $fn . " [$wgDBname]" );
}
}
+
+/**
+ * Stop profiling of a function
+ * @param $fn string
+ */
function wfProfileOut( $fn = '' ) {
global $hackwhere, $wgDBname, $haveProctitle;
- if (!$haveProctitle)
+ if( !$haveProctitle )
return;
- if (count($hackwhere))
- array_pop($hackwhere);
- if (count($hackwhere))
- setproctitle($hackwhere[count($hackwhere)-1] . " [$wgDBname]");
+ if( count( $hackwhere ) )
+ array_pop( $hackwhere );
+ if( count( $hackwhere ) )
+ setproctitle( $hackwhere[count( $hackwhere )-1] . " [$wgDBname]" );
}
-function wfGetProfilingOutput( $s, $e ) {}
-function wfProfileClose() {}
-$wgProfiling = false;
+/**
+ * Does nothing, just for compatibility
+ */
+function wfGetProfilingOutput( $s, $e ) {}
+/**
+ * Does nothing, just for compatibility
+ */
+function wfProfileClose() {}