25require __DIR__ .
'/../commandLine.inc';
28 echo
"Usage: php testCompression.php [--type=<type>] [--start=<start-date>] " .
29 "[--limit=<num-revs>] <page-title>\n";
33$lang = Language::factory(
'en' );
34$title = Title::newFromText(
$args[0] );
37 echo
"Starting from " .
$lang->timeanddate( $start ) .
"\n";
39 $start =
'19700101000000';
56 'page_namespace' => $title->getNamespace(),
57 'page_title' => $title->getDBkey(),
58 'rev_timestamp > ' .
$dbr->addQuotes(
$dbr->timestamp( $start ) ),
61 [
'LIMIT' => $limit ],
70foreach (
$res as $row ) {
72 $text = $revision->getSerializedData();
83# print_r( $blob->mDiffMap );
85printf(
"%s\nCompression ratio for %d revisions: %5.2f, %s -> %d\n",
92printf(
"Compression time: %5.2f ms\n",
$t * 1000 );
96foreach (
$keys as $id => $key ) {
97 $text =
$blob->getItem( $key );
99 echo
"Content hash mismatch for rev_id $id\n";
104printf(
"Decompression time: %5.2f ms\n",
$t * 1000 );
unserialize( $serialized)
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
static getQueryInfo( $options=[])
Return the tables, fields, and join conditions to be selected to create a new revision object.
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
foreach( $res as $row) $serialized
if(!isset( $args[0])) $lang