Beispiel #1
0
 /**
  * @param Path      $path
  * @param \DateTime $fromDate
  * @param \DateTime $toDate
  *
  * @return FileReportModel[]
  */
 public function listContents(Path $path, \DateTime $fromDate, \DateTime $toDate)
 {
     $adapter = $this->getAdapter();
     $files = [];
     $rawFiles = $adapter->listContents($path->getPath(), true);
     foreach ($rawFiles as $rawFile) {
         if ($rawFile['type'] !== 'file') {
             continue;
         }
         if (isset($rawFile['timestamp'])) {
             $creationDate = \DateTime::createFromFormat('U', $rawFile['timestamp']);
         } else {
             $creationDate = null;
         }
         $files[] = new FileReportModel($rawFile['path'], $rawFile['size'], $creationDate);
     }
     $this->sortFilesByDate($files);
     return $files;
 }
Beispiel #2
0
 /**
  * @param Path      $path
  * @param \DateTime $fromDate
  * @param \DateTime $toDate
  *
  * @return FileReportModel[]
  */
 public function listContents(Path $path, \DateTime $fromDate, \DateTime $toDate)
 {
     $path->setPath(preg_replace('#^(.+)\\/[^\\/]+$#', '$1', $path->getPath()));
     return parent::listContents($path, $fromDate, $toDate);
 }