Return fileinfo

@param  string  $path  file cache
@return array
@author Dmitry (dio) Levashov
19536
protected function stat($path) {
		return isset($this->cache[$path])
			? $this->cache[$path]
			: $this->updateCache($path, $this->_stat($path));
	}
933798
private function getFilePathCollection($path)
    {
        $key = \array_flip($this->filePathMapping)[$path];

        return $this->filePathCollection[$key];
    }
72313
public function dirInfo($file,$path){
        if($file->isReadable()){
            $item = $this->fileDetails;
            $item["filename"] = $file->getFilename();
            $item["filetype"] = $file->getExtension();
            $item["lastmodified"] = $file->getMTime();
            $item["size"] = $file->getSize();
            $item["filetype"] = '';
            $item["isdir"] = true;
            $item["urlfolder"] = $path.$item["filename"].'/';
            $item['preview'] = '';
            return $item;
        }else{
            return ;
        }
    }
190881
protected function fileDetails($path)
    {
        $path = '/'.ltrim($path, '/');

        return [
            'name'         => basename($path),
            'fullPath'     => $path,
            'webPath'      => $this->fileWebpath($path),
            'mimeType'     => $this->fileMimeType($path),
            'size'         => $this->fileSize($path),
            'modified'     => $this->fileModified($path),
            'relativePath' => $this->fileRelativePath($path),
        ];
    }
1270214
public function getFolder($path = '')
    {
        $this->connect();

        $path = trim($path, '/');

        if (file_exists($this->scheme . '/' . $path))
        {

            $result = [ 'folders' => $this->listSubFolder($path), 'files' => $this->listFiles($path) ];

            $folder = new Folder($path, $result);

            return $folder;
        }

        return false;
    }
1226936
public function getMetadata($path)
    {
        $url = self::BASE_URI.$this->getPathUnderRootDrive($path);

        return $this->getResponse('GET', $url);
    }
233736
protected function cacheDir($path) {
 		$this->dirsCache[$path] = array();

		$list = array();
		foreach (ftp_rawlist($this->connect, $this->convEncIn($path)) as $raw) {
			if (($stat = $this->parseRaw($raw))) {
				$list[] = $stat;
			}
		}
		$list = $this->convEncOut($list);
		foreach($list as $stat) {
			$p    = $path.'/'.$stat['name'];
			$stat = $this->updateCache($p, $stat);
			if (empty($stat['hidden'])) {
				// $files[] = $stat;
				$this->dirsCache[$path][] = $p;
			}
		}
	}
740244
private function getFiles($path)
    {
        if (is_file($path)) {
            return [new SplFileInfo($path, '', '')];
        }

        return $this->finder->name('*.php')->in(realpath($path));
    }
977046
public function get_filecontent($path) {
        $fullpath = $this->tempdir . '/' . $path;
        if (is_file($fullpath) && is_readable($fullpath)) {
            return file_get_contents($fullpath);
        }
        return false;
    }
266134
public function read($path)
    {
        $contents = file_get_contents($this->applyPathPrefix($path));

        return $contents !== false ? compact('contents') : false;
    }
277886
protected function cacheDir($path) {
		$this->dirsCache[$path] = array();

		$sql = 'SELECT f.id, f.parent_id, f.name, f.size, f.mtime AS ts, f.mime, f.read, f.write, f.locked, f.hidden, f.width, f.height, IF(ch.id, 1, 0) AS dirs 
				FROM '.$this->tbf.' AS f 
				LEFT JOIN '.$this->tbf.' AS ch ON ch.parent_id=f.id AND ch.mime="directory"
				WHERE f.parent_id="'.$path.'"
				GROUP BY f.id';
				
		$res = $this->query($sql);
		if ($res) {
			while ($row = $res->fetch_assoc()) {
				// debug($row);
				$id = $row['id'];
				if ($row['parent_id']) {
					$row['phash'] = $this->encode($row['parent_id']);
				} 
				
				if ($row['mime'] == 'directory') {
					unset($row['width']);
					unset($row['height']);
				} else {
					unset($row['dirs']);
				}
				
				unset($row['id']);
				unset($row['parent_id']);
				
				
				
				if (($stat = $this->updateCache($id, $row)) && empty($stat['hidden'])) {
					$this->dirsCache[$path][] = $id;
				}
			}
		}
		
		return $this->dirsCache[$path];
	}
641086
public function getCacheInfo() {

		if(($cachePath = $this->folder->getCachePath(TRUE))) {
			$size	= 0;
			$count	= 0;

			$di	= new \DirectoryIterator($cachePath);

			foreach($di as $fileinfo) {
				if(	$fileinfo->isDot() ||
					!$fileinfo->isFile() ||
					strpos($fileinfo->getFilename(), $this->filename) !== 0
				) {
					continue;
				}
				++$count;
				$size += $fileinfo->getSize();
			}
			return ['count' => $count, 'totalSize' => $size];
		}
		return FALSE;
	}
150762
public function getMetadata($path)
    {
        $location = $this->applyPathPrefix($path);
        return $this->ossClient->getObjectMeta($this->bucket, $location);
    }
406043
public function getList($path = '/') {/*{{{*/

        $rsp = $this->_do_request('GET', $path);

        $list = array();
        if ($rsp) {
            $rsp = explode("\n", $rsp);
            foreach($rsp as $item) {
                @list($name, $type, $size, $time) = explode("\t", trim($item));
                if (!empty($time)) {
                    $type = $type == 'N' ? 'file' : 'folder';
                }

                $item = array(
                    'name' => $name,
                    'type' => $type,
                    'size' => intval($size),
                    'time' => intval($time),
                );
                array_push($list, $item);
            }
        }

        return $list;
    }
243011
private function get_folder_contents( $path ) {

		$items = array();
		$uid   = opendir( $path );
		if ( $uid ) {
			return $this->load_folder_items( $uid, $path );
		}

		return $items;
	}
206615
public static function get($path)
    {
        $ext = strtolower(pathinfo($path, PATHINFO_EXTENSION));
        if (!isset(self::$fileTypes[$ext])) {
            return false;
        }
        return self::$fileTypes[$ext];
    }
334108
public function lsFiles(string $path = '') : array
    {
        return array_filter(
            $this->ls($path),
            function(File $file) {
                return $file->isFile();
            }
        );
    }