Skip to content

Argument 5 passed to Alchemy\Zippy\Archive\Member::__construct() must be an instance of DateTime #111

@GoktugOzturk

Description

@GoktugOzturk

Hi,

I'm trying to open this zip file;
https://github.com/GoktugOzturk/tet-boardsports/archive/master.zip
On my localhost (windows 10 & php 5.6 )
It works fine.
But on my staging server (Centos & PHP 7.0.6 )
Error occurs:
Argument 5 passed to Alchemy\Zippy\Archive\Member::__construct() must be an instance of DateTime, boolean given, called in /home/project/_shared/vendor/alchemy/zippy/src/Adapter/ZipAdapter.php on line 126

$zippy = \Alchemy\Zippy\Zippy::load();
$archive = $zippy->open($tmpFile);
$archive->extract($tmpThemeDir);
if (!file_exists($tmpThemeDir . "/theme/theme.json")) {
    /** @var \Alchemy\Zippy\Archive\MemberInterface[] $zipContents */
    $zipContents = $archive->getMembers();
    foreach ($zipContents as $zipContent) {
        if (substr($zipContent->getLocation(), -16) == "theme/theme.json") {
            $tmpThemeDir .= DIRECTORY_SEPARATOR . str_replace("/theme/theme.json", "", $zipContent->getLocation());
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions