Fix(Task/Ext/Archive/ZipTask): Preseves directories' permissions in zip#1820
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1820 +/- ##
============================================
+ Coverage 52.99% 53.01% +0.01%
- Complexity 9798 9805 +7
============================================
Files 495 495
Lines 24647 24662 +15
============================================
+ Hits 13062 13074 +12
- Misses 11585 11588 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi, Thanks for your contribution! I'd like to make this behavior optional (i.e. controlled by an attribute). The attribute should default to false because we're changing behavior. The attribute should also be documented in the guide and the RNG grammar. When that's all done, it'll be added to the 3.1 release line (not 3.0). |
I am ok with that, though, something annoys me with letting the current working as default. Having files inheriting permissions but not directories ; it is more a bug than a feature. When dealing with such zip archives in a unix/Linux system, unzipped with the I'd propose some alternative instead with a The
See: the
|
|
@mrook Implemented a |
3d921b4 to
b15083e
Compare
|
Even Copilot says my code is smart ;)
|
See: - Implementation: phingofficial/phing#1820 - Issue: phingofficial/phing#1817
Fix phingofficial#1817 When file permissions are supported, stores directories's original permissions as `ZipArchive::OPSYS_UNIX` `ExternalAttribute`.
By default false when omitted, file permissions attribute are not saved.
When setting the savefileattributes to true, files permissions
are savec as external attributes in the Zip archive.
Example:
```xml
<zip includeemptydirs="true" destfile="${project.basedir}/test.zip" basedir="./dir" savefileattributes="true">
<fileset dir="dir">
<include name="**/**"/>
</fileset>
</zip>
```
ZipArchive::setMtimeIndex (PHP >= 8.0.0, PECL zip >= 1.16.0)
|
I'll take a look at this soon. Sorry for not having had the time earlier. |
|
@leagris would you mind to add a test case please? |
Fix #1817 When file permissions are supported, stores directories' original permissions as
ZipArchive::OPSYS_UNIXExternalAttribute.