dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7813e46
)
check function_exists() once, do nothing if not exists...
author
Domas Mituzas
<midom@users.mediawiki.org>
Tue, 10 Jan 2006 00:07:01 +0000
(
00:07
+0000)
committer
Domas Mituzas
<midom@users.mediawiki.org>
Tue, 10 Jan 2006 00:07:01 +0000
(
00:07
+0000)
includes/ProfilerStub.php
patch
|
blob
|
history
diff --git
a/includes/ProfilerStub.php
b/includes/ProfilerStub.php
index
86cc622
..
edadd5e
100644
(file)
--- a/
includes/ProfilerStub.php
+++ b/
includes/ProfilerStub.php
@@
-2,17
+2,21
@@
# Stub profiling functions
# Stub profiling functions
+$haveProctitle=function_exists("setproctitle");
function wfProfileIn( $fn = '' ) {
function wfProfileIn( $fn = '' ) {
- global $hackwhere, $wgDBname;
- $hackwhere[] = $fn;
- if (function_exists("setproctitle"))
+ global $hackwhere, $wgDBname
, $haveProctitle
;
+ if ($haveProctitle) {
+ $hackwhere[] = $fn;
setproctitle($fn . " [$wgDBname]");
setproctitle($fn . " [$wgDBname]");
+ }
}
function wfProfileOut( $fn = '' ) {
}
function wfProfileOut( $fn = '' ) {
- global $hackwhere, $wgDBname;
- if (count($hackwhere))
+ global $hackwhere, $wgDBname, $haveProctitle;
+ if (!$haveProctitle)
+ return;
+ if (count($hackwhere))
array_pop($hackwhere);
array_pop($hackwhere);
- if (
function_exists("setproctitle") &&
count($hackwhere))
+ if (count($hackwhere))
setproctitle($hackwhere[count($hackwhere)-1] . " [$wgDBname]");
}
function wfGetProfilingOutput( $s, $e ) {}
setproctitle($hackwhere[count($hackwhere)-1] . " [$wgDBname]");
}
function wfGetProfilingOutput( $s, $e ) {}