Services\Synchronize::Unzip PHP Method

Unzip() public method

Decompress a folder
public Unzip ( [type] $file, [type] $path )
$file [type]
$path [type]
    public function Unzip($file, $path)
    {
        $zip = new \ZipArchive();
        $res = $zip->open($file);
        if ($res === true) {
            // extract it to the path we determined above
            try {
                $zip->extractTo($path);
            } catch (ErrorException $e) {
                //skip
            }
            $zip->close();
            return true;
        } else {
            return false;
        }
    }