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

getFiles() public méthode

public getFiles ( string $path ) : File[]
$path string
Résultat Jarves\Model\File[]
    public function getFiles($path)
    {
        $items = parent::getFiles($path);
        $fs = $this->getAdapter($path);
        if ($fs->getMountPath()) {
            foreach ($items as &$file) {
                $file->setMountPoint($fs->getMountPath());
            }
        }
        if ('/' === $path) {
            foreach ($this->jarvesConfig->getSystemConfig()->getMountPoints() as $mountPoint) {
                $fileInfo = new FileInfo();
                $fileInfo->setPath('/' . $mountPoint->getPath());
                //                $fileInfo->setIcon($mountPoint->getIcon());
                $fileInfo->setType(FileInfo::DIR);
                $fileInfo->setMountPoint(true);
                array_unshift($items, $fileInfo);
            }
        }
        return $this->wrap($items);
    }

Usage Example

Exemple #1
0
 /**
  * Returns a list of files for a folder.
  *
  * @param string $path
  *
  * @return array|null
  */
 protected function getFiles($path)
 {
     if (!$this->getFile($path)) {
         return null;
     }
     //todo, create new option 'show hidden files' in user settings and depend on that
     $files = $this->webFilesystem->getFiles($path);
     return $this->prepareFiles($files);
 }
All Usage Examples Of Jarves\Filesystem\WebFilesystem::getFiles