Definition at line 41 of file ZipArchive.php.
◆ addFromString()
PHPExcel_Shared_ZipArchive::addFromString |
( |
|
$localname, |
|
|
|
$contents |
|
) |
| |
Add a new file to the zip archive from a string of raw data.
- Parameters
-
string | $localname | Directory/Name of the file to add to the zip archive |
string | $contents | String of data to add to the zip archive |
Definition at line 95 of file ZipArchive.php.
References $contents, $res, PCLZIP_OPT_ADD_PATH, and PCLZIP_OPT_REMOVE_PATH.
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"]);
foreach($_POST as $key=> $value) $res
const PCLZIP_OPT_ADD_PATH
const PCLZIP_OPT_REMOVE_PATH
◆ close()
PHPExcel_Shared_ZipArchive::close |
( |
| ) |
|
◆ getFromName()
PHPExcel_Shared_ZipArchive::getFromName |
( |
|
$fileName | ) |
|
Extract file from archive by given fileName (Emulate ZipArchive getFromName())
- Parameters
-
string | $fileName | Filename for the file in zip archive |
- Returns
- string $contents File string contents
Definition at line 141 of file ZipArchive.php.
References $contents, $filename, $i, $list, and PCLZIP_OPT_EXTRACT_AS_STRING.
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)) {
const PCLZIP_OPT_EXTRACT_AS_STRING
if(isset($_REQUEST['delete'])) $list
◆ locateName()
PHPExcel_Shared_ZipArchive::locateName |
( |
|
$fileName | ) |
|
Find if given fileName exist in archive (Emulate ZipArchive locateName())
- Parameters
-
string | $fileName | Filename for the file in zip archive |
- Returns
- boolean
Definition at line 120 of file ZipArchive.php.
References $i, and $list.
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);
if(isset($_REQUEST['delete'])) $list
◆ open()
PHPExcel_Shared_ZipArchive::open |
( |
|
$fileName | ) |
|
◆ $_tempDir
PHPExcel_Shared_ZipArchive::$_tempDir |
|
private |
◆ $_zip
PHPExcel_Shared_ZipArchive::$_zip |
|
private |
◆ CREATE
const PHPExcel_Shared_ZipArchive::CREATE = 'CREATE' |
◆ OVERWRITE
const PHPExcel_Shared_ZipArchive::OVERWRITE = 'OVERWRITE' |
The documentation for this class was generated from the following file:
- libs/composer/vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/ZipArchive.php