예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function get($path, HandlerInterface $handler = null)
 {
     $path = $this->normalizePath($path);
     if ($handler === null) {
         $this->assertPresent($path);
         $type = $this->doGetType($path);
         if ($type === 'dir') {
             $handler = new Handler\Directory($this, $path);
         } elseif ($type === 'image') {
             $handler = new Handler\Image($this, $path);
         } elseif ($type === 'json') {
             $handler = new Handler\JsonFile($this, $path);
         } elseif ($type === 'yaml') {
             $handler = new Handler\YamlFile($this, $path);
         } else {
             $handler = new Handler\File($this, $path);
         }
     }
     $handler->setPath($path);
     $handler->setFilesystem($this);
     if ($handler instanceof MountPointAwareInterface) {
         $handler->setMountPoint($this->mountPoint);
     }
     return $handler;
 }