{"id":15389095,"url":"https://github.com/splitbrain/php-archive","last_synced_at":"2025-05-15T09:00:18.993Z","repository":{"id":27585754,"uuid":"31068626","full_name":"splitbrain/php-archive","owner":"splitbrain","description":"Pure-PHP implementation to read and write TAR and ZIP archives","archived":false,"fork":false,"pushed_at":"2024-12-09T14:10:29.000Z","size":458,"stargazers_count":102,"open_issues_count":6,"forks_count":35,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-08T08:40:59.793Z","etag":null,"topics":["compression","extract","php","php-library","tar","zip"],"latest_commit_sha":null,"homepage":"https://splitbrain.github.io/php-archive/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/splitbrain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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,"publiccode":null,"codemeta":null},"funding":{"github":"splitbrain"}},"created_at":"2015-02-20T14:39:10.000Z","updated_at":"2025-03-25T12:30:21.000Z","dependencies_parsed_at":"2024-06-18T12:11:50.443Z","dependency_job_id":"3f74f38e-72c5-4b9f-9606-9c4d3d532f7b","html_url":"https://github.com/splitbrain/php-archive","commit_stats":{"total_commits":90,"total_committers":9,"mean_commits":10.0,"dds":"0.43333333333333335","last_synced_commit":"460c20518033e8478d425c48e7bb0bd348b10486"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splitbrain%2Fphp-archive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splitbrain%2Fphp-archive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splitbrain%2Fphp-archive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splitbrain%2Fphp-archive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/splitbrain","download_url":"https://codeload.github.com/splitbrain/php-archive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253501858,"owners_count":21918327,"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":["compression","extract","php","php-library","tar","zip"],"created_at":"2024-10-01T14:59:27.181Z","updated_at":"2025-05-15T09:00:18.901Z","avatar_url":"https://github.com/splitbrain.png","language":"PHP","readme":"PHPArchive - Pure PHP ZIP and TAR handling\n==========================================\n\nThis library allows to handle new ZIP and TAR archives without the need for any special PHP extensions (gz and bzip are\nneeded for compression). It can create new files or extract existing ones.\n\nTo keep things simple, the modification (adding or removing files) of existing archives is not supported.\n\nInstall\n-------\n\nUse composer:\n\n```php composer.phar require splitbrain/php-archive```\n\nUsage\n-----\n\nThe usage for the Zip and Tar classes are basically the same. Here are some\nexamples for working with TARs to get you started.\n\nCheck the [API docs](https://splitbrain.github.io/php-archive/) for more\ninfo.\n\n\n```php\nrequire_once 'vendor/autoload.php';\nuse splitbrain\\PHPArchive\\Tar;\n\n// To list the contents of an existing TAR archive, open() it and use\n// contents() on it:\n$tar = new Tar();\n$tar-\u003eopen('myfile.tgz');\n$toc = $tar-\u003econtents();\nprint_r($toc); // array of FileInfo objects\n\n// To extract the contents of an existing TAR archive, open() it and use\n// extract() on it:\n$tar = new Tar();\n$tar-\u003eopen('myfile.tgz');\n$tar-\u003eextract('/tmp');\n\n// To create a new TAR archive directly on the filesystem (low memory\n// requirements), create() it:\n$tar = new Tar();\n$tar-\u003ecreate('myfile.tgz');\n$tar-\u003eaddFile(...);\n$tar-\u003eaddData(...);\n...\n$tar-\u003eclose();\n\n// To create a TAR archive directly in memory, create() it, add*()\n// files and then either save() or getArchive() it:\n$tar = new Tar();\n$tar-\u003esetCompression(9, Archive::COMPRESS_BZIP);\n$tar-\u003ecreate();\n$tar-\u003eaddFile(...);\n$tar-\u003eaddData(...);\n...\n$tar-\u003esave('myfile.tbz'); // compresses and saves it\necho $tar-\u003egetArchive(); // compresses and returns it\n```\n\nDifferences between Tar and Zip: Tars are compressed as a whole, while Zips compress each file individually. Therefore\nyou can call ```setCompression``` before each ```addFile()``` and ```addData()``` function call.\n\nThe FileInfo class can be used to specify additional info like ownership or permissions when adding a file to\nan archive. \n","funding_links":["https://github.com/sponsors/splitbrain"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplitbrain%2Fphp-archive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsplitbrain%2Fphp-archive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplitbrain%2Fphp-archive/lists"}