31 require_once __DIR__ .
'/../includes/Benchmarker.php';
40 parent::__construct();
41 $this->defaultCount = 100;
45 private function newSettingsBuilder() {
49 return new SettingsBuilder( MW_INSTALL_PATH, $extReg, $configBuilder, $phpIniSink,
null );
56 $schema = $schemaSource->load();
59 foreach ( $schema[
'config-schema'] as $key => $sch ) {
60 if ( array_key_exists(
'default', $sch ) ) {
61 $defaults[$key] = $sch[
'default'];
65 $benches[
'DefaultSettings.php'] = [
66 'setup' =>
static function () {
68 include MW_INSTALL_PATH .
'/includes/DefaultSettings.php';
70 'function' =>
static function () {
71 include MW_INSTALL_PATH .
'/includes/DefaultSettings.php';
75 $benches[
'config-schema.php'] = [
76 'function' =>
function () {
77 $settingsBuilder = $this->newSettingsBuilder();
78 $settingsBuilder->load(
81 $settingsBuilder->apply();
85 $benches[
'config-schema.php + merge'] = [
86 'function' =>
function () use ( $defaults ) {
87 $settingsBuilder = $this->newSettingsBuilder();
90 $settingsBuilder->loadArray( [
'config' => $defaults ] );
91 $settingsBuilder->load(
94 $settingsBuilder->apply();
98 $benches[
'MainConfigSchema::class'] = [
99 'function' =>
function () {
100 $settingsBuilder = $this->newSettingsBuilder();
102 $settingsBuilder->apply();
106 $benches[
'DefaultSettings.php + SetupDynamicConfig.php'] = [
107 'function' =>
static function () {
108 $IP = MW_INSTALL_PATH;
109 include MW_INSTALL_PATH .
'/includes/DefaultSettings.php';
113 include MW_INSTALL_PATH .
'/includes/SetupDynamicConfig.php';
117 $benches[
'config-schema.php + finalize'] = [
118 'function' =>
function () {
119 $settingsBuilder = $this->newSettingsBuilder();
120 $settingsBuilder->load(
123 $settingsBuilder->enterRegistrationStage();
130 include MW_INSTALL_PATH .
'/includes/SetupDynamicConfig.php';
134 $this->
bench( $benches );
139 require_once RUN_MAINTENANCE_IF_MAIN;
if(!defined( 'MEDIAWIKI')) if(ini_get( 'mbstring.func_overload')) if(!defined( 'MW_ENTRY_POINT')) global $IP
Environment checks.
Maintenance script that benchmarks loading of settings files.
__construct()
Default constructor.
execute()
Do the actual work.
Base class for benchmark scripts.
Load JSON files, and uses a Processor to extract information.
addDescription( $text)
Set the description text.
This class contains schema declarations for all configuration variables known to MediaWiki core.
$wgLocaltimezone
Config variable stub for the Localtimezone setting, for use by phpdoc and IDEs.
$wgDummyLanguageCodes
Config variable stub for the DummyLanguageCodes setting, for use by phpdoc and IDEs.