Components\ThemeManager\Services\ThemeInstaller::Unzip PHP Метод

Unzip() защищенный Метод

protected Unzip ( $file, $path )
    protected function Unzip($file, $path)
    {
        // if(!is_file($file) || !is_readable($path)) {
        //     return \Redirect::to('backend/modules')
        //                         ->with('error_message', "Can't read input file");
        // }
        // if(!is_dir($path) || !is_writable($path)) {
        //     return \Redirect::to('backend/modules')
        //                         ->with('error_message', "Can't write to target");
        // }
        $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;
        }
    }