Example #1
0
 /**
  *
  * @param \SplFileInfo $dir
  * @param type $recursive
  *
  * @return MediaCollection
  */
 public function inspectDirectory($dir, $recursive = false)
 {
     $this->reader->reset()->in($dir)->followSymLinks();
     if (!$recursive) {
         $this->reader->notRecursive();
     }
     $files = new MediaCollection();
     foreach ($this->reader as $entity) {
         $file = new File($entity->getFile());
         $classname = $this->guessFromMimeType($file->getMimeType());
         $files[] = new $classname($file, $entity, $this->writer, $this->ffprobe);
     }
     return $files;
 }
Example #2
0
 /**
  * @covers MediaVorus\File::__construct
  * @covers MediaVorus\File::getMimeType
  */
 public function testGetMimeTypeApe()
 {
     $object = new File(__DIR__ . '/../../files/APE.ape');
     $this->assertEquals('audio/x-monkeys-audio', $object->getMimeType());
 }