F::unzip PHP Method

unzip() public static method

Unzips a zip file
public static unzip ( string $file, string $to ) : boolean
$file string
$to string
return boolean
    public static function unzip($file, $to)
    {
        if (!class_exists('ZipArchive')) {
            throw new Exception('The ZipArchive class is not available');
        }
        $zip = new ZipArchive();
        if ($zip->open($file) === true) {
            $zip->extractTo($to);
            $zip->close();
            return true;
        } else {
            return false;
        }
    }