public function open()
{
if (!$this->_decompress) {
$this->_handle = @fopen($this->getName(), 'r');
}
switch ($this->getCompression()) {
case false:
return false;
case 'application/bzip2':
if ($GLOBALS['cfg']['BZipDump'] && @function_exists('bzopen')) {
$this->_handle = @bzopen($this->getName(), 'r');
} else {
$this->errorUnsupported();
return false;
}
break;
case 'application/gzip':
if ($GLOBALS['cfg']['GZipDump'] && @function_exists('gzopen')) {
$this->_handle = @gzopen($this->getName(), 'r');
} else {
$this->errorUnsupported();
return false;
}
break;
case 'application/zip':
if ($GLOBALS['cfg']['ZipDump'] && @function_exists('zip_open')) {
return $this->openZip();
} else {
$this->errorUnsupported();
return false;
}
case 'none':
$this->_handle = @fopen($this->getName(), 'r');
break;
default:
$this->errorUnsupported();
return false;
}
return $this->_handle !== false;
}