31 require_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)) {
getFromName($fileName)
Extract file from archive by given fileName (Emulate ZipArchive getFromName())
const PCLZIP_OPT_EXTRACT_AS_STRING
addFromString($localname, $contents)
Add a new file to the zip archive from a string of raw data.
close()
Close this zip archive.
static sys_get_temp_dir()
Get the systems temporary directory.
open($fileName)
Open a new zip archive.
locateName($fileName)
Find if given fileName exist in archive (Emulate ZipArchive locateName())
const PCLZIP_OPT_ADD_PATH
const PCLZIP_OPT_REMOVE_PATH
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'