Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Zip don't include hidden files #40

Open
IvGaLa opened this issue Feb 26, 2015 · 6 comments
Open

Zip don't include hidden files #40

IvGaLa opened this issue Feb 26, 2015 · 6 comments

Comments

@IvGaLa
Copy link

IvGaLa commented Feb 26, 2015

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
Copy link
Author

IvGaLa commented Feb 26, 2015

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 😄

@thecotne
Copy link
Contributor

@doobiedoo do you have workaround?

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

this will work?

@Vasek18
Copy link

Vasek18 commented Jun 1, 2016

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

@eleftrik
Copy link

@Chumper Was this issue fixed? Thank you.

@eleftrik
Copy link

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

@Chumper
Copy link
Owner

Chumper commented Jun 27, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants