31require_once PHPEXCEL_ROOT . 
'PHPExcel/Shared/PCLZip/pclzip.lib.php';
 
   70        public function open($fileName)
 
   74                $this->_zip = 
new PclZip($fileName);
 
   97                $filenameParts = pathinfo($localname);
 
   99                $handle = fopen($this->_tempDir.
'/'.$filenameParts[
"basename"], 
"wb");
 
  103                $res = $this->_zip->add($this->_tempDir.
'/'.$filenameParts[
"basename"],
 
  111                unlink($this->_tempDir.
'/'.$filenameParts[
"basename"]);
 
  122        $list = $this->_zip->listContent();
 
  123        $listCount = count($list);
 
  125        for ($i = 0; $i < $listCount; ++$i) {
 
  126            if (strtolower($list[$i][
"filename"]) == strtolower($fileName) ||
 
  127                strtolower($list[$i][
"stored_filename"]) == strtolower($fileName)) {
 
  132        return ($list_index > -1);
 
  143        $list = $this->_zip->listContent();
 
  144        $listCount = count($list);
 
  146        for ($i = 0; $i < $listCount; ++$i) {
 
  147            if (strtolower($list[$i][
"filename"]) == strtolower($fileName) ||
 
  148                strtolower($list[$i][
"stored_filename"]) == strtolower($fileName)) {
 
  155        if ($list_index != -1) {
 
  160            for ($i = 0; $i < $listCount; ++$i) {
 
  161                if (strtolower($list[$i][
"filename"]) == strtolower($fileName) || 
 
  162                    strtolower($list[$i][
"stored_filename"]) == strtolower($fileName)) {
 
  169        if ((is_array($extracted)) && ($extracted != 0)) {
 
An exception for terminatinating execution or to throw for unit testing.
static sys_get_temp_dir()
Get the systems temporary directory.
locateName($fileName)
Find if given fileName exist in archive (Emulate ZipArchive locateName())
addFromString($localname, $contents)
Add a new file to the zip archive from a string of raw data.
open($fileName)
Open a new zip archive.
close()
Close this zip archive.
getFromName($fileName)
Extract file from archive by given fileName (Emulate ZipArchive getFromName())
const PCLZIP_OPT_EXTRACT_AS_STRING
const PCLZIP_OPT_ADD_PATH
const PCLZIP_OPT_REMOVE_PATH
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'