ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Shared_ZipArchive Class Reference
+ Collaboration diagram for PHPExcel_Shared_ZipArchive:

Public Member Functions

 open ($fileName)
 close ()
 addFromString ($localname, $contents)

Private Attributes

 $_tempDir
 $_zip

Detailed Description

Definition at line 38 of file ZipArchive.php.

Member Function Documentation

PHPExcel_Shared_ZipArchive::addFromString (   $localname,
  $contents 
)

Definition at line 71 of file ZipArchive.php.

References $handle, $res, PCLZIP_OPT_ADD_PATH, and PCLZIP_OPT_REMOVE_PATH.

{
$filenameParts = pathinfo($localname);
$handle = fopen($this->_tempDir.'/'.$filenameParts["basename"], "wb");
fwrite($handle, $contents);
fclose($handle);
$res = $this->_zip->add($this->_tempDir.'/'.$filenameParts["basename"],
PCLZIP_OPT_REMOVE_PATH, $this->_tempDir,
PCLZIP_OPT_ADD_PATH, $filenameParts["dirname"]
);
if ($res == 0) {
throw new Exception("Error zipping files : " . $this->_zip->errorInfo(true));
}
unlink($this->_tempDir.'/'.$filenameParts["basename"]);
}
PHPExcel_Shared_ZipArchive::close ( )

Definition at line 66 of file ZipArchive.php.

{
}
PHPExcel_Shared_ZipArchive::open (   $fileName)

Definition at line 56 of file ZipArchive.php.

References PHPExcel_Shared_File\sys_get_temp_dir().

{
$this->_zip = new PclZip($fileName);
return true;
}

+ Here is the call graph for this function:

Field Documentation

PHPExcel_Shared_ZipArchive::$_tempDir
private

Definition at line 46 of file ZipArchive.php.

PHPExcel_Shared_ZipArchive::$_zip
private

Definition at line 53 of file ZipArchive.php.


The documentation for this class was generated from the following file: