stolentine/zip-partial-reader

Client for read one file from zip archive by curl

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/stolentine/zip-partial-reader

v0.1.1 2022-12-08 12:54 UTC

This package is auto-updated.

Last update: 2025-10-08 19:42:19 UTC


README

Client for read one file from zip archive by curl.

use Stolentine\ZipPartialReader\ZipPartialReader;

$zip = ZipPartialReader::openUrl('https://example.com/foo.zip');

$path = '/var/www/files/';
$pathName = '/var/www/files/fooBazBar.xml';
$filePathName = 'baz/bar.xml';

foreach ($zip->getFiles() as $file) {
    if (str_starts_with($file->name, $filePathName)) {
        $zip->extractToDir($file, new SplFileInfo($path));
        // or 
        $zip->extractToFile($file, new SplFileInfo($pathName));
    }
}