/**
  * Default per-revision callback, performs the import.
  * @param WikiRevision $revision
  * @return bool
  */
 public function importRevision($revision)
 {
     if (!$revision->getContentHandler()->canBeUsedOn($revision->getTitle())) {
         $this->notice('import-error-bad-location', $revision->getTitle()->getPrefixedText(), $revision->getID(), $revision->getModel(), $revision->getFormat());
         return false;
     }
     try {
         $dbw = wfGetDB(DB_MASTER);
         return $dbw->deadlockLoop(array($revision, 'importOldRevision'));
     } catch (MWContentSerializationException $ex) {
         $this->notice('import-error-unserialize', $revision->getTitle()->getPrefixedText(), $revision->getID(), $revision->getModel(), $revision->getFormat());
     }
     return false;
 }
Exemple #2
0
 /**
  * Default per-revision callback, performs the import.
  * @param WikiRevision $revision
  * @return bool
  */
 public function importRevision($revision)
 {
     if (!$revision->getContentHandler()->canBeUsedOn($revision->getTitle())) {
         $this->notice('import-error-bad-location', $revision->getTitle()->getPrefixedText(), $revision->getID(), $revision->getModel(), $revision->getFormat());
         return false;
     }
     try {
         return $revision->importOldRevision();
     } catch (MWContentSerializationException $ex) {
         $this->notice('import-error-unserialize', $revision->getTitle()->getPrefixedText(), $revision->getID(), $revision->getModel(), $revision->getFormat());
     }
     return false;
 }