Rename namespace `PHPExcel` to `PhpSpreadsheet`

This also fix a few bugs that were introduced when migrating to
namespace. Some non-namespaces classes were leftover

FIX #15
This commit is contained in:
Adrien Crivelli 2016-08-16 23:24:47 +09:00
parent a6c6064348
commit 539a89a918
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
297 changed files with 5014 additions and 5483 deletions

View File

@ -43,7 +43,7 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"PHPExcel\\": "src/PhpSpreadsheet" "PhpSpreadsheet\\": "src/PhpSpreadsheet"
} }
}, },
"autoload-dev": { "autoload-dev": {

View File

@ -18,7 +18,7 @@
<php> <php>
<ini name="memory_limit" value="2048M"/> <ini name="memory_limit" value="2048M"/>
</php> </php>
<testsuite name="PHPExcel Unit Test Suite"> <testsuite name="PhpSpreadsheet Unit Test Suite">
<directory suffix="Test.php">./tests/PhpSpreadsheet</directory> <directory suffix="Test.php">./tests/PhpSpreadsheet</directory>
</testsuite> </testsuite>
<filter> <filter>

View File

@ -18,7 +18,7 @@
<php> <php>
<ini name="memory_limit" value="2048M"/> <ini name="memory_limit" value="2048M"/>
</php> </php>
<testsuite name="PHPExcel Unit Test Suite"> <testsuite name="PhpSpreadsheet Unit Test Suite">
<directory suffix="Test.php">./tests/PhpSpreadsheet</directory> <directory suffix="Test.php">./tests/PhpSpreadsheet</directory>
</testsuite> </testsuite>
<filter> <filter>

View File

@ -1,12 +1,12 @@
<?php <?php
namespace PHPExcel; namespace PhpSpreadsheet;
/** /**
* *
* Autoloader for PHPExcel classes * Autoloader for PhpSpreadsheet classes
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2016 PhpSpreadsheet
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -22,9 +22,8 @@ namespace PHPExcel;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -41,7 +40,7 @@ class Autoloader
spl_autoload_register('__autoload'); spl_autoload_register('__autoload');
} }
// Register ourselves with SPL // Register ourselves with SPL
return spl_autoload_register(array('PHPExcel\Autoloader', 'load')); return spl_autoload_register(array(\PhpSpreadsheet\Autoloader::class, 'load'));
} }
@ -52,14 +51,14 @@ class Autoloader
*/ */
public static function load($className) public static function load($className)
{ {
if ((class_exists($className, false)) || (strpos($className, 'PHPExcel\\') !== 0)) { if ((class_exists($className, false)) || (strpos($className, 'PhpSpreadsheet\\') !== 0)) {
// Either already loaded, or not a PHPExcel class request // Either already loaded, or not a PhpSpreadsheet class request
return false; return false;
} }
$classFilePath = __DIR__ . DIRECTORY_SEPARATOR . $classFilePath = __DIR__ . DIRECTORY_SEPARATOR .
'PhpSpreadsheet' . DIRECTORY_SEPARATOR . 'PhpSpreadsheet' . DIRECTORY_SEPARATOR .
str_replace(['PHPExcel\\', '\\'], ['', '/'], $className) . str_replace(['PhpSpreadsheet\\', '\\'], ['', '/'], $className) .
'.php'; '.php';
if ((file_exists($classFilePath) === false) || (is_readable($classFilePath) === false)) { if ((file_exists($classFilePath) === false) || (is_readable($classFilePath) === false)) {

View File

@ -2,9 +2,9 @@
/** /**
* *
* Bootstrap for PHPExcel classes * Bootstrap for PhpSpreadsheet classes
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2016 PhpSpreadsheet
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,13 +20,12 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
include_once __DIR__ . '/Autoloader.php'; include_once __DIR__ . '/Autoloader.php';
\PHPExcel\Autoloader::register(); \PhpSpreadsheet\Autoloader::register();

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CachedObjectStorage; namespace PhpSpreadsheet\CachedObjectStorage;
/** /**
* PHPExcel_CachedObjectStorage_APC * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CachedObjectStorage;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_CachedObjectStorage * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -50,7 +47,7 @@ class APC extends CacheBase implements ICache
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @access private * @access private
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
protected function storeData() protected function storeData()
{ {
@ -63,7 +60,7 @@ class APC extends CacheBase implements ICache
$this->cacheTime $this->cacheTime
)) { )) {
$this->__destruct(); $this->__destruct();
throw new \PHPExcel\Exception('Failed to store cell ' . $this->currentObjectID . ' in APC'); throw new \PhpSpreadsheet\Exception('Failed to store cell ' . $this->currentObjectID . ' in APC');
} }
$this->currentCellIsDirty = false; $this->currentCellIsDirty = false;
} }
@ -75,11 +72,11 @@ class APC extends CacheBase implements ICache
* *
* @access public * @access public
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update * @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PHPExcel\Cell * @return \PhpSpreadsheet\Cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function addCacheData($pCoord, \PHPExcel\Cell $cell) public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{ {
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData(); $this->storeData();
@ -94,11 +91,11 @@ class APC extends CacheBase implements ICache
} }
/** /**
* Is a value set in the current \PHPExcel\CachedObjectStorage\ICache for an indexed cell? * Is a value set in the current \PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell?
* *
* @access public * @access public
* @param string $pCoord Coordinate address of the cell to check * @param string $pCoord Coordinate address of the cell to check
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
* @return boolean * @return boolean
*/ */
public function isDataSet($pCoord) public function isDataSet($pCoord)
@ -113,7 +110,7 @@ class APC extends CacheBase implements ICache
if ($success === false) { if ($success === false) {
// Entry no longer exists in APC, so clear it from the cache array // Entry no longer exists in APC, so clear it from the cache array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
throw new \PHPExcel\Exception('Cell entry '.$pCoord.' no longer exists in APC cache'); throw new \PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in APC cache');
} }
return true; return true;
} }
@ -125,8 +122,8 @@ class APC extends CacheBase implements ICache
* *
* @access public * @access public
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) public function getCacheData($pCoord)
{ {
@ -141,7 +138,7 @@ class APC extends CacheBase implements ICache
if ($obj === false) { if ($obj === false) {
// Entry no longer exists in APC, so clear it from the cache array // Entry no longer exists in APC, so clear it from the cache array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
throw new \PHPExcel\Exception('Cell entry '.$pCoord.' no longer exists in APC cache'); throw new \PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in APC cache');
} }
} else { } else {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
@ -177,7 +174,7 @@ class APC extends CacheBase implements ICache
* *
* @access public * @access public
* @param string $pCoord Coordinate address of the cell to delete * @param string $pCoord Coordinate address of the cell to delete
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function deleteCacheData($pCoord) public function deleteCacheData($pCoord)
{ {
@ -192,10 +189,10 @@ class APC extends CacheBase implements ICache
* Clone the cell collection * Clone the cell collection
* *
* @access public * @access public
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function copyCellCollection(\PHPExcel\Worksheet $parent) public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent)
{ {
parent::copyCellCollection($parent); parent::copyCellCollection($parent);
// Get a new id for the new file name // Get a new id for the new file name
@ -208,11 +205,11 @@ class APC extends CacheBase implements ICache
if ($obj === false) { if ($obj === false) {
// Entry no longer exists in APC, so clear it from the cache array // Entry no longer exists in APC, so clear it from the cache array
parent::deleteCacheData($cellID); parent::deleteCacheData($cellID);
throw new \PHPExcel\Exception('Cell entry ' . $cellID . ' no longer exists in APC'); throw new \PhpSpreadsheet\Exception('Cell entry ' . $cellID . ' no longer exists in APC');
} }
if (!apc_store($newCachePrefix . $cellID . '.cache', $obj, $this->cacheTime)) { if (!apc_store($newCachePrefix . $cellID . '.cache', $obj, $this->cacheTime)) {
$this->__destruct(); $this->__destruct();
throw new \PHPExcel\Exception('Failed to store cell ' . $cellID . ' in APC'); throw new \PhpSpreadsheet\Exception('Failed to store cell ' . $cellID . ' in APC');
} }
} }
} }
@ -243,10 +240,10 @@ class APC extends CacheBase implements ICache
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param \PHPExcel\Worksheet $parent The worksheet for this cell collection * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
* @param array of mixed $arguments Additional initialisation arguments * @param array of mixed $arguments Additional initialisation arguments
*/ */
public function __construct(\PHPExcel\Worksheet $parent, $arguments) public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments)
{ {
$cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CachedObjectStorage; namespace PhpSpreadsheet\CachedObjectStorage;
/** /**
* PHPExcel_CachedObjectStorage_CacheBase * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CachedObjectStorage;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_CachedObjectStorage * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -32,14 +29,14 @@ abstract class CacheBase
/** /**
* Parent worksheet * Parent worksheet
* *
* @var \PHPExcel\Worksheet * @var \PhpSpreadsheet\Worksheet
*/ */
protected $parent; protected $parent;
/** /**
* The currently active Cell * The currently active Cell
* *
* @var \PHPExcel\Cell * @var \PhpSpreadsheet\Cell
*/ */
protected $currentObject = null; protected $currentObject = null;
@ -68,12 +65,12 @@ abstract class CacheBase
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param \PHPExcel\Worksheet $parent The worksheet for this cell collection * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
*/ */
public function __construct(\PHPExcel\Worksheet $parent) public function __construct(\PhpSpreadsheet\Worksheet $parent)
{ {
// Set our parent worksheet. // Set our parent worksheet.
// This is maintained within the cache controller to facilitate re-attaching it to \PHPExcel\Cell objects when // This is maintained within the cache controller to facilitate re-attaching it to \PhpSpreadsheet\Cell objects when
// they are woken from a serialized state // they are woken from a serialized state
$this->parent = $parent; $this->parent = $parent;
} }
@ -81,7 +78,7 @@ abstract class CacheBase
/** /**
* Return the parent worksheet for this cell collection * Return the parent worksheet for this cell collection
* *
* @return \PHPExcel\Worksheet * @return \PhpSpreadsheet\Worksheet
*/ */
public function getParent() public function getParent()
{ {
@ -89,7 +86,7 @@ abstract class CacheBase
} }
/** /**
* Is a value set in the current \PHPExcel\CachedObjectStorage\ICache for an indexed cell? * Is a value set in the current \PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell?
* *
* @param string $pCoord Coordinate address of the cell to check * @param string $pCoord Coordinate address of the cell to check
* @return boolean * @return boolean
@ -127,11 +124,11 @@ abstract class CacheBase
/** /**
* Add or Update a cell in cache * Add or Update a cell in cache
* *
* @param \PHPExcel\Cell $cell Cell to update * @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PHPExcel\Cell * @return \PhpSpreadsheet\Cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function updateCacheData(\PHPExcel\Cell $cell) public function updateCacheData(\PhpSpreadsheet\Cell $cell)
{ {
return $this->addCacheData($cell->getCoordinate(), $cell); return $this->addCacheData($cell->getCoordinate(), $cell);
} }
@ -140,7 +137,7 @@ abstract class CacheBase
* Delete a cell in cache identified by coordinate address * Delete a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to delete * @param string $pCoord Coordinate address of the cell to delete
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function deleteCacheData($pCoord) public function deleteCacheData($pCoord)
{ {
@ -262,9 +259,9 @@ abstract class CacheBase
if ($r != $row) { if ($r != $row) {
continue; continue;
} }
$columnList[] = \PHPExcel\Cell::columnIndexFromString($c); $columnList[] = \PhpSpreadsheet\Cell::columnIndexFromString($c);
} }
return \PHPExcel\Cell::stringFromColumnIndex(max($columnList) - 1); return \PhpSpreadsheet\Cell::stringFromColumnIndex(max($columnList) - 1);
} }
/** /**
@ -311,9 +308,9 @@ abstract class CacheBase
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
*/ */
public function copyCellCollection(\PHPExcel\Worksheet $parent) public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent)
{ {
$this->currentCellIsDirty; $this->currentCellIsDirty;
$this->storeData(); $this->storeData();

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CachedObjectStorage; namespace PhpSpreadsheet\CachedObjectStorage;
/** /**
* PHPExcel_CachedObjectStorage_DiscISAM * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CachedObjectStorage;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_CachedObjectStorage * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -55,7 +52,7 @@ class DiscISAM extends CacheBase implements ICache
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @return void * @return void
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
protected function storeData() protected function storeData()
{ {
@ -77,11 +74,11 @@ class DiscISAM extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update * @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PHPExcel\Cell * @return \PhpSpreadsheet\Cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function addCacheData($pCoord, \PHPExcel\Cell $cell) public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{ {
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData(); $this->storeData();
@ -98,8 +95,8 @@ class DiscISAM extends CacheBase implements ICache
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) public function getCacheData($pCoord)
{ {
@ -142,14 +139,14 @@ class DiscISAM extends CacheBase implements ICache
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
*/ */
public function copyCellCollection(\PHPExcel\Worksheet $parent) public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent)
{ {
parent::copyCellCollection($parent); parent::copyCellCollection($parent);
// Get a new id for the new file name // Get a new id for the new file name
$baseUnique = $this->getUniqueID(); $baseUnique = $this->getUniqueID();
$newFileName = $this->cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache'; $newFileName = $this->cacheDirectory.'/PhpSpreadsheet.'.$baseUnique.'.cache';
// Copy the existing cell cache file // Copy the existing cell cache file
copy($this->fileName, $newFileName); copy($this->fileName, $newFileName);
$this->fileName = $newFileName; $this->fileName = $newFileName;
@ -179,19 +176,19 @@ class DiscISAM extends CacheBase implements ICache
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param \PHPExcel\Worksheet $parent The worksheet for this cell collection * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
* @param array of mixed $arguments Additional initialisation arguments * @param array of mixed $arguments Additional initialisation arguments
*/ */
public function __construct(\PHPExcel\Worksheet $parent, $arguments) public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments)
{ {
$this->cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== null)) $this->cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== null))
? $arguments['dir'] ? $arguments['dir']
: \PHPExcel\Shared\File::sysGetTempDir(); : \PhpSpreadsheet\Shared\File::sysGetTempDir();
parent::__construct($parent); parent::__construct($parent);
if (is_null($this->fileHandle)) { if (is_null($this->fileHandle)) {
$baseUnique = $this->getUniqueID(); $baseUnique = $this->getUniqueID();
$this->fileName = $this->cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache'; $this->fileName = $this->cacheDirectory.'/PhpSpreadsheet.'.$baseUnique.'.cache';
$this->fileHandle = fopen($this->fileName, 'a+'); $this->fileHandle = fopen($this->fileName, 'a+');
} }
} }

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CachedObjectStorage; namespace PhpSpreadsheet\CachedObjectStorage;
/** /**
* PHPExcel_CachedObjectStorage_ICache * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CachedObjectStorage;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_CachedObjectStorage * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -33,27 +30,27 @@ interface ICache
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update * @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PHPExcel\Cell * @return \PhpSpreadsheet\Cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function addCacheData($pCoord, \PHPExcel\Cell $cell); public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell);
/** /**
* Add or Update a cell in cache * Add or Update a cell in cache
* *
* @param \PHPExcel\Cell $cell Cell to update * @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PHPExcel\Cell * @return \PhpSpreadsheet\Cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function updateCacheData(\PHPExcel\Cell $cell); public function updateCacheData(\PhpSpreadsheet\Cell $cell);
/** /**
* Fetch a cell from cache identified by coordinate address * Fetch a cell from cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to retrieve * @param string $pCoord Coordinate address of the cell to retrieve
* @return \PHPExcel\Cell Cell that was found, or null if not found * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function getCacheData($pCoord); public function getCacheData($pCoord);
@ -61,12 +58,12 @@ interface ICache
* Delete a cell in cache identified by coordinate address * Delete a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to delete * @param string $pCoord Coordinate address of the cell to delete
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function deleteCacheData($pCoord); public function deleteCacheData($pCoord);
/** /**
* Is a value set in the current \PHPExcel\CachedObjectStorage\ICache for an indexed cell? * Is a value set in the current \PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell?
* *
* @param string $pCoord Coordinate address of the cell to check * @param string $pCoord Coordinate address of the cell to check
* @return boolean * @return boolean
@ -90,9 +87,9 @@ interface ICache
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
*/ */
public function copyCellCollection(\PHPExcel\Worksheet $parent); public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent);
/** /**
* Identify whether the caching method is currently available * Identify whether the caching method is currently available

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CachedObjectStorage; namespace PhpSpreadsheet\CachedObjectStorage;
/** /**
* PHPExcel_CachedObjectStorage_Igbinary * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CachedObjectStorage;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_CachedObjectStorage * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -34,7 +31,7 @@ class Igbinary extends CacheBase implements ICache
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @return void * @return void
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
protected function storeData() protected function storeData()
{ {
@ -52,11 +49,11 @@ class Igbinary extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update * @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PHPExcel\Cell * @return \PhpSpreadsheet\Cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function addCacheData($pCoord, \PHPExcel\Cell $cell) public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{ {
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData(); $this->storeData();
@ -74,8 +71,8 @@ class Igbinary extends CacheBase implements ICache
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) public function getCacheData($pCoord)
{ {

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CachedObjectStorage; namespace PhpSpreadsheet\CachedObjectStorage;
/** /**
* PHPExcel_CachedObjectStorage_Memcache * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CachedObjectStorage;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_CachedObjectStorage * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -55,7 +52,7 @@ class Memcache extends CacheBase implements ICache
* Store cell data in cache for the current cell object if it's "dirty", * Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
protected function storeData() protected function storeData()
{ {
@ -66,7 +63,7 @@ class Memcache extends CacheBase implements ICache
if (!$this->memcache->replace($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) { if (!$this->memcache->replace($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) {
if (!$this->memcache->add($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) { if (!$this->memcache->add($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) {
$this->__destruct(); $this->__destruct();
throw new \PHPExcel\Exception("Failed to store cell {$this->currentObjectID} in MemCache"); throw new \PhpSpreadsheet\Exception("Failed to store cell {$this->currentObjectID} in MemCache");
} }
} }
$this->currentCellIsDirty = false; $this->currentCellIsDirty = false;
@ -79,11 +76,11 @@ class Memcache extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update * @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PHPExcel\Cell * @return \PhpSpreadsheet\Cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function addCacheData($pCoord, \PHPExcel\Cell $cell) public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{ {
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData(); $this->storeData();
@ -99,11 +96,11 @@ class Memcache extends CacheBase implements ICache
/** /**
* Is a value set in the current \PHPExcel\CachedObjectStorage\ICache for an indexed cell? * Is a value set in the current \PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell?
* *
* @param string $pCoord Coordinate address of the cell to check * @param string $pCoord Coordinate address of the cell to check
* @return boolean * @return boolean
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function isDataSet($pCoord) public function isDataSet($pCoord)
{ {
@ -117,7 +114,7 @@ class Memcache extends CacheBase implements ICache
if ($success === false) { if ($success === false) {
// Entry no longer exists in Memcache, so clear it from the cache array // Entry no longer exists in Memcache, so clear it from the cache array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
throw new \PHPExcel\Exception('Cell entry '.$pCoord.' no longer exists in MemCache'); throw new \PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in MemCache');
} }
return true; return true;
} }
@ -129,8 +126,8 @@ class Memcache extends CacheBase implements ICache
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) public function getCacheData($pCoord)
{ {
@ -145,7 +142,7 @@ class Memcache extends CacheBase implements ICache
if ($obj === false) { if ($obj === false) {
// Entry no longer exists in Memcache, so clear it from the cache array // Entry no longer exists in Memcache, so clear it from the cache array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
throw new \PHPExcel\Exception("Cell entry {$pCoord} no longer exists in MemCache"); throw new \PhpSpreadsheet\Exception("Cell entry {$pCoord} no longer exists in MemCache");
} }
} else { } else {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
@ -180,7 +177,7 @@ class Memcache extends CacheBase implements ICache
* Delete a cell in cache identified by coordinate address * Delete a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to delete * @param string $pCoord Coordinate address of the cell to delete
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function deleteCacheData($pCoord) public function deleteCacheData($pCoord)
{ {
@ -194,10 +191,10 @@ class Memcache extends CacheBase implements ICache
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function copyCellCollection(\PHPExcel\Worksheet $parent) public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent)
{ {
parent::copyCellCollection($parent); parent::copyCellCollection($parent);
// Get a new id for the new file name // Get a new id for the new file name
@ -210,11 +207,11 @@ class Memcache extends CacheBase implements ICache
if ($obj === false) { if ($obj === false) {
// Entry no longer exists in Memcache, so clear it from the cache array // Entry no longer exists in Memcache, so clear it from the cache array
parent::deleteCacheData($cellID); parent::deleteCacheData($cellID);
throw new \PHPExcel\Exception("Cell entry {$cellID} no longer exists in MemCache"); throw new \PhpSpreadsheet\Exception("Cell entry {$cellID} no longer exists in MemCache");
} }
if (!$this->memcache->add($newCachePrefix . $cellID . '.cache', $obj, null, $this->cacheTime)) { if (!$this->memcache->add($newCachePrefix . $cellID . '.cache', $obj, null, $this->cacheTime)) {
$this->__destruct(); $this->__destruct();
throw new \PHPExcel\Exception("Failed to store cell {$cellID} in MemCache"); throw new \PhpSpreadsheet\Exception("Failed to store cell {$cellID} in MemCache");
} }
} }
} }
@ -245,11 +242,11 @@ class Memcache extends CacheBase implements ICache
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param \PHPExcel\Worksheet $parent The worksheet for this cell collection * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
* @param mixed[] $arguments Additional initialisation arguments * @param mixed[] $arguments Additional initialisation arguments
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function __construct(\PHPExcel\Worksheet $parent, $arguments) public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments)
{ {
$memcacheServer = (isset($arguments['memcacheServer'])) ? $arguments['memcacheServer'] : 'localhost'; $memcacheServer = (isset($arguments['memcacheServer'])) ? $arguments['memcacheServer'] : 'localhost';
$memcachePort = (isset($arguments['memcachePort'])) ? $arguments['memcachePort'] : 11211; $memcachePort = (isset($arguments['memcachePort'])) ? $arguments['memcachePort'] : 11211;
@ -262,7 +259,7 @@ class Memcache extends CacheBase implements ICache
// Set a new Memcache object and connect to the Memcache server // Set a new Memcache object and connect to the Memcache server
$this->memcache = new Memcache(); $this->memcache = new Memcache();
if (!$this->memcache->addServer($memcacheServer, $memcachePort, false, 50, 5, 5, true, array($this, 'failureCallback'))) { if (!$this->memcache->addServer($memcacheServer, $memcachePort, false, 50, 5, 5, true, array($this, 'failureCallback'))) {
throw new \PHPExcel\Exception("Could not connect to MemCache server at {$memcacheServer}:{$memcachePort}"); throw new \PhpSpreadsheet\Exception("Could not connect to MemCache server at {$memcacheServer}:{$memcachePort}");
} }
$this->cacheTime = $cacheTime; $this->cacheTime = $cacheTime;
@ -275,11 +272,11 @@ class Memcache extends CacheBase implements ICache
* *
* @param string $host Memcache server * @param string $host Memcache server
* @param integer $port Memcache port * @param integer $port Memcache port
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function failureCallback($host, $port) public function failureCallback($host, $port)
{ {
throw new \PHPExcel\Exception("memcache {$host}:{$port} failed"); throw new \PhpSpreadsheet\Exception("memcache {$host}:{$port} failed");
} }
/** /**

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CachedObjectStorage; namespace PhpSpreadsheet\CachedObjectStorage;
/** /**
* PHPExcel_CachedObjectStorage_Memory * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CachedObjectStorage;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_CachedObjectStorage * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -42,11 +39,11 @@ class Memory extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update * @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PHPExcel\Cell * @return \PhpSpreadsheet\Cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function addCacheData($pCoord, \PHPExcel\Cell $cell) public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{ {
$this->cellCache[$pCoord] = $cell; $this->cellCache[$pCoord] = $cell;
@ -61,8 +58,8 @@ class Memory extends CacheBase implements ICache
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) public function getCacheData($pCoord)
{ {
@ -84,9 +81,9 @@ class Memory extends CacheBase implements ICache
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
*/ */
public function copyCellCollection(\PHPExcel\Worksheet $parent) public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent)
{ {
parent::copyCellCollection($parent); parent::copyCellCollection($parent);

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CachedObjectStorage; namespace PhpSpreadsheet\CachedObjectStorage;
/** /**
* PHPExcel_CachedObjectStorage_MemoryGZip * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CachedObjectStorage;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_CachedObjectStorage * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -34,7 +31,7 @@ class MemoryGZip extends CacheBase implements ICache
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @return void * @return void
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
protected function storeData() protected function storeData()
{ {
@ -52,11 +49,11 @@ class MemoryGZip extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update * @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PHPExcel\Cell * @return \PhpSpreadsheet\Cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function addCacheData($pCoord, \PHPExcel\Cell $cell) public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{ {
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData(); $this->storeData();
@ -74,8 +71,8 @@ class MemoryGZip extends CacheBase implements ICache
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) public function getCacheData($pCoord)
{ {

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CachedObjectStorage; namespace PhpSpreadsheet\CachedObjectStorage;
/** /**
* PHPExcel_CachedObjectStorage_MemorySerialized * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CachedObjectStorage;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_CachedObjectStorage * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -34,7 +31,7 @@ class MemorySerialized extends CacheBase implements ICache
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @return void * @return void
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
protected function storeData() protected function storeData()
{ {
@ -51,11 +48,11 @@ class MemorySerialized extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update * @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PHPExcel\Cell * @return \PhpSpreadsheet\Cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function addCacheData($pCoord, \PHPExcel\Cell $cell) public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{ {
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData(); $this->storeData();
@ -72,8 +69,8 @@ class MemorySerialized extends CacheBase implements ICache
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) public function getCacheData($pCoord)
{ {

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CachedObjectStorage; namespace PhpSpreadsheet\CachedObjectStorage;
/** /**
* PHPExcel_CachedObjectStorage_PHPTemp * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CachedObjectStorage;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_CachedObjectStorage * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -47,7 +44,7 @@ class PHPTemp extends CacheBase implements ICache
* Store cell data in cache for the current cell object if it's "dirty", * Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
protected function storeData() protected function storeData()
{ {
@ -70,11 +67,11 @@ class PHPTemp extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update * @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PHPExcel\Cell * @return \PhpSpreadsheet\Cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function addCacheData($pCoord, \PHPExcel\Cell $cell) public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{ {
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData(); $this->storeData();
@ -92,8 +89,8 @@ class PHPTemp extends CacheBase implements ICache
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) public function getCacheData($pCoord)
{ {
@ -136,9 +133,9 @@ class PHPTemp extends CacheBase implements ICache
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
*/ */
public function copyCellCollection(\PHPExcel\Worksheet $parent) public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent)
{ {
parent::copyCellCollection($parent); parent::copyCellCollection($parent);
// Open a new stream for the cell cache data // Open a new stream for the cell cache data
@ -174,10 +171,10 @@ class PHPTemp extends CacheBase implements ICache
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param \PHPExcel\Worksheet $parent The worksheet for this cell collection * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
* @param mixed[] $arguments Additional initialisation arguments * @param mixed[] $arguments Additional initialisation arguments
*/ */
public function __construct(\PHPExcel\Worksheet $parent, $arguments) public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments)
{ {
$this->memoryCacheSize = (isset($arguments['memoryCacheSize'])) ? $arguments['memoryCacheSize'] : '1MB'; $this->memoryCacheSize = (isset($arguments['memoryCacheSize'])) ? $arguments['memoryCacheSize'] : '1MB';

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CachedObjectStorage; namespace PhpSpreadsheet\CachedObjectStorage;
/** /**
* PHPExcel_CachedObjectStorage_SQLite * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CachedObjectStorage;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_CachedObjectStorage * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -47,7 +44,7 @@ class SQLite extends CacheBase implements ICache
* Store cell data in cache for the current cell object if it's "dirty", * Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
protected function storeData() protected function storeData()
{ {
@ -55,7 +52,7 @@ class SQLite extends CacheBase implements ICache
$this->currentObject->detach(); $this->currentObject->detach();
if (!$this->DBHandle->queryExec("INSERT OR REPLACE INTO kvp_".$this->TableName." VALUES('".$this->currentObjectID."','".sqlite_escape_string(serialize($this->currentObject))."')")) { if (!$this->DBHandle->queryExec("INSERT OR REPLACE INTO kvp_".$this->TableName." VALUES('".$this->currentObjectID."','".sqlite_escape_string(serialize($this->currentObject))."')")) {
throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError()));
} }
$this->currentCellIsDirty = false; $this->currentCellIsDirty = false;
} }
@ -66,11 +63,11 @@ class SQLite extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update * @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PHPExcel\Cell * @return \PhpSpreadsheet\Cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function addCacheData($pCoord, \PHPExcel\Cell $cell) public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{ {
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData(); $this->storeData();
@ -87,8 +84,8 @@ class SQLite extends CacheBase implements ICache
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) public function getCacheData($pCoord)
{ {
@ -100,7 +97,7 @@ class SQLite extends CacheBase implements ICache
$query = "SELECT value FROM kvp_".$this->TableName." WHERE id='".$pCoord."'"; $query = "SELECT value FROM kvp_".$this->TableName." WHERE id='".$pCoord."'";
$cellResultSet = $this->DBHandle->query($query, SQLITE_ASSOC); $cellResultSet = $this->DBHandle->query($query, SQLITE_ASSOC);
if ($cellResultSet === false) { if ($cellResultSet === false) {
throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError()));
} elseif ($cellResultSet->numRows() == 0) { } elseif ($cellResultSet->numRows() == 0) {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return null; return null;
@ -123,7 +120,7 @@ class SQLite extends CacheBase implements ICache
* *
* @param string $pCoord Coordinate address of the cell to check * @param string $pCoord Coordinate address of the cell to check
* @return boolean * @return boolean
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function isDataSet($pCoord) public function isDataSet($pCoord)
{ {
@ -135,7 +132,7 @@ class SQLite extends CacheBase implements ICache
$query = "SELECT id FROM kvp_".$this->TableName." WHERE id='".$pCoord."'"; $query = "SELECT id FROM kvp_".$this->TableName." WHERE id='".$pCoord."'";
$cellResultSet = $this->DBHandle->query($query, SQLITE_ASSOC); $cellResultSet = $this->DBHandle->query($query, SQLITE_ASSOC);
if ($cellResultSet === false) { if ($cellResultSet === false) {
throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError()));
} elseif ($cellResultSet->numRows() == 0) { } elseif ($cellResultSet->numRows() == 0) {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return false; return false;
@ -147,7 +144,7 @@ class SQLite extends CacheBase implements ICache
* Delete a cell in cache identified by coordinate address * Delete a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to delete * @param string $pCoord Coordinate address of the cell to delete
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function deleteCacheData($pCoord) public function deleteCacheData($pCoord)
{ {
@ -159,7 +156,7 @@ class SQLite extends CacheBase implements ICache
// Check if the requested entry exists in the cache // Check if the requested entry exists in the cache
$query = "DELETE FROM kvp_".$this->TableName." WHERE id='".$pCoord."'"; $query = "DELETE FROM kvp_".$this->TableName." WHERE id='".$pCoord."'";
if (!$this->DBHandle->queryExec($query)) { if (!$this->DBHandle->queryExec($query)) {
throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError()));
} }
$this->currentCellIsDirty = false; $this->currentCellIsDirty = false;
@ -170,7 +167,7 @@ class SQLite extends CacheBase implements ICache
* *
* @param string $fromAddress Current address of the cell to move * @param string $fromAddress Current address of the cell to move
* @param string $toAddress Destination address of the cell to move * @param string $toAddress Destination address of the cell to move
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
* @return boolean * @return boolean
*/ */
public function moveCell($fromAddress, $toAddress) public function moveCell($fromAddress, $toAddress)
@ -182,13 +179,13 @@ class SQLite extends CacheBase implements ICache
$query = "DELETE FROM kvp_".$this->TableName." WHERE id='".$toAddress."'"; $query = "DELETE FROM kvp_".$this->TableName." WHERE id='".$toAddress."'";
$result = $this->DBHandle->exec($query); $result = $this->DBHandle->exec($query);
if ($result === false) { if ($result === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
} }
$query = "UPDATE kvp_".$this->TableName." SET id='".$toAddress."' WHERE id='".$fromAddress."'"; $query = "UPDATE kvp_".$this->TableName." SET id='".$toAddress."' WHERE id='".$fromAddress."'";
$result = $this->DBHandle->exec($query); $result = $this->DBHandle->exec($query);
if ($result === false) { if ($result === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
} }
return true; return true;
@ -198,7 +195,7 @@ class SQLite extends CacheBase implements ICache
* Get a list of all cell addresses currently held in cache * Get a list of all cell addresses currently held in cache
* *
* @return string[] * @return string[]
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function getCellList() public function getCellList()
{ {
@ -209,7 +206,7 @@ class SQLite extends CacheBase implements ICache
$query = "SELECT id FROM kvp_".$this->TableName; $query = "SELECT id FROM kvp_".$this->TableName;
$cellIdsResult = $this->DBHandle->unbufferedQuery($query, SQLITE_ASSOC); $cellIdsResult = $this->DBHandle->unbufferedQuery($query, SQLITE_ASSOC);
if ($cellIdsResult === false) { if ($cellIdsResult === false) {
throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError()));
} }
$cellKeys = array(); $cellKeys = array();
@ -223,10 +220,10 @@ class SQLite extends CacheBase implements ICache
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function copyCellCollection(\PHPExcel\Worksheet $parent) public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent)
{ {
$this->currentCellIsDirty; $this->currentCellIsDirty;
$this->storeData(); $this->storeData();
@ -236,7 +233,7 @@ class SQLite extends CacheBase implements ICache
if (!$this->DBHandle->queryExec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB) if (!$this->DBHandle->queryExec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)
AS SELECT * FROM kvp_'.$this->TableName) AS SELECT * FROM kvp_'.$this->TableName)
) { ) {
throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError()));
} }
// Copy the existing cell cache file // Copy the existing cell cache file
@ -264,10 +261,10 @@ class SQLite extends CacheBase implements ICache
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param \PHPExcel\Worksheet $parent The worksheet for this cell collection * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function __construct(\PHPExcel\Worksheet $parent) public function __construct(\PhpSpreadsheet\Worksheet $parent)
{ {
parent::__construct($parent); parent::__construct($parent);
if (is_null($this->DBHandle)) { if (is_null($this->DBHandle)) {
@ -276,10 +273,10 @@ class SQLite extends CacheBase implements ICache
$this->DBHandle = new SQLiteDatabase($_DBName); $this->DBHandle = new SQLiteDatabase($_DBName);
if ($this->DBHandle === false) { if ($this->DBHandle === false) {
throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError()));
} }
if (!$this->DBHandle->queryExec('CREATE TABLE kvp_'.$this->TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { if (!$this->DBHandle->queryExec('CREATE TABLE kvp_'.$this->TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) {
throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError()));
} }
} }
} }

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CachedObjectStorage; namespace PhpSpreadsheet\CachedObjectStorage;
/** /**
* PHPExcel_CachedObjectStorage_SQLite3 * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CachedObjectStorage;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_CachedObjectStorage * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -75,7 +72,7 @@ class SQLite3 extends CacheBase implements ICache
* Store cell data in cache for the current cell object if it's "dirty", * Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
protected function storeData() protected function storeData()
{ {
@ -86,7 +83,7 @@ class SQLite3 extends CacheBase implements ICache
$this->insertQuery->bindValue('data', serialize($this->currentObject), SQLITE3_BLOB); $this->insertQuery->bindValue('data', serialize($this->currentObject), SQLITE3_BLOB);
$result = $this->insertQuery->execute(); $result = $this->insertQuery->execute();
if ($result === false) { if ($result === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
} }
$this->currentCellIsDirty = false; $this->currentCellIsDirty = false;
} }
@ -97,11 +94,11 @@ class SQLite3 extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update * @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PHPExcel\Cell * @return \PhpSpreadsheet\Cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function addCacheData($pCoord, \PHPExcel\Cell $cell) public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{ {
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData(); $this->storeData();
@ -118,9 +115,9 @@ class SQLite3 extends CacheBase implements ICache
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function getCacheData($pCoord) public function getCacheData($pCoord)
{ {
@ -132,7 +129,7 @@ class SQLite3 extends CacheBase implements ICache
$this->selectQuery->bindValue('id', $pCoord, SQLITE3_TEXT); $this->selectQuery->bindValue('id', $pCoord, SQLITE3_TEXT);
$cellResult = $this->selectQuery->execute(); $cellResult = $this->selectQuery->execute();
if ($cellResult === false) { if ($cellResult === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
} }
$cellData = $cellResult->fetchArray(SQLITE3_ASSOC); $cellData = $cellResult->fetchArray(SQLITE3_ASSOC);
if ($cellData === false) { if ($cellData === false) {
@ -156,7 +153,7 @@ class SQLite3 extends CacheBase implements ICache
* *
* @param string $pCoord Coordinate address of the cell to check * @param string $pCoord Coordinate address of the cell to check
* @return boolean * @return boolean
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function isDataSet($pCoord) public function isDataSet($pCoord)
{ {
@ -168,7 +165,7 @@ class SQLite3 extends CacheBase implements ICache
$this->selectQuery->bindValue('id', $pCoord, SQLITE3_TEXT); $this->selectQuery->bindValue('id', $pCoord, SQLITE3_TEXT);
$cellResult = $this->selectQuery->execute(); $cellResult = $this->selectQuery->execute();
if ($cellResult === false) { if ($cellResult === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
} }
$cellData = $cellResult->fetchArray(SQLITE3_ASSOC); $cellData = $cellResult->fetchArray(SQLITE3_ASSOC);
@ -179,7 +176,7 @@ class SQLite3 extends CacheBase implements ICache
* Delete a cell in cache identified by coordinate address * Delete a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to delete * @param string $pCoord Coordinate address of the cell to delete
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function deleteCacheData($pCoord) public function deleteCacheData($pCoord)
{ {
@ -192,7 +189,7 @@ class SQLite3 extends CacheBase implements ICache
$this->deleteQuery->bindValue('id', $pCoord, SQLITE3_TEXT); $this->deleteQuery->bindValue('id', $pCoord, SQLITE3_TEXT);
$result = $this->deleteQuery->execute(); $result = $this->deleteQuery->execute();
if ($result === false) { if ($result === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
} }
$this->currentCellIsDirty = false; $this->currentCellIsDirty = false;
@ -204,7 +201,7 @@ class SQLite3 extends CacheBase implements ICache
* @param string $fromAddress Current address of the cell to move * @param string $fromAddress Current address of the cell to move
* @param string $toAddress Destination address of the cell to move * @param string $toAddress Destination address of the cell to move
* @return boolean * @return boolean
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function moveCell($fromAddress, $toAddress) public function moveCell($fromAddress, $toAddress)
{ {
@ -215,14 +212,14 @@ class SQLite3 extends CacheBase implements ICache
$this->deleteQuery->bindValue('id', $toAddress, SQLITE3_TEXT); $this->deleteQuery->bindValue('id', $toAddress, SQLITE3_TEXT);
$result = $this->deleteQuery->execute(); $result = $this->deleteQuery->execute();
if ($result === false) { if ($result === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
} }
$this->updateQuery->bindValue('toid', $toAddress, SQLITE3_TEXT); $this->updateQuery->bindValue('toid', $toAddress, SQLITE3_TEXT);
$this->updateQuery->bindValue('fromid', $fromAddress, SQLITE3_TEXT); $this->updateQuery->bindValue('fromid', $fromAddress, SQLITE3_TEXT);
$result = $this->updateQuery->execute(); $result = $this->updateQuery->execute();
if ($result === false) { if ($result === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
} }
return true; return true;
@ -232,7 +229,7 @@ class SQLite3 extends CacheBase implements ICache
* Get a list of all cell addresses currently held in cache * Get a list of all cell addresses currently held in cache
* *
* @return string[] * @return string[]
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function getCellList() public function getCellList()
{ {
@ -243,7 +240,7 @@ class SQLite3 extends CacheBase implements ICache
$query = "SELECT id FROM kvp_".$this->TableName; $query = "SELECT id FROM kvp_".$this->TableName;
$cellIdsResult = $this->DBHandle->query($query); $cellIdsResult = $this->DBHandle->query($query);
if ($cellIdsResult === false) { if ($cellIdsResult === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
} }
$cellKeys = array(); $cellKeys = array();
@ -257,10 +254,10 @@ class SQLite3 extends CacheBase implements ICache
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function copyCellCollection(\PHPExcel\Worksheet $parent) public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent)
{ {
$this->currentCellIsDirty; $this->currentCellIsDirty;
$this->storeData(); $this->storeData();
@ -270,7 +267,7 @@ class SQLite3 extends CacheBase implements ICache
if (!$this->DBHandle->exec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB) if (!$this->DBHandle->exec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)
AS SELECT * FROM kvp_'.$this->TableName) AS SELECT * FROM kvp_'.$this->TableName)
) { ) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
} }
// Copy the existing cell cache file // Copy the existing cell cache file
@ -298,10 +295,10 @@ class SQLite3 extends CacheBase implements ICache
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param \PHPExcel\Worksheet $parent The worksheet for this cell collection * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function __construct(\PHPExcel\Worksheet $parent) public function __construct(\PhpSpreadsheet\Worksheet $parent)
{ {
parent::__construct($parent); parent::__construct($parent);
if (is_null($this->DBHandle)) { if (is_null($this->DBHandle)) {
@ -310,10 +307,10 @@ class SQLite3 extends CacheBase implements ICache
$this->DBHandle = new \SQLite3($_DBName); $this->DBHandle = new \SQLite3($_DBName);
if ($this->DBHandle === false) { if ($this->DBHandle === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
} }
if (!$this->DBHandle->exec('CREATE TABLE kvp_'.$this->TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { if (!$this->DBHandle->exec('CREATE TABLE kvp_'.$this->TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
} }
} }

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CachedObjectStorage; namespace PhpSpreadsheet\CachedObjectStorage;
/** /**
* PHPExcel_CachedObjectStorage_Wincache * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CachedObjectStorage;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_CachedObjectStorage * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -49,7 +46,7 @@ class Wincache extends CacheBase implements ICache
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @return void * @return void
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
protected function storeData() protected function storeData()
{ {
@ -60,12 +57,12 @@ class Wincache extends CacheBase implements ICache
if (wincache_ucache_exists($this->cachePrefix.$this->currentObjectID.'.cache')) { if (wincache_ucache_exists($this->cachePrefix.$this->currentObjectID.'.cache')) {
if (!wincache_ucache_set($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) { if (!wincache_ucache_set($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) {
$this->__destruct(); $this->__destruct();
throw new \PHPExcel\Exception('Failed to store cell '.$this->currentObjectID.' in WinCache'); throw new \PhpSpreadsheet\Exception('Failed to store cell '.$this->currentObjectID.' in WinCache');
} }
} else { } else {
if (!wincache_ucache_add($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) { if (!wincache_ucache_add($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) {
$this->__destruct(); $this->__destruct();
throw new \PHPExcel\Exception('Failed to store cell '.$this->currentObjectID.' in WinCache'); throw new \PhpSpreadsheet\Exception('Failed to store cell '.$this->currentObjectID.' in WinCache');
} }
} }
$this->currentCellIsDirty = false; $this->currentCellIsDirty = false;
@ -78,11 +75,11 @@ class Wincache extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update * @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PHPExcel\Cell * @return \PhpSpreadsheet\Cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function addCacheData($pCoord, \PHPExcel\Cell $cell) public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{ {
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData(); $this->storeData();
@ -97,11 +94,11 @@ class Wincache extends CacheBase implements ICache
} }
/** /**
* Is a value set in the current \PHPExcel\CachedObjectStorage\ICache for an indexed cell? * Is a value set in the current \PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell?
* *
* @param string $pCoord Coordinate address of the cell to check * @param string $pCoord Coordinate address of the cell to check
* @return boolean * @return boolean
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function isDataSet($pCoord) public function isDataSet($pCoord)
{ {
@ -115,7 +112,7 @@ class Wincache extends CacheBase implements ICache
if ($success === false) { if ($success === false) {
// Entry no longer exists in Wincache, so clear it from the cache array // Entry no longer exists in Wincache, so clear it from the cache array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
throw new \PHPExcel\Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); throw new \PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in WinCache');
} }
return true; return true;
} }
@ -127,8 +124,8 @@ class Wincache extends CacheBase implements ICache
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) public function getCacheData($pCoord)
{ {
@ -145,7 +142,7 @@ class Wincache extends CacheBase implements ICache
if ($success === false) { if ($success === false) {
// Entry no longer exists in WinCache, so clear it from the cache array // Entry no longer exists in WinCache, so clear it from the cache array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
throw new \PHPExcel\Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); throw new \PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in WinCache');
} }
} else { } else {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
@ -181,7 +178,7 @@ class Wincache extends CacheBase implements ICache
* Delete a cell in cache identified by coordinate address * Delete a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to delete * @param string $pCoord Coordinate address of the cell to delete
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function deleteCacheData($pCoord) public function deleteCacheData($pCoord)
{ {
@ -195,10 +192,10 @@ class Wincache extends CacheBase implements ICache
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public function copyCellCollection(\PHPExcel\Worksheet $parent) public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent)
{ {
parent::copyCellCollection($parent); parent::copyCellCollection($parent);
// Get a new id for the new file name // Get a new id for the new file name
@ -212,11 +209,11 @@ class Wincache extends CacheBase implements ICache
if ($success === false) { if ($success === false) {
// Entry no longer exists in WinCache, so clear it from the cache array // Entry no longer exists in WinCache, so clear it from the cache array
parent::deleteCacheData($cellID); parent::deleteCacheData($cellID);
throw new \PHPExcel\Exception('Cell entry '.$cellID.' no longer exists in Wincache'); throw new \PhpSpreadsheet\Exception('Cell entry '.$cellID.' no longer exists in Wincache');
} }
if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->cacheTime)) { if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->cacheTime)) {
$this->__destruct(); $this->__destruct();
throw new \PHPExcel\Exception('Failed to store cell '.$cellID.' in Wincache'); throw new \PhpSpreadsheet\Exception('Failed to store cell '.$cellID.' in Wincache');
} }
} }
} }
@ -248,10 +245,10 @@ class Wincache extends CacheBase implements ICache
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param \PHPExcel\Worksheet $parent The worksheet for this cell collection * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
* @param mixed[] $arguments Additional initialisation arguments * @param mixed[] $arguments Additional initialisation arguments
*/ */
public function __construct(\PHPExcel\Worksheet $parent, $arguments) public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments)
{ {
$cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel; namespace PhpSpreadsheet;
/** /**
* PHPExcel_CachedObjectStorageFactory * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_CachedObjectStorage * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -152,7 +149,7 @@ class CachedObjectStorageFactory
{ {
$activeMethods = array(); $activeMethods = array();
foreach (self::$storageMethods as $storageMethod) { foreach (self::$storageMethods as $storageMethod) {
$cacheStorageClass = '\\PHPExcel\\CachedObjectStorage\\' . $storageMethod; $cacheStorageClass = '\\PhpSpreadsheet\\CachedObjectStorage\\' . $storageMethod;
if (call_user_func(array($cacheStorageClass, 'cacheMethodIsAvailable'))) { if (call_user_func(array($cacheStorageClass, 'cacheMethodIsAvailable'))) {
$activeMethods[] = $storageMethod; $activeMethods[] = $storageMethod;
} }
@ -174,7 +171,7 @@ class CachedObjectStorageFactory
return false; return false;
} }
$cacheStorageClass = '\\PHPExcel\\CachedObjectStorage\\'.$method; $cacheStorageClass = '\\PhpSpreadsheet\\CachedObjectStorage\\'.$method;
if (!call_user_func([$cacheStorageClass, 'cacheMethodIsAvailable'])) { if (!call_user_func([$cacheStorageClass, 'cacheMethodIsAvailable'])) {
return false; return false;
} }
@ -187,7 +184,7 @@ class CachedObjectStorageFactory
} }
if (self::$cacheStorageMethod === null) { if (self::$cacheStorageMethod === null) {
self::$cacheStorageClass = '\\PHPExcel\\CachedObjectStorage\\' . $method; self::$cacheStorageClass = '\\PhpSpreadsheet\\CachedObjectStorage\\' . $method;
self::$cacheStorageMethod = $method; self::$cacheStorageMethod = $method;
} }
return true; return true;

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CalcEngine; namespace PhpSpreadsheet\CalcEngine;
/** /**
* PHPExcel_CalcEngine_CyclicReferenceStack * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CalcEngine;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\CalcEngine; namespace PhpSpreadsheet\CalcEngine;
/** /**
* PHPExcel_CalcEngine_Logger * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\CalcEngine;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** /**
* PHPExcel_Calculation_Categories * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Calculation;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -57,26 +54,26 @@ class Categories
private $excelName; private $excelName;
/** /**
* PHPExcel function name * Spreadsheet function name
* *
* @var string * @var string
*/ */
private $phpExcelName; private $spreadsheetName;
/** /**
* Create a new Categories * Create a new Categories
* @param string $pCategory Category (represented by CATEGORY_*) * @param string $pCategory Category (represented by CATEGORY_*)
* @param string $pExcelName Excel function name * @param string $pExcelName Excel function name
* @param string $pPHPExcelName PHPExcel internal function name * @param string $spreadsheetName Spreadsheet internal function name
* @throws Exception * @throws Exception
*/ */
public function __construct($pCategory = null, $pExcelName = null, $pPHPExcelName = null) public function __construct($pCategory = null, $pExcelName = null, $spreadsheetName = null)
{ {
if (($pCategory !== null) && ($pExcelName !== null) && ($pPHPExcelName !== null)) { if (($pCategory !== null) && ($pExcelName !== null) && ($spreadsheetName !== null)) {
// Initialise values // Initialise values
$this->category = $pCategory; $this->category = $pCategory;
$this->excelName = $pExcelName; $this->excelName = $pExcelName;
$this->phpExcelName = $pPHPExcelName; $this->spreadsheetName = $spreadsheetName;
} else { } else {
throw new Exception("Invalid parameters passed."); throw new Exception("Invalid parameters passed.");
} }
@ -128,22 +125,22 @@ class Categories
} }
/** /**
* Get PHPExcel function name * Get PhpSpreadsheet function name
* *
* @return string * @return string
*/ */
public function getPHPExcelName() public function getPhpSpreadsheetName()
{ {
return $this->phpExcelName; return $this->spreadsheetName;
} }
/** /**
* Set PHPExcel function name * Set PhpSpreadsheet function name
* *
* @param string $value * @param string $value
*/ */
public function setPHPExcelName($value) public function setPhpSpreadsheetName($value)
{ {
$this->phpExcelName = $value; $this->spreadsheetName = $value;
} }
} }

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** /**
* PHPExcel_Calculation_Database * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Calculation;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -119,12 +116,12 @@ class Database
$k = array_search($criteriaName, $fieldNames); $k = array_search($criteriaName, $fieldNames);
if (isset($dataValues[$k])) { if (isset($dataValues[$k])) {
$dataValue = $dataValues[$k]; $dataValue = $dataValues[$k];
$dataValue = (is_string($dataValue)) ? \PHPExcel\Calculation::wrapResult(strtoupper($dataValue)) : $dataValue; $dataValue = (is_string($dataValue)) ? \PhpSpreadsheet\Calculation::wrapResult(strtoupper($dataValue)) : $dataValue;
$testConditionList = str_replace('[:' . $criteriaName . ']', $dataValue, $testConditionList); $testConditionList = str_replace('[:' . $criteriaName . ']', $dataValue, $testConditionList);
} }
} }
// evaluate the criteria against the row data // evaluate the criteria against the row data
$result = \PHPExcel\Calculation::getInstance()->_calculateFormulaValue('='.$testConditionList); $result = \PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue('='.$testConditionList);
// If the row failed to meet the criteria, remove it from the database // If the row failed to meet the criteria, remove it from the database
if (!$result) { if (!$result) {
unset($database[$dataRow]); unset($database[$dataRow]);
@ -144,7 +141,7 @@ class Database
foreach ($database as $row) { foreach ($database as $row) {
$colData[] = $row[$field]; $colData[] = $row[$field];
} }
return $colData; return $colData;
} }

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** /**
* PHPExcel_Calculation_DateTime * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Calculation;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -92,7 +89,7 @@ class DateTime
return Functions::VALUE(); return Functions::VALUE();
} }
if ((is_object($dateValue)) && ($dateValue instanceof \DateTime)) { if ((is_object($dateValue)) && ($dateValue instanceof \DateTime)) {
$dateValue = \PHPExcel\Shared\Date::PHPToExcel($dateValue); $dateValue = \PhpSpreadsheet\Shared\Date::PHPToExcel($dateValue);
} else { } else {
$saveReturnDateType = Functions::getReturnDateType(); $saveReturnDateType = Functions::getReturnDateType();
Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL);
@ -123,7 +120,7 @@ class DateTime
private static function adjustDateByMonths($dateValue = 0, $adjustmentMonths = 0) private static function adjustDateByMonths($dateValue = 0, $adjustmentMonths = 0)
{ {
// Execute function // Execute function
$PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue); $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue);
$oMonth = (int) $PHPDateObject->format('m'); $oMonth = (int) $PHPDateObject->format('m');
$oYear = (int) $PHPDateObject->format('Y'); $oYear = (int) $PHPDateObject->format('Y');
@ -156,7 +153,7 @@ class DateTime
* open the worksheet. * open the worksheet.
* *
* NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
* and time format of your regional settings. PHPExcel does not change cell formatting in this way. * and time format of your regional settings. PhpSpreadsheet does not change cell formatting in this way.
* *
* Excel Function: * Excel Function:
* NOW() * NOW()
@ -173,7 +170,7 @@ class DateTime
$retValue = false; $retValue = false;
switch (Functions::getReturnDateType()) { switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
$retValue = (float) \PHPExcel\Shared\Date::PHPToExcel(time()); $retValue = (float) \PhpSpreadsheet\Shared\Date::PHPToExcel(time());
break; break;
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
$retValue = (integer) time(); $retValue = (integer) time();
@ -197,7 +194,7 @@ class DateTime
* open the worksheet. * open the worksheet.
* *
* NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
* and time format of your regional settings. PHPExcel does not change cell formatting in this way. * and time format of your regional settings. PhpSpreadsheet does not change cell formatting in this way.
* *
* Excel Function: * Excel Function:
* TODAY() * TODAY()
@ -212,16 +209,16 @@ class DateTime
$saveTimeZone = date_default_timezone_get(); $saveTimeZone = date_default_timezone_get();
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
$retValue = false; $retValue = false;
$excelDateTime = floor(\PHPExcel\Shared\Date::PHPToExcel(time())); $excelDateTime = floor(\PhpSpreadsheet\Shared\Date::PHPToExcel(time()));
switch (Functions::getReturnDateType()) { switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
$retValue = (float) $excelDateTime; $retValue = (float) $excelDateTime;
break; break;
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
$retValue = (integer) \PHPExcel\Shared\Date::excelToTimestamp($excelDateTime); $retValue = (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateTime);
break; break;
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
$retValue = \PHPExcel\Shared\Date::excelToDateTimeObject($excelDateTime); $retValue = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($excelDateTime);
break; break;
} }
date_default_timezone_set($saveTimeZone); date_default_timezone_set($saveTimeZone);
@ -236,12 +233,12 @@ class DateTime
* The DATE function returns a value that represents a particular date. * The DATE function returns a value that represents a particular date.
* *
* NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
* format of your regional settings. PHPExcel does not change cell formatting in this way. * format of your regional settings. PhpSpreadsheet does not change cell formatting in this way.
* *
* Excel Function: * Excel Function:
* DATE(year,month,day) * DATE(year,month,day)
* *
* PHPExcel is a lot more forgiving than MS Excel when passing non numeric values to this function. * PhpSpreadsheet is a lot more forgiving than MS Excel when passing non numeric values to this function.
* A Month name or abbreviation (English only at this point) such as 'January' or 'Jan' will still be accepted, * A Month name or abbreviation (English only at this point) such as 'January' or 'Jan' will still be accepted,
* as will a day value with a suffix (e.g. '21st' rather than simply 21); again only English language. * as will a day value with a suffix (e.g. '21st' rather than simply 21); again only English language.
* *
@ -287,16 +284,16 @@ class DateTime
$day = Functions::flattenSingleValue($day); $day = Functions::flattenSingleValue($day);
if (($month !== null) && (!is_numeric($month))) { if (($month !== null) && (!is_numeric($month))) {
$month = \PHPExcel\Shared\Date::monthStringToNumber($month); $month = \PhpSpreadsheet\Shared\Date::monthStringToNumber($month);
} }
if (($day !== null) && (!is_numeric($day))) { if (($day !== null) && (!is_numeric($day))) {
$day = \PHPExcel\Shared\Date::dayStringToNumber($day); $day = \PhpSpreadsheet\Shared\Date::dayStringToNumber($day);
} }
$year = ($year !== null) ? \PHPExcel\Shared\StringHelper::testStringAsNumeric($year) : 0; $year = ($year !== null) ? \PhpSpreadsheet\Shared\StringHelper::testStringAsNumeric($year) : 0;
$month = ($month !== null) ? \PHPExcel\Shared\StringHelper::testStringAsNumeric($month) : 0; $month = ($month !== null) ? \PhpSpreadsheet\Shared\StringHelper::testStringAsNumeric($month) : 0;
$day = ($day !== null) ? \PHPExcel\Shared\StringHelper::testStringAsNumeric($day) : 0; $day = ($day !== null) ? \PhpSpreadsheet\Shared\StringHelper::testStringAsNumeric($day) : 0;
if ((!is_numeric($year)) || if ((!is_numeric($year)) ||
(!is_numeric($month)) || (!is_numeric($month)) ||
(!is_numeric($day))) { (!is_numeric($day))) {
@ -306,7 +303,7 @@ class DateTime
$month = (integer) $month; $month = (integer) $month;
$day = (integer) $day; $day = (integer) $day;
$baseYear = \PHPExcel\Shared\Date::getExcelCalendar(); $baseYear = \PhpSpreadsheet\Shared\Date::getExcelCalendar();
// Validate parameters // Validate parameters
if ($year < ($baseYear-1900)) { if ($year < ($baseYear-1900)) {
return Functions::NAN(); return Functions::NAN();
@ -336,14 +333,14 @@ class DateTime
} }
// Execute function // Execute function
$excelDateValue = \PHPExcel\Shared\Date::formattedPHPToExcel($year, $month, $day); $excelDateValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel($year, $month, $day);
switch (Functions::getReturnDateType()) { switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue; return (float) $excelDateValue;
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::excelToTimestamp($excelDateValue); return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue);
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
return \PHPExcel\Shared\Date::excelToDateTimeObject($excelDateValue); return \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($excelDateValue);
} }
} }
@ -354,7 +351,7 @@ class DateTime
* The TIME function returns a value that represents a particular time. * The TIME function returns a value that represents a particular time.
* *
* NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the time * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the time
* format of your regional settings. PHPExcel does not change cell formatting in this way. * format of your regional settings. PhpSpreadsheet does not change cell formatting in this way.
* *
* Excel Function: * Excel Function:
* TIME(hour,minute,second) * TIME(hour,minute,second)
@ -429,13 +426,13 @@ class DateTime
switch (Functions::getReturnDateType()) { switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
$date = 0; $date = 0;
$calendar = \PHPExcel\Shared\Date::getExcelCalendar(); $calendar = \PhpSpreadsheet\Shared\Date::getExcelCalendar();
if ($calendar != \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900) { if ($calendar != \PhpSpreadsheet\Shared\Date::CALENDAR_WINDOWS_1900) {
$date = 1; $date = 1;
} }
return (float) \PHPExcel\Shared\Date::formattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second); return (float) \PhpSpreadsheet\Shared\Date::formattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second);
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::excelToTimestamp(\PHPExcel\Shared\Date::formattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600 return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpSpreadsheet\Shared\Date::formattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
$dayAdjust = 0; $dayAdjust = 0;
if ($hour < 0) { if ($hour < 0) {
@ -465,7 +462,7 @@ class DateTime
* value. * value.
* *
* NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
* format of your regional settings. PHPExcel does not change cell formatting in this way. * format of your regional settings. PhpSpreadsheet does not change cell formatting in this way.
* *
* Excel Function: * Excel Function:
* DATEVALUE(dateValue) * DATEVALUE(dateValue)
@ -571,7 +568,7 @@ class DateTime
return Functions::VALUE(); return Functions::VALUE();
} }
$excelDateValue = floor( $excelDateValue = floor(
\PHPExcel\Shared\Date::formattedPHPToExcel( \PhpSpreadsheet\Shared\Date::formattedPHPToExcel(
$PHPDateArray['year'], $PHPDateArray['year'],
$PHPDateArray['month'], $PHPDateArray['month'],
$PHPDateArray['day'], $PHPDateArray['day'],
@ -584,7 +581,7 @@ class DateTime
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue; return (float) $excelDateValue;
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::excelToTimestamp($excelDateValue); return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue);
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
return new \DateTime($PHPDateArray['year'].'-'.$PHPDateArray['month'].'-'.$PHPDateArray['day'].' 00:00:00'); return new \DateTime($PHPDateArray['year'].'-'.$PHPDateArray['month'].'-'.$PHPDateArray['day'].' 00:00:00');
} }
@ -601,7 +598,7 @@ class DateTime
* value. * value.
* *
* NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the time * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the time
* format of your regional settings. PHPExcel does not change cell formatting in this way. * format of your regional settings. PhpSpreadsheet does not change cell formatting in this way.
* *
* Excel Function: * Excel Function:
* TIMEVALUE(timeValue) * TIMEVALUE(timeValue)
@ -629,7 +626,7 @@ class DateTime
$PHPDateArray = date_parse($timeValue); $PHPDateArray = date_parse($timeValue);
if (($PHPDateArray !== false) && ($PHPDateArray['error_count'] == 0)) { if (($PHPDateArray !== false) && ($PHPDateArray['error_count'] == 0)) {
if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) { if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
$excelDateValue = \PHPExcel\Shared\Date::formattedPHPToExcel( $excelDateValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel(
$PHPDateArray['year'], $PHPDateArray['year'],
$PHPDateArray['month'], $PHPDateArray['month'],
$PHPDateArray['day'], $PHPDateArray['day'],
@ -638,14 +635,14 @@ class DateTime
$PHPDateArray['second'] $PHPDateArray['second']
); );
} else { } else {
$excelDateValue = \PHPExcel\Shared\Date::formattedPHPToExcel(1900, 1, 1, $PHPDateArray['hour'], $PHPDateArray['minute'], $PHPDateArray['second']) - 1; $excelDateValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel(1900, 1, 1, $PHPDateArray['hour'], $PHPDateArray['minute'], $PHPDateArray['second']) - 1;
} }
switch (Functions::getReturnDateType()) { switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue; return (float) $excelDateValue;
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) $phpDateValue = \PHPExcel\Shared\Date::excelToTimestamp($excelDateValue+25569) - 3600; return (integer) $phpDateValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue+25569) - 3600;
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
return new \DateTime('1900-01-01 '.$PHPDateArray['hour'].':'.$PHPDateArray['minute'].':'.$PHPDateArray['second']); return new \DateTime('1900-01-01 '.$PHPDateArray['hour'].':'.$PHPDateArray['minute'].':'.$PHPDateArray['second']);
} }
@ -685,12 +682,12 @@ class DateTime
// Execute function // Execute function
$difference = $endDate - $startDate; $difference = $endDate - $startDate;
$PHPStartDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($startDate); $PHPStartDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($startDate);
$startDays = $PHPStartDateObject->format('j'); $startDays = $PHPStartDateObject->format('j');
$startMonths = $PHPStartDateObject->format('n'); $startMonths = $PHPStartDateObject->format('n');
$startYears = $PHPStartDateObject->format('Y'); $startYears = $PHPStartDateObject->format('Y');
$PHPEndDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($endDate); $PHPEndDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate);
$endDays = $PHPEndDateObject->format('j'); $endDays = $PHPEndDateObject->format('j');
$endMonths = $PHPEndDateObject->format('n'); $endMonths = $PHPEndDateObject->format('n');
$endYears = $PHPEndDateObject->format('Y'); $endYears = $PHPEndDateObject->format('Y');
@ -805,12 +802,12 @@ class DateTime
} }
// Execute function // Execute function
$PHPStartDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($startDate); $PHPStartDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($startDate);
$startDay = $PHPStartDateObject->format('j'); $startDay = $PHPStartDateObject->format('j');
$startMonth = $PHPStartDateObject->format('n'); $startMonth = $PHPStartDateObject->format('n');
$startYear = $PHPStartDateObject->format('Y'); $startYear = $PHPStartDateObject->format('Y');
$PHPEndDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($endDate); $PHPEndDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate);
$endDay = $PHPEndDateObject->format('j'); $endDay = $PHPEndDateObject->format('j');
$endMonth = $PHPEndDateObject->format('n'); $endMonth = $PHPEndDateObject->format('n');
$endYear = $PHPEndDateObject->format('Y'); $endYear = $PHPEndDateObject->format('Y');
@ -1112,9 +1109,9 @@ class DateTime
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
return (float) $endDate; return (float) $endDate;
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::excelToTimestamp($endDate); return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($endDate);
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
return \PHPExcel\Shared\Date::excelToDateTimeObject($endDate); return \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate);
} }
} }
@ -1147,7 +1144,7 @@ class DateTime
} }
// Execute function // Execute function
$PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue); $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue);
return (int) $PHPDateObject->format('j'); return (int) $PHPDateObject->format('j');
} }
@ -1191,7 +1188,7 @@ class DateTime
} }
// Execute function // Execute function
$PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue); $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue);
$DoW = $PHPDateObject->format('w'); $DoW = $PHPDateObject->format('w');
$firstDay = 1; $firstDay = 1;
@ -1267,7 +1264,7 @@ class DateTime
} }
// Execute function // Execute function
$PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue); $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue);
$dayOfYear = $PHPDateObject->format('z'); $dayOfYear = $PHPDateObject->format('z');
$PHPDateObject->modify('-' . $dayOfYear . ' days'); $PHPDateObject->modify('-' . $dayOfYear . ' days');
$dow = $PHPDateObject->format('w'); $dow = $PHPDateObject->format('w');
@ -1306,7 +1303,7 @@ class DateTime
} }
// Execute function // Execute function
$PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue); $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue);
return (int) $PHPDateObject->format('n'); return (int) $PHPDateObject->format('n');
} }
@ -1338,7 +1335,7 @@ class DateTime
} }
// Execute function // Execute function
$PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue); $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue);
return (int) $PHPDateObject->format('Y'); return (int) $PHPDateObject->format('Y');
} }
@ -1379,7 +1376,7 @@ class DateTime
} elseif ($timeValue < 0.0) { } elseif ($timeValue < 0.0) {
return Functions::NAN(); return Functions::NAN();
} }
$timeValue = \PHPExcel\Shared\Date::excelToTimestamp($timeValue); $timeValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue);
return (int) gmdate('G', $timeValue); return (int) gmdate('G', $timeValue);
} }
@ -1420,7 +1417,7 @@ class DateTime
} elseif ($timeValue < 0.0) { } elseif ($timeValue < 0.0) {
return Functions::NAN(); return Functions::NAN();
} }
$timeValue = \PHPExcel\Shared\Date::excelToTimestamp($timeValue); $timeValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue);
return (int) gmdate('i', $timeValue); return (int) gmdate('i', $timeValue);
} }
@ -1461,7 +1458,7 @@ class DateTime
} elseif ($timeValue < 0.0) { } elseif ($timeValue < 0.0) {
return Functions::NAN(); return Functions::NAN();
} }
$timeValue = \PHPExcel\Shared\Date::excelToTimestamp($timeValue); $timeValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue);
return (int) gmdate('s', $timeValue); return (int) gmdate('s', $timeValue);
} }
@ -1505,9 +1502,9 @@ class DateTime
switch (Functions::getReturnDateType()) { switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject); return (float) \PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject);
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::excelToTimestamp(\PHPExcel\Shared\Date::PHPToExcel($PHPDateObject)); return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject));
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
return $PHPDateObject; return $PHPDateObject;
} }
@ -1554,9 +1551,9 @@ class DateTime
switch (Functions::getReturnDateType()) { switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject); return (float) \PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject);
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::excelToTimestamp(\PHPExcel\Shared\Date::PHPToExcel($PHPDateObject)); return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject));
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
return $PHPDateObject; return $PHPDateObject;
} }

View File

@ -1,14 +1,12 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** EULER */ /** EULER */
define('EULER', 2.71828182845904523536); define('EULER', 2.71828182845904523536);
/** /**
* PHPExcel_Calculation_Engineering * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -24,9 +22,8 @@ define('EULER', 2.71828182845904523536);
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -2426,7 +2423,7 @@ class Engineering
* Note: In Excel 2007 or earlier, if you input a negative value for the upper or lower bound arguments, * Note: In Excel 2007 or earlier, if you input a negative value for the upper or lower bound arguments,
* the function would return a #NUM! error. However, in Excel 2010, the function algorithm was * the function would return a #NUM! error. However, in Excel 2010, the function algorithm was
* improved, so that it can now calculate the function for both positive and negative ranges. * improved, so that it can now calculate the function for both positive and negative ranges.
* PHPExcel follows Excel 2010 behaviour, and accepts nagative arguments. * PhpSpreadsheet follows Excel 2010 behaviour, and accepts nagative arguments.
* *
* Excel Function: * Excel Function:
* ERF(lower[,upper]) * ERF(lower[,upper])
@ -2494,7 +2491,7 @@ class Engineering
* Note: In Excel 2007 or earlier, if you input a negative value for the lower bound argument, * Note: In Excel 2007 or earlier, if you input a negative value for the lower bound argument,
* the function would return a #NUM! error. However, in Excel 2010, the function algorithm was * the function would return a #NUM! error. However, in Excel 2010, the function algorithm was
* improved, so that it can now calculate the function for both positive and negative x values. * improved, so that it can now calculate the function for both positive and negative x values.
* PHPExcel follows Excel 2010 behaviour, and accepts nagative arguments. * PhpSpreadsheet follows Excel 2010 behaviour, and accepts nagative arguments.
* *
* Excel Function: * Excel Function:
* ERFC(x) * ERFC(x)

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** /**
* PHPExcel_Calculation_Exception * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,13 +19,12 @@ namespace PHPExcel\Calculation;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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 Exception extends \PHPExcel\Exception class Exception extends \PhpSpreadsheet\Exception
{ {
/** /**
* Error handler callback * Error handler callback

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** /**
* PHPExcel_Calculation_ExceptionHandler * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Calculation;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -34,7 +31,7 @@ class ExceptionHandler
*/ */
public function __construct() public function __construct()
{ {
set_error_handler(array('\\PHPExcel\\Calculation\\Exception', 'errorHandlerCallback'), E_ALL); set_error_handler(array('\\PhpSpreadsheet\\Calculation\\Exception', 'errorHandlerCallback'), E_ALL);
} }
/** /**

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** FINANCIAL_MAX_ITERATIONS */ /** FINANCIAL_MAX_ITERATIONS */
define('FINANCIAL_MAX_ITERATIONS', 128); define('FINANCIAL_MAX_ITERATIONS', 128);
@ -9,9 +9,7 @@ define('FINANCIAL_MAX_ITERATIONS', 128);
define('FINANCIAL_PRECISION', 1.0e-08); define('FINANCIAL_PRECISION', 1.0e-08);
/** /**
* PHPExcel_Calculation_Financial * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -27,9 +25,8 @@ define('FINANCIAL_PRECISION', 1.0e-08);
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -67,10 +64,10 @@ class Financial
{ {
$months = 12 / $frequency; $months = 12 / $frequency;
$result = \PHPExcel\Shared\Date::excelToDateTimeObject($maturity); $result = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($maturity);
$eom = self::isLastDayOfMonth($result); $eom = self::isLastDayOfMonth($result);
while ($settlement < \PHPExcel\Shared\Date::PHPToExcel($result)) { while ($settlement < \PhpSpreadsheet\Shared\Date::PHPToExcel($result)) {
$result->modify('-'.$months.' months'); $result->modify('-'.$months.' months');
} }
if ($next) { if ($next) {
@ -81,7 +78,7 @@ class Financial
$result->modify('-1 day'); $result->modify('-1 day');
} }
return \PHPExcel\Shared\Date::PHPToExcel($result); return \PhpSpreadsheet\Shared\Date::PHPToExcel($result);
} }

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** /**
* PHPExcel_Calculation_FormulaParser * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Calculation;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** /**
* PHPExcel_Calculation_FormulaToken * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Calculation;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** MAX_VALUE */ /** MAX_VALUE */
define('MAX_VALUE', 1.2e308); define('MAX_VALUE', 1.2e308);
@ -16,9 +16,7 @@ define('PRECISION', 8.88E-016);
/** /**
* PHPExcel_Calculation_Functions * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -34,9 +32,8 @@ define('PRECISION', 8.88E-016);
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -316,7 +313,7 @@ class Functions
} }
if (!in_array($condition{0}, array('>', '<', '='))) { if (!in_array($condition{0}, array('>', '<', '='))) {
if (!is_numeric($condition)) { if (!is_numeric($condition)) {
$condition = \PHPExcel\Calculation::wrapResult(strtoupper($condition)); $condition = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($condition));
} }
return '=' . $condition; return '=' . $condition;
} else { } else {
@ -325,7 +322,7 @@ class Functions
if (!is_numeric($operand)) { if (!is_numeric($operand)) {
$operand = str_replace('"', '""', $operand); $operand = str_replace('"', '""', $operand);
$operand = \PHPExcel\Calculation::wrapResult(strtoupper($operand)); $operand = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($operand));
} }
return $operator . $operand; return $operator . $operand;
@ -518,7 +515,7 @@ class Functions
*/ */
public static function VERSION() public static function VERSION()
{ {
return 'PHPExcel ##VERSION##, ##DATE##'; return 'PhpSpreadsheet ##VERSION##, ##DATE##';
} }

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** /**
* PHPExcel_Calculation_Logical * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Calculation;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -102,9 +99,9 @@ class Logical
$returnValue = $returnValue && ($arg != 0); $returnValue = $returnValue && ($arg != 0);
} elseif (is_string($arg)) { } elseif (is_string($arg)) {
$arg = strtoupper($arg); $arg = strtoupper($arg);
if (($arg == 'TRUE') || ($arg == \PHPExcel\Calculation::getTRUE())) { if (($arg == 'TRUE') || ($arg == \PhpSpreadsheet\Calculation::getTRUE())) {
$arg = true; $arg = true;
} elseif (($arg == 'FALSE') || ($arg == \PHPExcel\Calculation::getFALSE())) { } elseif (($arg == 'FALSE') || ($arg == \PhpSpreadsheet\Calculation::getFALSE())) {
$arg = false; $arg = false;
} else { } else {
return Functions::VALUE(); return Functions::VALUE();
@ -158,9 +155,9 @@ class Logical
$returnValue = $returnValue || ($arg != 0); $returnValue = $returnValue || ($arg != 0);
} elseif (is_string($arg)) { } elseif (is_string($arg)) {
$arg = strtoupper($arg); $arg = strtoupper($arg);
if (($arg == 'TRUE') || ($arg == \PHPExcel\Calculation::getTRUE())) { if (($arg == 'TRUE') || ($arg == \PhpSpreadsheet\Calculation::getTRUE())) {
$arg = true; $arg = true;
} elseif (($arg == 'FALSE') || ($arg == \PHPExcel\Calculation::getFALSE())) { } elseif (($arg == 'FALSE') || ($arg == \PhpSpreadsheet\Calculation::getFALSE())) {
$arg = false; $arg = false;
} else { } else {
return Functions::VALUE(); return Functions::VALUE();
@ -202,9 +199,9 @@ class Logical
$logical = Functions::flattenSingleValue($logical); $logical = Functions::flattenSingleValue($logical);
if (is_string($logical)) { if (is_string($logical)) {
$logical = strtoupper($logical); $logical = strtoupper($logical);
if (($logical == 'TRUE') || ($logical == \PHPExcel\Calculation::getTRUE())) { if (($logical == 'TRUE') || ($logical == \PhpSpreadsheet\Calculation::getTRUE())) {
return false; return false;
} elseif (($logical == 'FALSE') || ($logical == \PHPExcel\Calculation::getFALSE())) { } elseif (($logical == 'FALSE') || ($logical == \PhpSpreadsheet\Calculation::getFALSE())) {
return true; return true;
} else { } else {
return Functions::VALUE(); return Functions::VALUE();

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** /**
* PHPExcel_Calculation_LookupRef * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Calculation;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -69,7 +66,7 @@ class LookupRef
} }
if ((!is_bool($referenceStyle)) || $referenceStyle) { if ((!is_bool($referenceStyle)) || $referenceStyle) {
$rowRelative = $columnRelative = '$'; $rowRelative = $columnRelative = '$';
$column = \PHPExcel\Cell::stringFromColumnIndex($column-1); $column = \PhpSpreadsheet\Cell::stringFromColumnIndex($column-1);
if (($relativity == 2) || ($relativity == 4)) { if (($relativity == 2) || ($relativity == 4)) {
$columnRelative = ''; $columnRelative = '';
} }
@ -112,7 +109,7 @@ class LookupRef
if (is_array($cellAddress)) { if (is_array($cellAddress)) {
foreach ($cellAddress as $columnKey => $value) { foreach ($cellAddress as $columnKey => $value) {
$columnKey = preg_replace('/[^a-z]/i', '', $columnKey); $columnKey = preg_replace('/[^a-z]/i', '', $columnKey);
return (integer) \PHPExcel\Cell::columnIndexFromString($columnKey); return (integer) \PhpSpreadsheet\Cell::columnIndexFromString($columnKey);
} }
} else { } else {
if (strpos($cellAddress, '!') !== false) { if (strpos($cellAddress, '!') !== false) {
@ -124,12 +121,12 @@ class LookupRef
$endAddress = preg_replace('/[^a-z]/i', '', $endAddress); $endAddress = preg_replace('/[^a-z]/i', '', $endAddress);
$returnValue = array(); $returnValue = array();
do { do {
$returnValue[] = (integer) \PHPExcel\Cell::columnIndexFromString($startAddress); $returnValue[] = (integer) \PhpSpreadsheet\Cell::columnIndexFromString($startAddress);
} while ($startAddress++ != $endAddress); } while ($startAddress++ != $endAddress);
return $returnValue; return $returnValue;
} else { } else {
$cellAddress = preg_replace('/[^a-z]/i', '', $cellAddress); $cellAddress = preg_replace('/[^a-z]/i', '', $cellAddress);
return (integer) \PHPExcel\Cell::columnIndexFromString($cellAddress); return (integer) \PhpSpreadsheet\Cell::columnIndexFromString($cellAddress);
} }
} }
} }
@ -156,7 +153,7 @@ class LookupRef
reset($cellAddress); reset($cellAddress);
$isMatrix = (is_numeric(key($cellAddress))); $isMatrix = (is_numeric(key($cellAddress)));
list($columns, $rows) = \PHPExcel\Calculation::_getMatrixDimensions($cellAddress); list($columns, $rows) = \PhpSpreadsheet\Calculation::_getMatrixDimensions($cellAddress);
if ($isMatrix) { if ($isMatrix) {
return $rows; return $rows;
@ -234,7 +231,7 @@ class LookupRef
reset($cellAddress); reset($cellAddress);
$isMatrix = (is_numeric(key($cellAddress))); $isMatrix = (is_numeric(key($cellAddress)));
list($columns, $rows) = \PHPExcel\Calculation::_getMatrixDimensions($cellAddress); list($columns, $rows) = \PhpSpreadsheet\Calculation::_getMatrixDimensions($cellAddress);
if ($isMatrix) { if ($isMatrix) {
return $columns; return $columns;
@ -254,10 +251,10 @@ class LookupRef
* @category Logical Functions * @category Logical Functions
* @param string $linkURL Value to check, is also the value returned when no error * @param string $linkURL Value to check, is also the value returned when no error
* @param string $displayName Value to return when testValue is an error condition * @param string $displayName Value to return when testValue is an error condition
* @param \PHPExcel\Cell $pCell The cell to set the hyperlink in * @param \PhpSpreadsheet\Cell $pCell The cell to set the hyperlink in
* @return mixed The value of $displayName (or $linkURL if $displayName was blank) * @return mixed The value of $displayName (or $linkURL if $displayName was blank)
*/ */
public static function HYPERLINK($linkURL = '', $displayName = null, \PHPExcel\Cell $pCell = null) public static function HYPERLINK($linkURL = '', $displayName = null, \PhpSpreadsheet\Cell $pCell = null)
{ {
$args = func_get_args(); $args = func_get_args();
$pCell = array_pop($args); $pCell = array_pop($args);
@ -292,13 +289,13 @@ class LookupRef
* NOTE - INDIRECT() does not yet support the optional a1 parameter introduced in Excel 2010 * NOTE - INDIRECT() does not yet support the optional a1 parameter introduced in Excel 2010
* *
* @param cellAddress $cellAddress The cell address of the current cell (containing this formula) * @param cellAddress $cellAddress The cell address of the current cell (containing this formula)
* @param \PHPExcel\Cell $pCell The current cell (containing this formula) * @param \PhpSpreadsheet\Cell $pCell The current cell (containing this formula)
* @return mixed The cells referenced by cellAddress * @return mixed The cells referenced by cellAddress
* *
* @todo Support for the optional a1 parameter introduced in Excel 2010 * @todo Support for the optional a1 parameter introduced in Excel 2010
* *
*/ */
public static function INDIRECT($cellAddress = null, \PHPExcel\Cell $pCell = null) public static function INDIRECT($cellAddress = null, \PhpSpreadsheet\Cell $pCell = null)
{ {
$cellAddress = Functions::flattenSingleValue($cellAddress); $cellAddress = Functions::flattenSingleValue($cellAddress);
if (is_null($cellAddress) || $cellAddress === '') { if (is_null($cellAddress) || $cellAddress === '') {
@ -311,9 +308,9 @@ class LookupRef
list($cellAddress1, $cellAddress2) = explode(':', $cellAddress); list($cellAddress1, $cellAddress2) = explode(':', $cellAddress);
} }
if ((!preg_match('/^'.\PHPExcel\Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress1, $matches)) || if ((!preg_match('/^'.\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress1, $matches)) ||
((!is_null($cellAddress2)) && (!preg_match('/^'.\PHPExcel\Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress2, $matches)))) { ((!is_null($cellAddress2)) && (!preg_match('/^'.\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress2, $matches)))) {
if (!preg_match('/^'.\PHPExcel\Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $cellAddress1, $matches)) { if (!preg_match('/^'.\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $cellAddress1, $matches)) {
return Functions::REF(); return Functions::REF();
} }
@ -325,7 +322,7 @@ class LookupRef
$pSheet = $pCell->getWorksheet(); $pSheet = $pCell->getWorksheet();
} }
return \PHPExcel\Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, false); return \PhpSpreadsheet\Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, false);
} }
if (strpos($cellAddress, '!') !== false) { if (strpos($cellAddress, '!') !== false) {
@ -336,7 +333,7 @@ class LookupRef
$pSheet = $pCell->getWorksheet(); $pSheet = $pCell->getWorksheet();
} }
return \PHPExcel\Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false); return \PhpSpreadsheet\Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false);
} }
@ -391,23 +388,23 @@ class LookupRef
} else { } else {
$startCell = $endCell = $cellAddress; $startCell = $endCell = $cellAddress;
} }
list($startCellColumn, $startCellRow) = \PHPExcel\Cell::coordinateFromString($startCell); list($startCellColumn, $startCellRow) = \PhpSpreadsheet\Cell::coordinateFromString($startCell);
list($endCellColumn, $endCellRow) = \PHPExcel\Cell::coordinateFromString($endCell); list($endCellColumn, $endCellRow) = \PhpSpreadsheet\Cell::coordinateFromString($endCell);
$startCellRow += $rows; $startCellRow += $rows;
$startCellColumn = \PHPExcel\Cell::columnIndexFromString($startCellColumn) - 1; $startCellColumn = \PhpSpreadsheet\Cell::columnIndexFromString($startCellColumn) - 1;
$startCellColumn += $columns; $startCellColumn += $columns;
if (($startCellRow <= 0) || ($startCellColumn < 0)) { if (($startCellRow <= 0) || ($startCellColumn < 0)) {
return Functions::REF(); return Functions::REF();
} }
$endCellColumn = \PHPExcel\Cell::columnIndexFromString($endCellColumn) - 1; $endCellColumn = \PhpSpreadsheet\Cell::columnIndexFromString($endCellColumn) - 1;
if (($width != null) && (!is_object($width))) { if (($width != null) && (!is_object($width))) {
$endCellColumn = $startCellColumn + $width - 1; $endCellColumn = $startCellColumn + $width - 1;
} else { } else {
$endCellColumn += $columns; $endCellColumn += $columns;
} }
$startCellColumn = \PHPExcel\Cell::stringFromColumnIndex($startCellColumn); $startCellColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCellColumn);
if (($height != null) && (!is_object($height))) { if (($height != null) && (!is_object($height))) {
$endCellRow = $startCellRow + $height - 1; $endCellRow = $startCellRow + $height - 1;
@ -418,7 +415,7 @@ class LookupRef
if (($endCellRow <= 0) || ($endCellColumn < 0)) { if (($endCellRow <= 0) || ($endCellColumn < 0)) {
return Functions::REF(); return Functions::REF();
} }
$endCellColumn = \PHPExcel\Cell::stringFromColumnIndex($endCellColumn); $endCellColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex($endCellColumn);
$cellAddress = $startCellColumn.$startCellRow; $cellAddress = $startCellColumn.$startCellRow;
if (($startCellColumn != $endCellColumn) || ($startCellRow != $endCellRow)) { if (($startCellColumn != $endCellColumn) || ($startCellRow != $endCellRow)) {
@ -431,7 +428,7 @@ class LookupRef
$pSheet = $pCell->getWorksheet(); $pSheet = $pCell->getWorksheet();
} }
return \PHPExcel\Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false); return \PhpSpreadsheet\Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false);
} }

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** /**
* PHPExcel_Calculation_MathTrig * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Calculation;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -556,9 +553,9 @@ class MathTrig
} }
try { try {
$matrix = new \PHPExcel\Shared\JAMA\Matrix($matrixData); $matrix = new \PhpSpreadsheet\Shared\JAMA\Matrix($matrixData);
return $matrix->det(); return $matrix->det();
} catch (\PHPExcel\Exception $ex) { } catch (\PhpSpreadsheet\Exception $ex) {
return Functions::VALUE(); return Functions::VALUE();
} }
} }
@ -609,9 +606,9 @@ class MathTrig
} }
try { try {
$matrix = new \PHPExcel\Shared\JAMA\Matrix($matrixData); $matrix = new \PhpSpreadsheet\Shared\JAMA\Matrix($matrixData);
return $matrix->inverse()->getArray(); return $matrix->inverse()->getArray();
} catch (\PHPExcel\Exception $ex) { } catch (\PhpSpreadsheet\Exception $ex) {
return Functions::VALUE(); return Functions::VALUE();
} }
} }
@ -650,7 +647,7 @@ class MathTrig
} }
++$rowA; ++$rowA;
} }
$matrixA = new \PHPExcel\Shared\JAMA\Matrix($matrixAData); $matrixA = new \PhpSpreadsheet\Shared\JAMA\Matrix($matrixAData);
$rowB = 0; $rowB = 0;
foreach ($matrixData2 as $matrixRow) { foreach ($matrixData2 as $matrixRow) {
if (!is_array($matrixRow)) { if (!is_array($matrixRow)) {
@ -666,14 +663,14 @@ class MathTrig
} }
++$rowB; ++$rowB;
} }
$matrixB = new \PHPExcel\Shared\JAMA\Matrix($matrixBData); $matrixB = new \PhpSpreadsheet\Shared\JAMA\Matrix($matrixBData);
if ($columnA != $rowB) { if ($columnA != $rowB) {
return Functions::VALUE(); return Functions::VALUE();
} }
return $matrixA->times($matrixB)->getArray(); return $matrixA->times($matrixB)->getArray();
} catch (\PHPExcel\Exception $ex) { } catch (\PhpSpreadsheet\Exception $ex) {
var_dump($ex->getMessage()); var_dump($ex->getMessage());
return Functions::VALUE(); return Functions::VALUE();
} }
@ -1201,11 +1198,11 @@ class MathTrig
foreach ($aArgs as $key => $arg) { foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) { if (!is_numeric($arg)) {
$arg = str_replace('"', '""', $arg); $arg = str_replace('"', '""', $arg);
$arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg)); $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
} }
$testCondition = '='.$arg.$condition; $testCondition = '='.$arg.$condition;
if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
// Is it a value within our criteria // Is it a value within our criteria
$returnValue += $sumArgs[$key]; $returnValue += $sumArgs[$key];
} }
@ -1249,10 +1246,10 @@ class MathTrig
// Loop through arguments // Loop through arguments
foreach ($aArgs as $key => $arg) { foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) { if (!is_numeric($arg)) {
$arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg)); $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
} }
$testCondition = '='.$arg.$condition; $testCondition = '='.$arg.$condition;
if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
// Is it a value within our criteria // Is it a value within our criteria
$returnValue += $sumArgs[$key]; $returnValue += $sumArgs[$key];
} }

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** LOG_GAMMA_X_MAX_VALUE */ /** LOG_GAMMA_X_MAX_VALUE */
define('LOG_GAMMA_X_MAX_VALUE', 2.55e305); define('LOG_GAMMA_X_MAX_VALUE', 2.55e305);
@ -15,9 +15,7 @@ define('EPS', 2.22e-16);
define('SQRT2PI', 2.5066282746310005024157652848110452530069867406099); define('SQRT2PI', 2.5066282746310005024157652848110452530069867406099);
/** /**
* PHPExcel_Calculation_Statistical * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -33,9 +31,8 @@ define('SQRT2PI', 2.5066282746310005024157652848110452530069867406099);
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -866,10 +863,10 @@ class Statistical
$aCount = 0; $aCount = 0;
foreach ($aArgs as $key => $arg) { foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) { if (!is_numeric($arg)) {
$arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg)); $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
} }
$testCondition = '='.$arg.$condition; $testCondition = '='.$arg.$condition;
if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
if ((is_null($returnValue)) || ($arg > $returnValue)) { if ((is_null($returnValue)) || ($arg > $returnValue)) {
$returnValue += $arg; $returnValue += $arg;
++$aCount; ++$aCount;
@ -1165,7 +1162,7 @@ class Statistical
return Functions::DIV0(); return Functions::DIV0();
} }
$bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues);
return $bestFitLinear->getCorrelation(); return $bestFitLinear->getCorrelation();
} }
@ -1287,10 +1284,10 @@ class Statistical
// Loop through arguments // Loop through arguments
foreach ($aArgs as $arg) { foreach ($aArgs as $arg) {
if (!is_numeric($arg)) { if (!is_numeric($arg)) {
$arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg)); $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
} }
$testCondition = '='.$arg.$condition; $testCondition = '='.$arg.$condition;
if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
// Is it a value within our criteria // Is it a value within our criteria
++$returnValue; ++$returnValue;
} }
@ -1323,7 +1320,7 @@ class Statistical
return Functions::DIV0(); return Functions::DIV0();
} }
$bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues);
return $bestFitLinear->getCovariance(); return $bestFitLinear->getCovariance();
} }
@ -1609,7 +1606,7 @@ class Statistical
return Functions::DIV0(); return Functions::DIV0();
} }
$bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues);
return $bestFitLinear->getValueOfYForX($xValue); return $bestFitLinear->getValueOfYForX($xValue);
} }
@ -1780,7 +1777,7 @@ class Statistical
$newValues = Functions::flattenArray($newValues); $newValues = Functions::flattenArray($newValues);
$const = (is_null($const)) ? true : (boolean) Functions::flattenSingleValue($const); $const = (is_null($const)) ? true : (boolean) Functions::flattenSingleValue($const);
$bestFitExponential = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_EXPONENTIAL, $yValues, $xValues, $const); $bestFitExponential = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_EXPONENTIAL, $yValues, $xValues, $const);
if (empty($newValues)) { if (empty($newValues)) {
$newValues = $bestFitExponential->getXValues(); $newValues = $bestFitExponential->getXValues();
} }
@ -1904,7 +1901,7 @@ class Statistical
return Functions::DIV0(); return Functions::DIV0();
} }
$bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues);
return $bestFitLinear->getIntersect(); return $bestFitLinear->getIntersect();
} }
@ -2026,7 +2023,7 @@ class Statistical
return 0; return 0;
} }
$bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues, $const); $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues, $const);
if ($stats) { if ($stats) {
return array( return array(
array( array(
@ -2092,7 +2089,7 @@ class Statistical
return 1; return 1;
} }
$bestFitExponential = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_EXPONENTIAL, $yValues, $xValues, $const); $bestFitExponential = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_EXPONENTIAL, $yValues, $xValues, $const);
if ($stats) { if ($stats) {
return array( return array(
array( array(
@ -2279,10 +2276,10 @@ class Statistical
// Loop through arguments // Loop through arguments
foreach ($aArgs as $key => $arg) { foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) { if (!is_numeric($arg)) {
$arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg)); $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
} }
$testCondition = '='.$arg.$condition; $testCondition = '='.$arg.$condition;
if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
if ((is_null($returnValue)) || ($arg > $returnValue)) { if ((is_null($returnValue)) || ($arg > $returnValue)) {
$returnValue = $arg; $returnValue = $arg;
} }
@ -2438,10 +2435,10 @@ class Statistical
// Loop through arguments // Loop through arguments
foreach ($aArgs as $key => $arg) { foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) { if (!is_numeric($arg)) {
$arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg)); $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
} }
$testCondition = '='.$arg.$condition; $testCondition = '='.$arg.$condition;
if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
if ((is_null($returnValue)) || ($arg < $returnValue)) { if ((is_null($returnValue)) || ($arg < $returnValue)) {
$returnValue = $arg; $returnValue = $arg;
} }
@ -2917,7 +2914,7 @@ class Statistical
return Functions::DIV0(); return Functions::DIV0();
} }
$bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues);
return $bestFitLinear->getGoodnessOfFit(); return $bestFitLinear->getGoodnessOfFit();
} }
@ -2983,7 +2980,7 @@ class Statistical
return Functions::DIV0(); return Functions::DIV0();
} }
$bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues);
return $bestFitLinear->getSlope(); return $bestFitLinear->getSlope();
} }
@ -3276,7 +3273,7 @@ class Statistical
return Functions::DIV0(); return Functions::DIV0();
} }
$bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues);
return $bestFitLinear->getStdevOfResiduals(); return $bestFitLinear->getStdevOfResiduals();
} }
@ -3419,7 +3416,7 @@ class Statistical
$newValues = Functions::flattenArray($newValues); $newValues = Functions::flattenArray($newValues);
$const = (is_null($const)) ? true : (boolean) Functions::flattenSingleValue($const); $const = (is_null($const)) ? true : (boolean) Functions::flattenSingleValue($const);
$bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues, $const); $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues, $const);
if (empty($newValues)) { if (empty($newValues)) {
$newValues = $bestFitLinear->getXValues(); $newValues = $bestFitLinear->getXValues();
} }

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Calculation; namespace PhpSpreadsheet\Calculation;
/** /**
* PHPExcel_Calculation_TextData * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Calculation;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -85,7 +82,7 @@ class TextData
$stringValue = Functions::flattenSingleValue($stringValue); $stringValue = Functions::flattenSingleValue($stringValue);
if (is_bool($stringValue)) { if (is_bool($stringValue)) {
return ($stringValue) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); return ($stringValue) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
} }
if (self::$invalidChars == null) { if (self::$invalidChars == null) {
@ -109,7 +106,7 @@ class TextData
{ {
$stringValue = Functions::flattenSingleValue($stringValue); $stringValue = Functions::flattenSingleValue($stringValue);
if (is_bool($stringValue)) { if (is_bool($stringValue)) {
return ($stringValue) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); return ($stringValue) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
} }
if (is_string($stringValue) || is_numeric($stringValue)) { if (is_string($stringValue) || is_numeric($stringValue)) {
@ -135,7 +132,7 @@ class TextData
if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) { if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
$characters = (int) $characters; $characters = (int) $characters;
} else { } else {
$characters = ($characters) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); $characters = ($characters) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
} }
} }
@ -170,7 +167,7 @@ class TextData
if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) { if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
$arg = (int) $arg; $arg = (int) $arg;
} else { } else {
$arg = ($arg) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); $arg = ($arg) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
} }
} }
$returnValue .= $arg; $returnValue .= $arg;
@ -214,7 +211,7 @@ class TextData
$value = MathTrig::MROUND($value, $round); $value = MathTrig::MROUND($value, $round);
} }
return \PHPExcel\Style\NumberFormat::toFormattedString($value, $mask); return \PhpSpreadsheet\Style\NumberFormat::toFormattedString($value, $mask);
} }
@ -234,11 +231,11 @@ class TextData
if (!is_bool($needle)) { if (!is_bool($needle)) {
if (is_bool($haystack)) { if (is_bool($haystack)) {
$haystack = ($haystack) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); $haystack = ($haystack) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
} }
if (($offset > 0) && (\PHPExcel\Shared\StringHelper::countCharacters($haystack) > $offset)) { if (($offset > 0) && (\PhpSpreadsheet\Shared\StringHelper::countCharacters($haystack) > $offset)) {
if (\PHPExcel\Shared\StringHelper::countCharacters($needle) == 0) { if (\PhpSpreadsheet\Shared\StringHelper::countCharacters($needle) == 0) {
return $offset; return $offset;
} }
if (function_exists('mb_strpos')) { if (function_exists('mb_strpos')) {
@ -271,11 +268,11 @@ class TextData
if (!is_bool($needle)) { if (!is_bool($needle)) {
if (is_bool($haystack)) { if (is_bool($haystack)) {
$haystack = ($haystack) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); $haystack = ($haystack) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
} }
if (($offset > 0) && (\PHPExcel\Shared\StringHelper::countCharacters($haystack) > $offset)) { if (($offset > 0) && (\PhpSpreadsheet\Shared\StringHelper::countCharacters($haystack) > $offset)) {
if (\PHPExcel\Shared\StringHelper::countCharacters($needle) == 0) { if (\PhpSpreadsheet\Shared\StringHelper::countCharacters($needle) == 0) {
return $offset; return $offset;
} }
if (function_exists('mb_stripos')) { if (function_exists('mb_stripos')) {
@ -341,7 +338,7 @@ class TextData
} }
if (is_bool($value)) { if (is_bool($value)) {
$value = ($value) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); $value = ($value) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
} }
if (function_exists('mb_substr')) { if (function_exists('mb_substr')) {
@ -371,7 +368,7 @@ class TextData
} }
if (is_bool($value)) { if (is_bool($value)) {
$value = ($value) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); $value = ($value) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
} }
if (empty($chars)) { if (empty($chars)) {
@ -402,7 +399,7 @@ class TextData
} }
if (is_bool($value)) { if (is_bool($value)) {
$value = ($value) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); $value = ($value) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
} }
if ((function_exists('mb_substr')) && (function_exists('mb_strlen'))) { if ((function_exists('mb_substr')) && (function_exists('mb_strlen'))) {
@ -424,7 +421,7 @@ class TextData
$value = Functions::flattenSingleValue($value); $value = Functions::flattenSingleValue($value);
if (is_bool($value)) { if (is_bool($value)) {
$value = ($value) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); $value = ($value) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
} }
if (function_exists('mb_strlen')) { if (function_exists('mb_strlen')) {
@ -448,10 +445,10 @@ class TextData
$mixedCaseString = Functions::flattenSingleValue($mixedCaseString); $mixedCaseString = Functions::flattenSingleValue($mixedCaseString);
if (is_bool($mixedCaseString)) { if (is_bool($mixedCaseString)) {
$mixedCaseString = ($mixedCaseString) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); $mixedCaseString = ($mixedCaseString) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
} }
return \PHPExcel\Shared\StringHelper::strToLower($mixedCaseString); return \PhpSpreadsheet\Shared\StringHelper::strToLower($mixedCaseString);
} }
@ -468,10 +465,10 @@ class TextData
$mixedCaseString = Functions::flattenSingleValue($mixedCaseString); $mixedCaseString = Functions::flattenSingleValue($mixedCaseString);
if (is_bool($mixedCaseString)) { if (is_bool($mixedCaseString)) {
$mixedCaseString = ($mixedCaseString) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); $mixedCaseString = ($mixedCaseString) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
} }
return \PHPExcel\Shared\StringHelper::strToUpper($mixedCaseString); return \PhpSpreadsheet\Shared\StringHelper::strToUpper($mixedCaseString);
} }
@ -488,10 +485,10 @@ class TextData
$mixedCaseString = Functions::flattenSingleValue($mixedCaseString); $mixedCaseString = Functions::flattenSingleValue($mixedCaseString);
if (is_bool($mixedCaseString)) { if (is_bool($mixedCaseString)) {
$mixedCaseString = ($mixedCaseString) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); $mixedCaseString = ($mixedCaseString) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
} }
return \PHPExcel\Shared\StringHelper::strToTitle($mixedCaseString); return \PhpSpreadsheet\Shared\StringHelper::strToTitle($mixedCaseString);
} }
@ -595,11 +592,11 @@ class TextData
$value = Functions::flattenSingleValue($value); $value = Functions::flattenSingleValue($value);
$format = Functions::flattenSingleValue($format); $format = Functions::flattenSingleValue($format);
if ((is_string($value)) && (!is_numeric($value)) && \PHPExcel\Shared\Date::isDateTimeFormatCode($format)) { if ((is_string($value)) && (!is_numeric($value)) && \PhpSpreadsheet\Shared\Date::isDateTimeFormatCode($format)) {
$value = DateTime::DATEVALUE($value); $value = DateTime::DATEVALUE($value);
} }
return (string) \PHPExcel\Style\NumberFormat::toFormattedString($value, $format); return (string) \PhpSpreadsheet\Style\NumberFormat::toFormattedString($value, $format);
} }
/** /**
@ -614,9 +611,9 @@ class TextData
if (!is_numeric($value)) { if (!is_numeric($value)) {
$numberValue = str_replace( $numberValue = str_replace(
\PHPExcel\Shared\StringHelper::getThousandsSeparator(), \PhpSpreadsheet\Shared\StringHelper::getThousandsSeparator(),
'', '',
trim($value, " \t\n\r\0\x0B" . \PHPExcel\Shared\StringHelper::getCurrencyCode()) trim($value, " \t\n\r\0\x0B" . \PhpSpreadsheet\Shared\StringHelper::getCurrencyCode())
); );
if (is_numeric($numberValue)) { if (is_numeric($numberValue)) {
return (float) $numberValue; return (float) $numberValue;

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Calculation\Token; namespace PhpSpreadsheet\Calculation\Token;
/** /**
* PHPExcel_Calculation_Token_Stack * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Calculation\Token;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Calculation * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -68,7 +65,7 @@ class Stack
'reference' => $reference 'reference' => $reference
); );
if ($type == 'Function') { if ($type == 'Function') {
$localeFunction = \PHPExcel\Calculation::localeFunc($value); $localeFunction = \PhpSpreadsheet\Calculation::localeFunc($value);
if ($localeFunction != $value) { if ($localeFunction != $value) {
$this->stack[($this->count - 1)]['localeValue'] = $localeFunction; $this->stack[($this->count - 1)]['localeValue'] = $localeFunction;
} }

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel; namespace PhpSpreadsheet;
/** /**
* PHPExcel_Cell * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Cell * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -961,7 +958,7 @@ class Cell
public static function setValueBinder(Cell\IValueBinder $binder = null) public static function setValueBinder(Cell\IValueBinder $binder = null)
{ {
if ($binder === null) { if ($binder === null) {
throw new Exception("A \\PHPExcel\\Cell\\IValueBinder is required for PHPExcel to function correctly."); throw new Exception("A \\PhpSpreadsheet\\Cell\\IValueBinder is required for PhpSpreadsheet to function correctly.");
} }
self::$valueBinder = $binder; self::$valueBinder = $binder;

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Cell; namespace PhpSpreadsheet\Cell;
/** /**
* PHPExcel_Cell_AdvancedValueBinder * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Cell;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Cell * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -32,33 +29,33 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
/** /**
* Bind value to a cell * Bind value to a cell
* *
* @param \PHPExcel\Cell $cell Cell to bind value to * @param \PhpSpreadsheet\Cell $cell Cell to bind value to
* @param mixed $value Value to bind in cell * @param mixed $value Value to bind in cell
* @return boolean * @return boolean
*/ */
public function bindValue(\PHPExcel\Cell $cell, $value = null) public function bindValue(\PhpSpreadsheet\Cell $cell, $value = null)
{ {
// sanitize UTF-8 strings // sanitize UTF-8 strings
if (is_string($value)) { if (is_string($value)) {
$value = \PHPExcel\Shared\StringHelper::sanitizeUTF8($value); $value = \PhpSpreadsheet\Shared\StringHelper::sanitizeUTF8($value);
} }
// Find out data type // Find out data type
$dataType = parent::dataTypeForValue($value); $dataType = parent::dataTypeForValue($value);
// Style logic - strings // Style logic - strings
if ($dataType === DataType::TYPE_STRING && !$value instanceof \PHPExcel\RichText) { if ($dataType === DataType::TYPE_STRING && !$value instanceof \PhpSpreadsheet\RichText) {
// Test for booleans using locale-setting // Test for booleans using locale-setting
if ($value == \PHPExcel\Calculation::getTRUE()) { if ($value == \PhpSpreadsheet\Calculation::getTRUE()) {
$cell->setValueExplicit(true, DataType::TYPE_BOOL); $cell->setValueExplicit(true, DataType::TYPE_BOOL);
return true; return true;
} elseif ($value == \PHPExcel\Calculation::getFALSE()) { } elseif ($value == \PhpSpreadsheet\Calculation::getFALSE()) {
$cell->setValueExplicit(false, DataType::TYPE_BOOL); $cell->setValueExplicit(false, DataType::TYPE_BOOL);
return true; return true;
} }
// Check for number in scientific format // Check for number in scientific format
if (preg_match('/^'.\PHPExcel\Calculation::CALCULATION_REGEXP_NUMBER.'$/', $value)) { if (preg_match('/^'.\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_NUMBER.'$/', $value)) {
$cell->setValueExplicit((float) $value, DataType::TYPE_NUMERIC); $cell->setValueExplicit((float) $value, DataType::TYPE_NUMERIC);
return true; return true;
} }
@ -95,14 +92,14 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
$cell->setValueExplicit($value, DataType::TYPE_NUMERIC); $cell->setValueExplicit($value, DataType::TYPE_NUMERIC);
// Set style // Set style
$cell->getWorksheet()->getStyle($cell->getCoordinate()) $cell->getWorksheet()->getStyle($cell->getCoordinate())
->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_PERCENTAGE_00); ->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_PERCENTAGE_00);
return true; return true;
} }
// Check for currency // Check for currency
$currencyCode = \PHPExcel\Shared\StringHelper::getCurrencyCode(); $currencyCode = \PhpSpreadsheet\Shared\StringHelper::getCurrencyCode();
$decimalSeparator = \PHPExcel\Shared\StringHelper::getDecimalSeparator(); $decimalSeparator = \PhpSpreadsheet\Shared\StringHelper::getDecimalSeparator();
$thousandsSeparator = \PHPExcel\Shared\StringHelper::getThousandsSeparator(); $thousandsSeparator = \PhpSpreadsheet\Shared\StringHelper::getThousandsSeparator();
if (preg_match('/^'.preg_quote($currencyCode).' *(\d{1,3}('.preg_quote($thousandsSeparator).'\d{3})*|(\d+))('.preg_quote($decimalSeparator).'\d{2})?$/', $value)) { if (preg_match('/^'.preg_quote($currencyCode).' *(\d{1,3}('.preg_quote($thousandsSeparator).'\d{3})*|(\d+))('.preg_quote($decimalSeparator).'\d{2})?$/', $value)) {
// Convert value to number // Convert value to number
$value = (float) trim(str_replace(array($currencyCode, $thousandsSeparator, $decimalSeparator), array('', '', '.'), $value)); $value = (float) trim(str_replace(array($currencyCode, $thousandsSeparator, $decimalSeparator), array('', '', '.'), $value));
@ -110,7 +107,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
// Set style // Set style
$cell->getWorksheet()->getStyle($cell->getCoordinate()) $cell->getWorksheet()->getStyle($cell->getCoordinate())
->getNumberFormat()->setFormatCode( ->getNumberFormat()->setFormatCode(
str_replace('$', $currencyCode, \PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE) str_replace('$', $currencyCode, \PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE)
); );
return true; return true;
} elseif (preg_match('/^\$ *(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/', $value)) { } elseif (preg_match('/^\$ *(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/', $value)) {
@ -119,7 +116,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
$cell->setValueExplicit($value, DataType::TYPE_NUMERIC); $cell->setValueExplicit($value, DataType::TYPE_NUMERIC);
// Set style // Set style
$cell->getWorksheet()->getStyle($cell->getCoordinate()) $cell->getWorksheet()->getStyle($cell->getCoordinate())
->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE); ->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);
return true; return true;
} }
@ -131,7 +128,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
$cell->setValueExplicit($days, DataType::TYPE_NUMERIC); $cell->setValueExplicit($days, DataType::TYPE_NUMERIC);
// Set style // Set style
$cell->getWorksheet()->getStyle($cell->getCoordinate()) $cell->getWorksheet()->getStyle($cell->getCoordinate())
->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME3); ->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME3);
return true; return true;
} }
@ -144,12 +141,12 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
$cell->setValueExplicit($days, DataType::TYPE_NUMERIC); $cell->setValueExplicit($days, DataType::TYPE_NUMERIC);
// Set style // Set style
$cell->getWorksheet()->getStyle($cell->getCoordinate()) $cell->getWorksheet()->getStyle($cell->getCoordinate())
->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4); ->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4);
return true; return true;
} }
// Check for datetime, e.g. '2008-12-31', '2008-12-31 15:59', '2008-12-31 15:59:10' // Check for datetime, e.g. '2008-12-31', '2008-12-31 15:59', '2008-12-31 15:59:10'
if (($d = \PHPExcel\Shared\Date::stringToExcel($value)) !== false) { if (($d = \PhpSpreadsheet\Shared\Date::stringToExcel($value)) !== false) {
// Convert value to number // Convert value to number
$cell->setValueExplicit($d, DataType::TYPE_NUMERIC); $cell->setValueExplicit($d, DataType::TYPE_NUMERIC);
// Determine style. Either there is a time part or not. Look for ':' // Determine style. Either there is a time part or not. Look for ':'
@ -165,7 +162,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
// Check for newline character "\n" // Check for newline character "\n"
if (strpos($value, "\n") !== false) { if (strpos($value, "\n") !== false) {
$value = \PHPExcel\Shared\StringHelper::sanitizeUTF8($value); $value = \PhpSpreadsheet\Shared\StringHelper::sanitizeUTF8($value);
$cell->setValueExplicit($value, DataType::TYPE_STRING); $cell->setValueExplicit($value, DataType::TYPE_STRING);
// Set style // Set style
$cell->getWorksheet()->getStyle($cell->getCoordinate()) $cell->getWorksheet()->getStyle($cell->getCoordinate())

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Cell; namespace PhpSpreadsheet\Cell;
/** /**
* PHPExcel_Cell_DataType * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Cell;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Cell * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -67,7 +64,7 @@ class DataType
/** /**
* DataType for value * DataType for value
* *
* @deprecated Replaced by \PHPExcel\Cell\IValueBinder infrastructure, will be removed in version 1.8.0 * @deprecated Replaced by \PhpSpreadsheet\Cell\IValueBinder infrastructure, will be removed in version 1.8.0
* @param mixed $pValue * @param mixed $pValue
* @return string * @return string
*/ */
@ -84,13 +81,13 @@ class DataType
*/ */
public static function checkString($pValue = null) public static function checkString($pValue = null)
{ {
if ($pValue instanceof \PHPExcel\RichText) { if ($pValue instanceof \PhpSpreadsheet\RichText) {
// TODO: Sanitize Rich-Text string (max. character count is 32,767) // TODO: Sanitize Rich-Text string (max. character count is 32,767)
return $pValue; return $pValue;
} }
// string must never be longer than 32,767 characters, truncate if necessary // string must never be longer than 32,767 characters, truncate if necessary
$pValue = \PHPExcel\Shared\StringHelper::substring($pValue, 0, 32767); $pValue = \PhpSpreadsheet\Shared\StringHelper::substring($pValue, 0, 32767);
// we require that newline is represented as "\n" in core, not as "\r\n" or "\r" // we require that newline is represented as "\n" in core, not as "\r\n" or "\r"
$pValue = str_replace(array("\r\n", "\r"), "\n", $pValue); $pValue = str_replace(array("\r\n", "\r"), "\n", $pValue);

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Cell; namespace PhpSpreadsheet\Cell;
/** /**
* PHPExcel_Cell_DataValidation * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Cell;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Cell * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Cell; namespace PhpSpreadsheet\Cell;
/** /**
* PHPExcel_Cell_DefaultValueBinder * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Cell;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Cell * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -32,20 +29,20 @@ class DefaultValueBinder implements IValueBinder
/** /**
* Bind value to a cell * Bind value to a cell
* *
* @param \PHPExcel\Cell $cell Cell to bind value to * @param \PhpSpreadsheet\Cell $cell Cell to bind value to
* @param mixed $value Value to bind in cell * @param mixed $value Value to bind in cell
* @return boolean * @return boolean
*/ */
public function bindValue(\PHPExcel\Cell $cell, $value = null) public function bindValue(\PhpSpreadsheet\Cell $cell, $value = null)
{ {
// sanitize UTF-8 strings // sanitize UTF-8 strings
if (is_string($value)) { if (is_string($value)) {
$value = \PHPExcel\Shared\StringHelper::sanitizeUTF8($value); $value = \PhpSpreadsheet\Shared\StringHelper::sanitizeUTF8($value);
} elseif (is_object($value)) { } elseif (is_object($value)) {
// Handle any objects that might be injected // Handle any objects that might be injected
if ($value instanceof \DateTime) { if ($value instanceof \DateTime) {
$value = $value->format('Y-m-d H:i:s'); $value = $value->format('Y-m-d H:i:s');
} elseif (!($value instanceof \PHPExcel\RichText)) { } elseif (!($value instanceof \PhpSpreadsheet\RichText)) {
$value = (string) $value; $value = (string) $value;
} }
} }
@ -70,7 +67,7 @@ class DefaultValueBinder implements IValueBinder
return DataType::TYPE_NULL; return DataType::TYPE_NULL;
} elseif ($pValue === '') { } elseif ($pValue === '') {
return DataType::TYPE_STRING; return DataType::TYPE_STRING;
} elseif ($pValue instanceof \PHPExcel\RichText) { } elseif ($pValue instanceof \PhpSpreadsheet\RichText) {
return DataType::TYPE_INLINE; return DataType::TYPE_INLINE;
} elseif ($pValue{0} === '=' && strlen($pValue) > 1) { } elseif ($pValue{0} === '=' && strlen($pValue) > 1) {
return DataType::TYPE_FORMULA; return DataType::TYPE_FORMULA;

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Cell; namespace PhpSpreadsheet\Cell;
/** /**
* PHPExcel_Cell_Hyperlink * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Cell;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Cell * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Cell; namespace PhpSpreadsheet\Cell;
/** /**
* PHPExcel_Cell_IValueBinder * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Cell;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Cell * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -32,9 +29,9 @@ interface IValueBinder
/** /**
* Bind value to a cell * Bind value to a cell
* *
* @param \PHPExcel\Cell $cell Cell to bind value to * @param \PhpSpreadsheet\Cell $cell Cell to bind value to
* @param mixed $value Value to bind in cell * @param mixed $value Value to bind in cell
* @return boolean * @return boolean
*/ */
public function bindValue(\PHPExcel\Cell $cell, $value = null); public function bindValue(\PhpSpreadsheet\Cell $cell, $value = null);
} }

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel; namespace PhpSpreadsheet;
/** /**
* PHPExcel_Chart * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Chart * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -671,7 +668,7 @@ class Chart
set_include_path(get_include_path() . PATH_SEPARATOR . $libraryPath); set_include_path(get_include_path() . PATH_SEPARATOR . $libraryPath);
} }
$rendererName = '\\PHPExcel\\Chart\\Renderer\\'.$libraryName; $rendererName = '\\PhpSpreadsheet\\Chart\\Renderer\\'.$libraryName;
$renderer = new $rendererName($this); $renderer = new $rendererName($this);
if ($outputDestination == 'php://output') { if ($outputDestination == 'php://output') {

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PHPExcel\Chart; namespace PhpSpreadsheet\Chart;
/** /**
* Created by PhpStorm. * Created by PhpStorm.

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Chart; namespace PhpSpreadsheet\Chart;
/** /**
* PHPExcel_Chart_DataSeries * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Chart;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Chart * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -148,7 +145,7 @@ class DataSeries
$this->plotCategory = $plotCategory; $this->plotCategory = $plotCategory;
$this->smoothLine = $smoothLine; $this->smoothLine = $smoothLine;
$this->plotStyle = $plotStyle; $this->plotStyle = $plotStyle;
if (is_null($plotDirection)) { if (is_null($plotDirection)) {
$plotDirection = self::DIRECTION_COL; $plotDirection = self::DIRECTION_COL;
} }
@ -363,7 +360,7 @@ class DataSeries
return $this; return $this;
} }
public function refresh(\PHPExcel\Worksheet $worksheet) public function refresh(\PhpSpreadsheet\Worksheet $worksheet)
{ {
foreach ($this->plotValues as $plotValues) { foreach ($this->plotValues as $plotValues) {
if ($plotValues !== null) { if ($plotValues !== null) {

View File

@ -1,11 +1,11 @@
<?php <?php
namespace PHPExcel\Chart; namespace PhpSpreadsheet\Chart;
/** /**
* \PHPExcel\Chart\DataSeriesValues * \PhpSpreadsheet\Chart\DataSeriesValues
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2016 PhpSpreadsheet
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +21,8 @@ namespace PHPExcel\Chart;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Chart * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -108,9 +107,9 @@ class DataSeriesValues
* *
* @param string $dataType Datatype of this data series * @param string $dataType Datatype of this data series
* Typical values are: * Typical values are:
* \PHPExcel\Chart\DataSeriesValues::DATASERIES_TYPE_STRING * \PhpSpreadsheet\Chart\DataSeriesValues::DATASERIES_TYPE_STRING
* Normally used for axis point values * Normally used for axis point values
* \PHPExcel\Chart\DataSeriesValues::DATASERIES_TYPE_NUMBER * \PhpSpreadsheet\Chart\DataSeriesValues::DATASERIES_TYPE_NUMBER
* Normally used for chart data values * Normally used for chart data values
* @return DataSeriesValues * @return DataSeriesValues
* @throws Exception * @throws Exception
@ -272,7 +271,7 @@ class DataSeriesValues
*/ */
public function setDataValues($dataValues = array(), $refreshDataSource = true) public function setDataValues($dataValues = array(), $refreshDataSource = true)
{ {
$this->dataValues = \PHPExcel\Calculation\Functions::flattenArray($dataValues); $this->dataValues = \PhpSpreadsheet\Calculation\Functions::flattenArray($dataValues);
$this->pointCount = count($dataValues); $this->pointCount = count($dataValues);
if ($refreshDataSource) { if ($refreshDataSource) {
@ -287,11 +286,11 @@ class DataSeriesValues
return $var !== null; return $var !== null;
} }
public function refresh(\PHPExcel\Worksheet $worksheet, $flatten = true) public function refresh(\PhpSpreadsheet\Worksheet $worksheet, $flatten = true)
{ {
if ($this->dataSource !== null) { if ($this->dataSource !== null) {
$calcEngine = \PHPExcel\Calculation::getInstance($worksheet->getParent()); $calcEngine = \PhpSpreadsheet\Calculation::getInstance($worksheet->getParent());
$newDataValues = \PHPExcel\Calculation::unwrapResult( $newDataValues = \PhpSpreadsheet\Calculation::unwrapResult(
$calcEngine->_calculateFormulaValue( $calcEngine->_calculateFormulaValue(
'='.$this->dataSource, '='.$this->dataSource,
null, null,
@ -299,7 +298,7 @@ class DataSeriesValues
) )
); );
if ($flatten) { if ($flatten) {
$this->dataValues = \PHPExcel\Calculation\Functions::flattenArray($newDataValues); $this->dataValues = \PhpSpreadsheet\Calculation\Functions::flattenArray($newDataValues);
foreach ($this->dataValues as &$dataValue) { foreach ($this->dataValues as &$dataValue) {
if ((!empty($dataValue)) && ($dataValue[0] == '#')) { if ((!empty($dataValue)) && ($dataValue[0] == '#')) {
$dataValue = 0.0; $dataValue = 0.0;
@ -312,9 +311,9 @@ class DataSeriesValues
list(, $cellRange) = $cellRange; list(, $cellRange) = $cellRange;
} }
$dimensions = \PHPExcel\Cell::rangeDimension(str_replace('$', '', $cellRange)); $dimensions = \PhpSpreadsheet\Cell::rangeDimension(str_replace('$', '', $cellRange));
if (($dimensions[0] == 1) || ($dimensions[1] == 1)) { if (($dimensions[0] == 1) || ($dimensions[1] == 1)) {
$this->dataValues = \PHPExcel\Calculation\Functions::flattenArray($newDataValues); $this->dataValues = \PhpSpreadsheet\Calculation\Functions::flattenArray($newDataValues);
} else { } else {
$newArray = array_values(array_shift($newDataValues)); $newArray = array_values(array_shift($newDataValues));
foreach ($newArray as $i => $newDataSet) { foreach ($newArray as $i => $newDataSet) {

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Chart; namespace PhpSpreadsheet\Chart;
/** /**
* PHPExcel_Chart_Exception * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,13 +19,12 @@ namespace PHPExcel\Chart;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Chart * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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 Exception extends \PHPExcel\Exception class Exception extends \PhpSpreadsheet\Exception
{ {
/** /**
* Error handler callback * Error handler callback

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PHPExcel\Chart; namespace PhpSpreadsheet\Chart;
/** /**
* Created by PhpStorm. * Created by PhpStorm.

View File

@ -1,11 +1,11 @@
<?php <?php
namespace PHPExcel\Chart; namespace PhpSpreadsheet\Chart;
/** /**
* \PHPExcel\Chart\Layout * \PhpSpreadsheet\Chart\Layout
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2016 PhpSpreadsheet
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +21,8 @@ namespace PHPExcel\Chart;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Chart * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,11 +1,11 @@
<?php <?php
namespace PHPExcel\Chart; namespace PhpSpreadsheet\Chart;
/** /**
* \PHPExcel\Chart\Legend * \PhpSpreadsheet\Chart\Legend
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2016 PhpSpreadsheet
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +21,8 @@ namespace PHPExcel\Chart;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Chart * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Chart; namespace PhpSpreadsheet\Chart;
/** /**
* PHPExcel_Chart_PlotArea * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Chart;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Chart * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -115,11 +112,11 @@ class PlotArea
public function setPlotSeries($plotSeries = array()) public function setPlotSeries($plotSeries = array())
{ {
$this->plotSeries = $plotSeries; $this->plotSeries = $plotSeries;
return $this; return $this;
} }
public function refresh(\PHPExcel\Worksheet $worksheet) public function refresh(\PhpSpreadsheet\Worksheet $worksheet)
{ {
foreach ($this->plotSeries as $plotSeries) { foreach ($this->plotSeries as $plotSeries) {
$plotSeries->refresh($worksheet); $plotSeries->refresh($worksheet);

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PHPExcel\Chart; namespace PhpSpreadsheet\Chart;
/** /**
* Created by PhpStorm. * Created by PhpStorm.

View File

@ -1,13 +1,11 @@
<?php <?php
namespace PHPExcel\Chart\Renderer; namespace PhpSpreadsheet\Chart\Renderer;
require_once(\PHPExcel\Settings::getChartRendererPath().'/jpgraph.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'/jpgraph.php');
/** /**
* PHPExcel_Chart_Renderer_jpgraph * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -23,9 +21,8 @@ require_once(\PHPExcel\Settings::getChartRendererPath().'/jpgraph.php');
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Chart_Renderer * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -113,7 +110,7 @@ class JpGraph
} else { } else {
// Format labels according to any formatting code // Format labels according to any formatting code
if (!is_null($datasetLabelFormatCode)) { if (!is_null($datasetLabelFormatCode)) {
$datasetLabels[$i] = \PHPExcel\Style\NumberFormat::toFormattedString($datasetLabel, $datasetLabelFormatCode); $datasetLabels[$i] = \PhpSpreadsheet\Style\NumberFormat::toFormattedString($datasetLabel, $datasetLabelFormatCode);
} }
} }
++$testCurrentIndex; ++$testCurrentIndex;
@ -565,7 +562,7 @@ class JpGraph
private function renderAreaChart($groupCount, $dimensions = '2d') private function renderAreaChart($groupCount, $dimensions = '2d')
{ {
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php');
$this->renderCartesianPlotArea(); $this->renderCartesianPlotArea();
@ -577,7 +574,7 @@ class JpGraph
private function renderLineChart($groupCount, $dimensions = '2d') private function renderLineChart($groupCount, $dimensions = '2d')
{ {
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php');
$this->renderCartesianPlotArea(); $this->renderCartesianPlotArea();
@ -589,7 +586,7 @@ class JpGraph
private function renderBarChart($groupCount, $dimensions = '2d') private function renderBarChart($groupCount, $dimensions = '2d')
{ {
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_bar.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_bar.php');
$this->renderCartesianPlotArea(); $this->renderCartesianPlotArea();
@ -601,9 +598,9 @@ class JpGraph
private function renderScatterChart($groupCount) private function renderScatterChart($groupCount)
{ {
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_scatter.php');
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_regstat.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_regstat.php');
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php');
$this->renderCartesianPlotArea('linlin'); $this->renderCartesianPlotArea('linlin');
@ -615,7 +612,7 @@ class JpGraph
private function renderBubbleChart($groupCount) private function renderBubbleChart($groupCount)
{ {
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_scatter.php');
$this->renderCartesianPlotArea('linlin'); $this->renderCartesianPlotArea('linlin');
@ -627,9 +624,9 @@ class JpGraph
private function renderPieChart($groupCount, $dimensions = '2d', $doughnut = false, $multiplePlots = false) private function renderPieChart($groupCount, $dimensions = '2d', $doughnut = false, $multiplePlots = false)
{ {
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_pie.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_pie.php');
if ($dimensions == '3d') { if ($dimensions == '3d') {
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_pie3d.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_pie3d.php');
} }
$this->renderPiePlotArea($doughnut); $this->renderPiePlotArea($doughnut);
@ -704,7 +701,7 @@ class JpGraph
private function renderRadarChart($groupCount) private function renderRadarChart($groupCount)
{ {
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_radar.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_radar.php');
$this->renderRadarPlotArea(); $this->renderRadarPlotArea();
@ -716,7 +713,7 @@ class JpGraph
private function renderStockChart($groupCount) private function renderStockChart($groupCount)
{ {
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_stock.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_stock.php');
$this->renderCartesianPlotArea('intint'); $this->renderCartesianPlotArea('intint');
@ -728,7 +725,7 @@ class JpGraph
private function renderContourChart($groupCount, $dimensions) private function renderContourChart($groupCount, $dimensions)
{ {
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_contour.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_contour.php');
$this->renderCartesianPlotArea('intint'); $this->renderCartesianPlotArea('intint');
@ -740,11 +737,11 @@ class JpGraph
private function renderCombinationChart($groupCount, $dimensions, $outputDestination) private function renderCombinationChart($groupCount, $dimensions, $outputDestination)
{ {
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php');
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_bar.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_bar.php');
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_scatter.php');
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_regstat.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_regstat.php');
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php'); require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php');
$this->renderCartesianPlotArea(); $this->renderCartesianPlotArea();
@ -877,7 +874,7 @@ class JpGraph
/** /**
* Create a new jpgraph * Create a new jpgraph
*/ */
public function __construct(\PHPExcel\Chart $chart) public function __construct(\PhpSpreadsheet\Chart $chart)
{ {
$this->graph = null; $this->graph = null;
$this->chart = $chart; $this->chart = $chart;

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Chart; namespace PhpSpreadsheet\Chart;
/** /**
* PHPExcel_Chart_Title * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Chart;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Chart * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -72,7 +69,7 @@ class Title
public function setCaption($caption = null) public function setCaption($caption = null)
{ {
$this->caption = $caption; $this->caption = $caption;
return $this; return $this;
} }

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel; namespace PhpSpreadsheet;
/** /**
* PHPExcel_Comment * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Document; namespace PhpSpreadsheet\Document;
/** /**
* PHPExcel_Document_Properties * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Document;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Document; namespace PhpSpreadsheet\Document;
/** /**
* PHPExcel_Document_Security * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Document;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -169,7 +166,7 @@ class Security
public function setRevisionsPassword($pValue = '', $pAlreadyHashed = false) public function setRevisionsPassword($pValue = '', $pAlreadyHashed = false)
{ {
if (!$pAlreadyHashed) { if (!$pAlreadyHashed) {
$pValue = \PHPExcel\Shared\PasswordHasher::hashPassword($pValue); $pValue = \PhpSpreadsheet\Shared\PasswordHasher::hashPassword($pValue);
} }
$this->revisionsPassword = $pValue; $this->revisionsPassword = $pValue;
return $this; return $this;
@ -195,7 +192,7 @@ class Security
public function setWorkbookPassword($pValue = '', $pAlreadyHashed = false) public function setWorkbookPassword($pValue = '', $pAlreadyHashed = false)
{ {
if (!$pAlreadyHashed) { if (!$pAlreadyHashed) {
$pValue = \PHPExcel\Shared\PasswordHasher::hashPassword($pValue); $pValue = \PhpSpreadsheet\Shared\PasswordHasher::hashPassword($pValue);
} }
$this->workbookPassword = $pValue; $this->workbookPassword = $pValue;
return $this; return $this;

View File

@ -1,11 +1,11 @@
<?php <?php
namespace PHPExcel; namespace PhpSpreadsheet;
/** /**
* PHPExcel\Exception * PhpSpreadsheet\Exception
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2016 PhpSpreadsheet
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +21,8 @@ namespace PHPExcel;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,11 +1,11 @@
<?php <?php
namespace PHPExcel; namespace PhpSpreadsheet;
/** /**
* PHPExcel\HashTable * PhpSpreadsheet\HashTable
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2016 PhpSpreadsheet
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +21,8 @@ namespace PHPExcel;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -44,7 +43,7 @@ class HashTable
protected $keyMap = []; protected $keyMap = [];
/** /**
* Create a new \PHPExcel\HashTable * Create a new \PhpSpreadsheet\HashTable
* *
* @param IComparable[] $pSource Optional source array to create HashTable from * @param IComparable[] $pSource Optional source array to create HashTable from
* @throws Exception * @throws Exception

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Helper; namespace PhpSpreadsheet\Helper;
/** /**
* PHPExcel_Helper_HTML * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Helper;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -623,7 +620,7 @@ class HTML
// Discard excess white space // Discard excess white space
$dom->preserveWhiteSpace = false; $dom->preserveWhiteSpace = false;
$this->richTextObject = new \PHPExcel\RichText(); $this->richTextObject = new \PhpSpreadsheet\RichText();
$this->parseElements($dom); $this->parseElements($dom);
// Clean any further spurious whitespace // Clean any further spurious whitespace
@ -661,7 +658,7 @@ class HTML
$richtextRun->getFont()->setSize($this->size); $richtextRun->getFont()->setSize($this->size);
} }
if ($this->color) { if ($this->color) {
$richtextRun->getFont()->setColor(new \PHPExcel\Style\Color('ff' . $this->color)); $richtextRun->getFont()->setColor(new \PhpSpreadsheet\Style\Color('ff' . $this->color));
} }
if ($this->bold) { if ($this->bold) {
$richtextRun->getFont()->setBold(true); $richtextRun->getFont()->setBold(true);
@ -670,7 +667,7 @@ class HTML
$richtextRun->getFont()->setItalic(true); $richtextRun->getFont()->setItalic(true);
} }
if ($this->underline) { if ($this->underline) {
$richtextRun->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_SINGLE); $richtextRun->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE);
} }
if ($this->superscript) { if ($this->superscript) {
$richtextRun->getFont()->setSuperScript(true); $richtextRun->getFont()->setSuperScript(true);

View File

@ -1,10 +1,8 @@
<?php <?php
namespace PHPExcel; namespace PhpSpreadsheet;
/** /**
* PHPExcel_IComparable
*
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
@ -19,9 +17,8 @@ namespace PHPExcel;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel; namespace PhpSpreadsheet;
/** /**
* PHPExcel_IOFactory * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -37,8 +34,8 @@ class IOFactory
* @static * @static
*/ */
private static $searchLocations = array( private static $searchLocations = array(
array( 'type' => 'IWriter', 'path' => 'PHPExcel/Writer/{0}.php', 'class' => '\\PHPExcel\\Writer\\{0}' ), array( 'type' => 'IWriter', 'path' => 'PhpSpreadsheet/Writer/{0}.php', 'class' => '\\PhpSpreadsheet\\Writer\\{0}' ),
array( 'type' => 'IReader', 'path' => 'PHPExcel/Reader/{0}.php', 'class' => '\\PHPExcel\\Reader\\{0}' ) array( 'type' => 'IReader', 'path' => 'PhpSpreadsheet/Reader/{0}.php', 'class' => '\\PhpSpreadsheet\\Reader\\{0}' )
); );
/** /**
@ -101,7 +98,7 @@ class IOFactory
* @static * @static
* @access public * @access public
* @param string $type Example: IWriter * @param string $type Example: IWriter
* @param string $location Example: PHPExcel/Writer/{0}.php * @param string $location Example: PhpSpreadsheet/Writer/{0}.php
* @param string $classname Example: Writer\{0} * @param string $classname Example: Writer\{0}
*/ */
public static function addSearchLocation($type = '', $location = '', $classname = '') public static function addSearchLocation($type = '', $location = '', $classname = '')
@ -114,12 +111,12 @@ class IOFactory
* *
* @static * @static
* @access public * @access public
* @param Spreadsheet $phpExcel * @param Spreadsheet $spreadsheet
* @param string $writerType Example: Excel2007 * @param string $writerType Example: Excel2007
* @return Writer\IWriter * @return Writer\IWriter
* @throws Writer\Exception * @throws Writer\Exception
*/ */
public static function createWriter(Spreadsheet $phpExcel, $writerType = '') public static function createWriter(Spreadsheet $spreadsheet, $writerType = '')
{ {
// Search type // Search type
$searchType = 'IWriter'; $searchType = 'IWriter';
@ -129,7 +126,7 @@ class IOFactory
if ($searchLocation['type'] == $searchType) { if ($searchLocation['type'] == $searchType) {
$className = str_replace('{0}', $writerType, $searchLocation['class']); $className = str_replace('{0}', $writerType, $searchLocation['class']);
$instance = new $className($phpExcel); $instance = new $className($spreadsheet);
if ($instance !== null) { if ($instance !== null) {
return $instance; return $instance;
} }

View File

@ -1,11 +1,11 @@
<?php <?php
namespace PHPExcel; namespace PhpSpreadsheet;
/** /**
* PHPExcel\NamedRange * PhpSpreadsheet\NamedRange
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2016 PhpSpreadsheet
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +21,8 @@ namespace PHPExcel;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader; namespace PhpSpreadsheet\Reader;
/** /**
* PHPExcel_Reader_BaseReader * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Reader;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -119,7 +116,7 @@ abstract class BaseReader implements IReader
* *
* @param boolean $pValue * @param boolean $pValue
* *
* @return PHPExcel_Reader_IReader * @return IReader
*/ */
public function setReadEmptyCells($pValue = true) public function setReadEmptyCells($pValue = true)
{ {

View File

@ -1,13 +1,11 @@
<?php <?php
namespace PHPExcel\Reader; namespace PhpSpreadsheet\Reader;
use PHPExcel\Spreadsheet; use PhpSpreadsheet\Spreadsheet;
/** /**
* PHPExcel_Reader_CSV * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -23,9 +21,8 @@ use PHPExcel\Spreadsheet;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -205,7 +202,7 @@ class CSV extends BaseReader implements IReader
$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'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($worksheetInfo[0]['lastColumnIndex']);
$worksheetInfo[0]['totalColumns'] = $worksheetInfo[0]['lastColumnIndex'] + 1; $worksheetInfo[0]['totalColumns'] = $worksheetInfo[0]['lastColumnIndex'] + 1;
// Close file // Close file
@ -218,27 +215,27 @@ class CSV extends BaseReader implements IReader
* Loads Spreadsheet from file * Loads Spreadsheet from file
* *
* @param string $pFilename * @param string $pFilename
* @return \PHPExcel\Spreadsheet * @return \PhpSpreadsheet\Spreadsheet
* @throws Exception * @throws Exception
*/ */
public function load($pFilename) public function load($pFilename)
{ {
// Create new Spreadsheet // Create new Spreadsheet
$objPHPExcel = new \PHPExcel\Spreadsheet(); $spreadsheet = new \PhpSpreadsheet\Spreadsheet();
// Load into this instance // Load into this instance
return $this->loadIntoExisting($pFilename, $objPHPExcel); return $this->loadIntoExisting($pFilename, $spreadsheet);
} }
/** /**
* Loads PHPExcel from file into PHPExcel instance * Loads PhpSpreadsheet from file into PhpSpreadsheet instance
* *
* @param string $pFilename * @param string $pFilename
* @param Spreadsheet $objPHPExcel * @param Spreadsheet $spreadsheet
* @return Spreadsheet * @return Spreadsheet
* @throws Exception * @throws Exception
*/ */
public function loadIntoExisting($pFilename, Spreadsheet $objPHPExcel) public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet)
{ {
$lineEnding = ini_get('auto_detect_line_endings'); $lineEnding = ini_get('auto_detect_line_endings');
ini_set('auto_detect_line_endings', true); ini_set('auto_detect_line_endings', true);
@ -255,11 +252,11 @@ class CSV extends BaseReader implements IReader
$this->skipBOM(); $this->skipBOM();
$this->checkSeparator(); $this->checkSeparator();
// Create new PHPExcel object // Create new PhpSpreadsheet object
while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) { while ($spreadsheet->getSheetCount() <= $this->sheetIndex) {
$objPHPExcel->createSheet(); $spreadsheet->createSheet();
} }
$sheet = $objPHPExcel->setActiveSheetIndex($this->sheetIndex); $sheet = $spreadsheet->setActiveSheetIndex($this->sheetIndex);
$escapeEnclosures = array( "\\" . $this->enclosure, $escapeEnclosures = array( "\\" . $this->enclosure,
$this->enclosure . $this->enclosure $this->enclosure . $this->enclosure
@ -281,7 +278,7 @@ class CSV extends BaseReader implements IReader
// Convert encoding if necessary // Convert encoding if necessary
if ($this->inputEncoding !== 'UTF-8') { if ($this->inputEncoding !== 'UTF-8') {
$rowDatum = \PHPExcel\Shared\StringHelper::convertEncoding($rowDatum, 'UTF-8', $this->inputEncoding); $rowDatum = \PhpSpreadsheet\Shared\StringHelper::convertEncoding($rowDatum, 'UTF-8', $this->inputEncoding);
} }
// Set cell value // Set cell value
@ -302,7 +299,7 @@ class CSV extends BaseReader implements IReader
ini_set('auto_detect_line_endings', $lineEnding); ini_set('auto_detect_line_endings', $lineEnding);
// Return // Return
return $objPHPExcel; return $spreadsheet;
} }
/** /**

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader; namespace PhpSpreadsheet\Reader;
/** /**
* PHPExcel_Reader_DefaultReadFilter * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Reader;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader; namespace PhpSpreadsheet\Reader;
/** /**
* PHPExcel_Reader_Excel2003XML * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Reader;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -80,7 +77,7 @@ class Excel2003XML extends BaseReader implements IReader
// Open file // Open file
$this->openFile($pFilename); $this->openFile($pFilename);
$fileHandle = $this->fileHandle; $fileHandle = $this->fileHandle;
// Read sample data (first 2 KB will do) // Read sample data (first 2 KB will do)
$data = fread($fileHandle, 2048); $data = fread($fileHandle, 2048);
fclose($fileHandle); fclose($fileHandle);
@ -105,7 +102,7 @@ class Excel2003XML extends BaseReader implements IReader
/** /**
* 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 PhpSpreadsheet object
* *
* @param string $pFilename * @param string $pFilename
* @throws Exception * @throws Exception
@ -125,7 +122,7 @@ class Excel2003XML extends BaseReader implements IReader
$xml = simplexml_load_string( $xml = simplexml_load_string(
$this->securityScan(file_get_contents($pFilename)), $this->securityScan(file_get_contents($pFilename)),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$namespaces = $xml->getNamespaces(true); $namespaces = $xml->getNamespaces(true);
@ -157,7 +154,7 @@ class Excel2003XML extends BaseReader implements IReader
$xml = simplexml_load_string( $xml = simplexml_load_string(
$this->securityScan(file_get_contents($pFilename)), $this->securityScan(file_get_contents($pFilename)),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$namespaces = $xml->getNamespaces(true); $namespaces = $xml->getNamespaces(true);
@ -203,7 +200,7 @@ class Excel2003XML extends BaseReader implements IReader
} }
} }
$tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
$tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1; $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1;
$worksheetInfo[] = $tmpInfo; $worksheetInfo[] = $tmpInfo;
@ -215,20 +212,20 @@ class Excel2003XML extends BaseReader implements IReader
/** /**
* Loads PHPExcel from file * Loads PhpSpreadsheet from file
* *
* @param string $pFilename * @param string $pFilename
* @return \PHPExcel\Spreadsheet * @return \PhpSpreadsheet\Spreadsheet
* @throws Exception * @throws Exception
*/ */
public function load($pFilename) public function load($pFilename)
{ {
// Create new PHPExcel // Create new PhpSpreadsheet
$objPHPExcel = new PHPExcel(); $spreadsheet = new PhpSpreadsheet();
$objPHPExcel->removeSheetByIndex(0); $spreadsheet->removeSheetByIndex(0);
// Load into this instance // Load into this instance
return $this->loadIntoExisting($pFilename, $objPHPExcel); return $this->loadIntoExisting($pFilename, $spreadsheet);
} }
protected static function identifyFixedStyleValue($styleList, &$styleAttributeValue) protected static function identifyFixedStyleValue($styleList, &$styleAttributeValue)
@ -276,38 +273,38 @@ class Excel2003XML extends BaseReader implements IReader
} }
/** /**
* Loads PHPExcel from file into PHPExcel instance * Loads PhpSpreadsheet from file into PhpSpreadsheet instance
* *
* @param string $pFilename * @param string $pFilename
* @param PHPExcel $objPHPExcel * @param \PhpSpreadsheet\Spreadsheet $spreadsheet
* @return PHPExcel * @return \PhpSpreadsheet\Spreadsheet
* @throws Exception * @throws Exception
*/ */
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet)
{ {
$fromFormats = array('\-', '\ '); $fromFormats = array('\-', '\ ');
$toFormats = array('-', ' '); $toFormats = array('-', ' ');
$underlineStyles = array ( $underlineStyles = array (
\PHPExcel\Style\Font::UNDERLINE_NONE, \PhpSpreadsheet\Style\Font::UNDERLINE_NONE,
\PHPExcel\Style\Font::UNDERLINE_DOUBLE, \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE,
\PHPExcel\Style\Font::UNDERLINE_DOUBLEACCOUNTING, \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING,
\PHPExcel\Style\Font::UNDERLINE_SINGLE, \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE,
\PHPExcel\Style\Font::UNDERLINE_SINGLEACCOUNTING \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING
); );
$verticalAlignmentStyles = array ( $verticalAlignmentStyles = array (
\PHPExcel\Style\Alignment::VERTICAL_BOTTOM, \PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM,
\PHPExcel\Style\Alignment::VERTICAL_TOP, \PhpSpreadsheet\Style\Alignment::VERTICAL_TOP,
\PHPExcel\Style\Alignment::VERTICAL_CENTER, \PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
\PHPExcel\Style\Alignment::VERTICAL_JUSTIFY \PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY
); );
$horizontalAlignmentStyles = array ( $horizontalAlignmentStyles = array (
\PHPExcel\Style\Alignment::HORIZONTAL_GENERAL, \PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL,
\PHPExcel\Style\Alignment::HORIZONTAL_LEFT, \PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT,
\PHPExcel\Style\Alignment::HORIZONTAL_RIGHT, \PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT,
\PHPExcel\Style\Alignment::HORIZONTAL_CENTER, \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
\PHPExcel\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS, \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS,
\PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY \PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY
); );
$timezoneObj = new \DateTimeZone('Europe/London'); $timezoneObj = new \DateTimeZone('Europe/London');
@ -325,11 +322,11 @@ class Excel2003XML extends BaseReader implements IReader
$xml = simplexml_load_string( $xml = simplexml_load_string(
$this->securityScan(file_get_contents($pFilename)), $this->securityScan(file_get_contents($pFilename)),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$namespaces = $xml->getNamespaces(true); $namespaces = $xml->getNamespaces(true);
$docProps = $objPHPExcel->getProperties(); $docProps = $spreadsheet->getProperties();
if (isset($xml->DocumentProperties[0])) { if (isset($xml->DocumentProperties[0])) {
foreach ($xml->DocumentProperties[0] as $propertyName => $propertyValue) { foreach ($xml->DocumentProperties[0] as $propertyName => $propertyValue) {
switch ($propertyName) { switch ($propertyName) {
@ -374,27 +371,27 @@ class Excel2003XML extends BaseReader implements IReader
if (isset($xml->CustomDocumentProperties)) { if (isset($xml->CustomDocumentProperties)) {
foreach ($xml->CustomDocumentProperties[0] as $propertyName => $propertyValue) { foreach ($xml->CustomDocumentProperties[0] as $propertyName => $propertyValue) {
$propertyAttributes = $propertyValue->attributes($namespaces['dt']); $propertyAttributes = $propertyValue->attributes($namespaces['dt']);
$propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/', '\\PHPExcel\\Reader\\Excel2003XML::hex2str', $propertyName); $propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/', '\\PhpSpreadsheet\\Reader\\Excel2003XML::hex2str', $propertyName);
$propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_UNKNOWN; $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_UNKNOWN;
switch ((string) $propertyAttributes) { switch ((string) $propertyAttributes) {
case 'string': case 'string':
$propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_STRING; $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING;
$propertyValue = trim($propertyValue); $propertyValue = trim($propertyValue);
break; break;
case 'boolean': case 'boolean':
$propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_BOOLEAN; $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN;
$propertyValue = (bool) $propertyValue; $propertyValue = (bool) $propertyValue;
break; break;
case 'integer': case 'integer':
$propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_INTEGER; $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_INTEGER;
$propertyValue = intval($propertyValue); $propertyValue = intval($propertyValue);
break; break;
case 'float': case 'float':
$propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_FLOAT; $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_FLOAT;
$propertyValue = floatval($propertyValue); $propertyValue = floatval($propertyValue);
break; break;
case 'dateTime.tz': case 'dateTime.tz':
$propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_DATE; $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE;
$propertyValue = strtotime(trim($propertyValue)); $propertyValue = strtotime(trim($propertyValue));
break; break;
} }
@ -440,7 +437,7 @@ class Excel2003XML extends BaseReader implements IReader
// echo $borderStyleKey.' = '.$borderStyleValue.'<br />'; // echo $borderStyleKey.' = '.$borderStyleValue.'<br />';
switch ($borderStyleKey) { switch ($borderStyleKey) {
case 'LineStyle': case 'LineStyle':
$thisBorder['style'] = \PHPExcel\Style\Border::BORDER_MEDIUM; $thisBorder['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUM;
// $thisBorder['style'] = $borderStyleValue; // $thisBorder['style'] = $borderStyleValue;
break; break;
case 'Weight': case 'Weight':
@ -540,14 +537,14 @@ class Excel2003XML extends BaseReader implements IReader
// echo '<h3>Worksheet: ', $worksheet_ss['Name'],'<h3>'; // echo '<h3>Worksheet: ', $worksheet_ss['Name'],'<h3>';
// //
// Create new Worksheet // Create new Worksheet
$objPHPExcel->createSheet(); $spreadsheet->createSheet();
$objPHPExcel->setActiveSheetIndex($worksheetID); $spreadsheet->setActiveSheetIndex($worksheetID);
if (isset($worksheet_ss['Name'])) { if (isset($worksheet_ss['Name'])) {
$worksheetName = self::convertStringEncoding((string) $worksheet_ss['Name'], $this->charSet); $worksheetName = self::convertStringEncoding((string) $worksheet_ss['Name'], $this->charSet);
// Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in
// formula cells... during the load, all formulae should be correct, and we're simply bringing // formula cells... during the load, all formulae should be correct, and we're simply bringing
// the worksheet name in line with the formula, not the reverse // the worksheet name in line with the formula, not the reverse
$objPHPExcel->getActiveSheet()->setTitle($worksheetName, false); $spreadsheet->getActiveSheet()->setTitle($worksheetName, false);
} }
$columnID = 'A'; $columnID = 'A';
@ -555,12 +552,12 @@ class Excel2003XML extends BaseReader implements IReader
foreach ($worksheet->Table->Column as $columnData) { foreach ($worksheet->Table->Column as $columnData) {
$columnData_ss = $columnData->attributes($namespaces['ss']); $columnData_ss = $columnData->attributes($namespaces['ss']);
if (isset($columnData_ss['Index'])) { if (isset($columnData_ss['Index'])) {
$columnID = \PHPExcel\Cell::stringFromColumnIndex($columnData_ss['Index']-1); $columnID = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnData_ss['Index']-1);
} }
if (isset($columnData_ss['Width'])) { if (isset($columnData_ss['Width'])) {
$columnWidth = $columnData_ss['Width']; $columnWidth = $columnData_ss['Width'];
// echo '<b>Setting column width for '.$columnID.' to '.$columnWidth.'</b><br />'; // echo '<b>Setting column width for '.$columnID.' to '.$columnWidth.'</b><br />';
$objPHPExcel->getActiveSheet()->getColumnDimension($columnID)->setWidth($columnWidth / 5.4); $spreadsheet->getActiveSheet()->getColumnDimension($columnID)->setWidth($columnWidth / 5.4);
} }
++$columnID; ++$columnID;
} }
@ -581,7 +578,7 @@ class Excel2003XML extends BaseReader implements IReader
foreach ($rowData->Cell as $cell) { foreach ($rowData->Cell as $cell) {
$cell_ss = $cell->attributes($namespaces['ss']); $cell_ss = $cell->attributes($namespaces['ss']);
if (isset($cell_ss['Index'])) { if (isset($cell_ss['Index'])) {
$columnID = \PHPExcel\Cell::stringFromColumnIndex($cell_ss['Index']-1); $columnID = \PhpSpreadsheet\Cell::stringFromColumnIndex($cell_ss['Index']-1);
} }
$cellRange = $columnID.$rowID; $cellRange = $columnID.$rowID;
@ -595,14 +592,14 @@ class Excel2003XML extends BaseReader implements IReader
$columnTo = $columnID; $columnTo = $columnID;
if (isset($cell_ss['MergeAcross'])) { if (isset($cell_ss['MergeAcross'])) {
$additionalMergedCells += (int)$cell_ss['MergeAcross']; $additionalMergedCells += (int)$cell_ss['MergeAcross'];
$columnTo = \PHPExcel\Cell::stringFromColumnIndex(\PHPExcel\Cell::columnIndexFromString($columnID) + $cell_ss['MergeAcross'] -1); $columnTo = \PhpSpreadsheet\Cell::stringFromColumnIndex(\PhpSpreadsheet\Cell::columnIndexFromString($columnID) + $cell_ss['MergeAcross'] -1);
} }
$rowTo = $rowID; $rowTo = $rowID;
if (isset($cell_ss['MergeDown'])) { if (isset($cell_ss['MergeDown'])) {
$rowTo = $rowTo + $cell_ss['MergeDown']; $rowTo = $rowTo + $cell_ss['MergeDown'];
} }
$cellRange .= ':'.$columnTo.$rowTo; $cellRange .= ':'.$columnTo.$rowTo;
$objPHPExcel->getActiveSheet()->mergeCells($cellRange); $spreadsheet->getActiveSheet()->mergeCells($cellRange);
} }
$cellIsSet = $hasCalculatedValue = false; $cellIsSet = $hasCalculatedValue = false;
@ -618,7 +615,7 @@ class Excel2003XML extends BaseReader implements IReader
} }
if (isset($cell->Data)) { if (isset($cell->Data)) {
$cellValue = $cellData = $cell->Data; $cellValue = $cellData = $cell->Data;
$type = \PHPExcel\Cell_DataType::TYPE_NULL; $type = \PhpSpreadsheet\Cell_DataType::TYPE_NULL;
$cellData_ss = $cellData->attributes($namespaces['ss']); $cellData_ss = $cellData->attributes($namespaces['ss']);
if (isset($cellData_ss['Type'])) { if (isset($cellData_ss['Type'])) {
$cellDataType = $cellData_ss['Type']; $cellDataType = $cellData_ss['Type'];
@ -634,33 +631,33 @@ class Excel2003XML extends BaseReader implements IReader
*/ */
case 'String': case 'String':
$cellValue = self::convertStringEncoding($cellValue, $this->charSet); $cellValue = self::convertStringEncoding($cellValue, $this->charSet);
$type = \PHPExcel\Cell\DataType::TYPE_STRING; $type = \PhpSpreadsheet\Cell\DataType::TYPE_STRING;
break; break;
case 'Number': case 'Number':
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
$cellValue = (float) $cellValue; $cellValue = (float) $cellValue;
if (floor($cellValue) == $cellValue) { if (floor($cellValue) == $cellValue) {
$cellValue = (integer) $cellValue; $cellValue = (integer) $cellValue;
} }
break; break;
case 'Boolean': case 'Boolean':
$type = \PHPExcel\Cell\DataType::TYPE_BOOL; $type = \PhpSpreadsheet\Cell\DataType::TYPE_BOOL;
$cellValue = ($cellValue != 0); $cellValue = ($cellValue != 0);
break; break;
case 'DateTime': case 'DateTime':
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
$cellValue = \PHPExcel\Shared\Date::PHPToExcel(strtotime($cellValue)); $cellValue = \PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime($cellValue));
break; break;
case 'Error': case 'Error':
$type = \PHPExcel\Cell\DataType::TYPE_ERROR; $type = \PhpSpreadsheet\Cell\DataType::TYPE_ERROR;
break; break;
} }
} }
if ($hasCalculatedValue) { if ($hasCalculatedValue) {
// echo 'FORMULA<br />'; // echo 'FORMULA<br />';
$type = \PHPExcel\Cell\DataType::TYPE_FORMULA; $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA;
$columnNumber = \PHPExcel\Cell::columnIndexFromString($columnID); $columnNumber = \PhpSpreadsheet\Cell::columnIndexFromString($columnID);
if (substr($cellDataFormula, 0, 3) == 'of:') { if (substr($cellDataFormula, 0, 3) == 'of:') {
$cellDataFormula = substr($cellDataFormula, 3); $cellDataFormula = substr($cellDataFormula, 3);
// echo 'Before: ', $cellDataFormula,'<br />'; // echo 'Before: ', $cellDataFormula,'<br />';
@ -706,7 +703,7 @@ class Excel2003XML extends BaseReader implements IReader
if ($columnReference{0} == '[') { if ($columnReference{0} == '[') {
$columnReference = $columnNumber + trim($columnReference, '[]'); $columnReference = $columnNumber + trim($columnReference, '[]');
} }
$A1CellReference = \PHPExcel\Cell::stringFromColumnIndex($columnReference-1).$rowReference; $A1CellReference = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference-1).$rowReference;
$value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0])); $value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0]));
} }
} }
@ -720,10 +717,10 @@ class Excel2003XML extends BaseReader implements IReader
// echo 'Cell '.$columnID.$rowID.' is a '.$type.' with a value of '.(($hasCalculatedValue) ? $cellDataFormula : $cellValue).'<br />'; // echo 'Cell '.$columnID.$rowID.' is a '.$type.' with a value of '.(($hasCalculatedValue) ? $cellDataFormula : $cellValue).'<br />';
// //
$objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type); $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type);
if ($hasCalculatedValue) { if ($hasCalculatedValue) {
// echo 'Formula result is '.$cellValue.'<br />'; // echo 'Formula result is '.$cellValue.'<br />';
$objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($cellValue); $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($cellValue);
} }
$cellIsSet = $rowHasData = true; $cellIsSet = $rowHasData = true;
} }
@ -741,7 +738,7 @@ class Excel2003XML extends BaseReader implements IReader
// echo $annotation,'<br />'; // echo $annotation,'<br />';
$annotation = strip_tags($node); $annotation = strip_tags($node);
// echo 'Annotation: ', $annotation,'<br />'; // echo 'Annotation: ', $annotation,'<br />';
$objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation)); $spreadsheet->getActiveSheet()->getComment($columnID.$rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation));
} }
if (($cellIsSet) && (isset($cell_ss['StyleID']))) { if (($cellIsSet) && (isset($cell_ss['StyleID']))) {
@ -751,10 +748,10 @@ class Excel2003XML extends BaseReader implements IReader
// echo 'Cell '.$columnID.$rowID.'<br />'; // echo 'Cell '.$columnID.$rowID.'<br />';
// print_r($this->styles[$style]); // print_r($this->styles[$style]);
// echo '<br />'; // echo '<br />';
if (!$objPHPExcel->getActiveSheet()->cellExists($columnID.$rowID)) { if (!$spreadsheet->getActiveSheet()->cellExists($columnID.$rowID)) {
$objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValue(null); $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setValue(null);
} }
$objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styles[$style]); $spreadsheet->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styles[$style]);
} }
} }
++$columnID; ++$columnID;
@ -771,7 +768,7 @@ class Excel2003XML extends BaseReader implements IReader
if (isset($row_ss['Height'])) { if (isset($row_ss['Height'])) {
$rowHeight = $row_ss['Height']; $rowHeight = $row_ss['Height'];
// echo '<b>Setting row height to '.$rowHeight.'</b><br />'; // echo '<b>Setting row height to '.$rowHeight.'</b><br />';
$objPHPExcel->getActiveSheet()->getRowDimension($rowID)->setRowHeight($rowHeight); $spreadsheet->getActiveSheet()->getRowDimension($rowID)->setRowHeight($rowHeight);
} }
} }
@ -782,14 +779,14 @@ class Excel2003XML extends BaseReader implements IReader
} }
// Return // Return
return $objPHPExcel; return $spreadsheet;
} }
protected static function convertStringEncoding($string, $charset) protected static function convertStringEncoding($string, $charset)
{ {
if ($charset != 'UTF-8') { if ($charset != 'UTF-8') {
return \PHPExcel\Shared\StringHelper::convertEncoding($string, 'UTF-8', $charset); return \PhpSpreadsheet\Shared\StringHelper::convertEncoding($string, 'UTF-8', $charset);
} }
return $string; return $string;
} }
@ -797,7 +794,7 @@ class Excel2003XML extends BaseReader implements IReader
protected function parseRichText($is = '') protected function parseRichText($is = '')
{ {
$value = new \PHPExcel\RichText(); $value = new \PhpSpreadsheet\RichText();
$value->createText(self::convertStringEncoding($is, $this->charSet)); $value->createText(self::convertStringEncoding($is, $this->charSet));

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader; namespace PhpSpreadsheet\Reader;
/** /**
* PHPExcel_Reader_Excel2007 * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Reader;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -32,7 +29,7 @@ class Excel2007 extends BaseReader implements IReader
/** /**
* ReferenceHelper instance * ReferenceHelper instance
* *
* @var \PHPExcel\ReferenceHelper * @var \PhpSpreadsheet\ReferenceHelper
*/ */
private $referenceHelper = null; private $referenceHelper = null;
@ -49,7 +46,7 @@ class Excel2007 extends BaseReader implements IReader
public function __construct() public function __construct()
{ {
$this->readFilter = new DefaultReadFilter(); $this->readFilter = new DefaultReadFilter();
$this->referenceHelper = \PHPExcel\ReferenceHelper::getInstance(); $this->referenceHelper = \PhpSpreadsheet\ReferenceHelper::getInstance();
} }
/** /**
@ -66,7 +63,7 @@ class Excel2007 extends BaseReader implements IReader
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
} }
$zipClass = \PHPExcel\Settings::getZipClass(); $zipClass = \PhpSpreadsheet\Settings::getZipClass();
// Check if zip class exists // Check if zip class exists
// if (!class_exists($zipClass, false)) { // if (!class_exists($zipClass, false)) {
@ -83,7 +80,7 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, "_rels/.rels") $this->getFromZipArchive($zip, "_rels/.rels")
), ),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
if ($rels !== false) { if ($rels !== false) {
foreach ($rels->Relationship as $rel) { foreach ($rels->Relationship as $rel) {
@ -118,7 +115,7 @@ class Excel2007 extends BaseReader implements IReader
$worksheetNames = array(); $worksheetNames = array();
$zipClass = \PHPExcel\Settings::getZipClass(); $zipClass = \PhpSpreadsheet\Settings::getZipClass();
$zip = new $zipClass; $zip = new $zipClass;
$zip->open($pFilename); $zip->open($pFilename);
@ -128,7 +125,7 @@ class Excel2007 extends BaseReader implements IReader
$this->securityScan( $this->securityScan(
$this->getFromZipArchive($zip, "_rels/.rels"), $this->getFromZipArchive($zip, "_rels/.rels"),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
) )
); //~ http://schemas.openxmlformats.org/package/2006/relationships"); ); //~ http://schemas.openxmlformats.org/package/2006/relationships");
foreach ($rels->Relationship as $rel) { foreach ($rels->Relationship as $rel) {
@ -138,7 +135,7 @@ class Excel2007 extends BaseReader implements IReader
$this->securityScan( $this->securityScan(
$this->getFromZipArchive($zip, "{$rel['Target']}"), $this->getFromZipArchive($zip, "{$rel['Target']}"),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
) )
); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" ); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"
@ -172,7 +169,7 @@ class Excel2007 extends BaseReader implements IReader
$worksheetInfo = array(); $worksheetInfo = array();
$zipClass = \PHPExcel\Settings::getZipClass(); $zipClass = \PhpSpreadsheet\Settings::getZipClass();
$zip = new $zipClass; $zip = new $zipClass;
$zip->open($pFilename); $zip->open($pFilename);
@ -181,7 +178,7 @@ class Excel2007 extends BaseReader implements IReader
//~ http://schemas.openxmlformats.org/package/2006/relationships" //~ http://schemas.openxmlformats.org/package/2006/relationships"
$this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")), $this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
foreach ($rels->Relationship as $rel) { foreach ($rels->Relationship as $rel) {
if ($rel["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument") { if ($rel["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument") {
@ -192,7 +189,7 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels") $this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")
), ),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships"); $relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships");
@ -209,7 +206,7 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, "{$rel['Target']}") $this->getFromZipArchive($zip, "{$rel['Target']}")
), ),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
if ($xmlWorkbook->sheets) { if ($xmlWorkbook->sheets) {
$dir = dirname($rel["Target"]); $dir = dirname($rel["Target"]);
@ -227,10 +224,10 @@ class Excel2007 extends BaseReader implements IReader
$xml = new \XMLReader(); $xml = new \XMLReader();
$res = $xml->xml( $res = $xml->xml(
$this->securityScanFile( $this->securityScanFile(
'zip://'.\PHPExcel\Shared\File::realpath($pFilename).'#'."$dir/$fileWorksheet" 'zip://'.\PhpSpreadsheet\Shared\File::realpath($pFilename).'#'."$dir/$fileWorksheet"
), ),
null, null,
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$xml->setParserProperty(2, true); $xml->setParserProperty(2, true);
@ -249,7 +246,7 @@ class Excel2007 extends BaseReader implements IReader
$xml->close(); $xml->close();
$tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1; $tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1;
$tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
$worksheetInfo[] = $tmpInfo; $worksheetInfo[] = $tmpInfo;
} }
@ -316,11 +313,11 @@ class Excel2007 extends BaseReader implements IReader
// echo 'GETTING SHARED FORMULA', PHP_EOL; // echo 'GETTING SHARED FORMULA', PHP_EOL;
// echo 'Master is ', $sharedFormulas[$instance]['master'], PHP_EOL; // echo 'Master is ', $sharedFormulas[$instance]['master'], PHP_EOL;
// echo 'Formula is ', $sharedFormulas[$instance]['formula'], PHP_EOL; // echo 'Formula is ', $sharedFormulas[$instance]['formula'], PHP_EOL;
$master = \PHPExcel\Cell::coordinateFromString($sharedFormulas[$instance]['master']); $master = \PhpSpreadsheet\Cell::coordinateFromString($sharedFormulas[$instance]['master']);
$current = \PHPExcel\Cell::coordinateFromString($r); $current = \PhpSpreadsheet\Cell::coordinateFromString($r);
$difference = array(0, 0); $difference = array(0, 0);
$difference[0] = \PHPExcel\Cell::columnIndexFromString($current[0]) - \PHPExcel\Cell::columnIndexFromString($master[0]); $difference[0] = \PhpSpreadsheet\Cell::columnIndexFromString($current[0]) - \PhpSpreadsheet\Cell::columnIndexFromString($master[0]);
$difference[1] = $current[1] - $master[1]; $difference[1] = $current[1] - $master[1];
$value = $this->referenceHelper->updateFormulaReferences($sharedFormulas[$instance]['formula'], 'A1', $difference[0], $difference[1]); $value = $this->referenceHelper->updateFormulaReferences($sharedFormulas[$instance]['formula'], 'A1', $difference[0], $difference[1]);
@ -336,7 +333,7 @@ class Excel2007 extends BaseReader implements IReader
if (strpos($fileName, '//') !== false) { if (strpos($fileName, '//') !== false) {
$fileName = substr($fileName, strpos($fileName, '//') + 1); $fileName = substr($fileName, strpos($fileName, '//') + 1);
} }
$fileName = \PHPExcel\Shared\File::realpath($fileName); $fileName = \PhpSpreadsheet\Shared\File::realpath($fileName);
// Sadly, some 3rd party xlsx generators don't use consistent case for filenaming // Sadly, some 3rd party xlsx generators don't use consistent case for filenaming
// so we need to load case-insensitively from the zip file // so we need to load case-insensitively from the zip file
@ -370,14 +367,14 @@ class Excel2007 extends BaseReader implements IReader
} }
// Initialisations // Initialisations
$excel = new \PHPExcel\Spreadsheet; $excel = new \PhpSpreadsheet\Spreadsheet;
$excel->removeSheetByIndex(0); $excel->removeSheetByIndex(0);
if (!$this->readDataOnly) { if (!$this->readDataOnly) {
$excel->removeCellStyleXfByIndex(0); // remove the default style $excel->removeCellStyleXfByIndex(0); // remove the default style
$excel->removeCellXfByIndex(0); // remove the default style $excel->removeCellXfByIndex(0); // remove the default style
} }
$zipClass = \PHPExcel\Settings::getZipClass(); $zipClass = \PhpSpreadsheet\Settings::getZipClass();
$zip = new $zipClass; $zip = new $zipClass;
$zip->open($pFilename); $zip->open($pFilename);
@ -387,7 +384,7 @@ class Excel2007 extends BaseReader implements IReader
//~ http://schemas.openxmlformats.org/package/2006/relationships" //~ http://schemas.openxmlformats.org/package/2006/relationships"
$this->securityScan($this->getFromZipArchive($zip, "xl/_rels/workbook.xml.rels")), $this->securityScan($this->getFromZipArchive($zip, "xl/_rels/workbook.xml.rels")),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
foreach ($wbRels->Relationship as $rel) { foreach ($wbRels->Relationship as $rel) {
switch ($rel["Type"]) { switch ($rel["Type"]) {
@ -398,7 +395,7 @@ class Excel2007 extends BaseReader implements IReader
$xmlTheme = simplexml_load_string( $xmlTheme = simplexml_load_string(
$this->securityScan($this->getFromZipArchive($zip, "xl/{$rel['Target']}")), $this->securityScan($this->getFromZipArchive($zip, "xl/{$rel['Target']}")),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
if (is_object($xmlTheme)) { if (is_object($xmlTheme)) {
$xmlThemeName = $xmlTheme->attributes(); $xmlThemeName = $xmlTheme->attributes();
@ -433,7 +430,7 @@ class Excel2007 extends BaseReader implements IReader
//~ http://schemas.openxmlformats.org/package/2006/relationships" //~ http://schemas.openxmlformats.org/package/2006/relationships"
$this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")), $this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
foreach ($rels->Relationship as $rel) { foreach ($rels->Relationship as $rel) {
switch ($rel["Type"]) { switch ($rel["Type"]) {
@ -441,7 +438,7 @@ class Excel2007 extends BaseReader implements IReader
$xmlCore = simplexml_load_string( $xmlCore = simplexml_load_string(
$this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), $this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
if (is_object($xmlCore)) { if (is_object($xmlCore)) {
$xmlCore->registerXPathNamespace("dc", "http://purl.org/dc/elements/1.1/"); $xmlCore->registerXPathNamespace("dc", "http://purl.org/dc/elements/1.1/");
@ -463,7 +460,7 @@ class Excel2007 extends BaseReader implements IReader
$xmlCore = simplexml_load_string( $xmlCore = simplexml_load_string(
$this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), $this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
if (is_object($xmlCore)) { if (is_object($xmlCore)) {
$docProps = $excel->getProperties(); $docProps = $excel->getProperties();
@ -479,7 +476,7 @@ class Excel2007 extends BaseReader implements IReader
$xmlCore = simplexml_load_string( $xmlCore = simplexml_load_string(
$this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), $this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
if (is_object($xmlCore)) { if (is_object($xmlCore)) {
$docProps = $excel->getProperties(); $docProps = $excel->getProperties();
@ -490,8 +487,8 @@ class Excel2007 extends BaseReader implements IReader
$cellDataOfficeChildren = $xmlProperty->children('http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'); $cellDataOfficeChildren = $xmlProperty->children('http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes');
$attributeType = $cellDataOfficeChildren->getName(); $attributeType = $cellDataOfficeChildren->getName();
$attributeValue = (string) $cellDataOfficeChildren->{$attributeType}; $attributeValue = (string) $cellDataOfficeChildren->{$attributeType};
$attributeValue = \PHPExcel\Document\Properties::convertProperty($attributeValue, $attributeType); $attributeValue = \PhpSpreadsheet\Document\Properties::convertProperty($attributeValue, $attributeType);
$attributeType = \PHPExcel\Document\Properties::convertPropertyType($attributeType); $attributeType = \PhpSpreadsheet\Document\Properties::convertPropertyType($attributeType);
$docProps->setCustomProperty($propertyName, $attributeValue, $attributeType); $docProps->setCustomProperty($propertyName, $attributeValue, $attributeType);
} }
} }
@ -510,7 +507,7 @@ class Excel2007 extends BaseReader implements IReader
//~ http://schemas.openxmlformats.org/package/2006/relationships" //~ http://schemas.openxmlformats.org/package/2006/relationships"
$this->securityScan($this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")), $this->securityScan($this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships"); $relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships");
@ -520,12 +517,12 @@ class Excel2007 extends BaseReader implements IReader
//~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"
$this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")), $this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
if (isset($xmlStrings) && isset($xmlStrings->si)) { if (isset($xmlStrings) && isset($xmlStrings->si)) {
foreach ($xmlStrings->si as $val) { foreach ($xmlStrings->si as $val) {
if (isset($val->t)) { if (isset($val->t)) {
$sharedStrings[] = \PHPExcel\Shared\StringHelper::controlCharacterOOXML2PHP((string) $val->t); $sharedStrings[] = \PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $val->t);
} elseif (isset($val->r)) { } elseif (isset($val->r)) {
$sharedStrings[] = $this->parseRichText($val); $sharedStrings[] = $this->parseRichText($val);
} }
@ -565,7 +562,7 @@ class Excel2007 extends BaseReader implements IReader
//~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"
$this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")), $this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$numFmts = null; $numFmts = null;
if ($xmlStyles && $xmlStyles->numFmts[0]) { if ($xmlStyles && $xmlStyles->numFmts[0]) {
@ -576,7 +573,7 @@ class Excel2007 extends BaseReader implements IReader
} }
if (!$this->readDataOnly && $xmlStyles) { if (!$this->readDataOnly && $xmlStyles) {
foreach ($xmlStyles->cellXfs->xf as $xf) { foreach ($xmlStyles->cellXfs->xf as $xf) {
$numFmt = \PHPExcel\Style\NumberFormat::FORMAT_GENERAL; $numFmt = \PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL;
if ($xf["numFmtId"]) { if ($xf["numFmtId"]) {
if (isset($numFmts)) { if (isset($numFmts)) {
@ -591,8 +588,8 @@ class Excel2007 extends BaseReader implements IReader
// But there's a lot of naughty homebrew xlsx writers that do use "reserved" id values that aren't actually used // But there's a lot of naughty homebrew xlsx writers that do use "reserved" id values that aren't actually used
// So we make allowance for them rather than lose formatting masks // So we make allowance for them rather than lose formatting masks
if ((int)$xf["numFmtId"] < 164 && if ((int)$xf["numFmtId"] < 164 &&
\PHPExcel\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]) !== '') { \PhpSpreadsheet\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]) !== '') {
$numFmt = \PHPExcel\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]); $numFmt = \PhpSpreadsheet\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]);
} }
} }
$quotePrefix = false; $quotePrefix = false;
@ -612,19 +609,19 @@ class Excel2007 extends BaseReader implements IReader
$styles[] = $style; $styles[] = $style;
// add style to cellXf collection // add style to cellXf collection
$objStyle = new \PHPExcel\Style; $objStyle = new \PhpSpreadsheet\Style;
self::readStyle($objStyle, $style); self::readStyle($objStyle, $style);
$excel->addCellXf($objStyle); $excel->addCellXf($objStyle);
} }
foreach ($xmlStyles->cellStyleXfs->xf as $xf) { foreach ($xmlStyles->cellStyleXfs->xf as $xf) {
$numFmt = \PHPExcel\Style\NumberFormat::FORMAT_GENERAL; $numFmt = \PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL;
if ($numFmts && $xf["numFmtId"]) { if ($numFmts && $xf["numFmtId"]) {
$tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]")); $tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]"));
if (isset($tmpNumFmt["formatCode"])) { if (isset($tmpNumFmt["formatCode"])) {
$numFmt = (string) $tmpNumFmt["formatCode"]; $numFmt = (string) $tmpNumFmt["formatCode"];
} elseif ((int)$xf["numFmtId"] < 165) { } elseif ((int)$xf["numFmtId"] < 165) {
$numFmt = \PHPExcel\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]); $numFmt = \PhpSpreadsheet\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]);
} }
} }
@ -640,7 +637,7 @@ class Excel2007 extends BaseReader implements IReader
$cellStyles[] = $cellStyle; $cellStyles[] = $cellStyle;
// add style to cellStyleXf collection // add style to cellStyleXf collection
$objStyle = new \PHPExcel\Style; $objStyle = new \PhpSpreadsheet\Style;
self::readStyle($objStyle, $cellStyle); self::readStyle($objStyle, $cellStyle);
$excel->addCellStyleXf($objStyle); $excel->addCellStyleXf($objStyle);
} }
@ -651,7 +648,7 @@ class Excel2007 extends BaseReader implements IReader
// Conditional Styles // Conditional Styles
if ($xmlStyles->dxfs) { if ($xmlStyles->dxfs) {
foreach ($xmlStyles->dxfs->dxf as $dxf) { foreach ($xmlStyles->dxfs->dxf as $dxf) {
$style = new \PHPExcel\Style(false, true); $style = new \PhpSpreadsheet\Style(false, true);
self::readStyle($style, $dxf); self::readStyle($style, $dxf);
$dxfs[] = $style; $dxfs[] = $style;
} }
@ -662,7 +659,7 @@ class Excel2007 extends BaseReader implements IReader
if (intval($cellStyle['builtinId']) == 0) { if (intval($cellStyle['builtinId']) == 0) {
if (isset($cellStyles[intval($cellStyle['xfId'])])) { if (isset($cellStyles[intval($cellStyle['xfId'])])) {
// Set default style // Set default style
$style = new \PHPExcel\Style; $style = new \PhpSpreadsheet\Style;
self::readStyle($style, $cellStyles[intval($cellStyle['xfId'])]); self::readStyle($style, $cellStyles[intval($cellStyle['xfId'])]);
// normal style, currently not using it for anything // normal style, currently not using it for anything
@ -676,15 +673,15 @@ class Excel2007 extends BaseReader implements IReader
//~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"
$this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), $this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
// Set base date // Set base date
if ($xmlWorkbook->workbookPr) { if ($xmlWorkbook->workbookPr) {
\PHPExcel\Shared\Date::setExcelCalendar(\PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900); \PhpSpreadsheet\Shared\Date::setExcelCalendar(\PhpSpreadsheet\Shared\Date::CALENDAR_WINDOWS_1900);
if (isset($xmlWorkbook->workbookPr['date1904'])) { if (isset($xmlWorkbook->workbookPr['date1904'])) {
if (self::boolean((string) $xmlWorkbook->workbookPr['date1904'])) { if (self::boolean((string) $xmlWorkbook->workbookPr['date1904'])) {
\PHPExcel\Shared\Date::setExcelCalendar(\PHPExcel\Shared\Date::CALENDAR_MAC_1904); \PhpSpreadsheet\Shared\Date::setExcelCalendar(\PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904);
} }
} }
} }
@ -723,7 +720,7 @@ class Excel2007 extends BaseReader implements IReader
//~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"
$this->securityScan($this->getFromZipArchive($zip, "$dir/$fileWorksheet")), $this->securityScan($this->getFromZipArchive($zip, "$dir/$fileWorksheet")),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$sharedFormulas = array(); $sharedFormulas = array();
@ -832,22 +829,22 @@ class Excel2007 extends BaseReader implements IReader
foreach ($xmlSheet->cols->col as $col) { foreach ($xmlSheet->cols->col as $col) {
for ($i = intval($col["min"]) - 1; $i < intval($col["max"]); ++$i) { for ($i = intval($col["min"]) - 1; $i < intval($col["max"]); ++$i) {
if ($col["style"] && !$this->readDataOnly) { if ($col["style"] && !$this->readDataOnly) {
$docSheet->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($i))->setXfIndex(intval($col["style"])); $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setXfIndex(intval($col["style"]));
} }
if (self::boolean($col["bestFit"])) { if (self::boolean($col["bestFit"])) {
//$docSheet->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($i))->setAutoSize(true); //$docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setAutoSize(true);
} }
if (self::boolean($col["hidden"])) { if (self::boolean($col["hidden"])) {
// echo \PHPExcel\Cell::stringFromColumnIndex($i), ': HIDDEN COLUMN',PHP_EOL; // echo \PhpSpreadsheet\Cell::stringFromColumnIndex($i), ': HIDDEN COLUMN',PHP_EOL;
$docSheet->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($i))->setVisible(false); $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setVisible(false);
} }
if (self::boolean($col["collapsed"])) { if (self::boolean($col["collapsed"])) {
$docSheet->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($i))->setCollapsed(true); $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setCollapsed(true);
} }
if ($col["outlineLevel"] > 0) { if ($col["outlineLevel"] > 0) {
$docSheet->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($i))->setOutlineLevel(intval($col["outlineLevel"])); $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setOutlineLevel(intval($col["outlineLevel"]));
} }
$docSheet->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($i))->setWidth(floatval($col["width"])); $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setWidth(floatval($col["width"]));
if (intval($col["max"]) == 16384) { if (intval($col["max"]) == 16384) {
break; break;
@ -897,7 +894,7 @@ class Excel2007 extends BaseReader implements IReader
// Read cell? // Read cell?
if ($this->getReadFilter() !== null) { if ($this->getReadFilter() !== null) {
$coordinates = \PHPExcel\Cell::coordinateFromString($r); $coordinates = \PhpSpreadsheet\Cell::coordinateFromString($r);
if (!$this->getReadFilter()->readCell($coordinates[0], $coordinates[1], $docSheet->getTitle())) { if (!$this->getReadFilter()->readCell($coordinates[0], $coordinates[1], $docSheet->getTitle())) {
continue; continue;
@ -916,7 +913,7 @@ class Excel2007 extends BaseReader implements IReader
if ((string)$c->v != '') { if ((string)$c->v != '') {
$value = $sharedStrings[intval($c->v)]; $value = $sharedStrings[intval($c->v)];
if ($value instanceof \PHPExcel\RichText) { if ($value instanceof \PhpSpreadsheet\RichText) {
$value = clone $value; $value = clone $value;
} }
} else { } else {
@ -983,7 +980,7 @@ class Excel2007 extends BaseReader implements IReader
} }
// Rich text? // Rich text?
if ($value instanceof \PHPExcel\RichText && $this->readDataOnly) { if ($value instanceof \PhpSpreadsheet\RichText && $this->readDataOnly) {
$value = $value->getPlainText(); $value = $value->getPlainText();
} }
@ -1012,7 +1009,7 @@ class Excel2007 extends BaseReader implements IReader
if (!$this->readDataOnly && $xmlSheet && $xmlSheet->conditionalFormatting) { if (!$this->readDataOnly && $xmlSheet && $xmlSheet->conditionalFormatting) {
foreach ($xmlSheet->conditionalFormatting as $conditional) { foreach ($xmlSheet->conditionalFormatting as $conditional) {
foreach ($conditional->cfRule as $cfRule) { foreach ($conditional->cfRule as $cfRule) {
if (((string)$cfRule["type"] == \PHPExcel\Style\Conditional::CONDITION_NONE || (string)$cfRule["type"] == \PHPExcel\Style\Conditional::CONDITION_CELLIS || (string)$cfRule["type"] == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT || (string)$cfRule["type"] == \PHPExcel\Style\Conditional::CONDITION_EXPRESSION) && isset($dxfs[intval($cfRule["dxfId"])])) { if (((string)$cfRule["type"] == \PhpSpreadsheet\Style\Conditional::CONDITION_NONE || (string)$cfRule["type"] == \PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS || (string)$cfRule["type"] == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT || (string)$cfRule["type"] == \PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION) && isset($dxfs[intval($cfRule["dxfId"])])) {
$conditionals[(string) $conditional["sqref"]][intval($cfRule["priority"])] = $cfRule; $conditionals[(string) $conditional["sqref"]][intval($cfRule["priority"])] = $cfRule;
} }
} }
@ -1022,7 +1019,7 @@ class Excel2007 extends BaseReader implements IReader
ksort($cfRules); ksort($cfRules);
$conditionalStyles = array(); $conditionalStyles = array();
foreach ($cfRules as $cfRule) { foreach ($cfRules as $cfRule) {
$objConditional = new \PHPExcel\Style\Conditional(); $objConditional = new \PhpSpreadsheet\Style\Conditional();
$objConditional->setConditionType((string)$cfRule["type"]); $objConditional->setConditionType((string)$cfRule["type"]);
$objConditional->setOperatorType((string)$cfRule["operator"]); $objConditional->setOperatorType((string)$cfRule["operator"]);
@ -1076,17 +1073,17 @@ class Excel2007 extends BaseReader implements IReader
$column = $autoFilter->getColumnByOffset((integer) $filterColumn["colId"]); $column = $autoFilter->getColumnByOffset((integer) $filterColumn["colId"]);
// Check for standard filters // Check for standard filters
if ($filterColumn->filters) { if ($filterColumn->filters) {
$column->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER); $column->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER);
$filters = $filterColumn->filters; $filters = $filterColumn->filters;
if ((isset($filters["blank"])) && ($filters["blank"] == 1)) { if ((isset($filters["blank"])) && ($filters["blank"] == 1)) {
// Operator is undefined, but always treated as EQUAL // Operator is undefined, but always treated as EQUAL
$column->createRule()->setRule(null, '')->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER); $column->createRule()->setRule(null, '')->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER);
} }
// Standard filters are always an OR join, so no join rule needs to be set // Standard filters are always an OR join, so no join rule needs to be set
// Entries can be either filter elements // Entries can be either filter elements
foreach ($filters->filter as $filterRule) { foreach ($filters->filter as $filterRule) {
// Operator is undefined, but always treated as EQUAL // Operator is undefined, but always treated as EQUAL
$column->createRule()->setRule(null, (string) $filterRule["val"])->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER); $column->createRule()->setRule(null, (string) $filterRule["val"])->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER);
} }
// Or Date Group elements // Or Date Group elements
foreach ($filters->dateGroupItem as $dateGroupItem) { foreach ($filters->dateGroupItem as $dateGroupItem) {
@ -1103,29 +1100,29 @@ class Excel2007 extends BaseReader implements IReader
), ),
(string) $dateGroupItem["dateTimeGrouping"] (string) $dateGroupItem["dateTimeGrouping"]
) )
->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP); ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP);
} }
} }
// Check for custom filters // Check for custom filters
if ($filterColumn->customFilters) { if ($filterColumn->customFilters) {
$column->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER); $column->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER);
$customFilters = $filterColumn->customFilters; $customFilters = $filterColumn->customFilters;
// Custom filters can an AND or an OR join; // Custom filters can an AND or an OR join;
// and there should only ever be one or two entries // and there should only ever be one or two entries
if ((isset($customFilters["and"])) && ($customFilters["and"] == 1)) { if ((isset($customFilters["and"])) && ($customFilters["and"] == 1)) {
$column->setJoin(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND); $column->setJoin(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND);
} }
foreach ($customFilters->customFilter as $filterRule) { foreach ($customFilters->customFilter as $filterRule) {
$column->createRule()->setRule( $column->createRule()->setRule(
(string) $filterRule["operator"], (string) $filterRule["operator"],
(string) $filterRule["val"] (string) $filterRule["val"]
) )
->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER);
} }
} }
// Check for dynamic filters // Check for dynamic filters
if ($filterColumn->dynamicFilter) { if ($filterColumn->dynamicFilter) {
$column->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER); $column->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER);
// We should only ever have one dynamic filter // We should only ever have one dynamic filter
foreach ($filterColumn->dynamicFilter as $filterRule) { foreach ($filterColumn->dynamicFilter as $filterRule) {
$column->createRule()->setRule( $column->createRule()->setRule(
@ -1134,7 +1131,7 @@ class Excel2007 extends BaseReader implements IReader
(string) $filterRule["val"], (string) $filterRule["val"],
(string) $filterRule["type"] (string) $filterRule["type"]
) )
->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER); ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER);
if (isset($filterRule["val"])) { if (isset($filterRule["val"])) {
$column->setAttribute('val', (string) $filterRule["val"]); $column->setAttribute('val', (string) $filterRule["val"]);
} }
@ -1145,21 +1142,21 @@ class Excel2007 extends BaseReader implements IReader
} }
// Check for dynamic filters // Check for dynamic filters
if ($filterColumn->top10) { if ($filterColumn->top10) {
$column->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER); $column->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER);
// We should only ever have one top10 filter // We should only ever have one top10 filter
foreach ($filterColumn->top10 as $filterRule) { foreach ($filterColumn->top10 as $filterRule) {
$column->createRule()->setRule( $column->createRule()->setRule(
(((isset($filterRule["percent"])) && ($filterRule["percent"] == 1)) (((isset($filterRule["percent"])) && ($filterRule["percent"] == 1))
? \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT ? \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT
: \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE : \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE
), ),
(string) $filterRule["val"], (string) $filterRule["val"],
(((isset($filterRule["top"])) && ($filterRule["top"] == 1)) (((isset($filterRule["top"])) && ($filterRule["top"] == 1))
? \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP ? \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP
: \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM : \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM
) )
) )
->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER); ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER);
} }
} }
} }
@ -1248,14 +1245,14 @@ class Excel2007 extends BaseReader implements IReader
if ($xmlSheet && $xmlSheet->rowBreaks && $xmlSheet->rowBreaks->brk && !$this->readDataOnly) { if ($xmlSheet && $xmlSheet->rowBreaks && $xmlSheet->rowBreaks->brk && !$this->readDataOnly) {
foreach ($xmlSheet->rowBreaks->brk as $brk) { foreach ($xmlSheet->rowBreaks->brk as $brk) {
if ($brk["man"]) { if ($brk["man"]) {
$docSheet->setBreak("A$brk[id]", \PHPExcel\Worksheet::BREAK_ROW); $docSheet->setBreak("A$brk[id]", \PhpSpreadsheet\Worksheet::BREAK_ROW);
} }
} }
} }
if ($xmlSheet && $xmlSheet->colBreaks && $xmlSheet->colBreaks->brk && !$this->readDataOnly) { if ($xmlSheet && $xmlSheet->colBreaks && $xmlSheet->colBreaks->brk && !$this->readDataOnly) {
foreach ($xmlSheet->colBreaks->brk as $brk) { foreach ($xmlSheet->colBreaks->brk as $brk) {
if ($brk["man"]) { if ($brk["man"]) {
$docSheet->setBreak(\PHPExcel\Cell::stringFromColumnIndex((string) $brk["id"]) . "1", \PHPExcel\Worksheet::BREAK_COLUMN); $docSheet->setBreak(\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $brk["id"]) . "1", \PhpSpreadsheet\Worksheet::BREAK_COLUMN);
} }
} }
} }
@ -1269,7 +1266,7 @@ class Excel2007 extends BaseReader implements IReader
$stRange = $docSheet->shrinkRangeToFit($range); $stRange = $docSheet->shrinkRangeToFit($range);
// Extract all cell references in $range // Extract all cell references in $range
foreach (\PHPExcel\Cell::extractAllCellReferencesInRange($stRange) as $reference) { foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($stRange) as $reference) {
// Create validation // Create validation
$docValidation = $docSheet->getCell($reference)->getDataValidation(); $docValidation = $docSheet->getCell($reference)->getDataValidation();
$docValidation->setType((string) $dataValidation["type"]); $docValidation->setType((string) $dataValidation["type"]);
@ -1301,7 +1298,7 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels") $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")
), ),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
foreach ($relsWorksheet->Relationship as $ele) { foreach ($relsWorksheet->Relationship as $ele) {
if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink") { if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink") {
@ -1316,7 +1313,7 @@ class Excel2007 extends BaseReader implements IReader
// Link url // Link url
$linkRel = $hyperlink->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'); $linkRel = $hyperlink->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships');
foreach (\PHPExcel\Cell::extractAllCellReferencesInRange($hyperlink['ref']) as $cellReference) { foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($hyperlink['ref']) as $cellReference) {
$cell = $docSheet->getCell($cellReference); $cell = $docSheet->getCell($cellReference);
if (isset($linkRel['id'])) { if (isset($linkRel['id'])) {
$hyperlinkUrl = $hyperlinks[ (string)$linkRel['id'] ]; $hyperlinkUrl = $hyperlinks[ (string)$linkRel['id'] ];
@ -1349,7 +1346,7 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels") $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")
), ),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
foreach ($relsWorksheet->Relationship as $ele) { foreach ($relsWorksheet->Relationship as $ele) {
if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments") { if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments") {
@ -1364,11 +1361,11 @@ class Excel2007 extends BaseReader implements IReader
// Loop through comments // Loop through comments
foreach ($comments as $relName => $relPath) { foreach ($comments as $relName => $relPath) {
// Load comments file // Load comments file
$relPath = \PHPExcel\Shared\File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath); $relPath = \PhpSpreadsheet\Shared\File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath);
$commentsFile = simplexml_load_string( $commentsFile = simplexml_load_string(
$this->securityScan($this->getFromZipArchive($zip, $relPath)), $this->securityScan($this->getFromZipArchive($zip, $relPath)),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
// Utility variables // Utility variables
@ -1391,11 +1388,11 @@ class Excel2007 extends BaseReader implements IReader
// Loop through VML comments // Loop through VML comments
foreach ($vmlComments as $relName => $relPath) { foreach ($vmlComments as $relName => $relPath) {
// Load VML comments file // Load VML comments file
$relPath = \PHPExcel\Shared\File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath); $relPath = \PhpSpreadsheet\Shared\File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath);
$vmlCommentsFile = simplexml_load_string( $vmlCommentsFile = simplexml_load_string(
$this->securityScan($this->getFromZipArchive($zip, $relPath)), $this->securityScan($this->getFromZipArchive($zip, $relPath)),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$vmlCommentsFile->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); $vmlCommentsFile->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
@ -1466,7 +1463,7 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels") $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")
), ),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$vmlRelationship = ''; $vmlRelationship = '';
@ -1484,7 +1481,7 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels') $this->getFromZipArchive($zip, dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels')
), ),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$drawings = array(); $drawings = array();
foreach ($relsVML->Relationship as $ele) { foreach ($relsVML->Relationship as $ele) {
@ -1497,7 +1494,7 @@ class Excel2007 extends BaseReader implements IReader
$vmlDrawing = simplexml_load_string( $vmlDrawing = simplexml_load_string(
$this->securityScan($this->getFromZipArchive($zip, $vmlRelationship)), $this->securityScan($this->getFromZipArchive($zip, $vmlRelationship)),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$vmlDrawing->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); $vmlDrawing->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
@ -1512,12 +1509,12 @@ class Excel2007 extends BaseReader implements IReader
$imageData = $imageData->attributes('urn:schemas-microsoft-com:office:office'); $imageData = $imageData->attributes('urn:schemas-microsoft-com:office:office');
$style = self::toCSSArray((string)$shape['style']); $style = self::toCSSArray((string)$shape['style']);
$hfImages[(string) $shape['id']] = new \PHPExcel\Worksheet\HeaderFooterDrawing(); $hfImages[(string) $shape['id']] = new \PhpSpreadsheet\Worksheet\HeaderFooterDrawing();
if (isset($imageData['title'])) { if (isset($imageData['title'])) {
$hfImages[(string) $shape['id']]->setName((string)$imageData['title']); $hfImages[(string) $shape['id']]->setName((string)$imageData['title']);
} }
$hfImages[(string) $shape['id']]->setPath("zip://".\PHPExcel\Shared_File::realpath($pFilename)."#" . $drawings[(string)$imageData['relid']], false); $hfImages[(string) $shape['id']]->setPath("zip://".\PhpSpreadsheet\Shared_File::realpath($pFilename)."#" . $drawings[(string)$imageData['relid']], false);
$hfImages[(string) $shape['id']]->setResizeProportional(false); $hfImages[(string) $shape['id']]->setResizeProportional(false);
$hfImages[(string) $shape['id']]->setWidth($style['width']); $hfImages[(string) $shape['id']]->setWidth($style['width']);
$hfImages[(string) $shape['id']]->setHeight($style['height']); $hfImages[(string) $shape['id']]->setHeight($style['height']);
@ -1542,7 +1539,7 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels") $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")
), ),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$drawings = array(); $drawings = array();
foreach ($relsWorksheet->Relationship as $ele) { foreach ($relsWorksheet->Relationship as $ele) {
@ -1559,7 +1556,7 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, dirname($fileDrawing) . "/_rels/" . basename($fileDrawing) . ".rels") $this->getFromZipArchive($zip, dirname($fileDrawing) . "/_rels/" . basename($fileDrawing) . ".rels")
), ),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$images = array(); $images = array();
@ -1580,7 +1577,7 @@ class Excel2007 extends BaseReader implements IReader
$xmlDrawing = simplexml_load_string( $xmlDrawing = simplexml_load_string(
$this->securityScan($this->getFromZipArchive($zip, $fileDrawing)), $this->securityScan($this->getFromZipArchive($zip, $fileDrawing)),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
)->children("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"); )->children("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing");
if ($xmlDrawing->oneCellAnchor) { if ($xmlDrawing->oneCellAnchor) {
@ -1589,32 +1586,32 @@ class Excel2007 extends BaseReader implements IReader
$blip = $oneCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip; $blip = $oneCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip;
$xfrm = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm; $xfrm = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm;
$outerShdw = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw; $outerShdw = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw;
$objDrawing = new \PHPExcel\Worksheet\Drawing; $objDrawing = new \PhpSpreadsheet\Worksheet\Drawing;
$objDrawing->setName((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name")); $objDrawing->setName((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name"));
$objDrawing->setDescription((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr")); $objDrawing->setDescription((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr"));
$objDrawing->setPath( $objDrawing->setPath(
"zip://".\PHPExcel\Shared\File::realpath($pFilename)."#" . "zip://".\PhpSpreadsheet\Shared\File::realpath($pFilename)."#" .
$images[(string) self::getArrayItem( $images[(string) self::getArrayItem(
$blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), $blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"),
"embed" "embed"
)], )],
false false
); );
$objDrawing->setCoordinates(\PHPExcel\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1)); $objDrawing->setCoordinates(\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1));
$objDrawing->setOffsetX(\PHPExcel\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff)); $objDrawing->setOffsetX(\PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff));
$objDrawing->setOffsetY(\PHPExcel\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff)); $objDrawing->setOffsetY(\PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff));
$objDrawing->setResizeProportional(false); $objDrawing->setResizeProportional(false);
$objDrawing->setWidth(\PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx"))); $objDrawing->setWidth(\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx")));
$objDrawing->setHeight(\PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy"))); $objDrawing->setHeight(\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy")));
if ($xfrm) { if ($xfrm) {
$objDrawing->setRotation(\PHPExcel\Shared\Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot"))); $objDrawing->setRotation(\PhpSpreadsheet\Shared\Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot")));
} }
if ($outerShdw) { if ($outerShdw) {
$shadow = $objDrawing->getShadow(); $shadow = $objDrawing->getShadow();
$shadow->setVisible(true); $shadow->setVisible(true);
$shadow->setBlurRadius(\PHPExcel\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad"))); $shadow->setBlurRadius(\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad")));
$shadow->setDistance(\PHPExcel\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist"))); $shadow->setDistance(\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist")));
$shadow->setDirection(\PHPExcel\Shared\Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir"))); $shadow->setDirection(\PhpSpreadsheet\Shared\Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir")));
$shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), "algn")); $shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), "algn"));
$shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), "val")); $shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), "val"));
$shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), "val") / 1000); $shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), "val") / 1000);
@ -1622,11 +1619,11 @@ class Excel2007 extends BaseReader implements IReader
$objDrawing->setWorksheet($docSheet); $objDrawing->setWorksheet($docSheet);
} else { } else {
// ? Can charts be positioned with a oneCellAnchor ? // ? Can charts be positioned with a oneCellAnchor ?
$coordinates = \PHPExcel\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1); $coordinates = \PhpSpreadsheet\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1);
$offsetX = \PHPExcel\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff); $offsetX = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff);
$offsetY = \PHPExcel\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff); $offsetY = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff);
$width = \PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx")); $width = \PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx"));
$height = \PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy")); $height = \PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy"));
} }
} }
} }
@ -1636,45 +1633,45 @@ class Excel2007 extends BaseReader implements IReader
$blip = $twoCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip; $blip = $twoCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip;
$xfrm = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm; $xfrm = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm;
$outerShdw = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw; $outerShdw = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw;
$objDrawing = new \PHPExcel\Worksheet\Drawing; $objDrawing = new \PhpSpreadsheet\Worksheet\Drawing;
$objDrawing->setName((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name")); $objDrawing->setName((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name"));
$objDrawing->setDescription((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr")); $objDrawing->setDescription((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr"));
$objDrawing->setPath( $objDrawing->setPath(
"zip://".\PHPExcel\Shared\File::realpath($pFilename)."#" . "zip://".\PhpSpreadsheet\Shared\File::realpath($pFilename)."#" .
$images[(string) self::getArrayItem( $images[(string) self::getArrayItem(
$blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), $blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"),
"embed" "embed"
)], )],
false false
); );
$objDrawing->setCoordinates(\PHPExcel\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1)); $objDrawing->setCoordinates(\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1));
$objDrawing->setOffsetX(\PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff)); $objDrawing->setOffsetX(\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff));
$objDrawing->setOffsetY(\PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff)); $objDrawing->setOffsetY(\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff));
$objDrawing->setResizeProportional(false); $objDrawing->setResizeProportional(false);
if ($xfrm) { if ($xfrm) {
$objDrawing->setWidth(\PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cx"))); $objDrawing->setWidth(\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cx")));
$objDrawing->setHeight(\PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cy"))); $objDrawing->setHeight(\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cy")));
$objDrawing->setRotation(\PHPExcel\Shared\Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot"))); $objDrawing->setRotation(\PhpSpreadsheet\Shared\Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot")));
} }
if ($outerShdw) { if ($outerShdw) {
$shadow = $objDrawing->getShadow(); $shadow = $objDrawing->getShadow();
$shadow->setVisible(true); $shadow->setVisible(true);
$shadow->setBlurRadius(\PHPExcel\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad"))); $shadow->setBlurRadius(\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad")));
$shadow->setDistance(\PHPExcel\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist"))); $shadow->setDistance(\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist")));
$shadow->setDirection(\PHPExcel\Shared\Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir"))); $shadow->setDirection(\PhpSpreadsheet\Shared\Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir")));
$shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), "algn")); $shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), "algn"));
$shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), "val")); $shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), "val"));
$shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), "val") / 1000); $shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), "val") / 1000);
} }
$objDrawing->setWorksheet($docSheet); $objDrawing->setWorksheet($docSheet);
} elseif (($this->includeCharts) && ($twoCellAnchor->graphicFrame)) { } elseif (($this->includeCharts) && ($twoCellAnchor->graphicFrame)) {
$fromCoordinate = \PHPExcel\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1); $fromCoordinate = \PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1);
$fromOffsetX = \PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff); $fromOffsetX = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff);
$fromOffsetY = \PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff); $fromOffsetY = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff);
$toCoordinate = \PHPExcel\Cell::stringFromColumnIndex((string) $twoCellAnchor->to->col) . ($twoCellAnchor->to->row + 1); $toCoordinate = \PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->to->col) . ($twoCellAnchor->to->row + 1);
$toOffsetX = \PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->to->colOff); $toOffsetX = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->to->colOff);
$toOffsetY = \PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->to->rowOff); $toOffsetY = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->to->rowOff);
$graphic = $twoCellAnchor->graphicFrame->children("http://schemas.openxmlformats.org/drawingml/2006/main")->graphic; $graphic = $twoCellAnchor->graphicFrame->children("http://schemas.openxmlformats.org/drawingml/2006/main")->graphic;
$chartRef = $graphic->graphicData->children("http://schemas.openxmlformats.org/drawingml/2006/chart")->chart; $chartRef = $graphic->graphicData->children("http://schemas.openxmlformats.org/drawingml/2006/chart")->chart;
$thisChart = (string) $chartRef->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"); $thisChart = (string) $chartRef->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships");
@ -1805,7 +1802,7 @@ class Excel2007 extends BaseReader implements IReader
if ($worksheet = $docSheet->getParent()->getSheetByName($range[0])) { if ($worksheet = $docSheet->getParent()->getSheetByName($range[0])) {
$extractedRange = str_replace('$', '', $range[1]); $extractedRange = str_replace('$', '', $range[1]);
$scope = $docSheet->getParent()->getSheet($mapSheetId[(integer) $definedName['localSheetId']]); $scope = $docSheet->getParent()->getSheet($mapSheetId[(integer) $definedName['localSheetId']]);
$excel->addNamedRange(new \PHPExcel\NamedRange((string)$definedName['name'], $worksheet, $extractedRange, true, $scope)); $excel->addNamedRange(new \PhpSpreadsheet\NamedRange((string)$definedName['name'], $worksheet, $extractedRange, true, $scope));
} }
} }
} }
@ -1817,7 +1814,7 @@ class Excel2007 extends BaseReader implements IReader
$extractedSheetName = ''; $extractedSheetName = '';
if (strpos((string)$definedName, '!') !== false) { if (strpos((string)$definedName, '!') !== false) {
// Extract sheet name // Extract sheet name
$extractedSheetName = \PHPExcel\Worksheet::extractSheetTitle((string)$definedName, true); $extractedSheetName = \PhpSpreadsheet\Worksheet::extractSheetTitle((string)$definedName, true);
$extractedSheetName = $extractedSheetName[0]; $extractedSheetName = $extractedSheetName[0];
// Locate sheet // Locate sheet
@ -1829,7 +1826,7 @@ class Excel2007 extends BaseReader implements IReader
} }
if ($locatedSheet !== null) { if ($locatedSheet !== null) {
$excel->addNamedRange(new \PHPExcel\NamedRange((string)$definedName['name'], $locatedSheet, $extractedRange, false)); $excel->addNamedRange(new \PhpSpreadsheet\NamedRange((string)$definedName['name'], $locatedSheet, $extractedRange, false));
} }
} }
} }
@ -1860,7 +1857,7 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, "[Content_Types].xml") $this->getFromZipArchive($zip, "[Content_Types].xml")
), ),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
foreach ($contentTypes->Override as $contentType) { foreach ($contentTypes->Override as $contentType) {
switch ($contentType["ContentType"]) { switch ($contentType["ContentType"]) {
@ -1872,9 +1869,9 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, $chartEntryRef) $this->getFromZipArchive($zip, $chartEntryRef)
), ),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$objChart = \PHPExcel\Reader\Excel2007\Chart::readChart($chartElements, basename($chartEntryRef, '.xml')); $objChart = \PhpSpreadsheet\Reader\Excel2007\Chart::readChart($chartElements, basename($chartEntryRef, '.xml'));
// echo 'Chart ', $chartEntryRef, '<br />'; // echo 'Chart ', $chartEntryRef, '<br />';
// var_dump($charts[$chartEntryRef]); // var_dump($charts[$chartEntryRef]);
@ -1906,13 +1903,13 @@ class Excel2007 extends BaseReader implements IReader
if (isset($color["rgb"])) { if (isset($color["rgb"])) {
return (string)$color["rgb"]; return (string)$color["rgb"];
} elseif (isset($color["indexed"])) { } elseif (isset($color["indexed"])) {
return \PHPExcel\Style\Color::indexedColor($color["indexed"]-7, $background)->getARGB(); return \PhpSpreadsheet\Style\Color::indexedColor($color["indexed"]-7, $background)->getARGB();
} elseif (isset($color["theme"])) { } elseif (isset($color["theme"])) {
if (self::$theme !== null) { if (self::$theme !== null) {
$returnColour = self::$theme->getColourByIndex((int)$color["theme"]); $returnColour = self::$theme->getColourByIndex((int)$color["theme"]);
if (isset($color["tint"])) { if (isset($color["tint"])) {
$tintAdjust = (float) $color["tint"]; $tintAdjust = (float) $color["tint"];
$returnColour = \PHPExcel\Style\Color::changeBrightness($returnColour, $tintAdjust); $returnColour = \PhpSpreadsheet\Style\Color::changeBrightness($returnColour, $tintAdjust);
} }
return 'FF'.$returnColour; return 'FF'.$returnColour;
} }
@ -1951,7 +1948,7 @@ class Excel2007 extends BaseReader implements IReader
$docStyle->getFont()->getColor()->setARGB(self::readColor($style->font->color)); $docStyle->getFont()->getColor()->setARGB(self::readColor($style->font->color));
if (isset($style->font->u) && !isset($style->font->u["val"])) { if (isset($style->font->u) && !isset($style->font->u["val"])) {
$docStyle->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_SINGLE); $docStyle->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE);
} elseif (isset($style->font->u) && isset($style->font->u["val"])) { } elseif (isset($style->font->u) && isset($style->font->u["val"])) {
$docStyle->getFont()->setUnderline((string)$style->font->u["val"]); $docStyle->getFont()->setUnderline((string)$style->font->u["val"]);
} }
@ -1997,13 +1994,13 @@ class Excel2007 extends BaseReader implements IReader
$diagonalUp = self::boolean((string) $style->border["diagonalUp"]); $diagonalUp = self::boolean((string) $style->border["diagonalUp"]);
$diagonalDown = self::boolean((string) $style->border["diagonalDown"]); $diagonalDown = self::boolean((string) $style->border["diagonalDown"]);
if (!$diagonalUp && !$diagonalDown) { if (!$diagonalUp && !$diagonalDown) {
$docStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_NONE); $docStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_NONE);
} elseif ($diagonalUp && !$diagonalDown) { } elseif ($diagonalUp && !$diagonalDown) {
$docStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_UP); $docStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_UP);
} elseif (!$diagonalUp && $diagonalDown) { } elseif (!$diagonalUp && $diagonalDown) {
$docStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_DOWN); $docStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN);
} else { } else {
$docStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_BOTH); $docStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH);
} }
self::readBorder($docStyle->getBorders()->getLeft(), $style->border->left); self::readBorder($docStyle->getBorders()->getLeft(), $style->border->left);
self::readBorder($docStyle->getBorders()->getRight(), $style->border->right); self::readBorder($docStyle->getBorders()->getRight(), $style->border->right);
@ -2035,17 +2032,17 @@ class Excel2007 extends BaseReader implements IReader
if (isset($style->protection)) { if (isset($style->protection)) {
if (isset($style->protection['locked'])) { if (isset($style->protection['locked'])) {
if (self::boolean((string) $style->protection['locked'])) { if (self::boolean((string) $style->protection['locked'])) {
$docStyle->getProtection()->setLocked(\PHPExcel\Style\Protection::PROTECTION_PROTECTED); $docStyle->getProtection()->setLocked(\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED);
} else { } else {
$docStyle->getProtection()->setLocked(\PHPExcel\Style\Protection::PROTECTION_UNPROTECTED); $docStyle->getProtection()->setLocked(\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED);
} }
} }
if (isset($style->protection['hidden'])) { if (isset($style->protection['hidden'])) {
if (self::boolean((string) $style->protection['hidden'])) { if (self::boolean((string) $style->protection['hidden'])) {
$docStyle->getProtection()->setHidden(\PHPExcel\Style\Protection::PROTECTION_PROTECTED); $docStyle->getProtection()->setHidden(\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED);
} else { } else {
$docStyle->getProtection()->setHidden(\PHPExcel\Style\Protection::PROTECTION_UNPROTECTED); $docStyle->getProtection()->setHidden(\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED);
} }
} }
} }
@ -2068,17 +2065,17 @@ class Excel2007 extends BaseReader implements IReader
private function parseRichText($is = null) private function parseRichText($is = null)
{ {
$value = new \PHPExcel\RichText(); $value = new \PhpSpreadsheet\RichText();
if (isset($is->t)) { if (isset($is->t)) {
$value->createText(\PHPExcel\Shared\StringHelper::controlCharacterOOXML2PHP((string) $is->t)); $value->createText(\PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $is->t));
} else { } else {
if (is_object($is->r)) { if (is_object($is->r)) {
foreach ($is->r as $run) { foreach ($is->r as $run) {
if (!isset($run->rPr)) { if (!isset($run->rPr)) {
$objText = $value->createText(\PHPExcel\Shared\StringHelper::controlCharacterOOXML2PHP((string) $run->t)); $objText = $value->createText(\PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $run->t));
} else { } else {
$objText = $value->createTextRun(\PHPExcel\Shared\StringHelper::controlCharacterOOXML2PHP((string) $run->t)); $objText = $value->createTextRun(\PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $run->t));
if (isset($run->rPr->rFont["val"])) { if (isset($run->rPr->rFont["val"])) {
$objText->getFont()->setName((string) $run->rPr->rFont["val"]); $objText->getFont()->setName((string) $run->rPr->rFont["val"]);
@ -2087,7 +2084,7 @@ class Excel2007 extends BaseReader implements IReader
$objText->getFont()->setSize((string) $run->rPr->sz["val"]); $objText->getFont()->setSize((string) $run->rPr->sz["val"]);
} }
if (isset($run->rPr->color)) { if (isset($run->rPr->color)) {
$objText->getFont()->setColor(new \PHPExcel\Style\Color(self::readColor($run->rPr->color))); $objText->getFont()->setColor(new \PhpSpreadsheet\Style\Color(self::readColor($run->rPr->color)));
} }
if ((isset($run->rPr->b["val"]) && self::boolean((string) $run->rPr->b["val"])) || if ((isset($run->rPr->b["val"]) && self::boolean((string) $run->rPr->b["val"])) ||
(isset($run->rPr->b) && !isset($run->rPr->b["val"]))) { (isset($run->rPr->b) && !isset($run->rPr->b["val"]))) {
@ -2107,7 +2104,7 @@ class Excel2007 extends BaseReader implements IReader
} }
} }
if (isset($run->rPr->u) && !isset($run->rPr->u["val"])) { if (isset($run->rPr->u) && !isset($run->rPr->u["val"])) {
$objText->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_SINGLE); $objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE);
} elseif (isset($run->rPr->u) && isset($run->rPr->u["val"])) { } elseif (isset($run->rPr->u) && isset($run->rPr->u["val"])) {
$objText->getFont()->setUnderline((string)$run->rPr->u["val"]); $objText->getFont()->setUnderline((string)$run->rPr->u["val"]);
} }
@ -2139,7 +2136,7 @@ class Excel2007 extends BaseReader implements IReader
$UIRels = simplexml_load_string( $UIRels = simplexml_load_string(
$this->securityScan($dataRels), $this->securityScan($dataRels),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
if ($UIRels) { if ($UIRels) {
// we need to save id and target to avoid parsing customUI.xml and "guess" if it's a pseudo callback who load the image // we need to save id and target to avoid parsing customUI.xml and "guess" if it's a pseudo callback who load the image
@ -2189,15 +2186,15 @@ class Excel2007 extends BaseReader implements IReader
} }
if (strpos($item[1], 'pt') !== false) { if (strpos($item[1], 'pt') !== false) {
$item[1] = str_replace('pt', '', $item[1]); $item[1] = str_replace('pt', '', $item[1]);
$item[1] = \PHPExcel\Shared\Font::fontSizeToPixels($item[1]); $item[1] = \PhpSpreadsheet\Shared\Font::fontSizeToPixels($item[1]);
} }
if (strpos($item[1], 'in') !== false) { if (strpos($item[1], 'in') !== false) {
$item[1] = str_replace('in', '', $item[1]); $item[1] = str_replace('in', '', $item[1]);
$item[1] = \PHPExcel\Shared\Font::inchSizeToPixels($item[1]); $item[1] = \PhpSpreadsheet\Shared\Font::inchSizeToPixels($item[1]);
} }
if (strpos($item[1], 'cm') !== false) { if (strpos($item[1], 'cm') !== false) {
$item[1] = str_replace('cm', '', $item[1]); $item[1] = str_replace('cm', '', $item[1]);
$item[1] = \PHPExcel\Shared\Font::centimeterSizeToPixels($item[1]); $item[1] = \PhpSpreadsheet\Shared\Font::centimeterSizeToPixels($item[1]);
} }
$style[$item[0]] = $item[1]; $style[$item[0]] = $item[1];

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader\Excel2007; namespace PhpSpreadsheet\Reader\Excel2007;
/** /**
* PHPExcel_Reader_Excel2007_Chart * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Reader\Excel2007;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader_Excel2007 * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -52,7 +49,7 @@ class Chart
if (isset($color["rgb"])) { if (isset($color["rgb"])) {
return (string)$color["rgb"]; return (string)$color["rgb"];
} elseif (isset($color["indexed"])) { } elseif (isset($color["indexed"])) {
return \PHPExcel\Style\Color::indexedColor($color["indexed"]-7, $background)->getARGB(); return \PhpSpreadsheet\Style\Color::indexedColor($color["indexed"]-7, $background)->getARGB();
} }
} }
@ -156,9 +153,9 @@ class Chart
} }
} }
if ($plotAreaLayout == null) { if ($plotAreaLayout == null) {
$plotAreaLayout = new \PHPExcel\Chart\Layout(); $plotAreaLayout = new \PhpSpreadsheet\Chart\Layout();
} }
$plotArea = new \PHPExcel\Chart\PlotArea($plotAreaLayout, $plotSeries); $plotArea = new \PhpSpreadsheet\Chart\PlotArea($plotAreaLayout, $plotSeries);
self::setChartAttributes($plotAreaLayout, $plotAttributes); self::setChartAttributes($plotAreaLayout, $plotAttributes);
break; break;
case "plotVisOnly": case "plotVisOnly":
@ -187,13 +184,13 @@ class Chart
break; break;
} }
} }
$legend = new \PHPExcel\Chart\Legend($legendPos, $legendLayout, $legendOverlay); $legend = new \PhpSpreadsheet\Chart\Legend($legendPos, $legendLayout, $legendOverlay);
break; break;
} }
} }
} }
} }
$chart = new \PHPExcel\Chart($chartName, $title, $legend, $plotArea, $plotVisOnly, $dispBlanksAs, $XaxisLabel, $YaxisLabel); $chart = new \PhpSpreadsheet\Chart($chartName, $title, $legend, $plotArea, $plotVisOnly, $dispBlanksAs, $XaxisLabel, $YaxisLabel);
return $chart; return $chart;
} }
@ -220,7 +217,7 @@ class Chart
} }
} }
return new \PHPExcel\Chart\Title($caption, $titleLayout); return new \PhpSpreadsheet\Chart\Title($caption, $titleLayout);
} }
private static function chartLayoutDetails($chartDetail, $namespacesChartMeta) private static function chartLayoutDetails($chartDetail, $namespacesChartMeta)
@ -237,7 +234,7 @@ class Chart
// echo $detailKey, ' => ',self::getAttribute($detail, 'val', 'string'),PHP_EOL; // echo $detailKey, ' => ',self::getAttribute($detail, 'val', 'string'),PHP_EOL;
$layout[$detailKey] = self::getAttribute($detail, 'val', 'string'); $layout[$detailKey] = self::getAttribute($detail, 'val', 'string');
} }
return new \PHPExcel\Chart\Layout($layout); return new \PhpSpreadsheet\Chart\Layout($layout);
} }
private static function chartDataSeries($chartDetail, $namespacesChartMeta, $plotType) private static function chartDataSeries($chartDetail, $namespacesChartMeta, $plotType)
@ -288,7 +285,7 @@ class Chart
} }
} }
} }
return new \PHPExcel\Chart\DataSeries($plotType, $multiSeriesType, $plotOrder, $seriesLabel, $seriesCategory, $seriesValues, $smoothLine); return new \PhpSpreadsheet\Chart\DataSeries($plotType, $multiSeriesType, $plotOrder, $seriesLabel, $seriesCategory, $seriesValues, $smoothLine);
} }
@ -298,24 +295,24 @@ class Chart
$seriesSource = (string) $seriesDetail->strRef->f; $seriesSource = (string) $seriesDetail->strRef->f;
$seriesData = self::chartDataSeriesValues($seriesDetail->strRef->strCache->children($namespacesChartMeta['c']), 's'); $seriesData = self::chartDataSeriesValues($seriesDetail->strRef->strCache->children($namespacesChartMeta['c']), 's');
return new \PHPExcel\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); return new \PhpSpreadsheet\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
} elseif (isset($seriesDetail->numRef)) { } elseif (isset($seriesDetail->numRef)) {
$seriesSource = (string) $seriesDetail->numRef->f; $seriesSource = (string) $seriesDetail->numRef->f;
$seriesData = self::chartDataSeriesValues($seriesDetail->numRef->numCache->children($namespacesChartMeta['c'])); $seriesData = self::chartDataSeriesValues($seriesDetail->numRef->numCache->children($namespacesChartMeta['c']));
return new \PHPExcel\Chart\DataSeriesValues('Number', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); return new \PhpSpreadsheet\Chart\DataSeriesValues('Number', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
} elseif (isset($seriesDetail->multiLvlStrRef)) { } elseif (isset($seriesDetail->multiLvlStrRef)) {
$seriesSource = (string) $seriesDetail->multiLvlStrRef->f; $seriesSource = (string) $seriesDetail->multiLvlStrRef->f;
$seriesData = self::chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlStrRef->multiLvlStrCache->children($namespacesChartMeta['c']), 's'); $seriesData = self::chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlStrRef->multiLvlStrCache->children($namespacesChartMeta['c']), 's');
$seriesData['pointCount'] = count($seriesData['dataValues']); $seriesData['pointCount'] = count($seriesData['dataValues']);
return new \PHPExcel\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); return new \PhpSpreadsheet\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
} elseif (isset($seriesDetail->multiLvlNumRef)) { } elseif (isset($seriesDetail->multiLvlNumRef)) {
$seriesSource = (string) $seriesDetail->multiLvlNumRef->f; $seriesSource = (string) $seriesDetail->multiLvlNumRef->f;
$seriesData = self::chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlNumRef->multiLvlNumCache->children($namespacesChartMeta['c']), 's'); $seriesData = self::chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlNumRef->multiLvlNumCache->children($namespacesChartMeta['c']), 's');
$seriesData['pointCount'] = count($seriesData['dataValues']); $seriesData['pointCount'] = count($seriesData['dataValues']);
return new \PHPExcel\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); return new \PhpSpreadsheet\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
} }
return null; return null;
} }
@ -389,7 +386,7 @@ class Chart
private static function parseRichText($titleDetailPart = null) private static function parseRichText($titleDetailPart = null)
{ {
$value = new \PHPExcel\RichText(); $value = new \PhpSpreadsheet\RichText();
foreach ($titleDetailPart as $titleDetailElementKey => $titleDetailElement) { foreach ($titleDetailPart as $titleDetailElementKey => $titleDetailElement) {
if (isset($titleDetailElement->t)) { if (isset($titleDetailElement->t)) {
@ -407,7 +404,7 @@ class Chart
$fontColor = (self::getAttribute($titleDetailElement->rPr, 'color', 'string')); $fontColor = (self::getAttribute($titleDetailElement->rPr, 'color', 'string'));
if (!is_null($fontColor)) { if (!is_null($fontColor)) {
$objText->getFont()->setColor(new \PHPExcel\Style\Color(self::readColor($fontColor))); $objText->getFont()->setColor(new \PhpSpreadsheet\Style\Color(self::readColor($fontColor)));
} }
$bold = self::getAttribute($titleDetailElement->rPr, 'b', 'boolean'); $bold = self::getAttribute($titleDetailElement->rPr, 'b', 'boolean');
@ -432,11 +429,11 @@ class Chart
$underscore = (self::getAttribute($titleDetailElement->rPr, 'u', 'string')); $underscore = (self::getAttribute($titleDetailElement->rPr, 'u', 'string'));
if (!is_null($underscore)) { if (!is_null($underscore)) {
if ($underscore == 'sng') { if ($underscore == 'sng') {
$objText->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_SINGLE); $objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE);
} elseif ($underscore == 'dbl') { } elseif ($underscore == 'dbl') {
$objText->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_DOUBLE); $objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE);
} else { } else {
$objText->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_NONE); $objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_NONE);
} }
} }

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader\Excel2007; namespace PhpSpreadsheet\Reader\Excel2007;
/** /**
* PHPExcel_Reader_Excel2007_Theme * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Reader\Excel2007;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader_Excel2007 * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PHPExcel\Reader\Excel5; namespace PhpSpreadsheet\Reader\Excel5;
class Color class Color
{ {
@ -21,7 +21,7 @@ class Color
return $palette[$color - 8]; return $palette[$color - 8];
} else { } else {
// default color table // default color table
if ($version == \PHPExcel\Reader\Excel5::XLS_BIFF8) { if ($version == \PhpSpreadsheet\Reader\Excel5::XLS_BIFF8) {
return Color\BIFF8::lookup($color); return Color\BIFF8::lookup($color);
} else { } else {
// BIFF5 // BIFF5

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PHPExcel\Reader\Excel5\Color; namespace PhpSpreadsheet\Reader\Excel5\Color;
class BIFF5 class BIFF5
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PHPExcel\Reader\Excel5\Color; namespace PhpSpreadsheet\Reader\Excel5\Color;
class BIFF8 class BIFF8
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PHPExcel\Reader\Excel5\Color; namespace PhpSpreadsheet\Reader\Excel5\Color;
class BuiltIn class BuiltIn
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
namespace PHPExcel\Reader\Excel5; namespace PhpSpreadsheet\Reader\Excel5;
class ErrorCode class ErrorCode
{ {

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader\Excel5; namespace PhpSpreadsheet\Reader\Excel5;
/** /**
* PHPExcel_Reader_Excel5_Escher * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Reader\Excel5;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package \PHPExcel\Reader\Excel5 * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -103,7 +100,7 @@ class Escher
// Parse Escher stream // Parse Escher stream
while ($this->pos < $this->dataSize) { while ($this->pos < $this->dataSize) {
// offset: 2; size: 2: Record Type // offset: 2; size: 2: Record Type
$fbt = \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos + 2); $fbt = \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos + 2);
switch ($fbt) { switch ($fbt) {
case self::DGGCONTAINER: case self::DGGCONTAINER:
@ -175,15 +172,15 @@ class Escher
private function readDefault() private function readDefault()
{ {
// offset 0; size: 2; recVer and recInstance // offset 0; size: 2; recVer and recInstance
$verInstance = \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos); $verInstance = \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos);
// offset: 2; size: 2: Record Type // offset: 2; size: 2: Record Type
$fbt = \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos + 2); $fbt = \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos + 2);
// bit: 0-3; mask: 0x000F; recVer // bit: 0-3; mask: 0x000F; recVer
$recVer = (0x000F & $verInstance) >> 0; $recVer = (0x000F & $verInstance) >> 0;
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
@ -195,14 +192,14 @@ class Escher
*/ */
private function readDggContainer() private function readDggContainer()
{ {
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->pos += 8 + $length; $this->pos += 8 + $length;
// record is a container, read contents // record is a container, read contents
$dggContainer = new \PHPExcel\Shared\Escher\DggContainer(); $dggContainer = new \PhpSpreadsheet\Shared\Escher\DggContainer();
$this->object->setDggContainer($dggContainer); $this->object->setDggContainer($dggContainer);
$reader = new Escher($dggContainer); $reader = new Escher($dggContainer);
$reader->load($recordData); $reader->load($recordData);
@ -213,7 +210,7 @@ class Escher
*/ */
private function readDgg() private function readDgg()
{ {
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
@ -225,14 +222,14 @@ class Escher
*/ */
private function readBstoreContainer() private function readBstoreContainer()
{ {
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->pos += 8 + $length; $this->pos += 8 + $length;
// record is a container, read contents // record is a container, read contents
$bstoreContainer = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer(); $bstoreContainer = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer();
$this->object->setBstoreContainer($bstoreContainer); $this->object->setBstoreContainer($bstoreContainer);
$reader = new Escher($bstoreContainer); $reader = new Escher($bstoreContainer);
$reader->load($recordData); $reader->load($recordData);
@ -246,16 +243,16 @@ class Escher
// offset: 0; size: 2; recVer and recInstance // offset: 0; size: 2; recVer and recInstance
// bit: 4-15; mask: 0xFFF0; recInstance // bit: 4-15; mask: 0xFFF0; recInstance
$recInstance = (0xFFF0 & \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4;
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->pos += 8 + $length; $this->pos += 8 + $length;
// add BSE to BstoreContainer // add BSE to BstoreContainer
$BSE = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE(); $BSE = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE();
$this->object->addBSE($BSE); $this->object->addBSE($BSE);
$BSE->setBLIPType($recInstance); $BSE->setBLIPType($recInstance);
@ -270,16 +267,16 @@ class Escher
$rgbUid = substr($recordData, 2, 16); $rgbUid = substr($recordData, 2, 16);
// offset: 18; size: 2; tag // offset: 18; size: 2; tag
$tag = \PHPExcel\Reader\Excel5::getInt2d($recordData, 18); $tag = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 18);
// offset: 20; size: 4; size of BLIP in bytes // offset: 20; size: 4; size of BLIP in bytes
$size = \PHPExcel\Reader\Excel5::getInt4d($recordData, 20); $size = \PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 20);
// offset: 24; size: 4; number of references to this BLIP // offset: 24; size: 4; number of references to this BLIP
$cRef = \PHPExcel\Reader\Excel5::getInt4d($recordData, 24); $cRef = \PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 24);
// offset: 28; size: 4; MSOFO file offset // offset: 28; size: 4; MSOFO file offset
$foDelay = \PHPExcel\Reader\Excel5::getInt4d($recordData, 28); $foDelay = \PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 28);
// offset: 32; size: 1; unused1 // offset: 32; size: 1; unused1
$unused1 = ord($recordData{32}); $unused1 = ord($recordData{32});
@ -300,7 +297,7 @@ class Escher
$blipData = substr($recordData, 36 + $cbName); $blipData = substr($recordData, 36 + $cbName);
// record is a container, read contents // record is a container, read contents
$reader = new \PHPExcel\Reader\Excel5\Escher($BSE); $reader = new \PhpSpreadsheet\Reader\Excel5\Escher($BSE);
$reader->load($blipData); $reader->load($blipData);
} }
@ -312,9 +309,9 @@ class Escher
// offset: 0; size: 2; recVer and recInstance // offset: 0; size: 2; recVer and recInstance
// bit: 4-15; mask: 0xFFF0; recInstance // bit: 4-15; mask: 0xFFF0; recInstance
$recInstance = (0xFFF0 & \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4;
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
@ -339,7 +336,7 @@ class Escher
// offset: var; size: var; the raw image data // offset: var; size: var; the raw image data
$data = substr($recordData, $pos); $data = substr($recordData, $pos);
$blip = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); $blip = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip();
$blip->setData($data); $blip->setData($data);
$this->object->setBlip($blip); $this->object->setBlip($blip);
@ -353,9 +350,9 @@ class Escher
// offset: 0; size: 2; recVer and recInstance // offset: 0; size: 2; recVer and recInstance
// bit: 4-15; mask: 0xFFF0; recInstance // bit: 4-15; mask: 0xFFF0; recInstance
$recInstance = (0xFFF0 & \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4;
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
@ -380,7 +377,7 @@ class Escher
// offset: var; size: var; the raw image data // offset: var; size: var; the raw image data
$data = substr($recordData, $pos); $data = substr($recordData, $pos);
$blip = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); $blip = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip();
$blip->setData($data); $blip->setData($data);
$this->object->setBlip($blip); $this->object->setBlip($blip);
@ -394,9 +391,9 @@ class Escher
// offset: 0; size: 2; recVer and recInstance // offset: 0; size: 2; recVer and recInstance
// bit: 4-15; mask: 0xFFF0; recInstance // bit: 4-15; mask: 0xFFF0; recInstance
$recInstance = (0xFFF0 & \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4;
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
@ -413,9 +410,9 @@ class Escher
// offset: 0; size: 2; recVer and recInstance // offset: 0; size: 2; recVer and recInstance
// bit: 4-15; mask: 0xFFF0; recInstance // bit: 4-15; mask: 0xFFF0; recInstance
$recInstance = (0xFFF0 & \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4;
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
@ -427,7 +424,7 @@ class Escher
*/ */
private function readSplitMenuColors() private function readSplitMenuColors()
{ {
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
@ -439,16 +436,16 @@ class Escher
*/ */
private function readDgContainer() private function readDgContainer()
{ {
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->pos += 8 + $length; $this->pos += 8 + $length;
// record is a container, read contents // record is a container, read contents
$dgContainer = new \PHPExcel\Shared\Escher\DgContainer(); $dgContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer();
$this->object->setDgContainer($dgContainer); $this->object->setDgContainer($dgContainer);
$reader = new \PHPExcel\Reader\Excel5\Escher($dgContainer); $reader = new \PhpSpreadsheet\Reader\Excel5\Escher($dgContainer);
$escher = $reader->load($recordData); $escher = $reader->load($recordData);
} }
@ -457,7 +454,7 @@ class Escher
*/ */
private function readDg() private function readDg()
{ {
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
@ -471,16 +468,16 @@ class Escher
{ {
// context is either context DgContainer or SpgrContainer // context is either context DgContainer or SpgrContainer
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->pos += 8 + $length; $this->pos += 8 + $length;
// record is a container, read contents // record is a container, read contents
$spgrContainer = new \PHPExcel\Shared\Escher\DgContainer\SpgrContainer(); $spgrContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer();
if ($this->object instanceof \PHPExcel\Shared\Escher\DgContainer) { if ($this->object instanceof \PhpSpreadsheet\Shared\Escher\DgContainer) {
// DgContainer // DgContainer
$this->object->setSpgrContainer($spgrContainer); $this->object->setSpgrContainer($spgrContainer);
} else { } else {
@ -497,11 +494,11 @@ class Escher
*/ */
private function readSpContainer() private function readSpContainer()
{ {
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// add spContainer to spgrContainer // add spContainer to spgrContainer
$spContainer = new \PHPExcel\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); $spContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer();
$this->object->addChild($spContainer); $this->object->addChild($spContainer);
// move stream pointer to next record // move stream pointer to next record
@ -517,7 +514,7 @@ class Escher
*/ */
private function readSpgr() private function readSpgr()
{ {
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
@ -532,9 +529,9 @@ class Escher
// offset: 0; size: 2; recVer and recInstance // offset: 0; size: 2; recVer and recInstance
// bit: 4-15; mask: 0xFFF0; recInstance // bit: 4-15; mask: 0xFFF0; recInstance
$recInstance = (0xFFF0 & \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4;
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
@ -549,9 +546,9 @@ class Escher
// offset: 0; size: 2; recVer and recInstance // offset: 0; size: 2; recVer and recInstance
// bit: 4-15; mask: 0xFFF0; recInstance // bit: 4-15; mask: 0xFFF0; recInstance
$recInstance = (0xFFF0 & \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4;
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
@ -563,38 +560,38 @@ class Escher
*/ */
private function readClientAnchor() private function readClientAnchor()
{ {
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->pos += 8 + $length; $this->pos += 8 + $length;
// offset: 2; size: 2; upper-left corner column index (0-based) // offset: 2; size: 2; upper-left corner column index (0-based)
$c1 = \PHPExcel\Reader\Excel5::getInt2d($recordData, 2); $c1 = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 2);
// offset: 4; size: 2; upper-left corner horizontal offset in 1/1024 of column width // offset: 4; size: 2; upper-left corner horizontal offset in 1/1024 of column width
$startOffsetX = \PHPExcel\Reader\Excel5::getInt2d($recordData, 4); $startOffsetX = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 4);
// offset: 6; size: 2; upper-left corner row index (0-based) // offset: 6; size: 2; upper-left corner row index (0-based)
$r1 = \PHPExcel\Reader\Excel5::getInt2d($recordData, 6); $r1 = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 6);
// offset: 8; size: 2; upper-left corner vertical offset in 1/256 of row height // offset: 8; size: 2; upper-left corner vertical offset in 1/256 of row height
$startOffsetY = \PHPExcel\Reader\Excel5::getInt2d($recordData, 8); $startOffsetY = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 8);
// offset: 10; size: 2; bottom-right corner column index (0-based) // offset: 10; size: 2; bottom-right corner column index (0-based)
$c2 = \PHPExcel\Reader\Excel5::getInt2d($recordData, 10); $c2 = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 10);
// offset: 12; size: 2; bottom-right corner horizontal offset in 1/1024 of column width // offset: 12; size: 2; bottom-right corner horizontal offset in 1/1024 of column width
$endOffsetX = \PHPExcel\Reader\Excel5::getInt2d($recordData, 12); $endOffsetX = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 12);
// offset: 14; size: 2; bottom-right corner row index (0-based) // offset: 14; size: 2; bottom-right corner row index (0-based)
$r2 = \PHPExcel\Reader\Excel5::getInt2d($recordData, 14); $r2 = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 14);
// offset: 16; size: 2; bottom-right corner vertical offset in 1/256 of row height // offset: 16; size: 2; bottom-right corner vertical offset in 1/256 of row height
$endOffsetY = \PHPExcel\Reader\Excel5::getInt2d($recordData, 16); $endOffsetY = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 16);
// set the start coordinates // set the start coordinates
$this->object->setStartCoordinates(\PHPExcel\Cell::stringFromColumnIndex($c1) . ($r1 + 1)); $this->object->setStartCoordinates(\PhpSpreadsheet\Cell::stringFromColumnIndex($c1) . ($r1 + 1));
// set the start offsetX // set the start offsetX
$this->object->setStartOffsetX($startOffsetX); $this->object->setStartOffsetX($startOffsetX);
@ -603,7 +600,7 @@ class Escher
$this->object->setStartOffsetY($startOffsetY); $this->object->setStartOffsetY($startOffsetY);
// set the end coordinates // set the end coordinates
$this->object->setEndCoordinates(\PHPExcel\Cell::stringFromColumnIndex($c2) . ($r2 + 1)); $this->object->setEndCoordinates(\PhpSpreadsheet\Cell::stringFromColumnIndex($c2) . ($r2 + 1));
// set the end offsetX // set the end offsetX
$this->object->setEndOffsetX($endOffsetX); $this->object->setEndOffsetX($endOffsetX);
@ -617,7 +614,7 @@ class Escher
*/ */
private function readClientData() private function readClientData()
{ {
$length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
$recordData = substr($this->data, $this->pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
@ -640,7 +637,7 @@ class Escher
$fopte = substr($data, 6 * $i, 6); $fopte = substr($data, 6 * $i, 6);
// offset: 0; size: 2; opid // offset: 0; size: 2; opid
$opid = \PHPExcel\Reader\Excel5::getInt2d($fopte, 0); $opid = \PhpSpreadsheet\Reader\Excel5::getInt2d($fopte, 0);
// bit: 0-13; mask: 0x3FFF; opid.opid // bit: 0-13; mask: 0x3FFF; opid.opid
$opidOpid = (0x3FFF & $opid) >> 0; $opidOpid = (0x3FFF & $opid) >> 0;
@ -652,7 +649,7 @@ class Escher
$opidFComplex = (0x8000 & $opid) >> 15; $opidFComplex = (0x8000 & $opid) >> 15;
// offset: 2; size: 4; the value for this property // offset: 2; size: 4; the value for this property
$op = \PHPExcel\Reader\Excel5::getInt4d($fopte, 2); $op = \PhpSpreadsheet\Reader\Excel5::getInt4d($fopte, 2);
if ($opidFComplex) { if ($opidFComplex) {
$complexData = substr($splicedComplexData, 0, $op); $complexData = substr($splicedComplexData, 0, $op);

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader\Excel5; namespace PhpSpreadsheet\Reader\Excel5;
/** /**
* PHPExcel_Reader_Excel5_MD5 * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Reader\Excel5;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader_Excel5 * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader\Excel5; namespace PhpSpreadsheet\Reader\Excel5;
/** /**
* PHPExcel_Reader_Excel5_RC4 * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Reader\Excel5;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader_Excel5 * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,8 +1,8 @@
<?php <?php
namespace PHPExcel\Reader\Excel5\Style; namespace PhpSpreadsheet\Reader\Excel5\Style;
use \PHPExcel\Style\Border as StyleBorder; use \PhpSpreadsheet\Style\Border as StyleBorder;
class Border class Border
{ {

View File

@ -1,8 +1,8 @@
<?php <?php
namespace PHPExcel\Reader\Excel5\Style; namespace PhpSpreadsheet\Reader\Excel5\Style;
use \PHPExcel\Style\Fill; use \PhpSpreadsheet\Style\Fill;
class FillPattern class FillPattern
{ {

View File

@ -1,11 +1,11 @@
<?php <?php
namespace PHPExcel\Reader; namespace PhpSpreadsheet\Reader;
/** /**
* \PHPExcel\Reader\Exception * \PhpSpreadsheet\Reader\Exception
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2016 PhpSpreadsheet
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,13 +21,12 @@ namespace PHPExcel\Reader;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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 Exception extends \PHPExcel\Exception class Exception extends \PhpSpreadsheet\Exception
{ {
/** /**
* Error handler callback * Error handler callback

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader; namespace PhpSpreadsheet\Reader;
/** /**
* PHPExcel_Reader_Gnumeric * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Reader;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -51,7 +48,7 @@ class Gnumeric extends BaseReader implements IReader
public function __construct() public function __construct()
{ {
$this->readFilter = new DefaultReadFilter(); $this->readFilter = new DefaultReadFilter();
$this->referenceHelper = \PHPExcel\ReferenceHelper::getInstance(); $this->referenceHelper = \PhpSpreadsheet\ReferenceHelper::getInstance();
} }
/** /**
@ -86,7 +83,7 @@ class Gnumeric extends BaseReader implements IReader
} }
/** /**
* 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 PhpSpreadsheet object
* *
* @param string $pFilename * @param string $pFilename
* @throws Exception * @throws Exception
@ -99,7 +96,7 @@ class Gnumeric extends BaseReader implements IReader
} }
$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, \PhpSpreadsheet\Settings::getLibXmlLoaderOptions());
$xml->setParserProperty(2, true); $xml->setParserProperty(2, true);
$worksheetNames = array(); $worksheetNames = array();
@ -130,7 +127,7 @@ class Gnumeric extends BaseReader implements IReader
} }
$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, \PhpSpreadsheet\Settings::getLibXmlLoaderOptions());
$xml->setParserProperty(2, true); $xml->setParserProperty(2, true);
$worksheetInfo = array(); $worksheetInfo = array();
@ -158,7 +155,7 @@ class Gnumeric extends BaseReader implements IReader
break; break;
} }
} }
$tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
$worksheetInfo[] = $tmpInfo; $worksheetInfo[] = $tmpInfo;
} }
} }
@ -180,30 +177,30 @@ class Gnumeric extends BaseReader implements IReader
} }
/** /**
* Loads PHPExcel from file * Loads PhpSpreadsheet from file
* *
* @param string $pFilename * @param string $pFilename
* @return PHPExcel * @return PhpSpreadsheet
* @throws Exception * @throws Exception
*/ */
public function load($pFilename) public function load($pFilename)
{ {
// Create new PHPExcel // Create new PhpSpreadsheet
$objPHPExcel = new PHPExcel(); $spreadsheet = new PhpSpreadsheet();
// Load into this instance // Load into this instance
return $this->loadIntoExisting($pFilename, $objPHPExcel); return $this->loadIntoExisting($pFilename, $spreadsheet);
} }
/** /**
* Loads PHPExcel from file into PHPExcel instance * Loads PhpSpreadsheet from file into PhpSpreadsheet instance
* *
* @param string $pFilename * @param string $pFilename
* @param PHPExcel $objPHPExcel * @param \PhpSpreadsheet\Spreadsheet $spreadsheet
* @return PHPExcel * @return PhpSpreadsheet
* @throws Exception * @throws Exception
*/ */
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet)
{ {
// Check if file exists // Check if file exists
if (!file_exists($pFilename)) { if (!file_exists($pFilename)) {
@ -219,14 +216,14 @@ class Gnumeric extends BaseReader implements IReader
// 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', \PhpSpreadsheet\Settings::getLibXmlLoaderOptions());
$namespacesMeta = $xml->getNamespaces(true); $namespacesMeta = $xml->getNamespaces(true);
// var_dump($namespacesMeta); // var_dump($namespacesMeta);
// //
$gnmXML = $xml->children($namespacesMeta['gnm']); $gnmXML = $xml->children($namespacesMeta['gnm']);
$docProps = $objPHPExcel->getProperties(); $docProps = $spreadsheet->getProperties();
// Document Properties are held differently, depending on the version of Gnumeric // Document Properties are held differently, depending on the version of Gnumeric
if (isset($namespacesMeta['office'])) { if (isset($namespacesMeta['office'])) {
$officeXML = $xml->children($namespacesMeta['office']); $officeXML = $xml->children($namespacesMeta['office']);
@ -340,12 +337,12 @@ class Gnumeric extends BaseReader implements IReader
$maxRow = $maxCol = 0; $maxRow = $maxCol = 0;
// Create new Worksheet // Create new Worksheet
$objPHPExcel->createSheet(); $spreadsheet->createSheet();
$objPHPExcel->setActiveSheetIndex($worksheetID); $spreadsheet->setActiveSheetIndex($worksheetID);
// Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in formula // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in formula
// cells... during the load, all formulae should be correct, and we're simply bringing the worksheet // cells... during the load, all formulae should be correct, and we're simply bringing the worksheet
// name in line with the formula, not the reverse // name in line with the formula, not the reverse
$objPHPExcel->getActiveSheet()->setTitle($worksheetName, false); $spreadsheet->getActiveSheet()->setTitle($worksheetName, false);
if ((!$this->readDataOnly) && (isset($sheet->PrintInformation))) { if ((!$this->readDataOnly) && (isset($sheet->PrintInformation))) {
if (isset($sheet->PrintInformation->Margins)) { if (isset($sheet->PrintInformation->Margins)) {
@ -359,22 +356,22 @@ class Gnumeric extends BaseReader implements IReader
} }
switch ($key) { switch ($key) {
case 'top': case 'top':
$objPHPExcel->getActiveSheet()->getPageMargins()->setTop($marginSize); $spreadsheet->getActiveSheet()->getPageMargins()->setTop($marginSize);
break; break;
case 'bottom': case 'bottom':
$objPHPExcel->getActiveSheet()->getPageMargins()->setBottom($marginSize); $spreadsheet->getActiveSheet()->getPageMargins()->setBottom($marginSize);
break; break;
case 'left': case 'left':
$objPHPExcel->getActiveSheet()->getPageMargins()->setLeft($marginSize); $spreadsheet->getActiveSheet()->getPageMargins()->setLeft($marginSize);
break; break;
case 'right': case 'right':
$objPHPExcel->getActiveSheet()->getPageMargins()->setRight($marginSize); $spreadsheet->getActiveSheet()->getPageMargins()->setRight($marginSize);
break; break;
case 'header': case 'header':
$objPHPExcel->getActiveSheet()->getPageMargins()->setHeader($marginSize); $spreadsheet->getActiveSheet()->getPageMargins()->setHeader($marginSize);
break; break;
case 'footer': case 'footer':
$objPHPExcel->getActiveSheet()->getPageMargins()->setFooter($marginSize); $spreadsheet->getActiveSheet()->getPageMargins()->setFooter($marginSize);
break; break;
} }
} }
@ -393,7 +390,7 @@ class Gnumeric extends BaseReader implements IReader
$maxCol = $column; $maxCol = $column;
} }
$column = \PHPExcel\Cell::stringFromColumnIndex($column); $column = \PhpSpreadsheet\Cell::stringFromColumnIndex($column);
// Read cell? // Read cell?
if ($this->getReadFilter() !== null) { if ($this->getReadFilter() !== null) {
@ -407,7 +404,7 @@ class Gnumeric extends BaseReader implements IReader
// 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 = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA;
if ($ExprID > '') { if ($ExprID > '') {
if (((string) $cell) > '') { if (((string) $cell) > '') {
$this->expressions[$ExprID] = array( $this->expressions[$ExprID] = array(
@ -429,33 +426,33 @@ class Gnumeric extends BaseReader implements IReader
// 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 = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA;
} else { } else {
switch ($ValueType) { switch ($ValueType) {
case '10': // NULL case '10': // NULL
$type = \PHPExcel\Cell\DataType::TYPE_NULL; $type = \PhpSpreadsheet\Cell\DataType::TYPE_NULL;
break; break;
case '20': // Boolean case '20': // Boolean
$type = \PHPExcel\Cell\DataType::TYPE_BOOL; $type = \PhpSpreadsheet\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 = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
break; break;
case '50': // Error case '50': // Error
$type = \PHPExcel\Cell\DataType::TYPE_ERROR; $type = \PhpSpreadsheet\Cell\DataType::TYPE_ERROR;
break; break;
case '60': // String case '60': // String
$type = \PHPExcel\Cell\DataType::TYPE_STRING; $type = \PhpSpreadsheet\Cell\DataType::TYPE_STRING;
break; break;
case '70': // Cell Range case '70': // Cell Range
case '80': // Array case '80': // Array
} }
} }
$objPHPExcel->getActiveSheet()->getCell($column.$row)->setValueExplicit($cell, $type); $spreadsheet->getActiveSheet()->getCell($column.$row)->setValueExplicit($cell, $type);
} }
if ((!$this->readDataOnly) && (isset($sheet->Objects))) { if ((!$this->readDataOnly) && (isset($sheet->Objects))) {
@ -463,7 +460,7 @@ class Gnumeric extends BaseReader implements IReader
$commentAttributes = $comment->attributes(); $commentAttributes = $comment->attributes();
// Only comment objects are handled at the moment // Only comment objects are handled at the moment
if ($commentAttributes->Text) { if ($commentAttributes->Text) {
$objPHPExcel->getActiveSheet()->getComment((string)$commentAttributes->ObjectBound)->setAuthor((string)$commentAttributes->Author)->setText($this->parseRichText((string)$commentAttributes->Text)); $spreadsheet->getActiveSheet()->getComment((string)$commentAttributes->ObjectBound)->setAuthor((string)$commentAttributes->Author)->setText($this->parseRichText((string)$commentAttributes->Text));
} }
} }
} }
@ -473,11 +470,11 @@ class Gnumeric extends BaseReader implements IReader
$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 = \PhpSpreadsheet\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 = \PhpSpreadsheet\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;
@ -489,45 +486,45 @@ class Gnumeric extends BaseReader implements IReader
// 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']))) { (\PhpSpreadsheet\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'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL;
break; break;
case '2': case '2':
$styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_LEFT; $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT;
break; break;
case '4': case '4':
$styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_RIGHT; $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT;
break; break;
case '8': case '8':
$styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_CENTER; $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\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'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS;
break; break;
case '32': case '32':
$styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY; $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\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'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_TOP;
break; break;
case '2': case '2':
$styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_BOTTOM; $styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM;
break; break;
case '4': case '4':
$styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_CENTER; $styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER;
break; break;
case '8': case '8':
$styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_JUSTIFY; $styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY;
break; break;
} }
@ -545,64 +542,64 @@ class Gnumeric extends BaseReader implements IReader
$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'] = \PhpSpreadsheet\Style\Fill::FILL_SOLID;
break; break;
case '2': case '2':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR;
break; break;
case '3': case '3':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_GRADIENT_PATH; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH;
break; break;
case '4': case '4':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKDOWN; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKDOWN;
break; break;
case '5': case '5':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKGRAY; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRAY;
break; break;
case '6': case '6':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKGRID; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRID;
break; break;
case '7': case '7':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKHORIZONTAL; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKHORIZONTAL;
break; break;
case '8': case '8':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKTRELLIS; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKTRELLIS;
break; break;
case '9': case '9':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKUP; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKUP;
break; break;
case '10': case '10':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKVERTICAL; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKVERTICAL;
break; break;
case '11': case '11':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_GRAY0625; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY0625;
break; break;
case '12': case '12':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_GRAY125; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125;
break; break;
case '13': case '13':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTDOWN; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTDOWN;
break; break;
case '14': case '14':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRAY; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY;
break; break;
case '15': case '15':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRID; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRID;
break; break;
case '16': case '16':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL;
break; break;
case '17': case '17':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTTRELLIS; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTTRELLIS;
break; break;
case '18': case '18':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTUP; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTUP;
break; break;
case '19': case '19':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTVERTICAL; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTVERTICAL;
break; break;
case '20': case '20':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_MEDIUMGRAY; $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_MEDIUMGRAY;
break; break;
} }
} }
@ -617,19 +614,19 @@ class Gnumeric extends BaseReader implements IReader
$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'] = \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE;
break; break;
case '2': case '2':
$styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_DOUBLE; $styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE;
break; break;
case '3': case '3':
$styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_SINGLEACCOUNTING; $styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING;
break; break;
case '4': case '4':
$styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_DOUBLEACCOUNTING; $styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING;
break; break;
default: default:
$styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_NONE; $styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_NONE;
break; break;
} }
switch ($fontAttributes['Script']) { switch ($fontAttributes['Script']) {
@ -656,13 +653,13 @@ class Gnumeric extends BaseReader implements IReader
} }
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'] = \PhpSpreadsheet\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'] = \PhpSpreadsheet\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'] = \PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN;
} }
} }
if (isset($styleRegion->Style->HyperLink)) { if (isset($styleRegion->Style->HyperLink)) {
@ -672,7 +669,7 @@ class Gnumeric extends BaseReader implements IReader
} }
// var_dump($styleArray); // var_dump($styleArray);
// echo '<br />'; // echo '<br />';
$objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($styleArray); $spreadsheet->getActiveSheet()->getStyle($cellRange)->applyFromArray($styleArray);
} }
} }
} }
@ -689,19 +686,19 @@ class Gnumeric extends BaseReader implements IReader
$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); $spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\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); $spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setWidth($columnWidth);
if ($hidden) { if ($hidden) {
$objPHPExcel->getActiveSheet()->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($c))->setVisible(false); $spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setVisible(false);
} }
++$c; ++$c;
} }
} }
while ($c <= $maxCol) { while ($c <= $maxCol) {
$objPHPExcel->getActiveSheet()->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); $spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth);
++$c; ++$c;
} }
} }
@ -720,19 +717,19 @@ class Gnumeric extends BaseReader implements IReader
$rowCount = (isset($rowAttributes['Count'])) ? $rowAttributes['Count'] : 1; $rowCount = (isset($rowAttributes['Count'])) ? $rowAttributes['Count'] : 1;
while ($r < $row) { while ($r < $row) {
++$r; ++$r;
$objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight); $spreadsheet->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight);
} }
while (($r < ($row+$rowCount)) && ($r < $maxRow)) { while (($r < ($row+$rowCount)) && ($r < $maxRow)) {
++$r; ++$r;
$objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($rowHeight); $spreadsheet->getActiveSheet()->getRowDimension($r)->setRowHeight($rowHeight);
if ($hidden) { if ($hidden) {
$objPHPExcel->getActiveSheet()->getRowDimension($r)->setVisible(false); $spreadsheet->getActiveSheet()->getRowDimension($r)->setVisible(false);
} }
} }
} }
while ($r < $maxRow) { while ($r < $maxRow) {
++$r; ++$r;
$objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight); $spreadsheet->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight);
} }
} }
@ -740,7 +737,7 @@ class Gnumeric extends BaseReader implements IReader
if (isset($sheet->MergedRegions)) { if (isset($sheet->MergedRegions)) {
foreach ($sheet->MergedRegions->Merge as $mergeCells) { foreach ($sheet->MergedRegions->Merge as $mergeCells) {
if (strpos($mergeCells, ':') !== false) { if (strpos($mergeCells, ':') !== false) {
$objPHPExcel->getActiveSheet()->mergeCells($mergeCells); $spreadsheet->getActiveSheet()->mergeCells($mergeCells);
} }
} }
} }
@ -759,15 +756,15 @@ class Gnumeric extends BaseReader implements IReader
$range = explode('!', $range); $range = explode('!', $range);
$range[0] = trim($range[0], "'"); $range[0] = trim($range[0], "'");
if ($worksheet = $objPHPExcel->getSheetByName($range[0])) { if ($worksheet = $spreadsheet->getSheetByName($range[0])) {
$extractedRange = str_replace('$', '', $range[1]); $extractedRange = str_replace('$', '', $range[1]);
$objPHPExcel->addNamedRange(new \PHPExcel\NamedRange($name, $worksheet, $extractedRange)); $spreadsheet->addNamedRange(new \PhpSpreadsheet\NamedRange($name, $worksheet, $extractedRange));
} }
} }
} }
// Return // Return
return $objPHPExcel; return $spreadsheet;
} }
private static function parseBorderAttributes($borderAttributes) private static function parseBorderAttributes($borderAttributes)
@ -779,46 +776,46 @@ class Gnumeric extends BaseReader implements IReader
switch ($borderAttributes["Style"]) { switch ($borderAttributes["Style"]) {
case '0': case '0':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_NONE; $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_NONE;
break; break;
case '1': case '1':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_THIN; $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break; break;
case '2': case '2':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUM; $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUM;
break; break;
case '3': case '3':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_SLANTDASHDOT; $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT;
break; break;
case '4': case '4':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_DASHED; $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DASHED;
break; break;
case '5': case '5':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_THICK; $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_THICK;
break; break;
case '6': case '6':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_DOUBLE; $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DOUBLE;
break; break;
case '7': case '7':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_DOTTED; $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DOTTED;
break; break;
case '8': case '8':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHED; $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED;
break; break;
case '9': case '9':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_DASHDOT; $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DASHDOT;
break; break;
case '10': case '10':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT; $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT;
break; break;
case '11': case '11':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_DASHDOTDOT; $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT;
break; break;
case '12': case '12':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT; $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT;
break; break;
case '13': case '13':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT; $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT;
break; break;
} }
return $styleArray; return $styleArray;
@ -826,7 +823,7 @@ class Gnumeric extends BaseReader implements IReader
private function parseRichText($is = '') private function parseRichText($is = '')
{ {
$value = new \PHPExcel\RichText(); $value = new \PhpSpreadsheet\RichText();
$value->createText($is); $value->createText($is);
return $value; return $value;

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader; namespace PhpSpreadsheet\Reader;
/** /**
* PHPExcel_Reader_HTML * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,13 +19,12 @@ namespace PHPExcel\Reader;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
/** PHPExcel root directory */ /** PhpSpreadsheet root directory */
class HTML extends BaseReader implements IReader class HTML extends BaseReader implements IReader
{ {
@ -91,16 +88,16 @@ class HTML extends BaseReader implements IReader
'font' => array( 'font' => array(
'underline' => true, 'underline' => true,
'color' => array( 'color' => array(
'argb' => \PHPExcel\Style\Color::COLOR_BLUE, 'argb' => \PhpSpreadsheet\Style\Color::COLOR_BLUE,
), ),
), ),
), // Blue underlined ), // Blue underlined
'hr' => array( 'hr' => array(
'borders' => array( 'borders' => array(
'bottom' => array( 'bottom' => array(
'style' => \PHPExcel\Style\Border::BORDER_THIN, 'style' => \PhpSpreadsheet\Style\Border::BORDER_THIN,
'color' => array( 'color' => array(
\PHPExcel\Style\Color::COLOR_BLACK, \PhpSpreadsheet\Style\Color::COLOR_BLACK,
), ),
), ),
), ),
@ -135,19 +132,19 @@ class HTML extends BaseReader implements IReader
} }
/** /**
* Loads PHPExcel from file * Loads PhpSpreadsheet from file
* *
* @param string $pFilename * @param string $pFilename
* @return PHPExcel * @return PhpSpreadsheet
* @throws Exception * @throws Exception
*/ */
public function load($pFilename) public function load($pFilename)
{ {
// Create new PHPExcel // Create new PhpSpreadsheet
$objPHPExcel = new PHPExcel(); $spreadsheet = new PhpSpreadsheet();
// Load into this instance // Load into this instance
return $this->loadIntoExisting($pFilename, $objPHPExcel); return $this->loadIntoExisting($pFilename, $spreadsheet);
} }
/** /**
@ -172,7 +169,7 @@ class HTML extends BaseReader implements IReader
return $this->inputEncoding; return $this->inputEncoding;
} }
// Data Array used for testing only, should write to PHPExcel object on completion of tests // Data Array used for testing only, should write to PhpSpreadsheet object on completion of tests
protected $dataArray = array(); protected $dataArray = array();
protected $tableLevel = 0; protected $tableLevel = 0;
protected $nestedColumn = array('A'); protected $nestedColumn = array('A');
@ -407,7 +404,7 @@ class HTML extends BaseReader implements IReader
$this->flushCell($sheet, $column, $row, $cellContent); $this->flushCell($sheet, $column, $row, $cellContent);
// if (isset($attributeArray['style']) && !empty($attributeArray['style'])) { // if (isset($attributeArray['style']) && !empty($attributeArray['style'])) {
// $styleAry = $this->getPhpExcelStyleArray($attributeArray['style']); // $styleAry = $this->getPhpSpreadsheetStyleArray($attributeArray['style']);
// //
// if (!empty($styleAry)) { // if (!empty($styleAry)) {
// $sheet->getStyle($column . $row)->applyFromArray($styleAry); // $sheet->getStyle($column . $row)->applyFromArray($styleAry);
@ -421,7 +418,7 @@ class HTML extends BaseReader implements IReader
++$columnTo; ++$columnTo;
} }
$range = $column . $row . ':' . $columnTo . ($row + $attributeArray['rowspan'] - 1); $range = $column . $row . ':' . $columnTo . ($row + $attributeArray['rowspan'] - 1);
foreach (\PHPExcel\Cell::extractAllCellReferencesInRange($range) as $value) { foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($range) as $value) {
$this->rowspan[$value] = true; $this->rowspan[$value] = true;
} }
$sheet->mergeCells($range); $sheet->mergeCells($range);
@ -429,7 +426,7 @@ class HTML extends BaseReader implements IReader
} elseif (isset($attributeArray['rowspan'])) { } elseif (isset($attributeArray['rowspan'])) {
//create merging rowspan //create merging rowspan
$range = $column . $row . ':' . $column . ($row + $attributeArray['rowspan'] - 1); $range = $column . $row . ':' . $column . ($row + $attributeArray['rowspan'] - 1);
foreach (\PHPExcel\Cell::extractAllCellReferencesInRange($range) as $value) { foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($range) as $value) {
$this->rowspan[$value] = true; $this->rowspan[$value] = true;
} }
$sheet->mergeCells($range); $sheet->mergeCells($range);
@ -459,14 +456,14 @@ class HTML extends BaseReader implements IReader
} }
/** /**
* Loads PHPExcel from file into PHPExcel instance * Loads PhpSpreadsheet from file into PhpSpreadsheet instance
* *
* @param string $pFilename * @param string $pFilename
* @param PHPExcel $objPHPExcel * @param \PhpSpreadsheet\Spreadsheet $spreadsheet
* @return PHPExcel * @return \PhpSpreadsheet\Spreadsheet
* @throws Exception * @throws Exception
*/ */
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet)
{ {
// Open file to validate // Open file to validate
$this->openFile($pFilename); $this->openFile($pFilename);
@ -477,11 +474,11 @@ class HTML extends BaseReader implements IReader
// Close after validating // Close after validating
fclose($this->fileHandle); fclose($this->fileHandle);
// Create new PHPExcel // Create new PhpSpreadsheet
while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) { while ($spreadsheet->getSheetCount() <= $this->sheetIndex) {
$objPHPExcel->createSheet(); $spreadsheet->createSheet();
} }
$objPHPExcel->setActiveSheetIndex($this->sheetIndex); $spreadsheet->setActiveSheetIndex($this->sheetIndex);
// Create a new DOM object // Create a new DOM object
$dom = new domDocument; $dom = new domDocument;
@ -497,10 +494,10 @@ class HTML extends BaseReader implements IReader
$row = 0; $row = 0;
$column = 'A'; $column = 'A';
$content = ''; $content = '';
$this->processDomElement($dom, $objPHPExcel->getActiveSheet(), $row, $column, $content); $this->processDomElement($dom, $spreadsheet->getActiveSheet(), $row, $column, $content);
// Return // Return
return $objPHPExcel; return $spreadsheet;
} }
/** /**

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader; namespace PhpSpreadsheet\Reader;
/** /**
* PHPExcel_Reader_IReadFilter * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Reader;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader; namespace PhpSpreadsheet\Reader;
/** /**
* PHPExcel_Reader_IReader * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Reader;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -38,10 +35,10 @@ interface IReader
public function canRead($pFilename); public function canRead($pFilename);
/** /**
* Loads PHPExcel from file * Loads PhpSpreadsheet from file
* *
* @param string $pFilename * @param string $pFilename
* @return PHPExcel * @return PhpSpreadsheet
* @throws Exception * @throws Exception
*/ */
public function load($pFilename); public function load($pFilename);

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader; namespace PhpSpreadsheet\Reader;
/** /**
* PHPExcel_Reader_OOCalc * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Reader;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -58,7 +55,7 @@ class OOCalc extends BaseReader implements IReader
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
} }
$zipClass = \PHPExcel\Settings::getZipClass(); $zipClass = \PhpSpreadsheet\Settings::getZipClass();
// Check if zip class exists // Check if zip class exists
// if (!class_exists($zipClass, false)) { // if (!class_exists($zipClass, false)) {
@ -77,7 +74,7 @@ class OOCalc extends BaseReader implements IReader
$xml = simplexml_load_string( $xml = simplexml_load_string(
$this->securityScan($zip->getFromName('META-INF/manifest.xml')), $this->securityScan($zip->getFromName('META-INF/manifest.xml')),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$namespacesContent = $xml->getNamespaces(true); $namespacesContent = $xml->getNamespaces(true);
if (isset($namespacesContent['manifest'])) { if (isset($namespacesContent['manifest'])) {
@ -102,7 +99,7 @@ class OOCalc extends BaseReader implements IReader
/** /**
* 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 PhpSpreadsheet object
* *
* @param string $pFilename * @param string $pFilename
* @throws Exception * @throws Exception
@ -114,7 +111,7 @@ class OOCalc extends BaseReader implements IReader
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
} }
$zipClass = \PHPExcel\Settings::getZipClass(); $zipClass = \PhpSpreadsheet\Settings::getZipClass();
$zip = new $zipClass; $zip = new $zipClass;
if (!$zip->open($pFilename)) { if (!$zip->open($pFilename)) {
@ -127,7 +124,7 @@ class OOCalc extends BaseReader implements IReader
$res = $xml->xml( $res = $xml->xml(
$this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'), $this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'),
null, null,
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$xml->setParserProperty(2, true); $xml->setParserProperty(2, true);
@ -172,7 +169,7 @@ class OOCalc extends BaseReader implements IReader
$worksheetInfo = array(); $worksheetInfo = array();
$zipClass = \PHPExcel\Settings::getZipClass(); $zipClass = \PhpSpreadsheet\Settings::getZipClass();
$zip = new $zipClass; $zip = new $zipClass;
if (!$zip->open($pFilename)) { if (!$zip->open($pFilename)) {
@ -183,7 +180,7 @@ class OOCalc extends BaseReader implements IReader
$res = $xml->xml( $res = $xml->xml(
$this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'), $this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'),
null, null,
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$xml->setParserProperty(2, true); $xml->setParserProperty(2, true);
@ -242,7 +239,7 @@ class OOCalc extends BaseReader implements IReader
$tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells); $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells);
$tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1; $tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1;
$tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
$worksheetInfo[] = $tmpInfo; $worksheetInfo[] = $tmpInfo;
} }
} }
@ -276,7 +273,7 @@ class OOCalc extends BaseReader implements IReader
// } // }
// } // }
// //
// $tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); // $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
// $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1; // $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1;
// //
// } // }
@ -287,19 +284,19 @@ class OOCalc extends BaseReader implements IReader
} }
/** /**
* Loads PHPExcel from file * Loads PhpSpreadsheet from file
* *
* @param string $pFilename * @param string $pFilename
* @return \PHPExcel\Spreadsheet * @return \PhpSpreadsheet\Spreadsheet
* @throws Exception * @throws Exception
*/ */
public function load($pFilename) public function load($pFilename)
{ {
// Create new Spreadsheet // Create new Spreadsheet
$objPHPExcel = new \PHPExcel\Spreadsheet(); $spreadsheet = new \PhpSpreadsheet\Spreadsheet();
// Load into this instance // Load into this instance
return $this->loadIntoExisting($pFilename, $objPHPExcel); return $this->loadIntoExisting($pFilename, $spreadsheet);
} }
private static function identifyFixedStyleValue($styleList, &$styleAttributeValue) private static function identifyFixedStyleValue($styleList, &$styleAttributeValue)
@ -315,14 +312,14 @@ class OOCalc extends BaseReader implements IReader
} }
/** /**
* Loads PHPExcel from file into PHPExcel instance * Loads PhpSpreadsheet from file into PhpSpreadsheet instance
* *
* @param string $pFilename * @param string $pFilename
* @param \PHPExcel\Spreadsheet $objPHPExcel * @param \PhpSpreadsheet\Spreadsheet $spreadsheet
* @return \PHPExcel\Spreadsheet * @return \PhpSpreadsheet\Spreadsheet
* @throws Exception * @throws Exception
*/ */
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet)
{ {
// Check if file exists // Check if file exists
if (!file_exists($pFilename)) { if (!file_exists($pFilename)) {
@ -332,7 +329,7 @@ class OOCalc extends BaseReader implements IReader
$timezoneObj = new DateTimeZone('Europe/London'); $timezoneObj = new DateTimeZone('Europe/London');
$GMT = new \DateTimeZone('UTC'); $GMT = new \DateTimeZone('UTC');
$zipClass = \PHPExcel\Settings::getZipClass(); $zipClass = \PhpSpreadsheet\Settings::getZipClass();
$zip = new $zipClass; $zip = new $zipClass;
if (!$zip->open($pFilename)) { if (!$zip->open($pFilename)) {
@ -343,14 +340,14 @@ class OOCalc extends BaseReader implements IReader
$xml = simplexml_load_string( $xml = simplexml_load_string(
$this->securityScan($zip->getFromName("meta.xml")), $this->securityScan($zip->getFromName("meta.xml")),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$namespacesMeta = $xml->getNamespaces(true); $namespacesMeta = $xml->getNamespaces(true);
// echo '<pre>'; // echo '<pre>';
// print_r($namespacesMeta); // print_r($namespacesMeta);
// echo '</pre><hr />'; // echo '</pre><hr />';
$docProps = $objPHPExcel->getProperties(); $docProps = $spreadsheet->getProperties();
$officeProperty = $xml->children($namespacesMeta['office']); $officeProperty = $xml->children($namespacesMeta['office']);
foreach ($officeProperty as $officePropertyData) { foreach ($officeProperty as $officePropertyData) {
$officePropertyDC = array(); $officePropertyDC = array();
@ -399,26 +396,26 @@ class OOCalc extends BaseReader implements IReader
$docProps->setCreated($creationDate); $docProps->setCreated($creationDate);
break; break;
case 'user-defined': case 'user-defined':
$propertyValueType = \PHPExcel\Document\Properties::PROPERTY_TYPE_STRING; $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING;
foreach ($propertyValueAttributes as $key => $value) { foreach ($propertyValueAttributes as $key => $value) {
if ($key == 'name') { if ($key == 'name') {
$propertyValueName = (string) $value; $propertyValueName = (string) $value;
} elseif ($key == 'value-type') { } elseif ($key == 'value-type') {
switch ($value) { switch ($value) {
case 'date': case 'date':
$propertyValue = \PHPExcel\Document\Properties::convertProperty($propertyValue, 'date'); $propertyValue = \PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'date');
$propertyValueType = \PHPExcel\Document\Properties::PROPERTY_TYPE_DATE; $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE;
break; break;
case 'boolean': case 'boolean':
$propertyValue = \PHPExcel\Document\Properties::convertProperty($propertyValue, 'bool'); $propertyValue = \PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'bool');
$propertyValueType = \PHPExcel\Document\Properties::PROPERTY_TYPE_BOOLEAN; $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN;
break; break;
case 'float': case 'float':
$propertyValue = \PHPExcel\Document\Properties::convertProperty($propertyValue, 'r4'); $propertyValue = \PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'r4');
$propertyValueType = \PHPExcel\Document\Properties::PROPERTY_TYPE_FLOAT; $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_FLOAT;
break; break;
default: default:
$propertyValueType = \PHPExcel\Document\Properties::PROPERTY_TYPE_STRING; $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING;
} }
} }
} }
@ -433,7 +430,7 @@ class OOCalc extends BaseReader implements IReader
$xml = simplexml_load_string( $xml = simplexml_load_string(
$this->securityScan($zip->getFromName("content.xml")), $this->securityScan($zip->getFromName("content.xml")),
'SimpleXMLElement', 'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions() \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
); );
$namespacesContent = $xml->getNamespaces(true); $namespacesContent = $xml->getNamespaces(true);
// echo '<pre>'; // echo '<pre>';
@ -458,14 +455,14 @@ class OOCalc extends BaseReader implements IReader
// echo '<h2>Worksheet '.$worksheetDataAttributes['name'].'</h2>'; // echo '<h2>Worksheet '.$worksheetDataAttributes['name'].'</h2>';
// Create new Worksheet // Create new Worksheet
$objPHPExcel->createSheet(); $spreadsheet->createSheet();
$objPHPExcel->setActiveSheetIndex($worksheetID); $spreadsheet->setActiveSheetIndex($worksheetID);
if (isset($worksheetDataAttributes['name'])) { if (isset($worksheetDataAttributes['name'])) {
$worksheetName = (string) $worksheetDataAttributes['name']; $worksheetName = (string) $worksheetDataAttributes['name'];
// Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in
// formula cells... during the load, all formulae should be correct, and we're simply // formula cells... during the load, all formulae should be correct, and we're simply
// bringing the worksheet name in line with the formula, not the reverse // bringing the worksheet name in line with the formula, not the reverse
$objPHPExcel->getActiveSheet()->setTitle($worksheetName, false); $spreadsheet->getActiveSheet()->setTitle($worksheetName, false);
} }
$rowID = 1; $rowID = 1;
@ -526,7 +523,7 @@ class OOCalc extends BaseReader implements IReader
} }
$text = implode("\n", $textArray); $text = implode("\n", $textArray);
// echo $text, '<br />'; // echo $text, '<br />';
$objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setText($this->parseRichText($text)); $spreadsheet->getActiveSheet()->getComment($columnID.$rowID)->setText($this->parseRichText($text));
// ->setAuthor( $author ) // ->setAuthor( $author )
} }
@ -554,7 +551,7 @@ class OOCalc extends BaseReader implements IReader
// echo 'Value Type is '.$cellDataOfficeAttributes['value-type'].'<br />'; // echo 'Value Type is '.$cellDataOfficeAttributes['value-type'].'<br />';
switch ($cellDataOfficeAttributes['value-type']) { switch ($cellDataOfficeAttributes['value-type']) {
case 'string': case 'string':
$type = \PHPExcel\Cell\DataType::TYPE_STRING; $type = \PhpSpreadsheet\Cell\DataType::TYPE_STRING;
$dataValue = $allCellDataText; $dataValue = $allCellDataText;
if (isset($dataValue->a)) { if (isset($dataValue->a)) {
$dataValue = $dataValue->a; $dataValue = $dataValue->a;
@ -563,27 +560,27 @@ class OOCalc extends BaseReader implements IReader
} }
break; break;
case 'boolean': case 'boolean':
$type = \PHPExcel\Cell\DataType::TYPE_BOOL; $type = \PhpSpreadsheet\Cell\DataType::TYPE_BOOL;
$dataValue = ($allCellDataText == 'TRUE') ? true : false; $dataValue = ($allCellDataText == 'TRUE') ? true : false;
break; break;
case 'percentage': case 'percentage':
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
$dataValue = (float) $cellDataOfficeAttributes['value']; $dataValue = (float) $cellDataOfficeAttributes['value'];
if (floor($dataValue) == $dataValue) { if (floor($dataValue) == $dataValue) {
$dataValue = (integer) $dataValue; $dataValue = (integer) $dataValue;
} }
$formatting = \PHPExcel\Style\NumberFormat::FORMAT_PERCENTAGE_00; $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_PERCENTAGE_00;
break; break;
case 'currency': case 'currency':
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
$dataValue = (float) $cellDataOfficeAttributes['value']; $dataValue = (float) $cellDataOfficeAttributes['value'];
if (floor($dataValue) == $dataValue) { if (floor($dataValue) == $dataValue) {
$dataValue = (integer) $dataValue; $dataValue = (integer) $dataValue;
} }
$formatting = \PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE; $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE;
break; break;
case 'float': case 'float':
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
$dataValue = (float) $cellDataOfficeAttributes['value']; $dataValue = (float) $cellDataOfficeAttributes['value'];
if (floor($dataValue) == $dataValue) { if (floor($dataValue) == $dataValue) {
if ($dataValue == (integer) $dataValue) { if ($dataValue == (integer) $dataValue) {
@ -594,21 +591,21 @@ class OOCalc extends BaseReader implements IReader
} }
break; break;
case 'date': case 'date':
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
$dateObj = new DateTime($cellDataOfficeAttributes['date-value'], $GMT); $dateObj = new DateTime($cellDataOfficeAttributes['date-value'], $GMT);
$dateObj->setTimeZone($timezoneObj); $dateObj->setTimeZone($timezoneObj);
list($year, $month, $day, $hour, $minute, $second) = explode(' ', $dateObj->format('Y m d H i s')); list($year, $month, $day, $hour, $minute, $second) = explode(' ', $dateObj->format('Y m d H i s'));
$dataValue = \PHPExcel\Shared\Date::formattedPHPToExcel($year, $month, $day, $hour, $minute, $second); $dataValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel($year, $month, $day, $hour, $minute, $second);
if ($dataValue != floor($dataValue)) { if ($dataValue != floor($dataValue)) {
$formatting = \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX15.' '.\PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4; $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15.' '.\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4;
} else { } else {
$formatting = \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX15; $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15;
} }
break; break;
case 'time': case 'time':
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
$dataValue = \PHPExcel\Shared\Date::PHPToExcel(strtotime('01-01-1970 '.implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS')))); $dataValue = \PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime('01-01-1970 '.implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS'))));
$formatting = \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4; $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4;
break; break;
} }
// echo 'Data value is '.$dataValue.'<br />'; // echo 'Data value is '.$dataValue.'<br />';
@ -616,12 +613,12 @@ class OOCalc extends BaseReader implements IReader
// echo 'Hyperlink is '.$hyperlink.'<br />'; // echo 'Hyperlink is '.$hyperlink.'<br />';
// } // }
} else { } else {
$type = \PHPExcel\Cell\DataType::TYPE_NULL; $type = \PhpSpreadsheet\Cell\DataType::TYPE_NULL;
$dataValue = null; $dataValue = null;
} }
if ($hasCalculatedValue) { if ($hasCalculatedValue) {
$type = \PHPExcel\Cell\DataType::TYPE_FORMULA; $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA;
// echo 'Formula: ', $cellDataFormula, PHP_EOL; // echo 'Formula: ', $cellDataFormula, PHP_EOL;
$cellDataFormula = substr($cellDataFormula, strpos($cellDataFormula, ':=')+1); $cellDataFormula = substr($cellDataFormula, strpos($cellDataFormula, ':=')+1);
$temp = explode('"', $cellDataFormula); $temp = explode('"', $cellDataFormula);
@ -633,7 +630,7 @@ class OOCalc extends BaseReader implements IReader
$value = preg_replace('/\[([^\.]+)\.([^\.]+)\]/Ui', '$1!$2', $value); // Cell reference in another sheet $value = preg_replace('/\[([^\.]+)\.([^\.]+)\]/Ui', '$1!$2', $value); // Cell reference in another sheet
$value = preg_replace('/\[\.([^\.]+):\.([^\.]+)\]/Ui', '$1:$2', $value); // Cell range reference $value = preg_replace('/\[\.([^\.]+):\.([^\.]+)\]/Ui', '$1:$2', $value); // Cell range reference
$value = preg_replace('/\[\.([^\.]+)\]/Ui', '$1', $value); // Simple cell reference $value = preg_replace('/\[\.([^\.]+)\]/Ui', '$1', $value); // Simple cell reference
$value = \PHPExcel\Calculation::translateSeparator(';', ',', $value, $inBraces); $value = \PhpSpreadsheet\Calculation::translateSeparator(';', ',', $value, $inBraces);
} }
} }
unset($value); unset($value);
@ -648,21 +645,21 @@ class OOCalc extends BaseReader implements IReader
if ($i > 0) { if ($i > 0) {
++$columnID; ++$columnID;
} }
if ($type !== \PHPExcel\Cell\DataType::TYPE_NULL) { if ($type !== \PhpSpreadsheet\Cell\DataType::TYPE_NULL) {
for ($rowAdjust = 0; $rowAdjust < $rowRepeats; ++$rowAdjust) { for ($rowAdjust = 0; $rowAdjust < $rowRepeats; ++$rowAdjust) {
$rID = $rowID + $rowAdjust; $rID = $rowID + $rowAdjust;
$objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type); $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type);
if ($hasCalculatedValue) { if ($hasCalculatedValue) {
// echo 'Forumla result is '.$dataValue.'<br />'; // echo 'Forumla result is '.$dataValue.'<br />';
$objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->setCalculatedValue($dataValue); $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->setCalculatedValue($dataValue);
} }
if ($formatting !== null) { if ($formatting !== null) {
$objPHPExcel->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode($formatting); $spreadsheet->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode($formatting);
} else { } else {
$objPHPExcel->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_GENERAL); $spreadsheet->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL);
} }
if ($hyperlink !== null) { if ($hyperlink !== null) {
$objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->getHyperlink()->setUrl($hyperlink); $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->getHyperlink()->setUrl($hyperlink);
} }
} }
} }
@ -671,17 +668,17 @@ class OOCalc extends BaseReader implements IReader
// Merged cells // Merged cells
if ((isset($cellDataTableAttributes['number-columns-spanned'])) || (isset($cellDataTableAttributes['number-rows-spanned']))) { if ((isset($cellDataTableAttributes['number-columns-spanned'])) || (isset($cellDataTableAttributes['number-rows-spanned']))) {
if (($type !== \PHPExcel\Cell\DataType::TYPE_NULL) || (!$this->readDataOnly)) { if (($type !== \PhpSpreadsheet\Cell\DataType::TYPE_NULL) || (!$this->readDataOnly)) {
$columnTo = $columnID; $columnTo = $columnID;
if (isset($cellDataTableAttributes['number-columns-spanned'])) { if (isset($cellDataTableAttributes['number-columns-spanned'])) {
$columnTo = \PHPExcel\Cell::stringFromColumnIndex(\PHPExcel\Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-spanned'] -2); $columnTo = \PhpSpreadsheet\Cell::stringFromColumnIndex(\PhpSpreadsheet\Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-spanned'] -2);
} }
$rowTo = $rowID; $rowTo = $rowID;
if (isset($cellDataTableAttributes['number-rows-spanned'])) { if (isset($cellDataTableAttributes['number-rows-spanned'])) {
$rowTo = $rowTo + $cellDataTableAttributes['number-rows-spanned'] - 1; $rowTo = $rowTo + $cellDataTableAttributes['number-rows-spanned'] - 1;
} }
$cellRange = $columnID.$rowID.':'.$columnTo.$rowTo; $cellRange = $columnID.$rowID.':'.$columnTo.$rowTo;
$objPHPExcel->getActiveSheet()->mergeCells($cellRange); $spreadsheet->getActiveSheet()->mergeCells($cellRange);
} }
} }
@ -696,12 +693,12 @@ class OOCalc extends BaseReader implements IReader
} }
// Return // Return
return $objPHPExcel; return $spreadsheet;
} }
private function parseRichText($is = '') private function parseRichText($is = '')
{ {
$value = new \PHPExcel\RichText(); $value = new \PhpSpreadsheet\RichText();
$value->createText($is); $value->createText($is);

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Reader; namespace PhpSpreadsheet\Reader;
/** /**
* PHPExcel_Reader_SYLK * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Reader;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Reader * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -144,7 +141,7 @@ class SYLK extends BaseReader implements IReader
$columnIndex = 0; $columnIndex = 0;
// convert SYLK encoded $rowData to UTF-8 // convert SYLK encoded $rowData to UTF-8
$rowData = \PHPExcel\Shared\StringHelper::SYLKtoUTF8($rowData); $rowData = \PhpSpreadsheet\Shared\StringHelper::SYLKtoUTF8($rowData);
// explode each row at semicolons while taking into account that literal semicolon (;) // explode each row at semicolons while taking into account that literal semicolon (;)
// is escaped like this (;;) // is escaped like this (;;)
@ -171,7 +168,7 @@ class SYLK extends BaseReader implements IReader
} }
} }
$worksheetInfo[0]['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($worksheetInfo[0]['lastColumnIndex']); $worksheetInfo[0]['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($worksheetInfo[0]['lastColumnIndex']);
$worksheetInfo[0]['totalColumns'] = $worksheetInfo[0]['lastColumnIndex'] + 1; $worksheetInfo[0]['totalColumns'] = $worksheetInfo[0]['lastColumnIndex'] + 1;
// Close file // Close file
@ -181,30 +178,30 @@ class SYLK extends BaseReader implements IReader
} }
/** /**
* Loads PHPExcel from file * Loads PhpSpreadsheet from file
* *
* @param string $pFilename * @param string $pFilename
* @return \PHPExcel\Spreadsheet * @return \PhpSpreadsheet\Spreadsheet
* @throws Exception * @throws Exception
*/ */
public function load($pFilename) public function load($pFilename)
{ {
// Create new Spreadsheet // Create new Spreadsheet
$objPHPExcel = new \PHPExcel\Spreadsheet(); $spreadsheet = new \PhpSpreadsheet\Spreadsheet();
// Load into this instance // Load into this instance
return $this->loadIntoExisting($pFilename, $objPHPExcel); return $this->loadIntoExisting($pFilename, $spreadsheet);
} }
/** /**
* Loads PHPExcel from file into PHPExcel instance * Loads PhpSpreadsheet from file into PhpSpreadsheet instance
* *
* @param string $pFilename * @param string $pFilename
* @param \PHPExcel\Spreadsheet $objPHPExcel * @param \PhpSpreadsheet\Spreadsheet $spreadsheet
* @return \PHPExcel\Spreadsheet * @return \PhpSpreadsheet\Spreadsheet
* @throws Exception * @throws Exception
*/ */
public function loadIntoExisting($pFilename, \PHPExcel\Spreadsheet $objPHPExcel) public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet)
{ {
// Open file // Open file
$this->openFile($pFilename); $this->openFile($pFilename);
@ -216,10 +213,10 @@ class SYLK extends BaseReader implements IReader
rewind($fileHandle); rewind($fileHandle);
// Create new Worksheets // Create new Worksheets
while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) { while ($spreadsheet->getSheetCount() <= $this->sheetIndex) {
$objPHPExcel->createSheet(); $spreadsheet->createSheet();
} }
$objPHPExcel->setActiveSheetIndex($this->sheetIndex); $spreadsheet->setActiveSheetIndex($this->sheetIndex);
$fromFormats = array('\-', '\ '); $fromFormats = array('\-', '\ ');
$toFormats = array('-', ' '); $toFormats = array('-', ' ');
@ -231,7 +228,7 @@ class SYLK extends BaseReader implements IReader
// loop through one row (line) at a time in the file // loop through one row (line) at a time in the file
while (($rowData = fgets($fileHandle)) !== false) { while (($rowData = fgets($fileHandle)) !== false) {
// convert SYLK encoded $rowData to UTF-8 // convert SYLK encoded $rowData to UTF-8
$rowData = \PHPExcel\Shared\StringHelper::SYLKtoUTF8($rowData); $rowData = \PhpSpreadsheet\Shared\StringHelper::SYLKtoUTF8($rowData);
// explode each row at semicolons while taking into account that literal semicolon (;) // explode each row at semicolons while taking into account that literal semicolon (;)
// is escaped like this (;;) // is escaped like this (;;)
@ -264,16 +261,16 @@ class SYLK extends BaseReader implements IReader
$formatArray['font']['bold'] = true; $formatArray['font']['bold'] = true;
break; break;
case 'T': case 'T':
$formatArray['borders']['top']['style'] = \PHPExcel\Style\Border::BORDER_THIN; $formatArray['borders']['top']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break; break;
case 'B': case 'B':
$formatArray['borders']['bottom']['style'] = \PHPExcel\Style\Border::BORDER_THIN; $formatArray['borders']['bottom']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break; break;
case 'L': case 'L':
$formatArray['borders']['left']['style'] = \PHPExcel\Style\Border::BORDER_THIN; $formatArray['borders']['left']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break; break;
case 'R': case 'R':
$formatArray['borders']['right']['style'] = \PHPExcel\Style\Border::BORDER_THIN; $formatArray['borders']['right']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break; break;
} }
} }
@ -332,7 +329,7 @@ class SYLK extends BaseReader implements IReader
if ($columnReference{0} == '[') { if ($columnReference{0} == '[') {
$columnReference = $column + trim($columnReference, '[]'); $columnReference = $column + trim($columnReference, '[]');
} }
$A1CellReference = \PHPExcel\Cell::stringFromColumnIndex($columnReference-1).$rowReference; $A1CellReference = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference-1).$rowReference;
$value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0])); $value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0]));
} }
@ -345,14 +342,14 @@ class SYLK extends BaseReader implements IReader
break; break;
} }
} }
$columnLetter = \PHPExcel\Cell::stringFromColumnIndex($column-1); $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column-1);
$cellData = \PHPExcel\Calculation::unwrapResult($cellData); $cellData = \PhpSpreadsheet\Calculation::unwrapResult($cellData);
// Set cell value // Set cell value
$objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData); $spreadsheet->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData);
if ($hasCalculatedValue) { if ($hasCalculatedValue) {
$cellData = \PHPExcel\Calculation::unwrapResult($cellData); $cellData = \PhpSpreadsheet\Calculation::unwrapResult($cellData);
$objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData); $spreadsheet->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData);
} }
// Read cell formatting // Read cell formatting
} elseif ($dataType == 'F') { } elseif ($dataType == 'F') {
@ -385,16 +382,16 @@ class SYLK extends BaseReader implements IReader
$styleData['font']['bold'] = true; $styleData['font']['bold'] = true;
break; break;
case 'T': case 'T':
$styleData['borders']['top']['style'] = \PHPExcel\Style\Border::BORDER_THIN; $styleData['borders']['top']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break; break;
case 'B': case 'B':
$styleData['borders']['bottom']['style'] = \PHPExcel\Style\Border::BORDER_THIN; $styleData['borders']['bottom']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break; break;
case 'L': case 'L':
$styleData['borders']['left']['style'] = \PHPExcel\Style\Border::BORDER_THIN; $styleData['borders']['left']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break; break;
case 'R': case 'R':
$styleData['borders']['right']['style'] = \PHPExcel\Style\Border::BORDER_THIN; $styleData['borders']['right']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break; break;
} }
} }
@ -402,25 +399,25 @@ class SYLK extends BaseReader implements IReader
} }
} }
if (($formatStyle > '') && ($column > '') && ($row > '')) { if (($formatStyle > '') && ($column > '') && ($row > '')) {
$columnLetter = \PHPExcel\Cell::stringFromColumnIndex($column-1); $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column-1);
if (isset($this->formats[$formatStyle])) { if (isset($this->formats[$formatStyle])) {
$objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($this->formats[$formatStyle]); $spreadsheet->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($this->formats[$formatStyle]);
} }
} }
if ((!empty($styleData)) && ($column > '') && ($row > '')) { if ((!empty($styleData)) && ($column > '') && ($row > '')) {
$columnLetter = \PHPExcel\Cell::stringFromColumnIndex($column-1); $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column-1);
$objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($styleData); $spreadsheet->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($styleData);
} }
if ($columnWidth > '') { if ($columnWidth > '') {
if ($startCol == $endCol) { if ($startCol == $endCol) {
$startCol = \PHPExcel\Cell::stringFromColumnIndex($startCol-1); $startCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCol-1);
$objPHPExcel->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth); $spreadsheet->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth);
} else { } else {
$startCol = \PHPExcel\Cell::stringFromColumnIndex($startCol-1); $startCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCol-1);
$endCol = \PHPExcel\Cell::stringFromColumnIndex($endCol-1); $endCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($endCol-1);
$objPHPExcel->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth); $spreadsheet->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth);
do { do {
$objPHPExcel->getActiveSheet()->getColumnDimension(++$startCol)->setWidth($columnWidth); $spreadsheet->getActiveSheet()->getColumnDimension(++$startCol)->setWidth($columnWidth);
} while ($startCol != $endCol); } while ($startCol != $endCol);
} }
} }
@ -444,7 +441,7 @@ class SYLK extends BaseReader implements IReader
fclose($fileHandle); fclose($fileHandle);
// Return // Return
return $objPHPExcel; return $spreadsheet;
} }
/** /**

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel; namespace PhpSpreadsheet;
/** /**
* PHPExcel_ReferenceHelper (Singleton) * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -258,7 +255,7 @@ class ReferenceHelper
($pNumCols > 0 || $pNumRows > 0) ? ($pNumCols > 0 || $pNumRows > 0) ?
uksort($aDataValidationCollection, array('self','cellReverseSort')) : uksort($aDataValidationCollection, array('self','cellReverseSort')) :
uksort($aDataValidationCollection, array('self','cellSort')); uksort($aDataValidationCollection, array('self','cellSort'));
foreach ($aDataValidationCollection as $key => $value) { foreach ($aDataValidationCollection as $key => $value) {
$newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows);
if ($key != $newReference) { if ($key != $newReference) {
@ -802,17 +799,17 @@ class ReferenceHelper
/** /**
* Update named formulas (i.e. containing worksheet references / named ranges) * Update named formulas (i.e. containing worksheet references / named ranges)
* *
* @param PHPExcel $pPhpExcel Object to update * @param \PhpSpreadsheet\Spreadsheet $spreadsheet Object to update
* @param string $oldName Old name (name to replace) * @param string $oldName Old name (name to replace)
* @param string $newName New name * @param string $newName New name
*/ */
public function updateNamedFormulas(Spreadsheet $pPhpExcel, $oldName = '', $newName = '') public function updateNamedFormulas(Spreadsheet $spreadsheet, $oldName = '', $newName = '')
{ {
if ($oldName == '') { if ($oldName == '') {
return; return;
} }
foreach ($pPhpExcel->getWorksheetIterator() as $sheet) { foreach ($spreadsheet->getWorksheetIterator() as $sheet) {
foreach ($sheet->getCellCollection(false) as $cellID) { foreach ($sheet->getCellCollection(false) as $cellID) {
$cell = $sheet->getCell($cellID); $cell = $sheet->getCell($cellID);
if (($cell !== null) && ($cell->getDataType() == Cell\DataType::TYPE_FORMULA)) { if (($cell !== null) && ($cell->getDataType() == Cell\DataType::TYPE_FORMULA)) {

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel; namespace PhpSpreadsheet;
/** /**
* PHPExcel_RichText * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_RichText * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -152,7 +149,7 @@ class RichText implements IComparable
if (is_array($pElements)) { if (is_array($pElements)) {
$this->richTextElements = $pElements; $this->richTextElements = $pElements;
} else { } else {
throw new Exception("Invalid \PHPExcel\RichText\ITextElement[] array passed."); throw new Exception("Invalid \PhpSpreadsheet\RichText\ITextElement[] array passed.");
} }
return $this; return $this;
} }

View File

@ -1,10 +1,8 @@
<?php <?php
namespace PHPExcel\RichText; namespace PhpSpreadsheet\RichText;
/** /**
* PHPExcel_RichText_ITextElement
*
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
@ -19,9 +17,8 @@ namespace PHPExcel\RichText;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_RichText * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -45,7 +42,7 @@ interface ITextElement
/** /**
* Get font * Get font
* *
* @return \PHPExcel\Style\Font * @return \PhpSpreadsheet\Style\Font
*/ */
public function getFont(); public function getFont();

View File

@ -1,10 +1,8 @@
<?php <?php
namespace PHPExcel\RichText; namespace PhpSpreadsheet\RichText;
/** /**
* PHPExcel_RichText_Run
*
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
@ -19,9 +17,8 @@ namespace PHPExcel\RichText;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_RichText * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -30,7 +27,7 @@ class Run extends TextElement implements ITextElement
/** /**
* Font * Font
* *
* @var \PHPExcel\Style\Font * @var \PhpSpreadsheet\Style\Font
*/ */
private $font; private $font;
@ -43,13 +40,13 @@ class Run extends TextElement implements ITextElement
{ {
// Initialise variables // Initialise variables
$this->setText($pText); $this->setText($pText);
$this->font = new \PHPExcel\Style\Font(); $this->font = new \PhpSpreadsheet\Style\Font();
} }
/** /**
* Get font * Get font
* *
* @return \PHPExcel\Style\Font * @return \PhpSpreadsheet\Style\Font
*/ */
public function getFont() public function getFont()
{ {
@ -59,11 +56,11 @@ class Run extends TextElement implements ITextElement
/** /**
* Set font * Set font
* *
* @param \PHPExcel\Style\Font $pFont Font * @param \PhpSpreadsheet\Style\Font $pFont Font
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
* @return ITextElement * @return ITextElement
*/ */
public function setFont(\PHPExcel\Style\Font $pFont = null) public function setFont(\PhpSpreadsheet\Style\Font $pFont = null)
{ {
$this->font = $pFont; $this->font = $pFont;
return $this; return $this;

View File

@ -1,10 +1,8 @@
<?php <?php
namespace PHPExcel\RichText; namespace PhpSpreadsheet\RichText;
/** /**
* PHPExcel_RichText_TextElement
*
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
@ -19,9 +17,8 @@ namespace PHPExcel\RichText;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_RichText * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -70,7 +67,7 @@ class TextElement implements ITextElement
/** /**
* Get font * Get font
* *
* @return \PHPExcel\Style\Font * @return \PhpSpreadsheet\Style\Font
*/ */
public function getFont() public function getFont()
{ {

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel; namespace PhpSpreadsheet;
/** /**
* PHPExcel_Settings * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Settings * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -31,7 +28,7 @@ class Settings
{ {
/** constants */ /** constants */
/** Available Zip library classes */ /** Available Zip library classes */
const PCLZIP = '\\PHPExcel\\Shared\\ZipArchive'; const PCLZIP = '\\PhpSpreadsheet\\Shared\\ZipArchive';
const ZIPARCHIVE = '\\ZipArchive'; const ZIPARCHIVE = '\\ZipArchive';
/** Optional Chart Rendering libraries */ /** Optional Chart Rendering libraries */
@ -105,10 +102,10 @@ class Settings
private static $libXmlLoaderOptions = null; private static $libXmlLoaderOptions = null;
/** /**
* Set the Zip handler Class that PHPExcel should use for Zip file management (PCLZip or ZipArchive) * Set the Zip handler Class that PhpSpreadsheet should use for Zip file management (PCLZip or ZipArchive)
* *
* @param string $zipClass The Zip handler class that PHPExcel should use for Zip file management * @param string $zipClass The Zip handler class that PhpSpreadsheet should use for Zip file management
* e.g. \PHPExcel\Settings::PCLZip or \PHPExcel\Settings::ZipArchive * e.g. \PhpSpreadsheet\Settings::PCLZip or \PhpSpreadsheet\Settings::ZipArchive
* @return boolean Success or failure * @return boolean Success or failure
*/ */
public static function setZipClass($zipClass) public static function setZipClass($zipClass)
@ -123,12 +120,12 @@ class Settings
/** /**
* Return the name of the Zip handler Class that PHPExcel is configured to use (PCLZip or ZipArchive) * Return the name of the Zip handler Class that PhpSpreadsheet is configured to use (PCLZip or ZipArchive)
* or Zip file management * or Zip file management
* *
* @return string Name of the Zip handler Class that PHPExcel is configured to use * @return string Name of the Zip handler Class that PhpSpreadsheet is configured to use
* for Zip file management * for Zip file management
* e.g. \PHPExcel\Settings::PCLZip or \PHPExcel\Settings::ZipArchive * e.g. \PhpSpreadsheet\Settings::PCLZip or \PhpSpreadsheet\Settings::ZipArchive
*/ */
public static function getZipClass() public static function getZipClass()
{ {
@ -184,10 +181,10 @@ class Settings
/** /**
* Set details of the external library that PHPExcel should use for rendering charts * Set details of the external library that PhpSpreadsheet should use for rendering charts
* *
* @param string $libraryName Internal reference name of the library * @param string $libraryName Internal reference name of the library
* e.g. \PHPExcel\Settings::CHART_RENDERER_JPGRAPH * e.g. \PhpSpreadsheet\Settings::CHART_RENDERER_JPGRAPH
* @param string $libraryBaseDir Directory path to the library's base folder * @param string $libraryBaseDir Directory path to the library's base folder
* *
* @return boolean Success or failure * @return boolean Success or failure
@ -202,10 +199,10 @@ class Settings
/** /**
* Identify to PHPExcel the external library to use for rendering charts * Identify to PhpSpreadsheet the external library to use for rendering charts
* *
* @param string $libraryName Internal reference name of the library * @param string $libraryName Internal reference name of the library
* e.g. \PHPExcel\Settings::CHART_RENDERER_JPGRAPH * e.g. \PhpSpreadsheet\Settings::CHART_RENDERER_JPGRAPH
* *
* @return boolean Success or failure * @return boolean Success or failure
*/ */
@ -221,7 +218,7 @@ class Settings
/** /**
* Tell PHPExcel where to find the external library to use for rendering charts * Tell PhpSpreadsheet where to find the external library to use for rendering charts
* *
* @param string $libraryBaseDir Directory path to the library's base folder * @param string $libraryBaseDir Directory path to the library's base folder
* @return boolean Success or failure * @return boolean Success or failure
@ -238,11 +235,11 @@ class Settings
/** /**
* Return the Chart Rendering Library that PHPExcel is currently configured to use (e.g. jpgraph) * Return the Chart Rendering Library that PhpSpreadsheet is currently configured to use (e.g. jpgraph)
* *
* @return string|NULL Internal reference name of the Chart Rendering Library that PHPExcel is * @return string|NULL Internal reference name of the Chart Rendering Library that PhpSpreadsheet is
* currently configured to use * currently configured to use
* e.g. \PHPExcel\Settings::CHART_RENDERER_JPGRAPH * e.g. \PhpSpreadsheet\Settings::CHART_RENDERER_JPGRAPH
*/ */
public static function getChartRendererName() public static function getChartRendererName()
{ {
@ -251,9 +248,9 @@ class Settings
/** /**
* Return the directory path to the Chart Rendering Library that PHPExcel is currently configured to use * Return the directory path to the Chart Rendering Library that PhpSpreadsheet is currently configured to use
* *
* @return string|NULL Directory Path to the Chart Rendering Library that PHPExcel is * @return string|NULL Directory Path to the Chart Rendering Library that PhpSpreadsheet is
* currently configured to use * currently configured to use
*/ */
public static function getChartRendererPath() public static function getChartRendererPath()
@ -263,12 +260,12 @@ class Settings
/** /**
* Set details of the external library that PHPExcel should use for rendering PDF files * Set details of the external library that PhpSpreadsheet should use for rendering PDF files
* *
* @param string $libraryName Internal reference name of the library * @param string $libraryName Internal reference name of the library
* e.g. \PHPExcel\Settings::PDF_RENDERER_TCPDF, * e.g. \PhpSpreadsheet\Settings::PDF_RENDERER_TCPDF,
* \PHPExcel\Settings::PDF_RENDERER_DOMPDF * \PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF
* or \PHPExcel\Settings::PDF_RENDERER_MPDF * or \PhpSpreadsheet\Settings::PDF_RENDERER_MPDF
* @param string $libraryBaseDir Directory path to the library's base folder * @param string $libraryBaseDir Directory path to the library's base folder
* *
* @return boolean Success or failure * @return boolean Success or failure
@ -283,12 +280,12 @@ class Settings
/** /**
* Identify to PHPExcel the external library to use for rendering PDF files * Identify to PhpSpreadsheet the external library to use for rendering PDF files
* *
* @param string $libraryName Internal reference name of the library * @param string $libraryName Internal reference name of the library
* e.g. \PHPExcel\Settings::PDF_RENDERER_TCPDF, * e.g. \PhpSpreadsheet\Settings::PDF_RENDERER_TCPDF,
* \PHPExcel\Settings::PDF_RENDERER_DOMPDF * \PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF
* or \PHPExcel\Settings::PDF_RENDERER_MPDF * or \PhpSpreadsheet\Settings::PDF_RENDERER_MPDF
* *
* @return boolean Success or failure * @return boolean Success or failure
*/ */
@ -304,7 +301,7 @@ class Settings
/** /**
* Tell PHPExcel where to find the external library to use for rendering PDF files * Tell PhpSpreadsheet where to find the external library to use for rendering PDF files
* *
* @param string $libraryBaseDir Directory path to the library's base folder * @param string $libraryBaseDir Directory path to the library's base folder
* @return boolean Success or failure * @return boolean Success or failure
@ -321,13 +318,13 @@ class Settings
/** /**
* Return the PDF Rendering Library that PHPExcel is currently configured to use (e.g. dompdf) * Return the PDF Rendering Library that PhpSpreadsheet is currently configured to use (e.g. dompdf)
* *
* @return string|NULL Internal reference name of the PDF Rendering Library that PHPExcel is * @return string|NULL Internal reference name of the PDF Rendering Library that PhpSpreadsheet is
* currently configured to use * currently configured to use
* e.g. \PHPExcel\Settings::PDF_RENDERER_TCPDF, * e.g. \PhpSpreadsheet\Settings::PDF_RENDERER_TCPDF,
* \PHPExcel\Settings::PDF_RENDERER_DOMPDF * \PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF
* or \PHPExcel\Settings::PDF_RENDERER_MPDF * or \PhpSpreadsheet\Settings::PDF_RENDERER_MPDF
*/ */
public static function getPdfRendererName() public static function getPdfRendererName()
{ {
@ -335,9 +332,9 @@ class Settings
} }
/** /**
* Return the directory path to the PDF Rendering Library that PHPExcel is currently configured to use * Return the directory path to the PDF Rendering Library that PhpSpreadsheet is currently configured to use
* *
* @return string|NULL Directory Path to the PDF Rendering Library that PHPExcel is * @return string|NULL Directory Path to the PDF Rendering Library that PhpSpreadsheet is
* currently configured to use * currently configured to use
*/ */
public static function getPdfRendererPath() public static function getPdfRendererPath()

View File

@ -1,11 +1,11 @@
<?php <?php
namespace PHPExcel\Shared; namespace PhpSpreadsheet\Shared;
/** /**
* \PHPExcel\Shared\CodePage * \PhpSpreadsheet\Shared\CodePage
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2016 PhpSpreadsheet
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +21,8 @@ namespace PHPExcel\Shared;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Shared * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -35,7 +34,7 @@ class CodePage
* *
* @param integer $codePage Microsoft Code Page Indentifier * @param integer $codePage Microsoft Code Page Indentifier
* @return string Code Page Name * @return string Code Page Name
* @throws \PHPExcel\Exception * @throws \PhpSpreadsheet\Exception
*/ */
public static function numberToName($codePage = 1252) public static function numberToName($codePage = 1252)
{ {
@ -45,7 +44,7 @@ class CodePage
case 437: case 437:
return 'CP437'; // OEM US return 'CP437'; // OEM US
case 720: case 720:
throw new \PHPExcel\Exception('Code page 720 not supported.'); // OEM Arabic throw new \PhpSpreadsheet\Exception('Code page 720 not supported.'); // OEM Arabic
case 737: case 737:
return 'CP737'; // OEM Greek return 'CP737'; // OEM Greek
case 775: case 775:
@ -147,12 +146,12 @@ class CodePage
case 32768: case 32768:
return 'MAC'; // Apple Roman return 'MAC'; // Apple Roman
case 32769: case 32769:
throw new \PHPExcel\Exception('Code page 32769 not supported.'); // ANSI Latin I (BIFF2-BIFF3) throw new \PhpSpreadsheet\Exception('Code page 32769 not supported.'); // ANSI Latin I (BIFF2-BIFF3)
case 65000: case 65000:
return 'UTF-7'; // Unicode (UTF-7) return 'UTF-7'; // Unicode (UTF-7)
case 65001: case 65001:
return 'UTF-8'; // Unicode (UTF-8) return 'UTF-8'; // Unicode (UTF-8)
} }
throw new \PHPExcel\Exception('Unknown codepage: ' . $codePage); throw new \PhpSpreadsheet\Exception('Unknown codepage: ' . $codePage);
} }
} }

View File

@ -1,11 +1,11 @@
<?php <?php
namespace PHPExcel\Shared; namespace PhpSpreadsheet\Shared;
/** /**
* \PHPExcel\Shared\Date * \PhpSpreadsheet\Shared\Date
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2016 PhpSpreadsheet
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +21,8 @@ namespace PHPExcel\Shared;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Shared * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -311,10 +310,10 @@ class Date
/** /**
* Is a given cell a date/time? * Is a given cell a date/time?
* *
* @param \PHPExcel\Cell $pCell * @param \PhpSpreadsheet\Cell $pCell
* @return boolean * @return boolean
*/ */
public static function isDateTime(\PHPExcel\Cell $pCell) public static function isDateTime(\PhpSpreadsheet\Cell $pCell)
{ {
return self::isDateTimeFormat( return self::isDateTimeFormat(
$pCell->getWorksheet()->getStyle( $pCell->getWorksheet()->getStyle(
@ -327,10 +326,10 @@ class Date
/** /**
* Is a given number format a date/time? * Is a given number format a date/time?
* *
* @param \PHPExcel\Style\NumberFormat $pFormat * @param \PhpSpreadsheet\Style\NumberFormat $pFormat
* @return boolean * @return boolean
*/ */
public static function isDateTimeFormat(\PHPExcel\Style\NumberFormat $pFormat) public static function isDateTimeFormat(\PhpSpreadsheet\Style\NumberFormat $pFormat)
{ {
return self::isDateTimeFormatCode($pFormat->getFormatCode()); return self::isDateTimeFormatCode($pFormat->getFormatCode());
} }
@ -346,7 +345,7 @@ class Date
*/ */
public static function isDateTimeFormatCode($pFormatCode = '') public static function isDateTimeFormatCode($pFormatCode = '')
{ {
if (strtolower($pFormatCode) === strtolower(\PHPExcel\Style\NumberFormat::FORMAT_GENERAL)) { if (strtolower($pFormatCode) === strtolower(\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL)) {
// "General" contains an epoch letter 'e', so we trap for it explicitly here (case-insensitive check) // "General" contains an epoch letter 'e', so we trap for it explicitly here (case-insensitive check)
return false; return false;
} }
@ -358,28 +357,28 @@ class Date
// Switch on formatcode // Switch on formatcode
switch ($pFormatCode) { switch ($pFormatCode) {
// Explicitly defined date formats // Explicitly defined date formats
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDD: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DDMMYYYY: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DMYSLASH: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMYSLASH:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DMYMINUS: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMYMINUS:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DMMINUS: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMMINUS:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_MYMINUS: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_MYMINUS:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DATETIME: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME1: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME1:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME2: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME2:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME3: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME3:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME5: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME5:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME6: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME6:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME7: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME7:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME8: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME8:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDDSLASH: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDDSLASH:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX14: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX14:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX15: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX16: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX16:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX17: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX17:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX22: case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX22:
return true; return true;
} }
@ -425,15 +424,15 @@ class Date
return false; return false;
} }
$dateValueNew = \PHPExcel\Calculation\DateTime::DATEVALUE($dateValue); $dateValueNew = \PhpSpreadsheet\Calculation\DateTime::DATEVALUE($dateValue);
if ($dateValueNew === \PHPExcel\Calculation\Functions::VALUE()) { if ($dateValueNew === \PhpSpreadsheet\Calculation\Functions::VALUE()) {
return false; return false;
} }
if (strpos($dateValue, ':') !== false) { if (strpos($dateValue, ':') !== false) {
$timeValue = \PHPExcel\Calculation\DateTime::TIMEVALUE($dateValue); $timeValue = \PhpSpreadsheet\Calculation\DateTime::TIMEVALUE($dateValue);
if ($timeValue === \PHPExcel\Calculation\Functions::VALUE()) { if ($timeValue === \PhpSpreadsheet\Calculation\Functions::VALUE()) {
return false; return false;
} }
$dateValueNew += $timeValue; $dateValueNew += $timeValue;

View File

@ -1,11 +1,9 @@
<?php <?php
namespace PHPExcel\Shared; namespace PhpSpreadsheet\Shared;
/** /**
* PHPExcel_Shared_Drawing * Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* Copyright (c) 2006 - 2015 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,9 +19,8 @@ namespace PHPExcel\Shared;
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PhpSpreadsheet
* @package PHPExcel_Shared * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @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##
*/ */
@ -61,22 +58,22 @@ class Drawing
* This gives a conversion factor of 7. Also, we assume that pixels and font size are proportional. * This gives a conversion factor of 7. Also, we assume that pixels and font size are proportional.
* *
* @param int $pValue Value in pixels * @param int $pValue Value in pixels
* @param \PHPExcel\Style\Font $pDefaultFont Default font of the workbook * @param \PhpSpreadsheet\Style\Font $pDefaultFont Default font of the workbook
* @return int Value in cell dimension * @return int Value in cell dimension
*/ */
public static function pixelsToCellDimension($pValue, \PHPExcel\Style\Font $pDefaultFont) public static function pixelsToCellDimension($pValue, \PhpSpreadsheet\Style\Font $pDefaultFont)
{ {
// Font name and size // Font name and size
$name = $pDefaultFont->getName(); $name = $pDefaultFont->getName();
$size = $pDefaultFont->getSize(); $size = $pDefaultFont->getSize();
if (isset(\PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size])) { if (isset(\PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size])) {
// Exact width can be determined // Exact width can be determined
$colWidth = $pValue * \PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size]['width'] / \PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size]['px']; $colWidth = $pValue * \PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size]['width'] / \PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size]['px'];
} else { } else {
// We don't have data for this particular font and size, use approximation by // We don't have data for this particular font and size, use approximation by
// extrapolating from Calibri 11 // extrapolating from Calibri 11
$colWidth = $pValue * 11 * \PHPExcel\Shared\Font::$defaultColumnWidths['Calibri'][11]['width'] / \PHPExcel\Shared\Font::$defaultColumnWidths['Calibri'][11]['px'] / $size; $colWidth = $pValue * 11 * \PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['width'] / \PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['px'] / $size;
} }
return $colWidth; return $colWidth;
@ -86,22 +83,22 @@ class Drawing
* Convert column width from (intrinsic) Excel units to pixels * Convert column width from (intrinsic) Excel units to pixels
* *
* @param float $pValue Value in cell dimension * @param float $pValue Value in cell dimension
* @param \PHPExcel\Style\Font $pDefaultFont Default font of the workbook * @param \PhpSpreadsheet\Style\Font $pDefaultFont Default font of the workbook
* @return int Value in pixels * @return int Value in pixels
*/ */
public static function cellDimensionToPixels($pValue, \PHPExcel\Style\Font $pDefaultFont) public static function cellDimensionToPixels($pValue, \PhpSpreadsheet\Style\Font $pDefaultFont)
{ {
// Font name and size // Font name and size
$name = $pDefaultFont->getName(); $name = $pDefaultFont->getName();
$size = $pDefaultFont->getSize(); $size = $pDefaultFont->getSize();
if (isset(\PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size])) { if (isset(\PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size])) {
// Exact width can be determined // Exact width can be determined
$colWidth = $pValue * \PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size]['px'] / \PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size]['width']; $colWidth = $pValue * \PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size]['px'] / \PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size]['width'];
} else { } else {
// We don't have data for this particular font and size, use approximation by // We don't have data for this particular font and size, use approximation by
// extrapolating from Calibri 11 // extrapolating from Calibri 11
$colWidth = $pValue * $size * \PHPExcel\Shared\Font::$defaultColumnWidths['Calibri'][11]['px'] / \PHPExcel\Shared\Font::$defaultColumnWidths['Calibri'][11]['width'] / 11; $colWidth = $pValue * $size * \PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['px'] / \PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['width'] / 11;
} }
// Round pixels to closest integer // Round pixels to closest integer

Some files were not shown because too many files have changed in this diff Show More