MediaWiki  1.23.1
bench_wfIsWindows.php
Go to the documentation of this file.
1 <?php
27 require_once __DIR__ . '/Benchmarker.php';
28 
35 
36  public function __construct() {
37  parent::__construct();
38  $this->mDescription = "Benchmark for wfIsWindows.";
39  }
40 
41  public function execute() {
42  $this->bench( array(
43  array( 'function' => array( $this, 'wfIsWindows' ) ),
44  array( 'function' => array( $this, 'wfIsWindowsCached' ) ),
45  ));
46  print $this->getFormattedResults();
47  }
48 
49  static function is_win() {
50  return substr( php_uname(), 0, 7 ) == 'Windows';
51  }
52 
53  // bench function 1
54  function wfIsWindows() {
55  return self::is_win();
56  }
57 
58  // bench function 2
59  function wfIsWindowsCached() {
60  static $isWindows = null;
61  if( $isWindows == null ) {
62  $isWindows = self::is_win();
63  }
64  return $isWindows;
65  }
66 }
67 
68 $maintClass = 'bench_wfIsWindows';
69 require_once RUN_MAINTENANCE_IF_MAIN;
bench_wfIsWindows\is_win
static is_win()
Definition: bench_wfIsWindows.php:49
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
Benchmarker\getFormattedResults
getFormattedResults()
Definition: Benchmarker.php:78
RUN_MAINTENANCE_IF_MAIN
require_once RUN_MAINTENANCE_IF_MAIN
Definition: maintenance.txt:50
bench_wfIsWindows\execute
execute()
Do the actual work.
Definition: bench_wfIsWindows.php:41
Benchmarker\bench
bench(array $benchs)
Definition: Benchmarker.php:45
bench_wfIsWindows
Maintenance script that benchmarks wfIsWindows().
Definition: bench_wfIsWindows.php:34
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
bench_wfIsWindows\wfIsWindowsCached
wfIsWindowsCached()
Definition: bench_wfIsWindows.php:59
Benchmarker
Base class for benchmark scripts.
Definition: Benchmarker.php:37
$maintClass
$maintClass
Definition: bench_wfIsWindows.php:68
bench_wfIsWindows\__construct
__construct()
Default constructor.
Definition: bench_wfIsWindows.php:36
bench_wfIsWindows\wfIsWindows
wfIsWindows()
Definition: bench_wfIsWindows.php:54