Zipper
Zipper copied to clipboard
Zip don't include hidden files
Hi, i'm Laravel developer on linux. I try to create a backup of my server, but Zipper don' include hidden files (.files) How can i do? I use this test code:
$zipper = new \Chumper\Zipper\Zipper;
$zipper->make('zipped.zip')->add(public_path)->close();
Thanks
Well, i get this trick.
The issue is not in zipper class, are in iluminate/Filesystem/Filesystem.php 'files' function The line (number ~250):
$glob = glob($directory.'/*');
only get files and dir but this one
$glob = glob($directory. '/{,.}*', GLOB_BRACE);
get dir and all files (include dot file, yes '.' and '..' too), but in the if sentence, when check is 'file' type discrimine dirs, and also '.' and '..' "files"
I hope this help someone, and sorry my poor english :smile:
@DooBieDoo do you have workaround?
$zipper = new \Chumper\Zipper\Zipper;
$zipper->make('zipped.zip')->add(glob($directory. '/{,.}*', GLOB_BRACE))->close();
this will work?
Hi, DooBieDoo's solution works for files But has anyone an idea of what to do with directories? Thanks
@Chumper Was this issue fixed? Thank you.
@Chumper Is this project still maintained? Anyone reading these issues?
Hey @eleftrik, this package was inteded for laravel 4 mainly. As I moved on I stopped updating the package myself except merging in PRs.
If you make a PR with the wished changes, I will happily merge them in.