forked from svn2github/wikia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
StartProfiler.php
23 lines (23 loc) · 1.04 KB
/
StartProfiler.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
# defined here since this is loaded before settings -gp
$wgProfilerSamplePercent = 10;
if( !empty( $_GET['forceprofile'] ) ) {
require_once( dirname(__FILE__).'/includes/profiler/ProfilerSimpleText.php' );
$wgProfiler = new ProfilerSimpleText(array());
$wgProfiler->setProfileID( 'forced' );
} elseif( !empty( $_GET['forcetrace'] ) ) {
require_once( dirname(__FILE__).'/includes/profiler/ProfilerSimpleTrace.php' );
$wgProfiler = new ProfilerSimpleTrace(array());
} elseif( false ) {
// this extension is not finished yet, do not enable
if ( !class_exists( 'ProfilerSimple' ) ) {
require_once( dirname(__FILE__).'/includes/profiler/ProfilerSimple.php');
}
require_once( dirname(__FILE__).'/extensions/wikia/WyvProfiler/WyvProfiler.class.php' );
$wgProfiler = new WyvProfiler;
} elseif (rand(1, 100) <= $wgProfilerSamplePercent ) {
require_once( dirname(__FILE__).'/includes/profiler/ProfilerSimpleUDP.php' );
$wgProfiler = new ProfilerSimpleUDP(array());
} else {
require_once( dirname(__FILE__).'/includes/profiler/ProfilerStub.php' );
}