Go to the documentation of this file.
25 require __DIR__ .
'/../commandLine.inc';
27 if ( !isset(
$args[0] ) ) {
28 echo
"Usage: php testCompression.php [--type=<type>] [--start=<start-date>] [--limit=<num-revs>] <page-title>\n";
35 echo
"Starting from " .
$wgLang->timeanddate( $start ) .
"\n";
37 $start =
'19700101000000';
50 array(
'page',
'revision',
'text' ),
53 'page_namespace' =>
$title->getNamespace(),
54 'page_title' =>
$title->getDBkey(),
56 'rev_timestamp > ' .
$dbr->addQuotes(
$dbr->timestamp( $start ) ),
65 $t = -microtime(
true );
68 $text = $revision->getSerializedData();
70 $hashes[$row->rev_id] = md5( $text );
78 $t += microtime(
true );
79 # print_r( $blob->mDiffMap );
81 printf(
"%s\nCompression ratio for %d revisions: %5.2f, %s -> %d\n",
88 printf(
"Compression time: %5.2f ms\n",
$t * 1000 );
90 $t = -microtime(
true );
92 foreach (
$keys as $id => $key ) {
93 $text =
$blob->getItem( $key );
94 if ( md5( $text ) !=
$hashes[$id] ) {
95 echo
"Content hash mismatch for rev_id $id\n";
99 $t += microtime(
true );
100 printf(
"Decompression time: %5.2f ms\n",
$t * 1000 );
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
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
foreach( $res as $row) $serialized
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
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
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
if(!isset( $args[0])) $title
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