48 'names' => [ 2 => null ],
63 $length = strlen( $text );
64 $threshold = $config->get(
'PreprocessorCacheThreshold' );
65 if ( $threshold ===
false || $length < $threshold || $length > 1e6 ) {
70 defined(
'static::CACHE_PREFIX' ) ? static::CACHE_PREFIX :
static::class,
72 $value = sprintf(
"%08d", static::CACHE_VERSION ) . $tree;
77 LoggerFactory::getInstance(
'Preprocessor' )
78 ->info(
"Cached preprocessor output (key: $key)" );
92 $length = strlen( $text );
93 $threshold = $config->get(
'PreprocessorCacheThreshold' );
94 if ( $threshold ===
false || $length < $threshold || $length > 1e6 ) {
101 defined(
'static::CACHE_PREFIX' ) ? static::CACHE_PREFIX :
static::class,
109 $version = intval( substr(
$value, 0, 8 ) );
110 if ( $version !== static::CACHE_VERSION ) {
114 LoggerFactory::getInstance(
'Preprocessor' )
115 ->info(
"Loaded preprocessor output from cache (key: $key)" );
117 return substr(
$value, 8 );
125 abstract public function newFrame();
215 public function implode( $sep );
329 public function setTTL( $ttl );
391 public function item( $i );
expand($root, $flags=0)
Expand a document tree node.
array $rules
Brace matching rules.
cachedExpand($key, $root, $flags=0)
Expand a document tree node, caching the result on its parent with the given key. ...
item($i)
Returns an item of an array-type node.
isEmpty()
Returns true if there are no arguments in this frame.
getArgument($name)
Get an argument to this frame by name.
setVolatile($flag=true)
Set the "volatile" flag.
newCustomFrame($args)
Create a new custom frame for programmatic use of parameter replacement as used in some extensions...
splitHeading()
Split an "" node.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
getTTL()
Get the TTL of the frame's output.
static getInstance($id)
Get a cached instance of the specified type of cache object.
getArguments()
Returns all arguments of this frame.
There are three types of nodes:
getNamedArguments()
Returns all named arguments of this frame.
setTTL($ttl)
Set the TTL of the output of this frame and all of its ancestors.
it s the revision text itself In either if gzip is the revision text is gzipped $flags
getNumberedArguments()
Returns all numbered arguments of this frame.
newChild($args=false, $title=false, $indexOffset=0)
Create a child frame.
implodeWithFlags($sep, $flags)
Implode with flags for expand()
getFirstChild()
Get the first child of a tree node.
array cacheSetTree($text, $flags, $tree)
Store a document tree in the cache.
static getMain()
Static methods.
implode($sep)
Implode with no flags specified.
getNextSibling()
Get the next sibling of any node.
getName()
Get the name of this node.
loopCheck($title)
Returns true if the infinite loop check is OK, false if a loop is detected.
namespace and then decline to actually register it file or subcat img or subcat $title
getLength()
Returns the length of the array, or false if this is not an array-type node.
isVolatile()
Get the "volatile" flag.
getChildrenOfType($type)
Get all children of this tree node which have a given name.
getTitle()
Get a title of frame.
splitExt()
Split an "" node into an associative array containing name, attr, inner and close All values in ...
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
virtualBracketedImplode($start, $sep, $end)
Virtual implode with brackets.
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
splitArg()
Split a "
" node into an associative array containing: name PPNode name index String index value...
MediaWiki Logger LoggerFactory implements a PSR[0] compatible message logging system Named Psr Log LoggerInterface instances can be obtained from the MediaWiki Logger LoggerFactory::getInstance() static method.MediaWiki\Logger\LoggerFactory expects a class implementing the MediaWiki\Logger\Spi interface to act as a factory for new Psr\Log\LoggerInterface instances.The"Spi"in MediaWiki\Logger\Spi stands for"service provider interface".An SPI is an API intended to be implemented or extended by a third party.This software design pattern is intended to enable framework extension and replaceable components.It is specifically used in the MediaWiki\Logger\LoggerFactory service to allow alternate PSR-3 logging implementations to be easily integrated with MediaWiki.The service provider interface allows the backend logging library to be implemented in multiple ways.The $wgMWLoggerDefaultSpi global provides the classname of the default MediaWiki\Logger\Spi implementation to be loaded at runtime.This can either be the name of a class implementing the MediaWiki\Logger\Spi with a zero argument const ructor or a callable that will return an MediaWiki\Logger\Spi instance.Alternately the MediaWiki\Logger\LoggerFactory MediaWiki Logger LoggerFactory
preprocessToObj($text, $flags=0)
Preprocess text to a PPNode.
wfMemcKey()
Make a cache key for the local wiki.
getChildren()
Get an array-type node containing the children of this node.
newFrame()
Create a new top-level frame for expansion of a page.
isTemplate()
Return true if the frame is a template frame.
const SUPPORTS_INDEX_OFFSET
This constant exists when $indexOffset is supported in newChild()
newPartNodeArray($values)
Create a new custom node for programmatic use of parameter replacement as used in some extensions...
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
cacheGetTree($text, $flags)
Attempt to load a precomputed document tree for some given wikitext from the cache.
virtualImplode($sep)
Makes an object that, when expand()ed, will be the same as one obtained with implode() ...
Allows to change the fields on the form that will be generated $name