B
B
BloodVIRUS2016-12-10 17:30:29
PHP
BloodVIRUS, 2016-12-10 17:30:29

How to add links to the archive?

Hello! I have a task to archive a folder, the contents of which I do not know. But I know for sure that there are symlinks to folders and files in different nesting of directories.
If I make an archive via zip on the server, then I get symlinks in separate folders at the output.
zip("/var/www/sites/site/", "/var/www/sites/file.zip");
At the output, I get that all files and folders are in their places, but the links carefully lie in the full path. And there are no files. That is, the site structure was valid
/var/www/sites/site/index.php - file
/var/www/sites/site/images/ - folder
/var/www/sites/site/images/image.png - file
/var/www/sites/site/images33/ - symlink to the /var/www/sites/site2/images/ folder and inside it there are different files
Zip will give me the output archive in which it will be;
index.php
images/image.png
/var/www/sites/site2/images/ - and everything else will be empty here..
I may be going in the wrong direction.. I
forgot to add, this is all done through php, and then the archive should be given to the user.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
display: block, 2016-12-10
@qork

php.net/manual/ru/function.is-link.php
php.net/manual/ru/function.readlink.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question