コード例 #1
0
 /**
  * Read the files from the input directory
  * @return array
  */
 public function readFiles()
 {
     if ($this->isValidDirectory($this->inputDirectory)) {
         $this->resetFiles();
         if ($handle = opendir($this->inputDirectory)) {
             while (false !== ($entry = readdir($handle))) {
                 if ($entry != "." && $entry != ".." && File_Model::isImage($this->inputDirectory . '/' . $entry)) {
                     $file = new File_Model();
                     $file->setFilename($entry);
                     $file->setFileType($file->getFileTypeFromFile($this->inputDirectory . '/' . $file->getFileName()));
                     $this->files[] = $file;
                 }
             }
             closedir($handle);
         }
     }
     return $this->files;
 }