|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-12-03 03:46 UTC] michae dot lee at zerustech dot com
[2018-12-03 08:15 UTC] petk@php.net
-PHP Version: Irrelevant
+PHP Version: 7.2.4
[2018-12-04 06:03 UTC] hanskrentel at yahoo dot de
[2020-11-26 13:28 UTC] cmb@php.net
-Status: Open
+Status: Analyzed
-PHP Version: 7.2.4
+PHP Version: 7.4
[2020-11-26 13:28 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 07:00:02 2025 UTC |
Description: ------------ The `Phar::buildFromDirectory()` method generates tar archives in `PAX` format, so different tar archives that contain the same files may have different `sha1` checksums. Test script: --------------- <?php // mkdir test && echo 'hello' > test/test.txt $phar = new \PharData('a.tar'); $phar->buildFromDirectory('test'); // sleep for 1 second to produce different atime. sleep(1); $phar = new \PharData('b.tar'); $phar->buildFromDirectory('test'); echo sha1_file('a.tar') . "\n"; echo sha1_file('b.tar') . "\n"; // a.tar and b.tar contain the same files, but have different checksums // Looks like the `buildFromDirectory()` method generates tar archives // with `PAX` headers. Calling "tar --format=ustar -cf ..." from command line // resolves this issue. Expected result: ---------------- The sha1 checksums for a.tar and b.tar should be the same. Actual result: -------------- The sha1 checksums for a.tar and b.tar are different.