|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-09-06 20:43 UTC] black-cod3 at live dot com
Description:
------------
When using the zip php functions to extract or read a zip file containing a symbolic link (ex: indx -> /home/myuser/public_html/index.html) it fails to extract the original symbolic link it only returned the link name and it's contents is the symbolic link path.
ln -s /home/myuser/public_html/index.html indx;ls -la
28672300 lrwxrwxrwx 1 myuser mygroup 35 Sep 6 13:41 indx -> /home/myuser/public_html/index.html
zip -y indx.zip indx;ls -la
28672300 lrwxrwxrwx 1 myuser mygroup 35 Sep 6 13:41 indx -> /home/myuser/public_html/index.html
28672304 -rw-r--r-- 1 myuser mygroup 175 Sep 6 14:50 indx.zip
extracting php code to the indx.zip as following:
Reproduce code:
---------------
<?php
$zip = new ZipArchive;
if ($zip->open('indx.zip') === TRUE) {
$zip->extractTo('/home/myuser/public_html/');
$zip->close();
echo 'done';
} else {
echo 'failed';
}
?>
Expected result:
----------------
expected to be extracted as :
indx -> /home/myuser/public_html/index.html
Actual result:
--------------
but actual reslult is :
indx
and the contents of indx is :
/home/myuser/public_html/index.html
Thx for your attention and hope to know if there is a different coding method to zip a symbolic link by php zip functions or the above code was expected to works well?
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 03:00:01 2025 UTC |
Also note that when zipping the symbolic link using php code as: <?php $zip = new ZipArchive; $res = $zip->open('indx.zip', ZipArchive::CREATE); if ($res === TRUE) { $zip->addFile('indx'); $zip->close(); echo 'ok'; } else { echo 'failed'; } ?> also the result after extracting indx.zip with the above php extracting code: indx