error('__construct', '$file'); $this->file = $file; switch($comptype) { case TarLib::COMPRESS_AUTO: case TarLib::COMPRESS_DETECT: $comptype = Tar::COMPRESS_AUTO; break; case TarLib::COMPRESS_GZIP: $comptype = Tar::COMPRESS_GZIP; break; case TarLib::COMPRESS_BZIP: $comptype = Tar::COMPRESS_BZIP; break; default: $comptype = Tar::COMPRESS_NONE; } $this->complevel = $complevel; try { $this->tar = new Tar(); $this->tar->open($file, $comptype); } catch(Exception $e) { $this->_result = false; } } function Extract($p_what = TarLib::FULL_ARCHIVE, $p_to = '.', $p_remdir = '', $p_mode = 0755) { if($p_what != TarLib::FULL_ARCHIVE) { $this->error('Extract', 'Ep_what'); return 0; } try { $this->tar->extract($p_to, $p_remdir); } catch(Exception $e) { return 0; } return 1; } function error($func, $param = '') { $error = 'TarLib is deprecated and should no longer be used.'; if($param) { $error .= "In this compatibility wrapper, the function '$func' does not accept your value for". "the parameter '$param' anymore."; } else { $error .= "The function '$func' no longer exists in this compatibility wrapper."; } msg($error, -1); } function __call($name, $arguments) { $this->error($name); } }