Mediamanager\Controller\Mediamanager::unzip PHP Метод

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

protected unzip ( )
    protected function unzip()
    {
        $return = ['success' => false];
        $path = $this->param('path', false);
        $zip = $this->param('zip', false);
        if ($path && $zip) {
            $path = $this->root . '/' . trim($path, '/');
            $zip = $this->root . '/' . trim($zip, '/');
            $za = new \ZipArchive();
            if ($za->open($zip)) {
                if ($za->extractTo($path)) {
                    $return = ['success' => true];
                }
                $za->close();
            }
        }
        return json_encode($return);
    }