Exemplo n.º 1
0
 function GetMedias($path)
 {
     $medias = array();
     $files = scandir($path);
     sort($files);
     foreach ($files as $f) {
         if ($this->IsImage($path . '/' . $f)) {
             $image = new Image();
             $image->SetPath($path . '/' . $f);
             $medias[] = $image;
         }
         if ($this->IsVideo($path . '/' . $f)) {
             $video = new Video();
             $video->SetPath($path . '/' . $f);
             $medias[] = $video;
         }
         if ($this->IsAudio($path . '/' . $f)) {
             $audio = new Audio();
             $audio->SetPath($path . '/' . $f);
             $medias[] = $audio;
         }
     }
     return $medias;
 }