Go to the documentation of this file.
24 require_once __DIR__ .
'/Maintenance.php';
34 parent::__construct();
36 'Fix instances of JSON pages prior to them being the ContentHandler default' );
45 if ( !$this->
getConfig()->
get(
'ContentHandlerUseDB' ) ) {
46 $this->
output(
"\$wgContentHandlerUseDB is not enabled, nothing to do.\n" );
60 [
'page_id',
'page_title',
'page_namespace',
'page_content_model' ],
62 'page_namespace' => $ns,
63 'page_title ' . $like,
64 'page_id > ' .
$dbr->addQuotes( $lastPage )
67 [
'ORDER BY' =>
'page_id',
'LIMIT' => $this->
getBatchSize() ]
80 $this->
output(
"Processing {$title} ({$row->page_id})...\n" );
89 $this->
output(
"Setting page_content_model to json..." );
93 [
'page_id' => $row->page_id ],
96 $this->
output(
"done.\n" );
103 $this->
output(
"Setting rev_content_model to wikitext..." );
105 $ids = $dbw->selectFieldValues(
108 [
'rev_page' => $row->page_id ],
111 foreach ( array_chunk( $ids, 50 )
as $chunk ) {
115 [
'rev_page' => $row->page_id,
'rev_id' => $chunk ]
119 $this->
output(
"done.\n" );
122 $this->
output(
"not a JSON page? Skipping\n" );
addDescription( $text)
Set the description text.
namespace and then decline to actually register it & $namespaces
require_once RUN_MAINTENANCE_IF_MAIN
const CONTENT_MODEL_WIKITEXT
wfWaitForSlaves( $ifWritesSince=null, $wiki=false, $cluster=false, $timeout=null)
Waits for the replica DBs to catch up to the master position.
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
getUpdateKey()
Get the update key name to go in the update log table.
static newFromTitle(LinkTarget $linkTarget, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given link target.
doDBUpdates()
Do the actual work.
Represents the content of a JSON content.
namespace and then decline to actually register it file or subcat img or subcat $title
Class for scripts that perform database maintenance and want to log the update in updatelog so we can...
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
__construct()
Default constructor.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction $rows
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
getBatchSize()
Returns batch size.
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
getDB( $db, $groups=[], $wiki=false)
Returns a database to be used by current maintenance script.
output( $out, $channel=null)
Throw some output to the user.
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
Usage: fixDefaultJsonContentPages.php.
setBatchSize( $s=0)
Set the batch size.