Пример #1
0
    /**
     * @param array $args For backward compatibility
     */
    function __construct($args = null)
    {
        parent::__construct();
        $this->addDescription(<<<TEXT
This script postprocesses XML dumps from dumpBackup.php to add
page text which was stubbed out (using --stub).

XML input is accepted on stdin.
XML output is sent to stdout; progress reports are sent to stderr.
TEXT
);
        $this->stderr = fopen("php://stderr", "wt");
        $this->addOption('stub', 'To load a compressed stub dump instead of stdin. ' . 'Specify as --stub=<type>:<file>.', false, true);
        $this->addOption('prefetch', 'Use a prior dump file as a text source, to savepressure on the ' . 'database. (Requires the XMLReader extension). Specify as --prefetch=<type>:<file>', false, true);
        $this->addOption('maxtime', 'Write out checkpoint file after this many minutes (writing' . 'out complete page, closing xml file properly, and opening new one' . 'with header).  This option requires the checkpointfile option.', false, true);
        $this->addOption('checkpointfile', 'Use this string for checkpoint filenames,substituting ' . 'first pageid written for the first %s (required) and the last pageid written for the ' . 'second %s if it exists.', false, true, false, true);
        // This can be specified multiple times
        $this->addOption('quiet', 'Don\'t dump status reports to stderr.');
        $this->addOption('current', 'Base ETA on number of pages in database instead of all revisions');
        $this->addOption('spawn', 'Spawn a subprocess for loading text records');
        $this->addOption('buffersize', 'Buffer size in bytes to use for reading the stub. ' . '(Default: 512KB, Minimum: 4KB)', false, true);
        if ($args) {
            $this->loadWithArgv($args);
            $this->processOptions();
        }
    }
Пример #2
0
    function __construct($args = null)
    {
        parent::__construct();
        $this->addDescription(<<<TEXT
This script dumps the wiki page or logging database into an
XML interchange wrapper format for export or backup.

XML output is sent to stdout; progress reports are sent to stderr.

WARNING: this is not a full database dump! It is merely for public export
         of your wiki. For full backup, see our online help at:
         https://www.mediawiki.org/wiki/Backup
TEXT
);
        $this->stderr = fopen("php://stderr", "wt");
        // Actions
        $this->addOption('full', 'Dump all revisions of every page');
        $this->addOption('current', 'Dump only the latest revision of every page.');
        $this->addOption('logs', 'Dump all log events');
        $this->addOption('stable', 'Dump stable versions of pages');
        $this->addOption('revrange', 'Dump range of revisions specified by revstart and ' . 'revend parameters');
        $this->addOption('orderrevs', 'Dump revisions in ascending revision order ' . '(implies dump of a range of pages)');
        $this->addOption('pagelist', 'Dump only pages included in the file', false, true);
        // Options
        $this->addOption('start', 'Start from page_id or log_id', false, true);
        $this->addOption('end', 'Stop before page_id or log_id n (exclusive)', false, true);
        $this->addOption('revstart', 'Start from rev_id', false, true);
        $this->addOption('revend', 'Stop before rev_id n (exclusive)', false, true);
        $this->addOption('skip-header', 'Don\'t output the <mediawiki> header');
        $this->addOption('skip-footer', 'Don\'t output the </mediawiki> footer');
        $this->addOption('stub', 'Don\'t perform old_text lookups; for 2-pass dump');
        $this->addOption('uploads', 'Include upload records without files');
        $this->addOption('include-files', 'Include files within the XML stream');
        if ($args) {
            $this->loadWithArgv($args);
            $this->processOptions();
        }
    }