{"id":16414568,"url":"https://github.com/wapmorgan/cabarchive","last_synced_at":"2025-10-26T19:31:15.322Z","repository":{"id":57078765,"uuid":"78963022","full_name":"wapmorgan/CabArchive","owner":"wapmorgan","description":"CabArchive - reader of cab-archives","archived":false,"fork":false,"pushed_at":"2020-04-28T23:54:48.000Z","size":30,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-31T22:41:33.605Z","etag":null,"topics":["archives","cab","extract"],"latest_commit_sha":null,"homepage":"https://wapmorgan.github.io/CabArchive/","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/wapmorgan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-14T19:51:35.000Z","updated_at":"2022-12-05T13:35:07.000Z","dependencies_parsed_at":"2022-08-24T14:56:19.169Z","dependency_job_id":null,"html_url":"https://github.com/wapmorgan/CabArchive","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wapmorgan%2FCabArchive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wapmorgan%2FCabArchive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wapmorgan%2FCabArchive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wapmorgan%2FCabArchive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wapmorgan","download_url":"https://codeload.github.com/wapmorgan/CabArchive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238386473,"owners_count":19463375,"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":["archives","cab","extract"],"created_at":"2024-10-11T06:54:27.014Z","updated_at":"2025-10-26T19:31:15.038Z","avatar_url":"https://github.com/wapmorgan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CabArchive\n\n**CabArchive** is reader of CAB (Microsoft Cabinet files).\n\n[![Total Downloads](https://poser.pugx.org/wapmorgan/cab-archive/downloads)](https://packagist.org/packages/wapmorgan/cab-archive)\n[![Latest Stable Version](https://poser.pugx.org/wapmorgan/cab-archive/v/stable)](https://packagist.org/packages/wapmorgan/cab-archive)\n[![License](https://poser.pugx.org/wapmorgan/cab-archive/license)](https://packagist.org/packages/wapmorgan/cab-archive)\n[![Latest Unstable Version](https://poser.pugx.org/wapmorgan/cab-archive/v/unstable)](https://packagist.org/packages/wapmorgan/cab-archive)\n\n**Precaution!** Right now library provide functionality to extract files only on PHP 7.0.22+, 7.1.8+, 7.2.0 due to bug in previous versions.\n\n# Usage\nFirstly, you need to create CabArchive instance:\n\n```php\n$cab = new CabArchive('123.cab');\n\n```\nAfter that you can get list of files in archive:\n\n```php\nvar_dump($cab-\u003egetFileNames());\n```\n\nAfter that you can get all information about one file in archive:\n\n```php\nvar_dump($cab-\u003egetFileData('README.md'));\n```\n\n## CabArchive API\nAll list of properties and methods of `CabArchive` is listed below.\n\n- `$filesCount` - number of files in Cab-archive\n- `__construct($filename)` - creates new instance from file, stream or socket\n- `getCabHeader()` - returns header of Cab-archive as array\n- `hasPreviousCab()` - checks that this cab has previous Cab in set\n- `getPreviousCab()` - returns name of previous Cab\n- `hasNextCab()` - checks that this cab has next Cab in set\n- `getNextCab()` - returns name of next Cab\n- `getSetId()` - returns set id (identical for all cab-archives from one set)\n- `getInSetNumber()` - returns number of cab in set\n- `getFileNames(): array` - retrives list of files from archive\n- `getFileData($filename): object` - returns additional info of file as object.\n- `getFileAttributes($filename): array` - returns list of file attributes. All available attributes:\n    - `CabArchive::ATTRIB_READONLY`\n    - `CabArchive::ATTRIB_HIDDEN`\n    - `CabArchive::ATTRIB_SYSTEM`\n    - `CabArchive::ATTRIB_EXEC`\n- `getFileContent($filename): string` - returns raw content of file.\n- `extract($output, array $files = []): bool|int` - extracts file or files to specific folder.\n\n### getFileNames\n```php\narray getFileNames()\n```\nThis method returns an array of file names compressed in cab.\n\n### getFileData\n```php\nobject getFileData($filename)\n```\nThis method returns an object with following fields:\n\n- **size** - uncompressed size in bytes\n- **packedSize** - compressed size in bytes\n- **unixtime** - date\u0026time of modification in unixtime format\n- **isCompressed** - is file compressed as _boolean_\n\n### getFileContent\n```php\nstring getFileContent($filename)\n```\nThis method returns raw file content of `$filename`. \nSupports extracting from cab's without compression and with MSZip compression. LZX compression is not supported.\n\nWorks correctly only on PHP:\n\n- 7.0.22+\n- 7.1.8+\n- 7.2.0\n\n### extract\n```php\nint|bool extract($outputDirectory, array $files = [])\n```\nThis method extracts passed files or the whole cab to `$outputDirectory`.\n\nSupports extracting from cab's without compression and with MSZip compression. LZX compression is not supported.\n\nWorks correctly only on PHP:\n\n- 7.0.22+\n- 7.1.8+\n- 7.2.0\n\n## CAB Format\n- .CAB-files format is described at https://msdn.microsoft.com/en-us/library/bb417343.aspx\n- MSZIP compression (based on Deflate) is described at http://interoperability.blob.core.windows.net/files/MS-MCI/[MS-MCI].pdf\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwapmorgan%2Fcabarchive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwapmorgan%2Fcabarchive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwapmorgan%2Fcabarchive/lists"}