Pop\Archive\Adapter\Phar::listFiles PHP Метод

listFiles() публичный Метод

Method to return a listing of the contents of an archived file
public listFiles ( boolean $full = false ) : array
$full boolean
Результат array
    public function listFiles($full = false)
    {
        $list = array();
        foreach ($this->archive as $file) {
            if ($file->isDir()) {
                $objects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator((string) $file), \RecursiveIteratorIterator::SELF_FIRST);
                foreach ($objects as $fileInfo) {
                    if ($fileInfo->getFilename() != '.' && $fileInfo->getFilename() != '..') {
                        $f = $fileInfo->isDir() ? $fileInfo->getPathname() . DIRECTORY_SEPARATOR : $fileInfo->getPathname();
                        if (!$full) {
                            $list[] = substr($f, stripos($f, '.phar') + 6);
                        } else {
                            $f = $fileInfo->getPath() . DIRECTORY_SEPARATOR . $fileInfo->getFilename();
                            $list[] = array('name' => substr($f, stripos($f, '.phar') + 6), 'mtime' => $fileInfo->getMTime(), 'size' => $fileInfo->getSize());
                        }
                    }
                }
            } else {
                $f = $file->getPath() . DIRECTORY_SEPARATOR . $file->getFilename();
                if (!$full) {
                    $list[] = substr($f, stripos($f, '.phar') + 6);
                } else {
                    $list[] = array('name' => substr($f, stripos($f, '.phar') + 6), 'mtime' => $file->getMTime(), 'size' => $file->getSize());
                }
            }
        }
        return $list;
    }