Jarves\Filesystem\WebFilesystem::getFile PHP Méthode

getFile() public méthode

public getFile ( $path ) : Jarves\File\FileInfoInterface | Jarves\File\FileInfoInterface[] | File
Résultat Jarves\File\FileInfoInterface | Jarves\File\FileInfoInterface[] | Jarves\Model\File
    public function getFile($path)
    {
        return $this->wrap(parent::getFile($path));
    }

Usage Example

Exemple #1
0
 /**
  * Checks the file access.
  *
  * @param $path
  *
  * @throws AccessDeniedException
  */
 public function checkAccess($path)
 {
     $file = null;
     try {
         $file = $this->webFilesystem->getFile($path);
     } catch (FileNotFoundException $e) {
         while ('/' !== $path) {
             try {
                 $path = dirname($path);
                 $file = $this->webFilesystem->getFile($path);
             } catch (FileNotFoundException $e) {
             }
         }
     }
     if ($file && !$this->acl->isUpdatable('jarves/file', array('path' => $path))) {
         throw new AccessDeniedException(sprintf('No access to file `%s`', $path));
     }
 }
All Usage Examples Of Jarves\Filesystem\WebFilesystem::getFile