コード例 #1
0
 public function getRevisions()
 {
     if ($this->pageData === null) {
         // Previous revisions of the header are preserved in the underlying wikitext
         // page history. Only the top revision is imported.
         $response = $this->api->retrieveTopRevisionByTitle(array($this->title));
         $this->pageData = reset($response);
     }
     $revisions = array();
     if (isset($this->pageData['revisions']) && count($this->pageData['revisions']) > 0) {
         $lastLqtRevision = new ImportRevision(end($this->pageData['revisions']), $this, $this->source->getScriptUser());
         $titleObject = Title::newFromText($this->title);
         $cleanupRevision = $this->createHeaderCleanupRevision($lastLqtRevision, $titleObject);
         $revisions = array($lastLqtRevision, $cleanupRevision);
     }
     return new ArrayIterator($revisions);
 }
コード例 #2
0
 public function __construct(User $user = null)
 {
     parent::__construct();
     $this->user = $user;
 }