Go to the documentation of this file.
24 define(
'REPORTING_INTERVAL', 1 );
26 if ( !defined(
'MEDIAWIKI' ) ) {
27 require_once __DIR__ .
'/../commandLine.inc';
28 require_once __DIR__ .
'/../../includes/externalstore/ExternalStoreDB.php';
29 require_once
'resolveStubs.php';
33 if ( !isset(
$args[0] ) ) {
34 print
"Usage: php moveToExternal.php [-s <startid>] [-e <endid>] <cluster>\n";
44 $maxID = $dbw->selectField(
'text',
'MAX(old_id)',
false,
$fname );
56 $count = $maxID - $minID + 1;
58 $numBlocks = ceil(
$count / $blockSize );
59 print
"Moving text rows from $minID to $maxID to external storage\n";
63 for ( $block = 0; $block < $numBlocks; $block++ ) {
64 $blockStart = $block * $blockSize + $minID;
65 $blockEnd = $blockStart + $blockSize - 1;
68 print
"oldid=$blockStart, moved=$numMoved\n";
72 $res =
$dbr->select(
'text',
array(
'old_id',
'old_flags',
'old_text' ),
74 "old_id BETWEEN $blockStart AND $blockEnd",
75 'old_flags NOT ' .
$dbr->buildLike(
$dbr->anyString(),
'external',
$dbr->anyString() ),
79 $text = $row->old_text;
81 if ( $row->old_flags ===
'' ) {
84 $flags =
"{$row->old_flags},external";
88 $obj = unserialize( $text );
89 $className = strtolower( get_class( $obj ) );
90 if ( $className ==
'historyblobstub' ) {
91 # resolveStub( $id, $row->old_text, $row->old_flags );
94 } elseif ( $className ==
'historyblobcurstub' ) {
95 $text = gzdeflate( $obj->getText() );
96 $flags =
'utf-8,gzip,external';
97 } elseif ( $className ==
'concatenatedgziphistoryblob' ) {
100 print
"Warning: unrecognised object class \"$className\"\n";
107 if ( strlen( $text ) < 100 && $className ===
false ) {
112 # print "Storing " . strlen( $text ) . " bytes to $url\n";
113 # print "old_id=$id\n";
115 $url =
$ext->store( $cluster, $text );
117 print
"Error writing to external storage\n";
120 $dbw->update(
'text',
121 array(
'old_flags' =>
$flags,
'old_text' => $url ),
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
DB accessable external objects.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
if(!defined( 'MEDIAWIKI')) moveToExternal( $cluster, $maxID, $minID=1)
if(!defined( 'MEDIAWIKI')) $fname
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined.
it s the revision text itself In either if gzip is the revision text is gzipped $flags
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
wfWaitForSlaves( $maxLag=false, $wiki=false, $cluster=false)
Modern version of wfWaitForSlaves().
processing should stop and the error should be shown to the user * false
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
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