Go to the documentation of this file.
24 require_once __DIR__ .
'/Maintenance.php';
33 parent::__construct();
34 $this->mDescription =
"Send purge requests for listed pages to squid";
35 $this->
addOption(
'purge',
'Whether to update page_touched.',
false,
false );
36 $this->
addOption(
'namespace',
'Namespace number',
false,
true );
37 $this->
addOption(
'all',
'Purge all pages',
false,
false );
38 $this->
addOption(
'delay',
'Number of seconds to delay between each purge',
false,
true );
39 $this->
addOption(
'verbose',
'Show more output',
false,
false,
'v' );
46 } elseif ( $this->
hasOption(
'namespace' ) ) {
51 $this->
output(
"Done!\n" );
61 while ( !feof( $stdin ) ) {
62 $page = trim( fgets( $stdin ) );
63 if ( preg_match(
'%^https?://%', $page ) ) {
65 } elseif ( $page !==
'' ) {
68 $url =
$title->getInternalURL();
75 $this->
output(
"(Invalid title '$page')\n" );
79 $this->
output(
"Purging " . count( $urls ) .
" urls\n" );
89 if ( $namespace ===
false ) {
92 $conds =
array(
'page_namespace' => $namespace );
96 array(
'page_id',
'page_namespace',
'page_title' ),
97 $conds +
array(
'page_id > ' .
$dbr->addQuotes( $startId ) ),
100 'LIMIT' => $this->mBatchSize,
101 'ORDER BY' =>
'page_id'
105 if ( !
$res->numRows() ) {
109 foreach (
$res as $row ) {
111 $url =
$title->getInternalURL();
113 $startId = $row->page_id;
125 $delay = floatval( $this->
getOption(
'delay' ) );
126 foreach ( $urls
as $url ) {
128 $this->
output( $url .
"\n" );
132 usleep( $delay * 1e6 );
136 $this->
output( implode(
"\n", $urls ) .
"\n" );
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
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
getStdin( $len=null)
Return input from stdin.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
addOption( $name, $description, $required=false, $withArg=false, $shortName=false)
Add a parameter to the script.
require_once RUN_MAINTENANCE_IF_MAIN
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Maintenance script that sends purge requests for listed pages to squid.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
execute()
Do the actual work.
Handles purging appropriate Squid URLs given a title (or titles)
doPurge()
Purge URL coming from stdin.
__construct()
Default constructor.
presenting them properly to the user as errors is done by the caller $title
getOption( $name, $default=null)
Get an option, or return the default.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
output( $out, $channel=null)
Throw some output to the user.
purgeNamespace( $namespace=false)
Purge a namespace or all pages.
hasOption( $name)
Checks to see if a particular param exists.
sendPurgeRequest( $urls)
Helper to purge an array of $urls.
setBatchSize( $s=0)
Set the batch size.