26 require_once __DIR__ .
'/../includes/Benchmarker.php';
38 private $titleFormatter;
47 private $dbKey =
'FooBar';
63 parent::__construct();
72 $this->toParse =
'Category:FooBar';
75 'function' => [ $this,
'constructTitleValue' ],
78 'function' => [ $this,
'constructTitle' ],
81 'function' => [ $this,
'constructTitleSafe' ],
84 'function' => [ $this,
'getPrefixedTextTitleValue' ],
87 'function' => [ $this,
'getPrefixedTextTitle' ],
89 'parseTitleValue cached' => [
90 'function' => [ $this,
'parseTitleValue' ],
91 'setup' => [ $this,
'randomize' ],
93 'parseTitle cached' => [
94 'function' => [ $this,
'parseTitle' ],
95 'setup' => [ $this,
'randomize' ],
97 'parseTitleValue no cache' => [
98 'function' => [ $this,
'parseTitleValue' ],
99 'setupEach' => [ $this,
'randomize' ],
101 'parseTitle no cache' => [
102 'function' => [ $this,
'parseTitle' ],
103 'setupEach' => [ $this,
'randomize' ],
120 return Title::makeTitle(
NS_CATEGORY, $this->dbKey );
124 return Title::makeTitleSafe(
NS_CATEGORY, $this->dbKey );
129 return $this->titleFormatter->getPrefixedText( $this->titleValue );
133 return $this->title->getPrefixedText();
138 $this->titleParser->parseTitle(
'Category:' . $this->dbKey,
NS_MAIN );
142 Title::newFromText(
'Category:' . $this->dbKey );
147 require_once RUN_MAINTENANCE_IF_MAIN;
wfRandomString( $length=32)
Get a random string containing a number of pseudo-random hex characters.
Maintenance script that benchmarks TitleValue vs Title.
getPrefixedTextTitleValue()
randomize()
Use a different dbKey each time to avoid influence of Title caches.
__construct()
Default constructor.
execute()
Do the actual work.
Base class for benchmark scripts.
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.