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

Successive calls to Zipper::make() return the same object #149

Open
Bunobuno opened this issue Feb 25, 2019 · 0 comments
Open

Successive calls to Zipper::make() return the same object #149

Bunobuno opened this issue Feb 25, 2019 · 0 comments

Comments

@Bunobuno
Copy link

Hi,

I need to work on two different archives at the same time, thus I am trying to get two instances of Zipper to work on. I'm stuck because it seems that successive calls to make() will simply overwrite any previous instance:

$a=Zipper::make('a.zip');
$b=Zipper::make('b.zip');

The two objects become identical after the second call

>>> $a===$b;
=> true

and the internal properties of $a seem to have been overriden by these of $b

>>> print_r($a);
Chumper\Zipper\Zipper Object
(
    [currentFolder:Chumper\Zipper\Zipper:private] =>
    [file:Chumper\Zipper\Zipper:private] => Illuminate\Filesystem\Filesystem Object
        (
        )

    [repository:Chumper\Zipper\Zipper:private] => Chumper\Zipper\Repositories\ZipRepository Object
        (
            [archive:Chumper\Zipper\Repositories\ZipRepository:private] => ZipArchive Object
                (
                    [status] => 0
                    [statusSys] => 0
                    [numFiles] => 17
                    [filename] => /media/project/storage/app/b.zip
                    [comment] =>
                )

        )

    [filePath:Chumper\Zipper\Zipper:private] => /media/project/storage/app/b.zip
)
=> true

Is there a solution to work on multiple instances at the same time?

Thanks
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

1 participant