1
0
mirror of https://github.com/splitbrain/php-archive.git synced 2025-01-16 13:09:12 +01:00

108 Commits

Author SHA1 Message Date
Andreas Gohr
d9d4eaac12
Merge pull request #37 from zozlak/master
A bunch of enhancements for dealing with large tar archives
1.4.0
2024-12-09 15:08:44 +01:00
Mateusz Żółtak
7b1936c294 TarTestCase::testReadCurrentEntry() added 2024-12-07 10:23:55 +01:00
Mateusz Żółtak
5ff390cbd0 Tar: write performance optimizations
Tar::addData(): pad only the last block of data and write everything
else with just a single writebytes() call and without pack().

Tar::addFile(): move the read chunk size to a class constant.
2024-12-07 10:01:10 +01:00
Mateusz Żółtak
f15ef3a95c Tar::addFile(): use larger read buffer for better performance 2024-12-07 09:51:45 +01:00
Mateusz Żółtak
f931cad249 Tar::readCurrentEntry(): recognize end of file properly 2024-12-06 21:06:24 +01:00
Mateusz Żółtak
6136d0ab63 Tar: allow reading archive content while iterating over archive entries.
So far there was no way to read the data from a file in an archive
without extracting it and extraction of a single file required rereading
of a whole archive. This commit changes the yieldContents() in a way it
does not skip to the next header entry before returning a current header
content. A position of the next header entry is remembered instead and
rewinded to only at the next next() call on the generator. This allows
to read the current entry content until the next() call. For that the
Tar::readCurrentEntry() method was added.
2024-12-06 20:15:23 +01:00
Mateusz Żółtak
3e515824bf Tar: add support for large and negative numbers
In 2001 the GNU tar introduced support for large and negative numbers
(https://www.gnu.org/software/tar/manual/html_node/Extensions.html#Extensions)

This is required to handle files bigger than 8G.
2024-12-06 18:23:51 +01:00
Andreas Gohr
460c205180 added funding info 2023-03-16 17:29:03 +01:00
Andreas Gohr
d274e5190b Merge branch 'pr/26' into yield
* pr/26:
  Whoops, fixed wrong variable name.
  Added yieldContents() to keep contents() backward compatibility.
  Use yield in contents() instead of returning a single array with all results.
1.3.1
2022-03-23 10:21:55 +01:00
Andreas Gohr
dc0b5cdd89 moved constant definition to top 1.3.0 2022-03-23 10:13:31 +01:00
Andreas Gohr
4d0bcb0e3b adjust minimum dependencies 2022-03-23 10:09:07 +01:00
Andreas Gohr
1ad16c470b fix PHP <7.3 compatibility
trailing commas not allowed
2022-03-23 10:08:31 +01:00
Mihail Feraru
5a132129e9 Incremental block by block compression for ZIP 2022-03-22 13:15:54 +02:00
Andreas Gohr
726dfddda2
Merge pull request #34 from mreiden/mreiden-patch-1
Avoid a file exists error instead of supressing it
2021-08-06 06:33:19 +02:00
mreiden
57a0458d09
Avoid a file exists error instead of supressing it
Suppressing the mkdir error causes a lot of noise in symfony dev logs if there are multiple files in a subdirectory of the tar file. Skip trying to create the subdirectory if it already exists.
2021-08-05 21:09:15 -05:00
Andreas Gohr
2bdf379b41
Merge pull request #33 from splitbrain/windowstests
Windowstests
2021-02-22 23:18:22 +01:00
Andreas Gohr
0ca3e26516
Merge pull request #32 from fietserwin/windowstests
Windows tests
2021-02-22 23:16:21 +01:00
Erwin Derksen
a54081a9bc Make tests run on Windows. 2021-02-22 21:33:17 +01:00
Erwin Derksen
2880b67475 dirname(__FILE__) => __DIR__ (valid as of php 5.3) 2021-02-22 21:03:29 +01:00
Andreas Gohr
39b3e182c4 run tests on windows too 2021-02-22 19:06:24 +01:00
Andreas Gohr
211a2198b7 additional zero file testing
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.
1.2.1
2021-02-22 18:59:24 +01:00
Erwin Derksen
42240bb3d3 Corrected unit test testAddFileWithInvalidFile() 2021-02-22 17:28:57 +01:00
Erwin Derksen
c6310630e3 Issue #29 2021-02-22 16:28:49 +01:00
Andreas Gohr
d53bf2ed77 updated testing
* test on github not travis
* run phpunit8 (tests only on 7.2+)
* use github action to build api docs
2021-02-05 13:38:50 +01:00
Andreas Gohr
d4cf2d9a2d renamed FileInfo::match() to FileInfo::matchExpression()
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.
1.2.0
2020-10-13 14:41:15 +02:00
Andreas Gohr
e84a33abed
Merge pull request #28 from phallobst/master
Fix grammar
2020-08-16 06:13:15 +02:00
Michael Loßin
47f6079a42 Fix grammar 2020-08-15 22:50:39 +02:00
jgmdev
0240457f85 Whoops, fixed wrong variable name. 2020-02-19 22:26:08 -04:00
jgmdev
b87b8b736c Added yieldContents() to keep contents() backward compatibility. 2020-02-19 22:13:36 -04:00
jgmdev
c03205af98 Merge branch 'master' of https://github.com/splitbrain/php-archive 2020-02-19 21:54:44 -04:00
Andreas Gohr
5d82482592 old php versions aren't available at travis anymore 2020-02-06 15:21:14 +01:00
Andreas Gohr
18a672bf29 adjusted PHP versions in tests 2020-02-06 15:09:09 +01:00
Andreas Gohr
fc0680e034 fixed composer format
mixed caps packages are deprecated
2020-02-06 15:02:48 +01:00
jgmdev
0ce9d27ae5 Use yield in contents() instead of returning a single array with all results. 2018-12-24 11:23:04 -04:00
Andreas Gohr
10d8901357 supress chmod and touch warnings
On some file systems these commands will fail. It's unclear what systems
those are, I can reproduce it for touch() on my android phone (but not
on my tablet).

Instead of littering the output with potentially thousands of warnings
we supress them here. Ideally we should probably do something with them,
but I don't know what.

Maybe a strict setting that turns them into exceptions, would work? PRs
welcome.
1.1.1
2018-09-09 14:13:53 +02:00
Andreas Gohr
cabfd12a40 extracted exceptions into their own files
required for PSR-2
1.1.0
2018-06-12 22:09:13 +02:00
Andreas Gohr
0feb2c8107 clean up doc blocks and minor code smell 2018-06-12 22:04:45 +02:00
Andreas Gohr
3b5207aab3 added callback mechanism to show progress during ops 2018-06-12 22:04:17 +02:00
Andreas Gohr
e3a27bdc49 throw ArchiveIllegalCompressionException on bad compression level 2018-06-12 21:50:31 +02:00
Andreas Gohr
a46f3aaeb9 check for broken iconv setup 1.0.10 2018-05-01 10:03:56 +02:00
Andreas Gohr
0443bcff12
Merge pull request #23 from peter279k/test_enhancement
Test enhancement
2018-02-05 09:49:31 +01:00
peter279k
d65719bfe5 Merge branch 'test_enhancement' from source 2018-02-04 22:19:32 +08:00
peter279k
e6e5a8edf6 using assertInternalType method 2018-02-04 22:17:09 +08:00
peter279k
9711a651a4 drop the PHP 5.3 from test set the required 5.4+ 2018-02-04 22:16:23 +08:00
peter279k
f114f26ce5 usin assertInternalType method 2018-02-04 22:01:54 +08:00
peter279k
0f4a5d61de add clear cache 2018-02-04 21:16:23 +08:00
peter279k
7aaacf33a8 using filesize to check file size 2018-02-04 20:01:13 +08:00
peter279k
713d849aab 'test_enhancement' branch of removing bin2hex 2018-02-04 19:54:31 +08:00
peter279k
84db2380b4 chnage assertion method 2018-02-04 19:52:30 +08:00
peter279k
e62ad36138 drop the PHP 5.3 from test set the required 5.4+ 2018-02-04 19:52:22 +08:00