~ubuntu-branches/debian/squeeze/mediawiki/squeeze

« back to all changes in this revision

Viewing changes to .pc/backup_documentation.patch/maintenance/dumpBackup.php

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Wiltshire, Thorsten Glaser, Jonathan Wiltshire
  • Date: 2010-06-29 14:20:35 UTC
  • Revision ID: james.westby@ubuntu.com-20100629142035-fgcoyvnz7xzzqjmv
Tags: 1:1.15.4-2
[ Thorsten Glaser ]
* debian/control: add Vcs-SVN and Vcs-Browser

[ Jonathan Wiltshire ]
* debian/source/format: Switch to source format 3.0 (quilt)
* debian/rules: Drop CDBS quilt logic
* debian_specific_config.patch: Don't just redefine MW_INSTALL_PATH,
  remove the original definition (LP: #406358)
* debian/README.source: document use of quilt and format 3.0 (quilt)
* New patch backup_documentation.patch improves documentation of
  maintenance/dumpBackup.php (closes: #572355)
* Standards version 3.9.0 (no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * Copyright (C) 2005 Brion Vibber <brion@pobox.com>
 
4
 * http://www.mediawiki.org/
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License along
 
17
 * with this program; if not, write to the Free Software Foundation, Inc.,
 
18
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
19
 * http://www.gnu.org/copyleft/gpl.html
 
20
 *
 
21
 * @file
 
22
 * @ingroup Dump Maintenance
 
23
 */
 
24
 
 
25
$originalDir = getcwd();
 
26
 
 
27
$optionsWithArgs = array( 'pagelist', 'start', 'end' );
 
28
 
 
29
require_once( 'commandLine.inc' );
 
30
require_once( 'backup.inc' );
 
31
 
 
32
$dumper = new BackupDumper( $argv );
 
33
 
 
34
if( isset( $options['quiet'] ) ) {
 
35
        $dumper->reporting = false;
 
36
}
 
37
 
 
38
if ( isset( $options['pagelist'] ) ) {
 
39
        $olddir = getcwd();
 
40
        chdir( $originalDir );
 
41
        $pages = file( $options['pagelist'] );
 
42
        chdir( $olddir );
 
43
        if ( $pages === false ) {
 
44
                wfDie( "Unable to open file {$options['pagelist']}\n" );
 
45
        }
 
46
        $pages = array_map( 'trim', $pages );
 
47
        $dumper->pages = array_filter( $pages, create_function( '$x', 'return $x !== "";' ) );
 
48
}
 
49
 
 
50
if( isset( $options['start'] ) ) {
 
51
        $dumper->startId = intval( $options['start'] );
 
52
}
 
53
if( isset( $options['end'] ) ) {
 
54
        $dumper->endId = intval( $options['end'] );
 
55
}
 
56
$dumper->skipHeader = isset( $options['skip-header'] );
 
57
$dumper->skipFooter = isset( $options['skip-footer'] );
 
58
$dumper->dumpUploads = isset( $options['uploads'] );
 
59
 
 
60
$textMode = isset( $options['stub'] ) ? WikiExporter::STUB : WikiExporter::TEXT;
 
61
 
 
62
if( isset( $options['full'] ) ) {
 
63
        $dumper->dump( WikiExporter::FULL, $textMode );
 
64
} elseif( isset( $options['current'] ) ) {
 
65
        $dumper->dump( WikiExporter::CURRENT, $textMode );
 
66
} elseif( isset( $options['stable'] ) ) {
 
67
        $dumper->dump( WikiExporter::STABLE, $textMode );
 
68
} elseif( isset( $options['logs'] ) ) {
 
69
        $dumper->dump( WikiExporter::LOGS );
 
70
} else {
 
71
        $dumper->progress( <<<ENDS
 
72
This script dumps the wiki page database into an XML interchange wrapper
 
73
format for export or backup.
 
74
 
 
75
XML output is sent to stdout; progress reports are sent to stderr.
 
76
 
 
77
Usage: php dumpBackup.php <action> [<options>]
 
78
Actions:
 
79
  --full      Dump complete history of every page.
 
80
  --current   Includes only the latest revision of each page.
 
81
  --logs      Dump action logs for every page.
 
82
 
 
83
Options:
 
84
  --quiet     Don't dump status reports to stderr.
 
85
  --report=n  Report position and speed after every n pages processed.
 
86
              (Default: 100)
 
87
  --server=h  Force reading from MySQL server h
 
88
  --start=n   Start from page_id n
 
89
  --end=n     Stop before page_id n (exclusive)
 
90
  --skip-header Don't output the <mediawiki> header
 
91
  --skip-footer Don't output the </mediawiki> footer
 
92
  --stub      Don't perform old_text lookups; for 2-pass dump
 
93
  --uploads   Include upload records (experimental)
 
94
 
 
95
Fancy stuff:
 
96
  --plugin=<class>[:<file>]   Load a dump plugin class
 
97
  --output=<type>:<file>      Begin a filtered output stream;
 
98
                              <type>s: file, gzip, bzip2, 7zip
 
99
  --filter=<type>[:<options>] Add a filter on an output branch
 
100
 
 
101
ENDS
 
102
);
 
103
}
 
104
 
 
105