40use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
66 $services->getMainConfig()->get(
'ActorTableSchemaMigrationStage' )
71 return
$services->getService(
'_SqlBlobStore' );
86 $services->getMainConfig()->get(
'CommentTableSchemaMigrationStage' )
92 $registry =
$services->getBootstrapConfig()->get(
'ConfigRegistry' );
95 foreach ( $registry as $name => $callback ) {
96 $factory->register( $name, $callback );
116 $secret = $config->get(
'HKDFSecret' ) ?: $config->get(
'SecretKey' );
118 throw new RuntimeException(
"Cannot use MWCryptHKDF without a secret." );
123 $context = [ microtime(), getmypid(), gethostname() ];
140 return
$services->getDBLoadBalancerFactory()->getMainLB();
143 'DBLoadBalancerFactory' =>
145 $mainConfig =
$services->getMainConfig();
148 $mainConfig->get(
'LBFactoryConf' ),
154 $instance =
new $class( $lbConf );
168 $config->get(
'ExternalStores' )
176 'HttpRequestFactory' =>
186 $config->get(
'InterwikiExpiry' ),
187 $config->get(
'InterwikiCache' ),
188 $config->get(
'InterwikiScopes' ),
189 $config->get(
'InterwikiFallbackSite' )
203 if ( defined(
'MW_NO_SESSION' ) ) {
204 return $services->getLinkRendererFactory()->create();
206 return $services->getLinkRendererFactory()->createForUser( $wgUser );
219 return \ObjectCache::newFromId( $cacheId );
228 return
$services->getConfigFactory()->makeConfig(
'main' );
232 $mainConfig =
$services->getMainConfig();
234 $id = $mainConfig->get(
'MainStash' );
235 if ( !isset( $mainConfig->get(
'ObjectCaches' )[$id] ) ) {
236 throw new UnexpectedValueException(
237 "Cache type \"$id\" is not present in \$wgObjectCaches." );
240 return \ObjectCache::newFromParams( $mainConfig->get(
'ObjectCaches' )[$id] );
244 $mainConfig =
$services->getMainConfig();
246 $id = $mainConfig->get(
'MainWANCache' );
247 if ( !isset( $mainConfig->get(
'WANObjectCaches' )[$id] ) ) {
248 throw new UnexpectedValueException(
249 "WAN cache type \"$id\" is not present in \$wgWANObjectCaches." );
252 $params = $mainConfig->get(
'WANObjectCaches' )[$id];
253 $objectCacheId =
$params[
'cacheId'];
254 if ( !isset( $mainConfig->get(
'ObjectCaches' )[$objectCacheId] ) ) {
255 throw new UnexpectedValueException(
256 "Cache type \"$objectCacheId\" is not present in \$wgObjectCaches." );
258 $params[
'store'] = $mainConfig->get(
'ObjectCaches' )[$objectCacheId];
260 return \ObjectCache::newWANCacheFromParams(
$params );
265 $services->getMainConfig()->get(
'MediaHandlers' )
271 $mainConfig =
$services->getMainConfig();
273 'typeFile' => $mainConfig->get(
'MimeTypeFile' ),
274 'infoFile' => $mainConfig->get(
'MimeInfoFile' ),
275 'xmlTypes' => $mainConfig->get(
'XMLMimeTypes' ),
277 function ( $mimeAnalyzer, &$head, &$tail, $file, &
$mime ) use ( $logger ) {
280 if ( $deja->isValid() ) {
281 $logger->info(
"Detected $file as image/vnd.djvu\n" );
282 $mime =
'image/vnd.djvu';
288 'MimeMagicGuessFromContent',
289 [ $mimeAnalyzer, &$head, &$tail, $file, &
$mime ]
292 'extCallback' =>
function ( $mimeAnalyzer,
$ext, &
$mime ) {
296 'initCallback' =>
function ( $mimeAnalyzer ) {
298 Hooks::run(
'MimeMagicInit', [ $mimeAnalyzer ] );
303 if (
$params[
'infoFile'] ===
'includes/mime.info' ) {
304 $params[
'infoFile'] = __DIR__ .
"/libs/mime/mime.info";
307 if (
$params[
'typeFile'] ===
'includes/mime.types' ) {
308 $params[
'typeFile'] = __DIR__ .
"/libs/mime/mime.types";
311 $detectorCmd = $mainConfig->get(
'MimeDetectorCommand' );
312 if ( $detectorCmd ) {
313 $factory =
$services->getShellCommandFactory();
314 $params[
'detectCallback'] =
function ( $file ) use ( $detectorCmd, $factory ) {
315 $result = $factory->create()
317 ->unsafeParams( $detectorCmd )
320 return $result->getStdout();
324 return new MimeAnalyzer(
$params );
344 return
$services->getParserFactory()->create();
354 $config->get(
'CacheEpoch' )
360 $services->getMainConfig()->get(
'ParserConf' ),
371 $config->get(
'PasswordConfig' ),
372 $config->get(
'PasswordDefault' )
376 'PerDbNameStatsdDataFactory' =>
379 $wiki = $config->get(
'DBname' );
391 $services->getLinkRendererFactory()->create()
393 $factory->setLogger( LoggerFactory::getInstance(
'preferences' ) );
399 $mainConfig =
$services->getMainConfig();
401 $mainConfig->get(
'SquidServers' ),
402 $mainConfig->get(
'SquidServersNoPurge' )
423 $renderer->
setLogger( LoggerFactory::getInstance(
'SaveParse' ) );
429 return
$services->getRevisionStoreFactory()->getRevisionStore();
441 $config->get(
'MultiContentRevisionSchemaMigrationStage' ),
442 LoggerFactory::getProvider(),
443 $config->get(
'ContentHandlerUseDB' )
462 'time' => $config->get(
'MaxShellTime' ),
463 'walltime' => $config->get(
'MaxShellWallClockTime' ),
464 'memory' => $config->get(
'MaxShellMemory' ),
465 'filesize' => $config->get(
'MaxShellFileSize' ),
467 $cgroup = $config->get(
'ShellCgroup' );
468 $restrictionMethod = $config->get(
'ShellRestrictionMethod' );
470 $factory =
new CommandFactory( $limits, $cgroup, $restrictionMethod );
471 $factory->setLogger( LoggerFactory::getInstance(
'exec' ) );
472 $factory->logStderr();
478 $cacheFile =
$services->getMainConfig()->get(
'SitesCacheFile' );
480 if ( $cacheFile !==
false ) {
501 $names =
$services->getMainConfig()->get(
'ValidSkinNames' );
503 foreach ( $names as $name => $skin ) {
504 $factory->register( $name, $skin,
function () use ( $name, $skin ) {
505 $class =
"Skin$skin";
506 return new $class( $name );
510 $factory->register(
'fallback',
'Fallback',
function () {
514 $factory->register(
'apioutput',
'ApiOutput',
function () {
530 rtrim(
$services->getMainConfig()->get(
'StatsdMetricPrefix' ),
'.' )
535 return
$services->getService(
'_MediaWikiTitleCodec' );
539 return
$services->getService(
'_MediaWikiTitleCodec' );
544 $services->getMainConfig()->get(
'EnableUploads' ),
549 'VirtualRESTServiceClient' =>
551 $config =
$services->getMainConfig()->get(
'VirtualRestConfig' );
554 foreach ( $config[
'paths'] as $prefix => $serviceConfig ) {
555 $class = $serviceConfig[
'class'];
557 $constructArg = $serviceConfig[
'options'] ?? [];
558 $constructArg += $config[
'global'];
560 $vrsClient->mount( $prefix, [
'class' => $class,
'config' => $constructArg ] );
566 'WatchedItemQueryService' =>
580 $services->getMainConfig()->get(
'UpdateRowsPerQuery' )
584 if (
$services->getMainConfig()->get(
'ReadOnlyWatchedItemStore' ) ) {
591 'WikiRevisionOldRevisionImporterNoUpdates' =>
604 $services->getMainConfig()->get(
'LocalInterwikis' ),
610 return
$services->getBlobStoreFactory()->newSqlBlobStore();
wfUrlProtocols( $includeProtocolRelative=true)
Returns a regular expression of url protocols.
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
wfGetCache( $cacheType)
Get a specific cache object.
wfIsHHVM()
Check if we are running under HHVM.
This class handles the logic for the actor table migration.
Class representing a cache/ephemeral data store.
A factory for application metric data.
Factory class to create Config objects.
Support for detecting/validating DjVu image files and getting some basic file metadata (resolution et...
A BagOStuff object with no objects in it.
Factory class for spawning EventRelayer objects using configuration.
Provides a file-based cache of a SiteStore.
Caches user genders when needed to use correct namespace aliases.
Simple store for keeping values in an associative array for the current process.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Various HTTP related functions.
Internationalisation code.
Cache for article titles (prefixed DB keys) and ids linked from one source.
static applyDefaultConfig(array $lbConf, Config $mainConfig, ConfiguredReadOnlyMode $readOnlyMode)
static getLBFactoryClass(array $config)
Returns the LBFactory class to use and the load balancer configuration.
static setSchemaAliases(LBFactory $lbFactory, Config $config)
A factory that stores information about MagicWords, and creates them on demand with caching.
Factory for handling the special page list and generating SpecialPage objects.
Class to handle multiple HTTP requests.
Functions to get cache objects.
static getInstance( $id)
Get a cached instance of the specified type of cache object.
static getLocalClusterInstance()
Get the main cluster-local cache object.
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
Factory class for creating and checking Password objects.
Proxy to prefix metric keys sent to a StatsdDataFactoryInterface.
A service class for fetching the wiki's current read-only mode.
Configuration handling class for SearchEngine.
Factory class for SearchEngine.
SkinTemplate class for API output.
Factory class to create Skin objects.
SkinTemplate class for the fallback skin.
Virtual HTTP service client loosely styled after a Virtual File System.
Multi-datacenter aware caching interface.
Storage layer class for WatchedItems.
setStatsdDataFactory(StatsdDataFactoryInterface $stats)
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title e g db for database replication lag or jobqueue for job queue size converted to pseudo seconds It is possible to add more fields and they will be returned to the user in the API response after the basic globals have been set but before ordinary actions take place or wrap services the preferred way to define a new service is the $wgServiceWiringFiles array $services
Interface for configuration instances.
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
A title parser service for MediaWiki.
if( $ext=='php'|| $ext=='php5') $mime
if(!is_readable( $file)) $ext