Go to the documentation of this file.
23 require_once __DIR__ .
'/Benchmarker.php';
60 parent::__construct();
65 $this->titleFormatter = MediaWikiServices::getInstance()->getTitleFormatter();
66 $this->titleParser = MediaWikiServices::getInstance()->getTitleParser();
69 $this->toParse =
'Category:FooBar';
72 'function' => [ $this,
'constructTitleValue' ],
75 'function' => [ $this,
'constructTitle' ],
78 'function' => [ $this,
'constructTitleSafe' ],
81 'function' => [ $this,
'getPrefixedTextTitleValue' ],
84 'function' => [ $this,
'getPrefixedTextTitle' ],
86 'parseTitleValue cached' => [
87 'function' => [ $this,
'parseTitleValue' ],
88 'setup' => [ $this,
'randomize' ],
90 'parseTitle cached' => [
91 'function' => [ $this,
'parseTitle' ],
92 'setup' => [ $this,
'randomize' ],
94 'parseTitleValue no cache' => [
95 'function' => [ $this,
'parseTitleValue' ],
96 'setupEach' => [ $this,
'randomize' ],
98 'parseTitle no cache' => [
99 'function' => [ $this,
'parseTitle' ],
100 'setupEach' => [ $this,
'randomize' ],
126 return $this->titleFormatter->getPrefixedText( $this->titleValue );
130 return $this->title->getPrefixedText();
135 $this->titleParser->parseTitle(
'Category:' . $this->dbKey,
NS_MAIN );
const RUN_MAINTENANCE_IF_MAIN
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Maintenance script that benchmarks TitleValue vs Title.
getPrefixedTextTitleValue()
addDescription( $text)
Set the description text.
TitleFormatter $titleFormatter
randomize()
Use a different dbKey each time to avoid influence of Title caches.
__construct()
Default constructor.
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
A title parser service for MediaWiki.
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
execute()
Do the actual work.
Base class for benchmark scripts.
Represents a title within MediaWiki.
Represents a page (or page fragment) title within MediaWiki.
wfRandomString( $length=32)
Get a random string containing a number of pseudo-random hex characters.