{"id":15578443,"url":"https://github.com/xp-framework/zip","last_synced_at":"2025-04-24T02:21:31.110Z","repository":{"id":11753947,"uuid":"14285607","full_name":"xp-framework/zip","owner":"xp-framework","description":"ZIP File support for the XP Framework","archived":false,"fork":false,"pushed_at":"2024-10-05T11:11:42.000Z","size":3367,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T13:05:57.634Z","etag":null,"topics":["php7","php8","stream","xp-framework","zip"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xp-framework.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2013-11-10T22:18:54.000Z","updated_at":"2024-10-05T11:11:46.000Z","dependencies_parsed_at":"2024-02-25T14:32:01.740Z","dependency_job_id":"b7c5a2bb-8d09-4c58-890f-b74342d27467","html_url":"https://github.com/xp-framework/zip","commit_stats":{"total_commits":17945,"total_committers":37,"mean_commits":485.0,"dds":"0.35413764279743665","last_synced_commit":"abc169f8931926986387c6e7dd5bd519de8c1711"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fzip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fzip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fzip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fzip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xp-framework","download_url":"https://codeload.github.com/xp-framework/zip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250546363,"owners_count":21448313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php7","php8","stream","xp-framework","zip"],"created_at":"2024-10-02T19:10:30.678Z","updated_at":"2025-04-24T02:21:31.088Z","avatar_url":"https://github.com/xp-framework.png","language":"PHP","readme":"ZIP File support\n================\n\n[![Build status on GitHub](https://github.com/xp-framework/zip/workflows/Tests/badge.svg)](https://github.com/xp-framework/zip/actions)\n[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)\n[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)\n[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/xp-framework/zip/version.svg)](https://packagist.org/packages/xp-framework/zip)\n\nUsage (creating a zip file)\n---------------------------\n\n```php\nuse io\\archive\\zip\\{ZipFile, ZipDirEntry, ZipFileEntry};\nuse io\\File;\n\n$z= ZipFile::create(new File('dist.zip'));\n\n// Add a directory\n$dir= $z-\u003eadd(new ZipDirEntry('META-INF'));\n\n// Add a file\n$file= $z-\u003eadd(new ZipFileEntry($dir, 'version.txt'));\n$file-\u003eout()-\u003ewrite($contents);\n\n// Close\n$z-\u003eclose();\n```\n\nUsage (reading a zip file)\n--------------------------\n\n```php\nuse io\\archive\\zip\\ZipFile;\nuse io\\streams\\Streams;\nuse io\\File;\n\n$z= ZipFile::open(new File('dist.zip'));\nforeach ($z-\u003eentries() as $entry) {\n  if ($entry-\u003eisDirectory()) {\n    // Create dir\n  } else {\n    // Extract\n    Streams::readAll($entry-\u003ein());\n  }\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-framework%2Fzip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxp-framework%2Fzip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-framework%2Fzip/lists"}