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

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

@Bunobuno

Description

@Bunobuno

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions