Zipper icon indicating copy to clipboard operation
Zipper copied to clipboard

Zip don't include hidden files

Open IvGaLa opened this issue 9 years ago • 6 comments

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

IvGaLa avatar Feb 26 '15 09:02 IvGaLa

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:

IvGaLa avatar Feb 26 '15 10:02 IvGaLa

@DooBieDoo do you have workaround?

$zipper = new \Chumper\Zipper\Zipper;
$zipper->make('zipped.zip')->add(glob($directory. '/{,.}*', GLOB_BRACE))->close();

this will work?

thecotne avatar Feb 26 '15 17:02 thecotne

Hi, DooBieDoo's solution works for files But has anyone an idea of what to do with directories? Thanks

Vasek18 avatar Jun 01 '16 22:06 Vasek18

@Chumper Was this issue fixed? Thank you.

eleftrik avatar Jun 21 '16 13:06 eleftrik

@Chumper Is this project still maintained? Anyone reading these issues?

eleftrik avatar Jun 27 '16 05:06 eleftrik

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.

Chumper avatar Jun 27 '16 08:06 Chumper