ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
PHPExcel_Shared_XMLWriter Class Reference
+ Inheritance diagram for PHPExcel_Shared_XMLWriter:
+ Collaboration diagram for PHPExcel_Shared_XMLWriter:

Public Member Functions

 __construct ($pTemporaryStorage=self::STORAGE_MEMORY, $pTemporaryStorageFolder=NULL)
 Create a new PHPExcel_Shared_XMLWriter instance. More...
 
 __destruct ()
 Destructor. More...
 
 getData ()
 Get written data. More...
 
 writeRawData ($text)
 Fallback method for writeRaw, introduced in PHP 5.2. More...
 

Data Fields

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

Private Attributes

 $_tempFileName = ''
 

Detailed Description

Definition at line 44 of file XMLWriter.php.

Constructor & Destructor Documentation

◆ __construct()

PHPExcel_Shared_XMLWriter::__construct (   $pTemporaryStorage = self::STORAGE_MEMORY,
  $pTemporaryStorageFolder = NULL 
)

Create a new PHPExcel_Shared_XMLWriter instance.

Parameters
int$pTemporaryStorageTemporary storage location
string$pTemporaryStorageFolderTemporary storage folder

Definition at line 62 of file XMLWriter.php.

References PHPExcel_Shared_File\sys_get_temp_dir().

62  {
63  // Open temporary storage
64  if ($pTemporaryStorage == self::STORAGE_MEMORY) {
65  $this->openMemory();
66  } else {
67  // Create temporary filename
68  if ($pTemporaryStorageFolder === NULL)
69  $pTemporaryStorageFolder = PHPExcel_Shared_File::sys_get_temp_dir();
70  $this->_tempFileName = @tempnam($pTemporaryStorageFolder, 'xml');
71 
72  // Open storage
73  if ($this->openUri($this->_tempFileName) === false) {
74  // Fallback to memory...
75  $this->openMemory();
76  }
77  }
78 
79  // Set default values
80  if (DEBUGMODE_ENABLED) {
81  $this->setIndent(true);
82  }
83  }
static sys_get_temp_dir()
Get the systems temporary directory.
Definition: File.php:135
+ Here is the call graph for this function:

◆ __destruct()

PHPExcel_Shared_XMLWriter::__destruct ( )

Destructor.

Definition at line 88 of file XMLWriter.php.

88  {
89  // Unlink temporary files
90  if ($this->_tempFileName != '') {
91  @unlink($this->_tempFileName);
92  }
93  }

Member Function Documentation

◆ getData()

PHPExcel_Shared_XMLWriter::getData ( )

Get written data.

Returns
$data

Definition at line 100 of file XMLWriter.php.

100  {
101  if ($this->_tempFileName == '') {
102  return $this->outputMemory(true);
103  } else {
104  $this->flush();
105  return file_get_contents($this->_tempFileName);
106  }
107  }

◆ writeRawData()

PHPExcel_Shared_XMLWriter::writeRawData (   $text)

Fallback method for writeRaw, introduced in PHP 5.2.

Parameters
string$text
Returns
string

Definition at line 115 of file XMLWriter.php.

References $text.

116  {
117  if (is_array($text)) {
118  $text = implode("\n",$text);
119  }
120 
121  if (method_exists($this, 'writeRaw')) {
122  return $this->writeRaw(htmlspecialchars($text));
123  }
124 
125  return $this->text($text);
126  }
$text
Definition: errorreport.php:18

Field Documentation

◆ $_tempFileName

PHPExcel_Shared_XMLWriter::$_tempFileName = ''
private

Definition at line 54 of file XMLWriter.php.

◆ STORAGE_DISK

const PHPExcel_Shared_XMLWriter::STORAGE_DISK = 2

◆ STORAGE_MEMORY

const PHPExcel_Shared_XMLWriter::STORAGE_MEMORY = 1

Temporary storage method.

Definition at line 46 of file XMLWriter.php.

Referenced by PHPExcel_Writer_OpenDocument_Settings\write(), PHPExcel_Writer_OpenDocument_Meta\write(), PHPExcel_Writer_OpenDocument_Styles\write(), PHPExcel_Writer_OpenDocument_Content\write(), PHPExcel_Writer_Excel2007_Chart\writeChart(), PHPExcel_Writer_Excel2007_Comments\writeComments(), PHPExcel_Writer_Excel2007_ContentTypes\writeContentTypes(), PHPExcel_Writer_Excel2007_DocProps\writeDocPropsApp(), PHPExcel_Writer_Excel2007_DocProps\writeDocPropsCore(), PHPExcel_Writer_Excel2007_DocProps\writeDocPropsCustom(), PHPExcel_Writer_Excel2007_Rels\writeDrawingRelationships(), PHPExcel_Writer_Excel2007_Drawing\writeDrawings(), PHPExcel_Writer_Excel2007_Rels\writeHeaderFooterDrawingRelationships(), PHPExcel_Writer_OpenDocument_MetaInf\writeManifest(), PHPExcel_Writer_Excel2007_Rels\writeRelationships(), PHPExcel_Writer_Excel2007_RelsRibbon\writeRibbonRelationships(), PHPExcel_Writer_Excel2007_StringTable\writeStringTable(), PHPExcel_Writer_Excel2007_Style\writeStyles(), PHPExcel_Writer_Excel2007_Theme\writeTheme(), PHPExcel_Writer_Excel2007_RelsVBA\writeVBARelationships(), PHPExcel_Writer_Excel2007_Comments\writeVMLComments(), PHPExcel_Writer_Excel2007_Drawing\writeVMLHeaderFooterImages(), PHPExcel_Writer_Excel2007_Workbook\writeWorkbook(), PHPExcel_Writer_Excel2007_Rels\writeWorkbookRelationships(), PHPExcel_Writer_Excel2007_Worksheet\writeWorksheet(), and PHPExcel_Writer_Excel2007_Rels\writeWorksheetRelationships().


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