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

Public Member Functions

 __construct ($pTemporaryStorage=self::STORAGE_MEMORY, $pTemporaryStorageFolder= './')
 Create a new PHPExcel_Shared_XMLWriter instance.
 __destruct ()
 Destructor.
 getData ()
 Get written data.
 __call ($function, $args)
 Catch function calls (and pass them to internal XMLWriter)
 writeRaw ($text)
 Fallback method for writeRaw, introduced in PHP 5.2.

Data Fields

const STORAGE_MEMORY = 1
 Temporary storage method.
const STORAGE_DISK = 2

Private Attributes

 $_xmlWriter
 $_tempFileName = ''

Detailed Description

Definition at line 39 of file XMLWriter.php.

Constructor & Destructor Documentation

PHPExcel_Shared_XMLWriter::__construct (   $pTemporaryStorage = self::STORAGE_MEMORY,
  $pTemporaryStorageFolder = './' 
)

Create a new PHPExcel_Shared_XMLWriter instance.

Parameters
int$pTemporaryStorageTemporary storage location
string$pTemporaryStorageFolderTemporary storage folder

Definition at line 64 of file XMLWriter.php.

{
// Create internal XMLWriter
$this->_xmlWriter = new XMLWriter();
// Open temporary storage
if ($pTemporaryStorage == self::STORAGE_MEMORY) {
$this->_xmlWriter->openMemory();
} else {
// Create temporary filename
$this->_tempFileName = @tempnam($pTemporaryStorageFolder, 'xml');
// Open storage
if ($this->_xmlWriter->openUri($this->_tempFileName) === false) {
// Fallback to memory...
$this->_xmlWriter->openMemory();
}
}
// Set default values
$this->_xmlWriter->setIndent(true);
}
PHPExcel_Shared_XMLWriter::__destruct ( )

Destructor.

Definition at line 89 of file XMLWriter.php.

{
// Desctruct XMLWriter
unset($this->_xmlWriter);
// Unlink temporary files
if ($this->_tempFileName != '') {
@unlink($this->_tempFileName);
}
}

Member Function Documentation

PHPExcel_Shared_XMLWriter::__call (   $function,
  $args 
)

Catch function calls (and pass them to internal XMLWriter)

Parameters
unknown_type$function
unknown_type$args

Definition at line 119 of file XMLWriter.php.

{
try {
@call_user_func_array(array($this->_xmlWriter, $function), $args);
} catch (Exception $ex) {
// Do nothing!
}
}
PHPExcel_Shared_XMLWriter::getData ( )

Get written data.

Returns
$data

Definition at line 104 of file XMLWriter.php.

{
if ($this->_tempFileName == '') {
return $this->_xmlWriter->outputMemory(true);
} else {
$this->_xmlWriter->flush();
return file_get_contents($this->_tempFileName);
}
}
PHPExcel_Shared_XMLWriter::writeRaw (   $text)

Fallback method for writeRaw, introduced in PHP 5.2.

Parameters
string$text
Returns
string

Definition at line 133 of file XMLWriter.php.

{
if (isset($this->_xmlWriter) && is_object($this->_xmlWriter) && (method_exists($this->_xmlWriter, 'writeRaw'))) {
return $this->_xmlWriter->writeRaw(htmlspecialchars($text));
}
return $this->text($text);
}

Field Documentation

PHPExcel_Shared_XMLWriter::$_tempFileName = ''
private

Definition at line 56 of file XMLWriter.php.

PHPExcel_Shared_XMLWriter::$_xmlWriter
private

Definition at line 49 of file XMLWriter.php.


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