ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Reader_Serialized Class Reference
+ Inheritance diagram for PHPExcel_Reader_Serialized:
+ Collaboration diagram for PHPExcel_Reader_Serialized:

Public Member Functions

 canRead ($pFilename)
 Can the current PHPExcel_Reader_IReader read the file?
 load ($pFilename)
 Loads PHPExcel Serialized file.
 fileSupportsUnserializePHPExcel ($pFilename= '')
 Does a file support UnserializePHPExcel ?

Private Member Functions

 _loadSerialized ($pFilename)
 Load PHPExcel Serialized file.

Detailed Description

Definition at line 54 of file Serialized.php.

Member Function Documentation

PHPExcel_Reader_Serialized::_loadSerialized (   $pFilename)
private

Load PHPExcel Serialized file.

Parameters
string$pFilename
Returns
PHPExcel

Definition at line 100 of file Serialized.php.

Referenced by load().

{
$xmlData = simplexml_load_string(file_get_contents("zip://$pFilename#phpexcel.xml"));
$excel = unserialize(base64_decode((string)$xmlData->data));
// Update media links
for ($i = 0; $i < $excel->getSheetCount(); ++$i) {
for ($j = 0; $j < $excel->getSheet($i)->getDrawingCollection()->count(); ++$j) {
if ($excel->getSheet($i)->getDrawingCollection()->offsetGet($j) instanceof PHPExcl_Worksheet_BaseDrawing) {
$imgTemp =& $excel->getSheet($i)->getDrawingCollection()->offsetGet($j);
$imgTemp->setPath('zip://' . $pFilename . '#media/' . $imgTemp->getFilename(), false);
}
}
}
return $excel;
}

+ Here is the caller graph for this function:

PHPExcel_Reader_Serialized::canRead (   $pFilename)

Can the current PHPExcel_Reader_IReader read the file?

Parameters
string$pFileName
Returns
boolean

Implements PHPExcel_Reader_IReader.

Definition at line 62 of file Serialized.php.

References fileSupportsUnserializePHPExcel().

{
// Check if file exists
if (!file_exists($pFilename)) {
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
}
return $this->fileSupportsUnserializePHPExcel($pFilename);
}

+ Here is the call graph for this function:

PHPExcel_Reader_Serialized::fileSupportsUnserializePHPExcel (   $pFilename = '')

Does a file support UnserializePHPExcel ?

Parameters
string$pFilename
Exceptions
Exception
Returns
boolean

Definition at line 124 of file Serialized.php.

References PHPExcel_Shared_File\file_exists().

Referenced by canRead(), and load().

{
// Check if file exists
if (!file_exists($pFilename)) {
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
}
// File exists, does it contain phpexcel.xml?
return PHPExcel_Shared_File::file_exists("zip://$pFilename#phpexcel.xml");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Reader_Serialized::load (   $pFilename)

Loads PHPExcel Serialized file.

Parameters
string$pFilename
Returns
PHPExcel
Exceptions
Exception

Implements PHPExcel_Reader_IReader.

Definition at line 79 of file Serialized.php.

References _loadSerialized(), and fileSupportsUnserializePHPExcel().

{
// Check if file exists
if (!file_exists($pFilename)) {
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
}
// Unserialize... First make sure the file supports it!
if (!$this->fileSupportsUnserializePHPExcel($pFilename)) {
throw new Exception("Invalid file format for PHPExcel_Reader_Serialized: " . $pFilename . ".");
}
return $this->_loadSerialized($pFilename);
}

+ Here is the call graph for this function:


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