ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
PHPExcel_Reader_Abstract Class Reference
+ Inheritance diagram for PHPExcel_Reader_Abstract:
+ Collaboration diagram for PHPExcel_Reader_Abstract:

Public Member Functions

 getReadDataOnly ()
 Read data only? If this is true, then the Reader will only read data values for cells, it will not read any formatting information. More...
 
 setReadDataOnly ($pValue=FALSE)
 Set read data only Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information. More...
 
 getIncludeCharts ()
 Read charts in workbook? If this is true, then the Reader will include any charts that exist in the workbook. More...
 
 setIncludeCharts ($pValue=FALSE)
 Set read charts in workbook Set to true, to advise the Reader to include any charts that exist in the workbook. More...
 
 getLoadSheetsOnly ()
 Get which sheets to load Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null indicating that all worksheets in the workbook should be loaded. More...
 
 setLoadSheetsOnly ($value=NULL)
 Set which sheets to load. More...
 
 setLoadAllSheets ()
 Set all sheets to load Tells the Reader to load all worksheets from the workbook. More...
 
 getReadFilter ()
 Read filter. More...
 
 setReadFilter (PHPExcel_Reader_IReadFilter $pValue)
 Set read filter. More...
 
 canRead ($pFilename)
 Can the current PHPExcel_Reader_IReader read the file? More...
 
 securityScan ($xml)
 Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks. More...
 
 securityScanFile ($filestream)
 Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks. More...
 
- Public Member Functions inherited from PHPExcel_Reader_IReader
 canRead ($pFilename)
 Can the current PHPExcel_Reader_IReader read the file? More...
 
 load ($pFilename)
 

Protected Member Functions

 _openFile ($pFilename)
 Open file for reading. More...
 

Protected Attributes

 $_readDataOnly = FALSE
 
 $_includeCharts = FALSE
 
 $_loadSheetsOnly = NULL
 
 $_readFilter = NULL
 
 $_fileHandle = NULL
 

Detailed Description

Definition at line 36 of file Abstract.php.

Member Function Documentation

◆ _openFile()

PHPExcel_Reader_Abstract::_openFile (   $pFilename)
protected

Open file for reading.

Parameters
string$pFilename
Exceptions
PHPExcel_Reader_Exception
Returns
resource

Definition at line 195 of file Abstract.php.

196 {
197 // Check if file exists
198 if (!file_exists($pFilename) || !is_readable($pFilename)) {
199 throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
200 }
201
202 // Open file
203 $this->_fileHandle = fopen($pFilename, 'r');
204 if ($this->_fileHandle === FALSE) {
205 throw new PHPExcel_Reader_Exception("Could not open file " . $pFilename . " for reading.");
206 }
207 }

Referenced by canRead(), PHPExcel_Reader_Excel2003XML\canRead(), PHPExcel_Reader_CSV\listWorksheetInfo(), PHPExcel_Reader_SYLK\listWorksheetInfo(), PHPExcel_Reader_CSV\loadIntoExisting(), PHPExcel_Reader_HTML\loadIntoExisting(), and PHPExcel_Reader_SYLK\loadIntoExisting().

+ Here is the caller graph for this function:

◆ canRead()

PHPExcel_Reader_Abstract::canRead (   $pFilename)

Can the current PHPExcel_Reader_IReader read the file?

Parameters
string$pFilename
Returns
boolean
Exceptions
PHPExcel_Reader_Exception

Implements PHPExcel_Reader_IReader.

Reimplemented in PHPExcel_Reader_Excel2003XML, PHPExcel_Reader_Excel2007, PHPExcel_Reader_Excel5, PHPExcel_Reader_Gnumeric, and PHPExcel_Reader_OOCalc.

Definition at line 216 of file Abstract.php.

217 {
218 // Check if file exists
219 try {
220 $this->_openFile($pFilename);
221 } catch (Exception $e) {
222 return FALSE;
223 }
224
225 $readable = $this->_isValidFormat();
226 fclose ($this->_fileHandle);
227 return $readable;
228 }
_openFile($pFilename)
Open file for reading.
Definition: Abstract.php:195

References _openFile().

+ Here is the call graph for this function:

◆ getIncludeCharts()

PHPExcel_Reader_Abstract::getIncludeCharts ( )

Read charts in workbook? If this is true, then the Reader will include any charts that exist in the workbook.

Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. If false (the default) it will ignore any charts defined in the workbook file.

Returns
boolean

Definition at line 106 of file Abstract.php.

106 {
108 }

References $_includeCharts.

◆ getLoadSheetsOnly()

PHPExcel_Reader_Abstract::getLoadSheetsOnly ( )

Get which sheets to load Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null indicating that all worksheets in the workbook should be loaded.

Returns
mixed

Definition at line 132 of file Abstract.php.

133 {
135 }

References $_loadSheetsOnly.

◆ getReadDataOnly()

PHPExcel_Reader_Abstract::getReadDataOnly ( )

Read data only? If this is true, then the Reader will only read data values for cells, it will not read any formatting information.

If false (the default) it will read data and formatting.

Returns
boolean

Definition at line 80 of file Abstract.php.

80 {
82 }

References $_readDataOnly.

◆ getReadFilter()

◆ securityScan()

PHPExcel_Reader_Abstract::securityScan (   $xml)

Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks.

Parameters
string$xml
Exceptions
PHPExcel_Reader_Exception

Reimplemented in PHPExcel_Reader_HTML.

Definition at line 236 of file Abstract.php.

237 {
238 $pattern = '/\\0?' . implode('\\0?', str_split('<!DOCTYPE')) . '\\0?/';
239 if (preg_match($pattern, $xml)) {
240 throw new PHPExcel_Reader_Exception('Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks');
241 }
242 return $xml;
243 }

Referenced by PHPExcel_Reader_Excel2007\canRead(), PHPExcel_Reader_OOCalc\canRead(), PHPExcel_Reader_Excel2003XML\listWorksheetInfo(), PHPExcel_Reader_Excel2007\listWorksheetInfo(), PHPExcel_Reader_Excel2003XML\listWorksheetNames(), PHPExcel_Reader_Excel2007\listWorksheetNames(), PHPExcel_Reader_Excel2007\load(), PHPExcel_Reader_Excel2003XML\loadIntoExisting(), PHPExcel_Reader_Gnumeric\loadIntoExisting(), and securityScanFile().

+ Here is the caller graph for this function:

◆ securityScanFile()

PHPExcel_Reader_Abstract::securityScanFile (   $filestream)

Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks.

Parameters
string$filestream
Exceptions
PHPExcel_Reader_Exception

Definition at line 251 of file Abstract.php.

252 {
253 return $this->securityScan(file_get_contents($filestream));
254 }
securityScan($xml)
Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks.
Definition: Abstract.php:236

References securityScan().

Referenced by PHPExcel_Reader_Excel2007\listWorksheetInfo(), PHPExcel_Reader_Gnumeric\listWorksheetInfo(), PHPExcel_Reader_Gnumeric\listWorksheetNames(), and PHPExcel_Reader_HTML\loadIntoExisting().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setIncludeCharts()

PHPExcel_Reader_Abstract::setIncludeCharts (   $pValue = FALSE)

Set read charts in workbook Set to true, to advise the Reader to include any charts that exist in the workbook.

Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. Set to false (the default) to discard charts.

Parameters
boolean$pValue
Returns
PHPExcel_Reader_IReader

Definition at line 120 of file Abstract.php.

120 {
121 $this->_includeCharts = (boolean) $pValue;
122 return $this;
123 }

◆ setLoadAllSheets()

PHPExcel_Reader_Abstract::setLoadAllSheets ( )

Set all sheets to load Tells the Reader to load all worksheets from the workbook.

Returns
PHPExcel_Reader_IReader

Definition at line 162 of file Abstract.php.

163 {
164 $this->_loadSheetsOnly = NULL;
165 return $this;
166 }

Referenced by setLoadSheetsOnly().

+ Here is the caller graph for this function:

◆ setLoadSheetsOnly()

PHPExcel_Reader_Abstract::setLoadSheetsOnly (   $value = NULL)

Set which sheets to load.

Parameters
mixed$valueThis should be either an array of worksheet names to be loaded, or a string containing a single worksheet name. If NULL, then it tells the Reader to read all worksheets in the workbook
Returns
PHPExcel_Reader_IReader

Definition at line 146 of file Abstract.php.

147 {
148 if ($value === NULL)
149 return $this->setLoadAllSheets();
150
151 $this->_loadSheetsOnly = is_array($value) ?
152 $value : array($value);
153 return $this;
154 }
setLoadAllSheets()
Set all sheets to load Tells the Reader to load all worksheets from the workbook.
Definition: Abstract.php:162

References setLoadAllSheets().

+ Here is the call graph for this function:

◆ setReadDataOnly()

PHPExcel_Reader_Abstract::setReadDataOnly (   $pValue = FALSE)

Set read data only Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information.

Set to false (the default) to advise the Reader to read both data and formatting for cells.

Parameters
boolean$pValue
Returns
PHPExcel_Reader_IReader

Definition at line 93 of file Abstract.php.

93 {
94 $this->_readDataOnly = $pValue;
95 return $this;
96 }

◆ setReadFilter()

PHPExcel_Reader_Abstract::setReadFilter ( PHPExcel_Reader_IReadFilter  $pValue)

Set read filter.

Parameters
PHPExcel_Reader_IReadFilter$pValue
Returns
PHPExcel_Reader_IReader

Definition at line 183 of file Abstract.php.

183 {
184 $this->_readFilter = $pValue;
185 return $this;
186 }

Field Documentation

◆ $_fileHandle

◆ $_includeCharts

PHPExcel_Reader_Abstract::$_includeCharts = FALSE
protected

Definition at line 53 of file Abstract.php.

Referenced by getIncludeCharts().

◆ $_loadSheetsOnly

PHPExcel_Reader_Abstract::$_loadSheetsOnly = NULL
protected

Definition at line 61 of file Abstract.php.

Referenced by getLoadSheetsOnly().

◆ $_readDataOnly

PHPExcel_Reader_Abstract::$_readDataOnly = FALSE
protected

Definition at line 45 of file Abstract.php.

Referenced by getReadDataOnly(), and PHPExcel_Reader_Excel2007\load().

◆ $_readFilter

PHPExcel_Reader_Abstract::$_readFilter = NULL
protected

Definition at line 68 of file Abstract.php.

Referenced by getReadFilter().


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