Get a list of files in Zips

@return array
@throws ZipException
168921
public function listFiles(): array {

        try {
            return array_column(
                array_map(function($key, $archive) {
                    return [ "key" => $key, "files" => $archive->listFiles() ];
                }, array_keys($this->zip_archives), $this->zip_archives),
            "files", "key");
        } catch (ZipException $ze) {
            throw $ze;
        }

    }
717773
protected function getFiles() : array
    {
        $fileOrDirectory = base_path($this->argument('path'));
        if (! $this->files->exists($fileOrDirectory)) {
            $this->error($this->argument('path').' is not a file or a directory.');
            exit();
        }
        if ($this->files->isFile($fileOrDirectory)) {
            $files = [$fileOrDirectory];
        } elseif ($this->files->isDirectory($fileOrDirectory)) {
            $files = $this->files->files($fileOrDirectory);
        }

        return $files;
    }
772428
public function findFiles()
    {
        $search = (new Finder())->files();
        // Add in paths
        foreach ($this->paths as $path) {
            if (is_readable($path)) {
                $search->in($path);
            }
        }
        // Add in names
        foreach ($this->files as $pattern) {
            $search->name($pattern);
        }

        $array = array();
        foreach ($search as $f) {
            $array[] = $f->getRealPath();
        }

        return $array;

    }
824960
public function getFiles()
    {
        $files = $this->getGeneralFiles();

        if ($this->option('domain') && ! $this->option('lucid')) {
            return array_replace_recursive($files, $this->getDomainStubPaths());
        }

        if ($this->option('lucid')) {
            return array_merge($files, $this->getLucidPaths());
        }

        return $files;
    }
1299910
public function webtreesZipContents(string $zip_file): Collection
    {
        $zip_adapter    = new ZipArchiveAdapter($zip_file, null, 'webtrees');
        $zip_filesystem = new Filesystem(new CachedAdapter($zip_adapter, new Memory()));
        $paths          = new Collection($zip_filesystem->listContents('', true));

        return $paths->filter(static function (array $path): bool {
            return $path['type'] === 'file';
        })
            ->map(static function (array $path): string {
                return $path['path'];
            });
    }
92711
public function findAll()
    {
        $files = array();

        foreach (new \DirectoryIterator($this->path) as $file) {
            if ($file->isDot()) {
                continue;
            }
            $files[] = $file->getFilename();
        }

        sort($files);

        return $files;
    }
716542
public function returnZipFile() {
        chdir(codemonkey_pathTempDir);
        $zipname = $this->config['projectname'].".zip";
        $zip = new ZipArchive();
        $zip->open($zipname, ZipArchive::CREATE);

        foreach ($this->listTempDir() as $file) {
            $zip->addFile($file);
        }
        $zip->close();

        header('Content-Type: application/zip');
        header('Content-disposition: attachment; filename='.$zipname);
        header('Content-Length: ' . filesize($zipname));
        readfile(codemonkey_pathTempDir.$zipname);
        unlink($zipname);
        $this->clearTempFolder();
        exit();
    }
230083
public function getAllFiles()
    {
        $ext       = $this->formatter->getFileExtension();
        $filesystemIterator = new \FilesystemIterator($this->path, \FilesystemIterator::SKIP_DOTS);
        $files = new \RegexIterator($filesystemIterator, "/\\.{$ext}$/");

        return $files;
    }
83737
public function getAllFiles()
    {
        $ext   = $this->formatter->getFileExtension();
        $files = array();
        $this->getFilesRecursive($this->path, $files, $ext);

        return $files;
    }
76710
public function getPath(): array {

        return array_column(
            array_map(function($key, $archive) {
                return [ "key" => $key, "path" => $archive->getPath() ];
            }, array_keys($this->zip_archives), $this->zip_archives),
        "path", "key");

    }
773427
public function getFiles()
    {
        $files = array();
        while ($this->valid() && $this->isFile()) {
            if (!$this->searchPattern) {
                $files[] = $this->current();
            } elseif(preg_match($this->searchPattern, $this->getFilename())) {
                $files[] = $this->current();
            }
            $this->next();
        }
        return $files;
    }
766661
def _GetFileNames(self):
    """"""
    if self._zip:
      return self._zip.namelist()
    else:
      return os.listdir(self._path)
144260
protected function getFiles() {
        $dir_iterator = new RecursiveDirectoryIterator($this->entryPath);
        $iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::CHILD_FIRST);
        $files = new RegexIterator($iterator, '/^.+\.scss$/i');
        return $files;
    }
1192760
public function getFiles()
    {
        if (empty($this->files)) {
            foreach ($this->path as $path) {
                if (is_dir($path)) {
                    $this->files = array_merge($this->files, $this->getFilesFromDir($path));
                } elseif (is_file($path)) {
                    $this->files[$path] = new SplFileInfo($path, $path, $path);
                }
            }
        }

        return $this->files;
    }
974111
public function getFlatListOfExtensions()
	{
		if (!isset($this->flatExtentions))
		{
			$this->flatExtentions = [];

			foreach ($this->getFlatListOfFiles() as $file)
			{
				$this->flatExtentions[] = $file->getExtension();
			}

			$this->flatExtentions = array_count_values($this->flatExtentions);
		}

		return $this->flatExtentions;
	}
162957
private function dumpFiles()
    {
        $files = [];

        foreach(File::allFiles(Config::dumpPath()) as $dumpFile) {
            $files[] = $dumpFile->getRealpath();
        }

        sort($files);

        return $files;
    }
1306378
protected function getListFile()
    {
        $conditions = $this->query_filter;
        $conditions['limit'] = $this->data_limit;

        $list = (array) $this->file->getList($conditions);
        $this->prepareListFile($list);

        return $list;
    }