Exemplo n.º 1
0
 private function dumpVersionToIndividualFile(Version $version, $file, $key)
 {
     $this->loadIndividualFile($file, $key);
     $data = $version->toArray();
     $data['uid'] = $version->getId();
     $this->individualFiles[$key]['packages'][strtolower($version->getName())][$version->getVersion()] = $data;
     $timestamp = $version->getReleasedAt() ? $version->getReleasedAt()->getTimestamp() : time();
     if (!isset($this->individualFilesMtime[$key]) || $this->individualFilesMtime[$key] < $timestamp) {
         $this->individualFilesMtime[$key] = $timestamp;
     }
 }
Exemplo n.º 2
0
 /**
  * Populates a feed entry with data coming from Version objects.
  *
  * @param \Zend\Feed\Writer\Entry $entry
  * @param Version                 $version
  */
 protected function populateVersionData(Entry $entry, Version $version)
 {
     $entry->setTitle($entry->getTitle() . " ({$version->getVersion()})");
     $entry->setId($entry->getId() . ' ' . $version->getVersion());
     $entry->setDateModified($version->getReleasedAt());
     $entry->setDateCreated($version->getReleasedAt());
     foreach ($version->getAuthors() as $author) {
         /** @var $author \Packagist\WebBundle\Entity\Author */
         if ($author->getName()) {
             $entry->addAuthor(array('name' => $author->getName()));
         }
     }
 }