Kirby\Cli\Util::unzip PHP Method

unzip() public static method

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