Go to the documentation of this file.
25 require __DIR__ .
'/../Maintenance.php';
41 parent::__construct();
43 $this->
addArg(
'title',
'The name of the page to parse' );
44 $this->
addOption(
'cold',
'Don\'t repeat the parse operation to warm the cache' );
46 'Use the version of the page which was current at the given time',
49 'Use templates which were current at the given time (except that moves and ' .
50 'deletes are not handled properly)',
62 $this->
error(
"Invalid title" );
70 $this->
error(
"The page did not exist at that time" );
80 $this->
error(
"Unable to load revision, incorrect title?" );
88 $startUsage = getrusage();
89 $startTime = microtime(
true );
91 $endUsage = getrusage();
92 $endTime = microtime(
true );
94 printf(
"CPU time = %.3f s, wall clock time = %.3f s\n",
96 $endUsage[
'ru_utime.tv_sec'] + $endUsage[
'ru_utime.tv_usec'] * 1
e-6
97 - $startUsage[
'ru_utime.tv_sec'] - $startUsage[
'ru_utime.tv_usec'] * 1
e-6,
99 $endTime - $startTime );
112 $id =
$dbr->selectField(
113 array(
'revision',
'page' ),
116 'page_namespace' =>
$title->getNamespace(),
117 'page_title' =>
$title->getDBkey(),
121 array(
'ORDER BY' =>
'rev_timestamp DESC',
'LIMIT' => 1 ),
122 array(
'revision' =>
array(
'INNER JOIN',
'rev_page=page_id' ) )
135 $content->getParserOutput( $revision->
getTitle(), $revision->
getId() );
149 $pdbk =
$title->getPrefixedDBkey();
150 if ( !isset( $this->idCache[$pdbk] ) ) {
151 $proposedId = $this->
getRevIdForTime( $title, $this->templateTimestamp );
152 $this->idCache[$pdbk] = $proposedId;
154 if ( $this->idCache[$pdbk] !==
false ) {
155 $id = $this->idCache[$pdbk];
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
addDescription( $text)
Set the description text.
getContent( $audience=self::FOR_PUBLIC, User $user=null)
Fetch revision content if it's available to the specified audience.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
addOption( $name, $description, $required=false, $withArg=false, $shortName=false)
Add a parameter to the script.
require_once RUN_MAINTENANCE_IF_MAIN
in this case you re responsible for computing and outputting the entire conflict i e
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Maintenance script to benchmark how long it takes to parse a given title at an optionally specified t...
do that in ParserLimitReportFormat instead $parser
string $templateTimestamp
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS) *.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
getTitle()
Returns the title of the page associated with this entry or null.
onFetchTemplate(Parser $parser, Title $title, &$skip, &$id)
Hook into the parser's revision ID fetcher.
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
static newFromTitle( $title, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given title.
presenting them properly to the user as errors is done by the caller $title
runParser(Revision $revision)
Parse the text from a given Revision.
static register( $name, $callback)
Attach an event handler to a given hook.
execute()
Do the actual work.
Represents a title within MediaWiki.
getOption( $name, $default=null)
Get an option, or return the default.
addArg( $arg, $description, $required=true)
Add some args that are needed.
__construct()
Default constructor.
error( $err, $die=0)
Throw an error to the user.
hasOption( $name)
Checks to see if a particular param exists.
getArg( $argId=0, $default=null)
Get an argument.
array $idCache
Cache that maps a Title DB key to revision ID for the requested timestamp *.
getRevIdForTime(Title $title, $timestamp)
Fetch the ID of the revision of a Title that occurred.