PackageTrack
Sign in Get early access

splitbrain/php-archive

Pure-PHP implementation to read and write TAR and ZIP archives

1.5.1 1.6M downloads/mo #3493 most downloaded on Packagist splitbrain/php-archive

What this package is like to depend on

Last release 4 days ago

19 Aug 2026

Release timing varies

gaps range from 2 weeks to 2.7 years

Some releases are documented

notes for 8 of 23 stable releases

Nothing withdrawn

no release was ever pulled

11 years old

23 releases · first in 2015

4 releases in the last 12 months

see the full history below

Release timeline

23 releases · Feb 2015 to Aug 2026
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 23
  1. 1.5.1 19 Aug 2026
    Release notes

    Zip::extract() trusted the sizes and the compression method from an
    entry's headers before checking that the data was there.

    The copy loops padded short reads with pack('a'.$read_size, $buffer), so
    a small archive could make extraction write a much larger file:

    • a stored entry declaring more bytes than the archive holds copied
      central directory bytes and NUL padding past the end of the file,
    • a deflated entry declaring a large uncompressed size padded the
      output up to that size, and
    • an archive written by "zip -fz" produced 4 GiB from 280 bytes,
      because ZIP64 stores 0xFFFFFFFF in the 32 bit size fields.

    Entries using neither store nor deflate ended up in the output as their
    raw compressed data. zlib answers the faked gzip header of an unknown
    method with the bytes unchanged instead of an error.

    Incomplete headers reached unpack(), which warned about the missing
    input before the exception was thrown.

    Extraction now checks that an entry's data lies in front of the central
    directory, fails on a short read instead of padding it, and rejects
    unsupported compression methods. Entries that the include and exclude
    filters skip stay unchecked, because their data is never read. All
    headers are read through readRecord(), which refuses a short read.

    Regression tests cover each of these archives.

    Open source →
  2. 1.5.0 31 Jul 2026
    Release notes

    Adding a directory produced an entry that no reader recognized as one, because its name was
    stored without the trailing slash readers look for. Adding one through addFile() also tried
    to read its content, which raised a notice and left a stray deflate remnant in the entry.

    Directories are now stored with a trailing slash and without content, so empty directories
    survive a round trip and keep their mode.

    Open source →
  3. 1.4.3 20 Jul 2026
    Release notes

    writebytesAt() back-patches the CRC and sizes into a streamed local file
    header. The in-memory branch appended the patched buffer to itself and
    omitted the replacement length, so it duplicated data and left the header
    fields at zero instead of overwriting them in place. This corrupted any
    in-memory archive where an addFile() entry followed another entry; the
    fault stayed hidden because the library and several tools read those
    values from the central directory rather than the local header.

    Now the in-memory branch overwrites the header bytes in place, matching
    the file-backed branch.

    Open source →
  4. 1.4.2 13 May 2026
    Release notes

    When a corrupt zip file is read, an exception should be thrown without
    any previous notices and warnings leaking.

    This also introduces constants for a few magic numbers in the zip
    format.

    Open source →
  5. 1.4.1 01 Aug 2025
    Release notes

    add tests for testing file property preservation

    Open source →
  6. 1.4.0 09 Dec 2024

    Nothing published for this version

  7. 1.3.1 23 Mar 2022

    Nothing published for this version

  8. 1.3.0 23 Mar 2022
    Release notes

    moved constant definition to top

    Open source →
  9. 1.2.1 22 Feb 2021
    Release notes

    Existing tests didn't 100% make sure a zero byte file was correctly
    added and extracted. It was. Now we also have the tests to prove it.

    Open source →
  10. 1.2.0 13 Oct 2020
    Release notes

    In PHP8, match is a reserved keyword. In preparation this renames the
    method. A fallback via __call() is provided which will trigger a
    E_USER_NOTICE.

    Open source →
  11. 1.1.1 09 Sep 2018

    Nothing published for this version

  12. 1.1.0 12 Jun 2018

    Nothing published for this version

  13. 1.0.10 01 May 2018

    Nothing published for this version

  14. 1.0.9 11 Jun 2017

    Nothing published for this version

  15. 1.0.8 19 Mar 2017

    Nothing published for this version

  16. 1.0.7 12 Aug 2015

    Nothing published for this version

  17. 1.0.6 12 Aug 2015

    Nothing published for this version

  18. 1.0.5 12 Aug 2015

    Nothing published for this version

  19. 1.0.4 24 Jul 2015

    Nothing published for this version

  20. 1.0.3 24 Jul 2015

    Nothing published for this version

  21. 1.0.2 30 Jun 2015

    Nothing published for this version

  22. 1.0.1 30 Jun 2015

    Nothing published for this version

  23. 1.0.0 25 Feb 2015

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive