MediaWiki
master
Toggle main menu visibility
benchmarkGlobalVarConfig.php
Go to the documentation of this file.
1
<?php
2
3
use
MediaWiki\Config\GlobalVarConfig
;
4
use
MediaWiki\Maintenance\Benchmarker
;
5
6
require_once __DIR__ .
'/../includes/Benchmarker.php'
;
7
13
class
BenchmarkGlobalVarConfig
extends
Benchmarker
{
14
public
function
__construct
() {
15
parent::__construct();
16
$this->
addDescription
(
'Benchmark GlobalVarConfig::get()'
);
17
}
18
19
public
function
execute
() {
20
$config =
new
GlobalVarConfig
();
21
$GLOBALS[
'wgBenchmarkGlobalVarConfigTest'
] =
'value'
;
22
$GLOBALS[
'wgBenchmarkGlobalVarConfigTestNull'
] =
null
;
23
24
$benches = [
25
'GlobalVarConfig::get (hit)'
=> [
26
'function'
=>
static
function
() use ( $config ) {
27
$config->get(
'BenchmarkGlobalVarConfigTest'
);
28
}
29
],
30
'GlobalVarConfig::get (null)'
=> [
31
'function'
=>
static
function
() use ( $config ) {
32
$config->get(
'BenchmarkGlobalVarConfigTestNull'
);
33
}
34
],
35
];
36
37
$this->
bench
( $benches );
38
}
39
}
40
41
$maintClass
= BenchmarkGlobalVarConfig::class;
42
require_once RUN_MAINTENANCE_IF_MAIN;
$maintClass
$maintClass
Definition
addChangeTag.php:56
BenchmarkGlobalVarConfig
Benchmark GlobalVarConfig\get().
Definition
benchmarkGlobalVarConfig.php:13
BenchmarkGlobalVarConfig\execute
execute()
Do the actual work.
Definition
benchmarkGlobalVarConfig.php:19
BenchmarkGlobalVarConfig\__construct
__construct()
Default constructor.
Definition
benchmarkGlobalVarConfig.php:14
MediaWiki\Config\GlobalVarConfig
Accesses configuration settings from $GLOBALS.
Definition
GlobalVarConfig.php:19
MediaWiki\Maintenance\Benchmarker
Base class for benchmark scripts.
Definition
Benchmarker.php:29
MediaWiki\Maintenance\Benchmarker\bench
bench(array $benchs)
Definition
Benchmarker.php:39
MediaWiki\Maintenance\Maintenance\addDescription
addDescription( $text)
Set the description text.
Definition
Maintenance.php:335
maintenance
benchmarks
benchmarkGlobalVarConfig.php
Generated on
for MediaWiki by
1.18.0