Vector
Vector is a skin for MediaWiki. Vector has been the default skin on all Wikimedia wikis since 2010.
Loading...
Searching...
No Matches
MediaWiki Namespace Reference

A simple feature manager. More...

Detailed Description

A simple feature manager.

The OverridableConfigRequirement allows us to define requirements that can override configuration like querystring parameters, e.g.

The MaxWidthRequirement for content.

Some application state changes throughout the lifetime of the application, e.g.

NOTE: This API hasn't settled.

NOTE: This API hasn't settled. It may change at any time without warning. Please don't bind to it unless you absolutely need to.

@unstable

\Skins\Vector\FeatureManagement

It may change at any time without warning. Please don't bind to it unless you absolutely need to

@unstable

\Skins\Vector\FeatureManagement

wgSitename or wgFullyInitialised, which signals whether the application boot process has finished and critical resources like database connections are available.

The DynamicStateRequirement allows us to define requirements that lazily evaluate the application state statically, e.g.

=php
$featureManager->registerRequirement(
new DynamicConfigRequirement(
$config,
MainConfigNames::Sitename,
'requirementName'
)
);

registers a requirement that will evaluate to true only when mediawiki/includes/Setup.php has finished executing (after all service wiring has executed). I.e., every call to Requirement->isMet() reinterrogates the Config object for the current state and returns it. Contrast to

=php
$featureManager->registerSimpleRequirement(
'requirementName',
(bool)$config->get( MainConfigNames::Sitename )
);

wherein state is evaluated only once at registration time and permanently cached.

NOTE: This API hasn't settled. It may change at any time without warning. Please don't bind to it unless you absolutely need to

@unstable

\Skins\Vector\FeatureManagement\Requirements

\Skins\Vector\FeatureManagement\Requirements

=php
$featureManager->registerRequirement(
new OverridableConfigRequirement(
$config,
$user,
$request,
$centralIdLookup,
MainConfigNames::Sitename,
'requirementName',
'overrideName',
'configTestName',
)
);

registers a requirement that will evaluate to true only when mediawiki/includes/Setup.php has finished executing (after all service wiring has executed). I.e., every call to Requirement->isMet() re-interrogates the request, user authentication status, and config object for the current state and returns it. Contrast to:

=php
$featureManager->registerSimpleRequirement(
'requirementName',
(bool)$config->get( MainConfigNames::Sitename )
);

wherein state is evaluated only once at registration time and permanently cached.

NOTE: This API hasn't settled. It may change at any time without warning. Please don't bind to it unless you absolutely need to

\Skins\Vector\FeatureManagement\Requirements

It may change at any time without warning. Please don't bind to it unless you absolutely need to

@unstable

\Skins\Vector\FeatureManagement\Requirements