Start work on namespacing Reader classes

This commit is contained in:
MarkBaker 2015-05-31 23:24:19 +01:00
parent a39e15f49d
commit ebca5d1a57
13 changed files with 353 additions and 670 deletions

View File

@ -1,253 +0,0 @@
<?php
/**
* PHPExcel_Reader_Abstract
*
* Copyright (c) 2006 - 2015 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
abstract class PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
{
/**
* Read data only?
* Identifies whether the Reader should only read data values for cells, and ignore any formatting information;
* or whether it should read both data and formatting
*
* @var boolean
*/
protected $readDataOnly = false;
/**
* Read charts that are defined in the workbook?
* Identifies whether the Reader should read the definitions for any charts that exist in the workbook;
*
* @var boolean
*/
protected $includeCharts = false;
/**
* Restrict which sheets should be loaded?
* This property holds an array of worksheet names to be loaded. If null, then all worksheets will be loaded.
*
* @var array of string
*/
protected $loadSheetsOnly;
/**
* PHPExcel_Reader_IReadFilter instance
*
* @var PHPExcel_Reader_IReadFilter
*/
protected $readFilter;
protected $fileHandle = null;
/**
* 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.
*
* @return boolean
*/
public function getReadDataOnly()
{
return $this->readDataOnly;
}
/**
* 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.
*
* @param boolean $pValue
*
* @return PHPExcel_Reader_IReader
*/
public function setReadDataOnly($pValue = false)
{
$this->readDataOnly = $pValue;
return $this;
}
/**
* 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.
*
* @return boolean
*/
public function getIncludeCharts()
{
return $this->includeCharts;
}
/**
* 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.
*
* @param boolean $pValue
*
* @return PHPExcel_Reader_IReader
*/
public function setIncludeCharts($pValue = false)
{
$this->includeCharts = (boolean) $pValue;
return $this;
}
/**
* 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.
*
* @return mixed
*/
public function getLoadSheetsOnly()
{
return $this->loadSheetsOnly;
}
/**
* Set which sheets to load
*
* @param mixed $value
* This 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
*
* @return PHPExcel_Reader_IReader
*/
public function setLoadSheetsOnly($value = null)
{
if ($value === null) {
return $this->setLoadAllSheets();
}
$this->loadSheetsOnly = is_array($value) ? $value : array($value);
return $this;
}
/**
* Set all sheets to load
* Tells the Reader to load all worksheets from the workbook.
*
* @return PHPExcel_Reader_IReader
*/
public function setLoadAllSheets()
{
$this->loadSheetsOnly = null;
return $this;
}
/**
* Read filter
*
* @return PHPExcel_Reader_IReadFilter
*/
public function getReadFilter()
{
return $this->readFilter;
}
/**
* Set read filter
*
* @param PHPExcel_Reader_IReadFilter $pValue
* @return PHPExcel_Reader_IReader
*/
public function setReadFilter(PHPExcel_Reader_IReadFilter $pValue)
{
$this->readFilter = $pValue;
return $this;
}
/**
* Open file for reading
*
* @param string $pFilename
* @throws PHPExcel_Reader_Exception
* @return resource
*/
protected function openFile($pFilename)
{
// Check if file exists
if (!file_exists($pFilename) || !is_readable($pFilename)) {
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
}
// Open file
$this->fileHandle = fopen($pFilename, 'r');
if ($this->fileHandle === false) {
throw new PHPExcel_Reader_Exception("Could not open file " . $pFilename . " for reading.");
}
}
/**
* Can the current PHPExcel_Reader_IReader read the file?
*
* @param string $pFilename
* @return boolean
* @throws PHPExcel_Reader_Exception
*/
public function canRead($pFilename)
{
// Check if file exists
try {
$this->openFile($pFilename);
} catch (Exception $e) {
return false;
}
$readable = $this->isValidFormat();
fclose($this->fileHandle);
return $readable;
}
/**
* Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks
*
* @param string $xml
* @throws PHPExcel_Reader_Exception
*/
public function securityScan($xml)
{
$pattern = '/\\0?' . implode('\\0?', str_split('<!DOCTYPE')) . '\\0?/';
if (preg_match($pattern, $xml)) {
throw new PHPExcel_Reader_Exception('Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks');
}
return $xml;
}
/**
* Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks
*
* @param string $filestream
* @throws PHPExcel_Reader_Exception
*/
public function securityScanFile($filestream)
{
return $this->securityScan(file_get_contents($filestream));
}
}

View File

@ -1,13 +1,6 @@
<?php <?php
/** PHPExcel root directory */ namespace PHPExcel\Reader;
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* PHPExcel_Reader_CSV * PHPExcel_Reader_CSV
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader class CSV extends BaseReader implements IReader
{ {
/** /**
* Input encoding * Input encoding
@ -85,11 +78,11 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
/** /**
* Create a new PHPExcel_Reader_CSV * Create a new CSV
*/ */
public function __construct() public function __construct()
{ {
$this->readFilter = new PHPExcel_Reader_DefaultReadFilter(); $this->readFilter = new DefaultReadFilter();
} }
/** /**
@ -161,7 +154,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns) * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
* *
* @param string $pFilename * @param string $pFilename
* @throws PHPExcel_Reader_Exception * @throws Exception
*/ */
public function listWorksheetInfo($pFilename) public function listWorksheetInfo($pFilename)
{ {
@ -169,7 +162,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
$this->openFile($pFilename); $this->openFile($pFilename);
if (!$this->isValidFormat()) { if (!$this->isValidFormat()) {
fclose($this->fileHandle); fclose($this->fileHandle);
throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file."); throw new Exception($pFilename . " is an Invalid Spreadsheet file.");
} }
$fileHandle = $this->fileHandle; $fileHandle = $this->fileHandle;
@ -191,7 +184,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
$worksheetInfo[0]['lastColumnIndex'] = max($worksheetInfo[0]['lastColumnIndex'], count($rowData) - 1); $worksheetInfo[0]['lastColumnIndex'] = max($worksheetInfo[0]['lastColumnIndex'], count($rowData) - 1);
} }
$worksheetInfo[0]['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($worksheetInfo[0]['lastColumnIndex']); $worksheetInfo[0]['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($worksheetInfo[0]['lastColumnIndex']);
$worksheetInfo[0]['totalColumns'] = $worksheetInfo[0]['lastColumnIndex'] + 1; $worksheetInfo[0]['totalColumns'] = $worksheetInfo[0]['lastColumnIndex'] + 1;
// Close file // Close file
@ -205,7 +198,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
* *
* @param string $pFilename * @param string $pFilename
* @return PHPExcel * @return PHPExcel
* @throws PHPExcel_Reader_Exception * @throws Exception
*/ */
public function load($pFilename) public function load($pFilename)
{ {
@ -222,7 +215,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
* @param string $pFilename * @param string $pFilename
* @param PHPExcel $objPHPExcel * @param PHPExcel $objPHPExcel
* @return PHPExcel * @return PHPExcel
* @throws PHPExcel_Reader_Exception * @throws Exception
*/ */
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
{ {
@ -233,7 +226,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
$this->openFile($pFilename); $this->openFile($pFilename);
if (!$this->isValidFormat()) { if (!$this->isValidFormat()) {
fclose($this->fileHandle); fclose($this->fileHandle);
throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file."); throw new Exception($pFilename . " is an Invalid Spreadsheet file.");
} }
$fileHandle = $this->fileHandle; $fileHandle = $this->fileHandle;
@ -266,7 +259,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
// Convert encoding if necessary // Convert encoding if necessary
if ($this->inputEncoding !== 'UTF-8') { if ($this->inputEncoding !== 'UTF-8') {
$rowDatum = PHPExcel_Shared_String::ConvertEncoding($rowDatum, 'UTF-8', $this->inputEncoding); $rowDatum = \PHPExcel\Shared\String::ConvertEncoding($rowDatum, 'UTF-8', $this->inputEncoding);
} }
// Set cell value // Set cell value
@ -304,7 +297,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
* Set delimiter * Set delimiter
* *
* @param string $pValue Delimiter, defaults to , * @param string $pValue Delimiter, defaults to ,
* @return PHPExcel_Reader_CSV * @return CSV
*/ */
public function setDelimiter($pValue = ',') public function setDelimiter($pValue = ',')
{ {
@ -326,7 +319,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
* Set enclosure * Set enclosure
* *
* @param string $pValue Enclosure, defaults to " * @param string $pValue Enclosure, defaults to "
* @return PHPExcel_Reader_CSV * @return CSV
*/ */
public function setEnclosure($pValue = '"') public function setEnclosure($pValue = '"')
{ {
@ -351,7 +344,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
* Set sheet index * Set sheet index
* *
* @param integer $pValue Sheet index * @param integer $pValue Sheet index
* @return PHPExcel_Reader_CSV * @return CSV
*/ */
public function setSheetIndex($pValue = 0) public function setSheetIndex($pValue = 0)
{ {

View File

@ -1,13 +1,6 @@
<?php <?php
/** PHPExcel root directory */ namespace PHPExcel\Reader;
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* PHPExcel_Reader_DefaultReadFilter * PHPExcel_Reader_DefaultReadFilter
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
class PHPExcel_Reader_DefaultReadFilter implements PHPExcel_Reader_IReadFilter class DefaultReadFilter implements IReadFilter
{ {
/** /**
* Should this cell be read? * Should this cell be read?

View File

@ -1,13 +1,6 @@
<?php <?php
/** PHPExcel root directory */ namespace PHPExcel\Reader;
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* PHPExcel_Reader_Excel2003XML * PHPExcel_Reader_Excel2003XML
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader class Excel2003XML extends BaseReader implements IReader
{ {
/** /**
* Formats * Formats

View File

@ -1,13 +1,6 @@
<?php <?php
/** PHPExcel root directory */ namespace PHPExcel\Reader;
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* PHPExcel_Reader_Excel2007 * PHPExcel_Reader_Excel2007
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader class Excel2007 extends BaseReader implements IReader
{ {
/** /**
* PHPExcel_ReferenceHelper instance * PHPExcel_ReferenceHelper instance

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,7 @@
<?php <?php
namespace PHPExcel\Reader;
/** /**
* PHPExcel_Reader_Exception * PHPExcel_Reader_Exception
* *
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
class PHPExcel_Reader_Exception extends PHPExcel_Exception class Exception extends \PHPExcel\Exception
{ {
/** /**
* Error handler callback * Error handler callback

View File

@ -1,13 +1,6 @@
<?php <?php
/** PHPExcel root directory */ namespace PHPExcel\Reader;
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* PHPExcel_Reader_Gnumeric * PHPExcel_Reader_Gnumeric
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader class Gnumeric extends BaseReader implements IReader
{ {
/** /**
* Formats * Formats
@ -53,31 +46,31 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
private $referenceHelper = null; private $referenceHelper = null;
/** /**
* Create a new PHPExcel_Reader_Gnumeric * Create a new Gnumeric
*/ */
public function __construct() public function __construct()
{ {
$this->readFilter = new PHPExcel_Reader_DefaultReadFilter(); $this->readFilter = new DefaultReadFilter();
$this->referenceHelper = PHPExcel_ReferenceHelper::getInstance(); $this->referenceHelper = \PHPExcel\ReferenceHelper::getInstance();
} }
/** /**
* Can the current PHPExcel_Reader_IReader read the file? * Can the current IReader read the file?
* *
* @param string $pFilename * @param string $pFilename
* @return boolean * @return boolean
* @throws PHPExcel_Reader_Exception * @throws Exception
*/ */
public function canRead($pFilename) public function canRead($pFilename)
{ {
// Check if file exists // Check if file exists
if (!file_exists($pFilename)) { if (!file_exists($pFilename)) {
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
} }
// Check if gzlib functions are available // Check if gzlib functions are available
if (!function_exists('gzread')) { if (!function_exists('gzread')) {
throw new PHPExcel_Reader_Exception("gzlib library is not enabled"); throw new Exception("gzlib library is not enabled");
} }
// Read signature data (first 3 bytes) // Read signature data (first 3 bytes)
@ -96,17 +89,17 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
* Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object
* *
* @param string $pFilename * @param string $pFilename
* @throws PHPExcel_Reader_Exception * @throws Exception
*/ */
public function listWorksheetNames($pFilename) public function listWorksheetNames($pFilename)
{ {
// Check if file exists // Check if file exists
if (!file_exists($pFilename)) { if (!file_exists($pFilename)) {
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
} }
$xml = new XMLReader(); $xml = new XMLReader();
$xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, PHPExcel_Settings::getLibXmlLoaderOptions()); $xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, \PHPExcel\Settings::getLibXmlLoaderOptions());
$xml->setParserProperty(2, true); $xml->setParserProperty(2, true);
$worksheetNames = array(); $worksheetNames = array();
@ -127,17 +120,17 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns) * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
* *
* @param string $pFilename * @param string $pFilename
* @throws PHPExcel_Reader_Exception * @throws Exception
*/ */
public function listWorksheetInfo($pFilename) public function listWorksheetInfo($pFilename)
{ {
// Check if file exists // Check if file exists
if (!file_exists($pFilename)) { if (!file_exists($pFilename)) {
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
} }
$xml = new XMLReader(); $xml = new XMLReader();
$xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, PHPExcel_Settings::getLibXmlLoaderOptions()); $xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, \PHPExcel\Settings::getLibXmlLoaderOptions());
$xml->setParserProperty(2, true); $xml->setParserProperty(2, true);
$worksheetInfo = array(); $worksheetInfo = array();
@ -165,7 +158,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
break; break;
} }
} }
$tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
$worksheetInfo[] = $tmpInfo; $worksheetInfo[] = $tmpInfo;
} }
} }
@ -191,7 +184,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
* *
* @param string $pFilename * @param string $pFilename
* @return PHPExcel * @return PHPExcel
* @throws PHPExcel_Reader_Exception * @throws Exception
*/ */
public function load($pFilename) public function load($pFilename)
{ {
@ -208,13 +201,13 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
* @param string $pFilename * @param string $pFilename
* @param PHPExcel $objPHPExcel * @param PHPExcel $objPHPExcel
* @return PHPExcel * @return PHPExcel
* @throws PHPExcel_Reader_Exception * @throws Exception
*/ */
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
{ {
// Check if file exists // Check if file exists
if (!file_exists($pFilename)) { if (!file_exists($pFilename)) {
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist."); throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
} }
$timezoneObj = new DateTimeZone('Europe/London'); $timezoneObj = new DateTimeZone('Europe/London');
@ -226,7 +219,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
// echo htmlentities($gFileData,ENT_QUOTES,'UTF-8'); // echo htmlentities($gFileData,ENT_QUOTES,'UTF-8');
// echo '</pre><hr />'; // echo '</pre><hr />';
// //
$xml = simplexml_load_string($this->securityScan($gFileData), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); $xml = simplexml_load_string($this->securityScan($gFileData), 'SimpleXMLElement', \PHPExcel\Settings::getLibXmlLoaderOptions());
$namespacesMeta = $xml->getNamespaces(true); $namespacesMeta = $xml->getNamespaces(true);
// var_dump($namespacesMeta); // var_dump($namespacesMeta);
@ -400,7 +393,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$maxCol = $column; $maxCol = $column;
} }
$column = PHPExcel_Cell::stringFromColumnIndex($column); $column = \PHPExcel\Cell::stringFromColumnIndex($column);
// Read cell? // Read cell?
if ($this->getReadFilter() !== null) { if ($this->getReadFilter() !== null) {
@ -414,7 +407,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
// echo 'Cell ', $column, $row,'<br />'; // echo 'Cell ', $column, $row,'<br />';
// echo 'Type is ', $ValueType,'<br />'; // echo 'Type is ', $ValueType,'<br />';
// echo 'Value is ', $cell,'<br />'; // echo 'Value is ', $cell,'<br />';
$type = PHPExcel_Cell_DataType::TYPE_FORMULA; $type = \PHPExcel\Cell\DataType::TYPE_FORMULA;
if ($ExprID > '') { if ($ExprID > '') {
if (((string) $cell) > '') { if (((string) $cell) > '') {
$this->expressions[$ExprID] = array( $this->expressions[$ExprID] = array(
@ -436,27 +429,27 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
// echo 'SHARED EXPRESSION ', $ExprID,'<br />'; // echo 'SHARED EXPRESSION ', $ExprID,'<br />';
// echo 'New Value is ', $cell,'<br />'; // echo 'New Value is ', $cell,'<br />';
} }
$type = PHPExcel_Cell_DataType::TYPE_FORMULA; $type = \PHPExcel\Cell\DataType::TYPE_FORMULA;
} else { } else {
switch ($ValueType) { switch ($ValueType) {
case '10': // NULL case '10': // NULL
$type = PHPExcel_Cell_DataType::TYPE_NULL; $type = \PHPExcel\Cell\DataType::TYPE_NULL;
break; break;
case '20': // Boolean case '20': // Boolean
$type = PHPExcel_Cell_DataType::TYPE_BOOL; $type = \PHPExcel\Cell\DataType::TYPE_BOOL;
$cell = ($cell == 'TRUE') ? true: false; $cell = ($cell == 'TRUE') ? true: false;
break; break;
case '30': // Integer case '30': // Integer
$cell = intval($cell); $cell = intval($cell);
// Excel 2007+ doesn't differentiate between integer and float, so set the value and dropthru to the next (numeric) case // Excel 2007+ doesn't differentiate between integer and float, so set the value and dropthru to the next (numeric) case
case '40': // Float case '40': // Float
$type = PHPExcel_Cell_DataType::TYPE_NUMERIC; $type = \PHPExcel\Cell\DataType::TYPE_NUMERIC;
break; break;
case '50': // Error case '50': // Error
$type = PHPExcel_Cell_DataType::TYPE_ERROR; $type = \PHPExcel\Cell\DataType::TYPE_ERROR;
break; break;
case '60': // String case '60': // String
$type = PHPExcel_Cell_DataType::TYPE_STRING; $type = \PHPExcel\Cell\DataType::TYPE_STRING;
break; break;
case '70': // Cell Range case '70': // Cell Range
case '80': // Array case '80': // Array
@ -480,11 +473,11 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$styleAttributes = $styleRegion->attributes(); $styleAttributes = $styleRegion->attributes();
if (($styleAttributes['startRow'] <= $maxRow) && if (($styleAttributes['startRow'] <= $maxRow) &&
($styleAttributes['startCol'] <= $maxCol)) { ($styleAttributes['startCol'] <= $maxCol)) {
$startColumn = PHPExcel_Cell::stringFromColumnIndex((int) $styleAttributes['startCol']); $startColumn = \PHPExcel\Cell::stringFromColumnIndex((int) $styleAttributes['startCol']);
$startRow = $styleAttributes['startRow'] + 1; $startRow = $styleAttributes['startRow'] + 1;
$endColumn = ($styleAttributes['endCol'] > $maxCol) ? $maxCol : (int) $styleAttributes['endCol']; $endColumn = ($styleAttributes['endCol'] > $maxCol) ? $maxCol : (int) $styleAttributes['endCol'];
$endColumn = PHPExcel_Cell::stringFromColumnIndex($endColumn); $endColumn = \PHPExcel\Cell::stringFromColumnIndex($endColumn);
$endRow = ($styleAttributes['endRow'] > $maxRow) ? $maxRow : $styleAttributes['endRow']; $endRow = ($styleAttributes['endRow'] > $maxRow) ? $maxRow : $styleAttributes['endRow'];
$endRow += 1; $endRow += 1;
$cellRange = $startColumn.$startRow.':'.$endColumn.$endRow; $cellRange = $startColumn.$startRow.':'.$endColumn.$endRow;
@ -496,45 +489,45 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
// We still set the number format mask for date/time values, even if readDataOnly is true // We still set the number format mask for date/time values, even if readDataOnly is true
if ((!$this->readDataOnly) || if ((!$this->readDataOnly) ||
(PHPExcel_Shared_Date::isDateTimeFormatCode((string) $styleAttributes['Format']))) { (\PHPExcel\Shared\Date::isDateTimeFormatCode((string) $styleAttributes['Format']))) {
$styleArray = array(); $styleArray = array();
$styleArray['numberformat']['code'] = (string) $styleAttributes['Format']; $styleArray['numberformat']['code'] = (string) $styleAttributes['Format'];
// If readDataOnly is false, we set all formatting information // If readDataOnly is false, we set all formatting information
if (!$this->readDataOnly) { if (!$this->readDataOnly) {
switch ($styleAttributes['HAlign']) { switch ($styleAttributes['HAlign']) {
case '1': case '1':
$styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; $styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_GENERAL;
break; break;
case '2': case '2':
$styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_LEFT; $styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_LEFT;
break; break;
case '4': case '4':
$styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_RIGHT; $styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_RIGHT;
break; break;
case '8': case '8':
$styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_CENTER; $styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_CENTER;
break; break;
case '16': case '16':
case '64': case '64':
$styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS; $styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS;
break; break;
case '32': case '32':
$styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY; $styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY;
break; break;
} }
switch ($styleAttributes['VAlign']) { switch ($styleAttributes['VAlign']) {
case '1': case '1':
$styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_TOP; $styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_TOP;
break; break;
case '2': case '2':
$styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_BOTTOM; $styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_BOTTOM;
break; break;
case '4': case '4':
$styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_CENTER; $styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_CENTER;
break; break;
case '8': case '8':
$styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_JUSTIFY; $styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_JUSTIFY;
break; break;
} }
@ -552,64 +545,64 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$styleArray['fill']['endcolor']['rgb'] = $RGB2; $styleArray['fill']['endcolor']['rgb'] = $RGB2;
switch ($shade) { switch ($shade) {
case '1': case '1':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_SOLID; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_SOLID;
break; break;
case '2': case '2':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR;
break; break;
case '3': case '3':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_GRADIENT_PATH; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_GRADIENT_PATH;
break; break;
case '4': case '4':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKDOWN;
break; break;
case '5': case '5':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKGRAY;
break; break;
case '6': case '6':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKGRID;
break; break;
case '7': case '7':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKHORIZONTAL;
break; break;
case '8': case '8':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKTRELLIS;
break; break;
case '9': case '9':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKUP; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKUP;
break; break;
case '10': case '10':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKVERTICAL;
break; break;
case '11': case '11':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_GRAY0625;
break; break;
case '12': case '12':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_GRAY125; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_GRAY125;
break; break;
case '13': case '13':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTDOWN;
break; break;
case '14': case '14':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRAY;
break; break;
case '15': case '15':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRID;
break; break;
case '16': case '16':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL;
break; break;
case '17': case '17':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTTRELLIS;
break; break;
case '18': case '18':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTUP;
break; break;
case '19': case '19':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTVERTICAL;
break; break;
case '20': case '20':
$styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY; $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_MEDIUMGRAY;
break; break;
} }
} }
@ -624,19 +617,19 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$styleArray['font']['strike'] = ($fontAttributes['StrikeThrough'] == '1') ? true : false; $styleArray['font']['strike'] = ($fontAttributes['StrikeThrough'] == '1') ? true : false;
switch ($fontAttributes['Underline']) { switch ($fontAttributes['Underline']) {
case '1': case '1':
$styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_SINGLE; $styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_SINGLE;
break; break;
case '2': case '2':
$styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_DOUBLE; $styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_DOUBLE;
break; break;
case '3': case '3':
$styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING; $styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_SINGLEACCOUNTING;
break; break;
case '4': case '4':
$styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING; $styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_DOUBLEACCOUNTING;
break; break;
default: default:
$styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_NONE; $styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_NONE;
break; break;
} }
switch ($fontAttributes['Script']) { switch ($fontAttributes['Script']) {
@ -663,13 +656,13 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
} }
if ((isset($styleRegion->Style->StyleBorder->Diagonal)) && (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}))) { if ((isset($styleRegion->Style->StyleBorder->Diagonal)) && (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}))) {
$styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes()); $styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes());
$styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_BOTH; $styleArray['borders']['diagonaldirection'] = \PHPExcel\Style\Borders::DIAGONAL_BOTH;
} elseif (isset($styleRegion->Style->StyleBorder->Diagonal)) { } elseif (isset($styleRegion->Style->StyleBorder->Diagonal)) {
$styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes()); $styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes());
$styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_UP; $styleArray['borders']['diagonaldirection'] = \PHPExcel\Style\Borders::DIAGONAL_UP;
} elseif (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'})) { } elseif (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'})) {
$styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}->attributes()); $styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}->attributes());
$styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_DOWN; $styleArray['borders']['diagonaldirection'] = \PHPExcel\Style\Borders::DIAGONAL_DOWN;
} }
} }
if (isset($styleRegion->Style->HyperLink)) { if (isset($styleRegion->Style->HyperLink)) {
@ -696,19 +689,19 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$hidden = ((isset($columnAttributes['Hidden'])) && ($columnAttributes['Hidden'] == '1')) ? true : false; $hidden = ((isset($columnAttributes['Hidden'])) && ($columnAttributes['Hidden'] == '1')) ? true : false;
$columnCount = (isset($columnAttributes['Count'])) ? $columnAttributes['Count'] : 1; $columnCount = (isset($columnAttributes['Count'])) ? $columnAttributes['Count'] : 1;
while ($c < $column) { while ($c < $column) {
$objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); $objPHPExcel->getActiveSheet()->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth);
++$c; ++$c;
} }
while (($c < ($column+$columnCount)) && ($c <= $maxCol)) { while (($c < ($column+$columnCount)) && ($c <= $maxCol)) {
$objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($columnWidth); $objPHPExcel->getActiveSheet()->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($c))->setWidth($columnWidth);
if ($hidden) { if ($hidden) {
$objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setVisible(false); $objPHPExcel->getActiveSheet()->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($c))->setVisible(false);
} }
++$c; ++$c;
} }
} }
while ($c <= $maxCol) { while ($c <= $maxCol) {
$objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); $objPHPExcel->getActiveSheet()->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth);
++$c; ++$c;
} }
} }
@ -768,7 +761,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$range[0] = trim($range[0], "'"); $range[0] = trim($range[0], "'");
if ($worksheet = $objPHPExcel->getSheetByName($range[0])) { if ($worksheet = $objPHPExcel->getSheetByName($range[0])) {
$extractedRange = str_replace('$', '', $range[1]); $extractedRange = str_replace('$', '', $range[1]);
$objPHPExcel->addNamedRange(new PHPExcel_NamedRange($name, $worksheet, $extractedRange)); $objPHPExcel->addNamedRange(new \PHPExcel\NamedRange($name, $worksheet, $extractedRange));
} }
} }
} }
@ -786,46 +779,46 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
switch ($borderAttributes["Style"]) { switch ($borderAttributes["Style"]) {
case '0': case '0':
$styleArray['style'] = PHPExcel_Style_Border::BORDER_NONE; $styleArray['style'] = \PHPExcel\Style\Border::BORDER_NONE;
break; break;
case '1': case '1':
$styleArray['style'] = PHPExcel_Style_Border::BORDER_THIN; $styleArray['style'] = \PHPExcel\Style\Border::BORDER_THIN;
break; break;
case '2': case '2':
$styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUM; $styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUM;
break; break;
case '3': case '3':
$styleArray['style'] = PHPExcel_Style_Border::BORDER_SLANTDASHDOT; $styleArray['style'] = \PHPExcel\Style\Border::BORDER_SLANTDASHDOT;
break; break;
case '4': case '4':
$styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHED; $styleArray['style'] = \PHPExcel\Style\Border::BORDER_DASHED;
break; break;
case '5': case '5':
$styleArray['style'] = PHPExcel_Style_Border::BORDER_THICK; $styleArray['style'] = \PHPExcel\Style\Border::BORDER_THICK;
break; break;
case '6': case '6':
$styleArray['style'] = PHPExcel_Style_Border::BORDER_DOUBLE; $styleArray['style'] = \PHPExcel\Style\Border::BORDER_DOUBLE;
break; break;
case '7': case '7':
$styleArray['style'] = PHPExcel_Style_Border::BORDER_DOTTED; $styleArray['style'] = \PHPExcel\Style\Border::BORDER_DOTTED;
break; break;
case '8': case '8':
$styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHED; $styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHED;
break; break;
case '9': case '9':
$styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHDOT; $styleArray['style'] = \PHPExcel\Style\Border::BORDER_DASHDOT;
break; break;
case '10': case '10':
$styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT; $styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT;
break; break;
case '11': case '11':
$styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHDOTDOT; $styleArray['style'] = \PHPExcel\Style\Border::BORDER_DASHDOTDOT;
break; break;
case '12': case '12':
$styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT; $styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT;
break; break;
case '13': case '13':
$styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT; $styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT;
break; break;
} }
return $styleArray; return $styleArray;
@ -833,7 +826,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
private function parseRichText($is = '') private function parseRichText($is = '')
{ {
$value = new PHPExcel_RichText(); $value = new \PHPExcel\RichText();
$value->createText($is); $value->createText($is);
return $value; return $value;

View File

@ -1,12 +1,6 @@
<?php <?php
if (!defined('PHPEXCEL_ROOT')) { namespace PHPExcel\Reader;
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* PHPExcel_Reader_HTML * PHPExcel_Reader_HTML
@ -34,7 +28,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/** PHPExcel root directory */ /** PHPExcel root directory */
class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader class HTML extends BaseReader implements IReader
{ {
/** /**

View File

@ -1,5 +1,7 @@
<?php <?php
namespace PHPExcel\Reader;
/** /**
* PHPExcel_Reader_IReadFilter * PHPExcel_Reader_IReadFilter
* *
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
interface PHPExcel_Reader_IReadFilter interface IReadFilter
{ {
/** /**
* Should this cell be read? * Should this cell be read?

View File

@ -1,5 +1,7 @@
<?php <?php
namespace PHPExcel\Reader;
/** /**
* PHPExcel_Reader_IReader * PHPExcel_Reader_IReader
* *
@ -25,10 +27,10 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
interface PHPExcel_Reader_IReader interface IReader
{ {
/** /**
* Can the current PHPExcel_Reader_IReader read the file? * Can the current IReader read the file?
* *
* @param string $pFilename * @param string $pFilename
* @return boolean * @return boolean
@ -40,7 +42,7 @@ interface PHPExcel_Reader_IReader
* *
* @param string $pFilename * @param string $pFilename
* @return PHPExcel * @return PHPExcel
* @throws PHPExcel_Reader_Exception * @throws Exception
*/ */
public function load($pFilename); public function load($pFilename);
} }

View File

@ -1,13 +1,6 @@
<?php <?php
/** PHPExcel root directory */ namespace PHPExcel\Reader;
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* PHPExcel_Reader_OOCalc * PHPExcel_Reader_OOCalc
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader class OOCalc extends BaseReader implements IReader
{ {
/** /**
* Formats * Formats

View File

@ -1,13 +1,6 @@
<?php <?php
/** PHPExcel root directory */ namespace PHPExcel\Reader;
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* PHPExcel_Reader_SYLK * PHPExcel_Reader_SYLK
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader class SYLK extends BaseReader implements IReader
{ {
/** /**
* Input encoding * Input encoding