Ejemplo n.º 1
0
 function processOptions()
 {
     global $IP;
     parent::processOptions();
     if ($this->hasOption('buffersize')) {
         $this->bufferSize = max(intval($this->getOption('buffersize')), 4 * 1024);
     }
     if ($this->hasOption('prefetch')) {
         require_once "{$IP}/maintenance/backupPrefetch.inc";
         $url = $this->processFileOpt($this->getOption('prefetch'));
         $this->prefetch = new BaseDump($url);
     }
     if ($this->hasOption('stub')) {
         $this->input = $this->processFileOpt($this->getOption('stub'));
     }
     if ($this->hasOption('maxtime')) {
         $this->maxTimeAllowed = intval($this->getOption('maxtime')) * 60;
     }
     if ($this->hasOption('checkpointfile')) {
         $this->checkpointFiles = $this->getOption('checkpointfile');
     }
     if ($this->hasOption('current')) {
         $this->history = WikiExporter::CURRENT;
     }
     if ($this->hasOption('full')) {
         $this->history = WikiExporter::FULL;
     }
     if ($this->hasOption('spawn')) {
         $this->spawn = true;
         $val = $this->getOption('spawn');
         if ($val !== 1) {
             $this->php = $val;
         }
     }
 }
Ejemplo n.º 2
0
 function processOptions()
 {
     parent::processOptions();
     // Evaluate options specific to this class
     $this->reporting = !$this->hasOption('quiet');
     if ($this->hasOption('pagelist')) {
         $filename = $this->getOption('pagelist');
         $pages = file($filename);
         if ($pages === false) {
             $this->fatalError("Unable to open file {$filename}\n");
         }
         $pages = array_map('trim', $pages);
         $this->pages = array_filter($pages, function ($x) {
             return $x !== '';
         });
     }
     if ($this->hasOption('start')) {
         $this->startId = intval($this->getOption('start'));
     }
     if ($this->hasOption('end')) {
         $this->endId = intval($this->getOption('end'));
     }
     if ($this->hasOption('revstart')) {
         $this->revStartId = intval($this->getOption('revstart'));
     }
     if ($this->hasOption('revend')) {
         $this->revEndId = intval($this->getOption('revend'));
     }
     $this->skipHeader = $this->hasOption('skip-header');
     $this->skipFooter = $this->hasOption('skip-footer');
     $this->dumpUploads = $this->hasOption('uploads');
     $this->dumpUploadFileContents = $this->hasOption('include-files');
 }
Ejemplo n.º 3
0
 function processOptions()
 {
     parent::processOptions();
     // Evaluate options specific to this class
     $this->reporting = !$this->hasOption('quiet');
     if ($this->hasOption('pagelist')) {
         $olddir = getcwd();
         chdir($originalDir);
         $pages = file($this->getOption('quiet'));
         chdir($olddir);
         if ($pages === false) {
             echo "Unable to open file {$options['pagelist']}\n";
             die(1);
         }
         $pages = array_map('trim', $pages);
         $this->pages = array_filter($pages, create_function('$x', 'return $x !== "";'));
     }
     if ($this->hasOption('start')) {
         $this->startId = intval($this->getOption('start'));
     }
     if ($this->hasOption('end')) {
         $this->endId = intval($this->getOption('end'));
     }
     if ($this->hasOption('revstart')) {
         $this->revStartId = intval($this->getOption('revstart'));
     }
     if ($this->hasOption('revend')) {
         $this->revEndId = intval($this->getOption('revend'));
     }
     $this->skipHeader = $this->hasOption('skip-header');
     $this->skipFooter = $this->hasOption('skip-footer');
     $this->dumpUploads = $this->hasOption('uploads');
     $this->dumpUploadFileContents = $this->hasOption('include-files');
 }