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": {
"psr-4": {
"PHPExcel\\": "src/PhpSpreadsheet"
"PhpSpreadsheet\\": "src/PhpSpreadsheet"
}
},
"autoload-dev": {

View File

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

View File

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

View File

@ -1,12 +1,12 @@
<?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
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -41,7 +40,7 @@ class Autoloader
spl_autoload_register('__autoload');
}
// 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)
{
if ((class_exists($className, false)) || (strpos($className, 'PHPExcel\\') !== 0)) {
// Either already loaded, or not a PHPExcel class request
if ((class_exists($className, false)) || (strpos($className, 'PhpSpreadsheet\\') !== 0)) {
// Either already loaded, or not a PhpSpreadsheet class request
return false;
}
$classFilePath = __DIR__ . DIRECTORY_SEPARATOR .
'PhpSpreadsheet' . DIRECTORY_SEPARATOR .
str_replace(['PHPExcel\\', '\\'], ['', '/'], $className) .
str_replace(['PhpSpreadsheet\\', '\\'], ['', '/'], $className) .
'.php';
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
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
include_once __DIR__ . '/Autoloader.php';
\PHPExcel\Autoloader::register();
\PhpSpreadsheet\Autoloader::register();

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\CachedObjectStorage;
namespace PhpSpreadsheet\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_APC
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -50,7 +47,7 @@ class APC extends CacheBase implements ICache
* and the 'nullify' the current cell object
*
* @access private
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
protected function storeData()
{
@ -63,7 +60,7 @@ class APC extends CacheBase implements ICache
$this->cacheTime
)) {
$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;
}
@ -75,11 +72,11 @@ class APC extends CacheBase implements ICache
*
* @access public
* @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PhpSpreadsheet\Cell
* @throws \PhpSpreadsheet\Exception
*/
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$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
* @param string $pCoord Coordinate address of the cell to check
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
* @return boolean
*/
public function isDataSet($pCoord)
@ -113,7 +110,7 @@ class APC extends CacheBase implements ICache
if ($success === false) {
// Entry no longer exists in APC, so clear it from the cache array
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;
}
@ -125,8 +122,8 @@ class APC extends CacheBase implements ICache
*
* @access public
* @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found
* @throws \PhpSpreadsheet\Exception
* @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
{
@ -141,7 +138,7 @@ class APC extends CacheBase implements ICache
if ($obj === false) {
// Entry no longer exists in APC, so clear it from the cache array
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 {
// Return null if requested entry doesn't exist in cache
@ -177,7 +174,7 @@ class APC extends CacheBase implements ICache
*
* @access public
* @param string $pCoord Coordinate address of the cell to delete
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
public function deleteCacheData($pCoord)
{
@ -192,10 +189,10 @@ class APC extends CacheBase implements ICache
* Clone the cell collection
*
* @access public
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
* @throws \PhpSpreadsheet\Exception
*/
public function copyCellCollection(\PHPExcel\Worksheet $parent)
public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent)
{
parent::copyCellCollection($parent);
// Get a new id for the new file name
@ -208,11 +205,11 @@ class APC extends CacheBase implements ICache
if ($obj === false) {
// Entry no longer exists in APC, so clear it from the cache array
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)) {
$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
*
* @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
*/
public function __construct(\PHPExcel\Worksheet $parent, $arguments)
public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments)
{
$cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\CachedObjectStorage;
namespace PhpSpreadsheet\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_CacheBase
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -32,14 +29,14 @@ abstract class CacheBase
/**
* Parent worksheet
*
* @var \PHPExcel\Worksheet
* @var \PhpSpreadsheet\Worksheet
*/
protected $parent;
/**
* The currently active Cell
*
* @var \PHPExcel\Cell
* @var \PhpSpreadsheet\Cell
*/
protected $currentObject = null;
@ -68,12 +65,12 @@ abstract class CacheBase
/**
* 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.
// 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
$this->parent = $parent;
}
@ -81,7 +78,7 @@ abstract class CacheBase
/**
* Return the parent worksheet for this cell collection
*
* @return \PHPExcel\Worksheet
* @return \PhpSpreadsheet\Worksheet
*/
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
* @return boolean
@ -127,11 +124,11 @@ abstract class CacheBase
/**
* Add or Update a cell in cache
*
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PhpSpreadsheet\Cell
* @throws \PhpSpreadsheet\Exception
*/
public function updateCacheData(\PHPExcel\Cell $cell)
public function updateCacheData(\PhpSpreadsheet\Cell $cell)
{
return $this->addCacheData($cell->getCoordinate(), $cell);
}
@ -140,7 +137,7 @@ abstract class CacheBase
* Delete a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to delete
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
public function deleteCacheData($pCoord)
{
@ -262,9 +259,9 @@ abstract class CacheBase
if ($r != $row) {
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
*
* @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->storeData();

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\CachedObjectStorage;
namespace PhpSpreadsheet\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_DiscISAM
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -55,7 +52,7 @@ class DiscISAM extends CacheBase implements ICache
* and the 'nullify' the current cell object
*
* @return void
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
protected function storeData()
{
@ -77,11 +74,11 @@ class DiscISAM extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PhpSpreadsheet\Cell
* @throws \PhpSpreadsheet\Exception
*/
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData();
@ -98,8 +95,8 @@ class DiscISAM extends CacheBase implements ICache
* Get cell at a specific coordinate
*
* @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found
* @throws \PhpSpreadsheet\Exception
* @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
{
@ -142,14 +139,14 @@ class DiscISAM extends CacheBase implements ICache
/**
* 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);
// Get a new id for the new file name
$baseUnique = $this->getUniqueID();
$newFileName = $this->cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache';
$newFileName = $this->cacheDirectory.'/PhpSpreadsheet.'.$baseUnique.'.cache';
// Copy the existing cell cache file
copy($this->fileName, $newFileName);
$this->fileName = $newFileName;
@ -179,19 +176,19 @@ class DiscISAM extends CacheBase implements ICache
/**
* 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
*/
public function __construct(\PHPExcel\Worksheet $parent, $arguments)
public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments)
{
$this->cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== null))
? $arguments['dir']
: \PHPExcel\Shared\File::sysGetTempDir();
: \PhpSpreadsheet\Shared\File::sysGetTempDir();
parent::__construct($parent);
if (is_null($this->fileHandle)) {
$baseUnique = $this->getUniqueID();
$this->fileName = $this->cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache';
$this->fileName = $this->cacheDirectory.'/PhpSpreadsheet.'.$baseUnique.'.cache';
$this->fileHandle = fopen($this->fileName, 'a+');
}
}

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\CachedObjectStorage;
namespace PhpSpreadsheet\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_ICache
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -33,27 +30,27 @@ interface ICache
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PhpSpreadsheet\Cell
* @throws \PhpSpreadsheet\Exception
*/
public function addCacheData($pCoord, \PHPExcel\Cell $cell);
public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell);
/**
* Add or Update a cell in cache
*
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PhpSpreadsheet\Cell
* @throws \PhpSpreadsheet\Exception
*/
public function updateCacheData(\PHPExcel\Cell $cell);
public function updateCacheData(\PhpSpreadsheet\Cell $cell);
/**
* Fetch a cell from cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to retrieve
* @return \PHPExcel\Cell Cell that was found, or null if not found
* @throws \PHPExcel\Exception
* @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
* @throws \PhpSpreadsheet\Exception
*/
public function getCacheData($pCoord);
@ -61,12 +58,12 @@ interface ICache
* Delete a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to delete
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
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
* @return boolean
@ -90,9 +87,9 @@ interface ICache
/**
* 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

View File

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

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\CachedObjectStorage;
namespace PhpSpreadsheet\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_Memcache
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @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",
* and the 'nullify' the current cell object
*
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
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->add($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) {
$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;
@ -79,11 +76,11 @@ class Memcache extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PhpSpreadsheet\Cell
* @throws \PhpSpreadsheet\Exception
*/
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$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
* @return boolean
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
public function isDataSet($pCoord)
{
@ -117,7 +114,7 @@ class Memcache extends CacheBase implements ICache
if ($success === false) {
// Entry no longer exists in Memcache, so clear it from the cache array
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;
}
@ -129,8 +126,8 @@ class Memcache extends CacheBase implements ICache
* Get cell at a specific coordinate
*
* @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found
* @throws \PhpSpreadsheet\Exception
* @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
{
@ -145,7 +142,7 @@ class Memcache extends CacheBase implements ICache
if ($obj === false) {
// Entry no longer exists in Memcache, so clear it from the cache array
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 {
// 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
*
* @param string $pCoord Coordinate address of the cell to delete
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
public function deleteCacheData($pCoord)
{
@ -194,10 +191,10 @@ class Memcache extends CacheBase implements ICache
/**
* Clone the cell collection
*
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
* @throws \PhpSpreadsheet\Exception
*/
public function copyCellCollection(\PHPExcel\Worksheet $parent)
public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent)
{
parent::copyCellCollection($parent);
// Get a new id for the new file name
@ -210,11 +207,11 @@ class Memcache extends CacheBase implements ICache
if ($obj === false) {
// Entry no longer exists in Memcache, so clear it from the cache array
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)) {
$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
*
* @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
* @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';
$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
$this->memcache = new Memcache();
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;
@ -275,11 +272,11 @@ class Memcache extends CacheBase implements ICache
*
* @param string $host Memcache server
* @param integer $port Memcache port
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
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
namespace PHPExcel\CachedObjectStorage;
namespace PhpSpreadsheet\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_Memory
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -42,11 +39,11 @@ class Memory extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PhpSpreadsheet\Cell
* @throws \PhpSpreadsheet\Exception
*/
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{
$this->cellCache[$pCoord] = $cell;
@ -61,8 +58,8 @@ class Memory extends CacheBase implements ICache
* Get cell at a specific coordinate
*
* @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found
* @throws \PhpSpreadsheet\Exception
* @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
{
@ -84,9 +81,9 @@ class Memory extends CacheBase implements ICache
/**
* 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);

View File

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

View File

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

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\CachedObjectStorage;
namespace PhpSpreadsheet\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_PHPTemp
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @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",
* and the 'nullify' the current cell object
*
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
protected function storeData()
{
@ -70,11 +67,11 @@ class PHPTemp extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PhpSpreadsheet\Cell
* @throws \PhpSpreadsheet\Exception
*/
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData();
@ -92,8 +89,8 @@ class PHPTemp extends CacheBase implements ICache
* Get cell at a specific coordinate
*
* @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found
* @throws \PhpSpreadsheet\Exception
* @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
{
@ -136,9 +133,9 @@ class PHPTemp extends CacheBase implements ICache
/**
* 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);
// Open a new stream for the cell cache data
@ -174,10 +171,10 @@ class PHPTemp extends CacheBase implements ICache
/**
* 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
*/
public function __construct(\PHPExcel\Worksheet $parent, $arguments)
public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments)
{
$this->memoryCacheSize = (isset($arguments['memoryCacheSize'])) ? $arguments['memoryCacheSize'] : '1MB';

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\CachedObjectStorage;
namespace PhpSpreadsheet\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_SQLite
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @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",
* and the 'nullify' the current cell object
*
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
protected function storeData()
{
@ -55,7 +52,7 @@ class SQLite extends CacheBase implements ICache
$this->currentObject->detach();
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;
}
@ -66,11 +63,11 @@ class SQLite extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PhpSpreadsheet\Cell
* @throws \PhpSpreadsheet\Exception
*/
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData();
@ -87,8 +84,8 @@ class SQLite extends CacheBase implements ICache
* Get cell at a specific coordinate
*
* @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found
* @throws \PhpSpreadsheet\Exception
* @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
{
@ -100,7 +97,7 @@ class SQLite extends CacheBase implements ICache
$query = "SELECT value FROM kvp_".$this->TableName." WHERE id='".$pCoord."'";
$cellResultSet = $this->DBHandle->query($query, SQLITE_ASSOC);
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) {
// Return null if requested entry doesn't exist in cache
return null;
@ -123,7 +120,7 @@ class SQLite extends CacheBase implements ICache
*
* @param string $pCoord Coordinate address of the cell to check
* @return boolean
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
public function isDataSet($pCoord)
{
@ -135,7 +132,7 @@ class SQLite extends CacheBase implements ICache
$query = "SELECT id FROM kvp_".$this->TableName." WHERE id='".$pCoord."'";
$cellResultSet = $this->DBHandle->query($query, SQLITE_ASSOC);
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) {
// Return null if requested entry doesn't exist in cache
return false;
@ -147,7 +144,7 @@ class SQLite extends CacheBase implements ICache
* Delete a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to delete
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
public function deleteCacheData($pCoord)
{
@ -159,7 +156,7 @@ class SQLite extends CacheBase implements ICache
// Check if the requested entry exists in the cache
$query = "DELETE FROM kvp_".$this->TableName." WHERE id='".$pCoord."'";
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;
@ -170,7 +167,7 @@ class SQLite extends CacheBase implements ICache
*
* @param string $fromAddress Current address of the cell to move
* @param string $toAddress Destination address of the cell to move
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
* @return boolean
*/
public function moveCell($fromAddress, $toAddress)
@ -182,13 +179,13 @@ class SQLite extends CacheBase implements ICache
$query = "DELETE FROM kvp_".$this->TableName." WHERE id='".$toAddress."'";
$result = $this->DBHandle->exec($query);
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."'";
$result = $this->DBHandle->exec($query);
if ($result === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg());
throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
}
return true;
@ -198,7 +195,7 @@ class SQLite extends CacheBase implements ICache
* Get a list of all cell addresses currently held in cache
*
* @return string[]
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
public function getCellList()
{
@ -209,7 +206,7 @@ class SQLite extends CacheBase implements ICache
$query = "SELECT id FROM kvp_".$this->TableName;
$cellIdsResult = $this->DBHandle->unbufferedQuery($query, SQLITE_ASSOC);
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();
@ -223,10 +220,10 @@ class SQLite extends CacheBase implements ICache
/**
* Clone the cell collection
*
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
* @throws \PhpSpreadsheet\Exception
*/
public function copyCellCollection(\PHPExcel\Worksheet $parent)
public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent)
{
$this->currentCellIsDirty;
$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)
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
@ -264,10 +261,10 @@ class SQLite extends CacheBase implements ICache
/**
* Initialise this new cell collection
*
* @param \PHPExcel\Worksheet $parent The worksheet for this cell collection
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
* @throws \PhpSpreadsheet\Exception
*/
public function __construct(\PHPExcel\Worksheet $parent)
public function __construct(\PhpSpreadsheet\Worksheet $parent)
{
parent::__construct($parent);
if (is_null($this->DBHandle)) {
@ -276,10 +273,10 @@ class SQLite extends CacheBase implements ICache
$this->DBHandle = new SQLiteDatabase($_DBName);
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)')) {
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
namespace PHPExcel\CachedObjectStorage;
namespace PhpSpreadsheet\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_SQLite3
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @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",
* and the 'nullify' the current cell object
*
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
protected function storeData()
{
@ -86,7 +83,7 @@ class SQLite3 extends CacheBase implements ICache
$this->insertQuery->bindValue('data', serialize($this->currentObject), SQLITE3_BLOB);
$result = $this->insertQuery->execute();
if ($result === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg());
throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
}
$this->currentCellIsDirty = false;
}
@ -97,11 +94,11 @@ class SQLite3 extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PhpSpreadsheet\Cell
* @throws \PhpSpreadsheet\Exception
*/
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData();
@ -118,9 +115,9 @@ class SQLite3 extends CacheBase implements ICache
* Get cell at a specific coordinate
*
* @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
* @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
* @throws \PhpSpreadsheet\Exception
*/
public function getCacheData($pCoord)
{
@ -132,7 +129,7 @@ class SQLite3 extends CacheBase implements ICache
$this->selectQuery->bindValue('id', $pCoord, SQLITE3_TEXT);
$cellResult = $this->selectQuery->execute();
if ($cellResult === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg());
throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
}
$cellData = $cellResult->fetchArray(SQLITE3_ASSOC);
if ($cellData === false) {
@ -156,7 +153,7 @@ class SQLite3 extends CacheBase implements ICache
*
* @param string $pCoord Coordinate address of the cell to check
* @return boolean
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
public function isDataSet($pCoord)
{
@ -168,7 +165,7 @@ class SQLite3 extends CacheBase implements ICache
$this->selectQuery->bindValue('id', $pCoord, SQLITE3_TEXT);
$cellResult = $this->selectQuery->execute();
if ($cellResult === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg());
throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
}
$cellData = $cellResult->fetchArray(SQLITE3_ASSOC);
@ -179,7 +176,7 @@ class SQLite3 extends CacheBase implements ICache
* Delete a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to delete
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
public function deleteCacheData($pCoord)
{
@ -192,7 +189,7 @@ class SQLite3 extends CacheBase implements ICache
$this->deleteQuery->bindValue('id', $pCoord, SQLITE3_TEXT);
$result = $this->deleteQuery->execute();
if ($result === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg());
throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
}
$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 $toAddress Destination address of the cell to move
* @return boolean
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
public function moveCell($fromAddress, $toAddress)
{
@ -215,14 +212,14 @@ class SQLite3 extends CacheBase implements ICache
$this->deleteQuery->bindValue('id', $toAddress, SQLITE3_TEXT);
$result = $this->deleteQuery->execute();
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('fromid', $fromAddress, SQLITE3_TEXT);
$result = $this->updateQuery->execute();
if ($result === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg());
throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
}
return true;
@ -232,7 +229,7 @@ class SQLite3 extends CacheBase implements ICache
* Get a list of all cell addresses currently held in cache
*
* @return string[]
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
public function getCellList()
{
@ -243,7 +240,7 @@ class SQLite3 extends CacheBase implements ICache
$query = "SELECT id FROM kvp_".$this->TableName;
$cellIdsResult = $this->DBHandle->query($query);
if ($cellIdsResult === false) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg());
throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
}
$cellKeys = array();
@ -257,10 +254,10 @@ class SQLite3 extends CacheBase implements ICache
/**
* Clone the cell collection
*
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
* @throws \PhpSpreadsheet\Exception
*/
public function copyCellCollection(\PHPExcel\Worksheet $parent)
public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent)
{
$this->currentCellIsDirty;
$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)
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
@ -298,10 +295,10 @@ class SQLite3 extends CacheBase implements ICache
/**
* Initialise this new cell collection
*
* @param \PHPExcel\Worksheet $parent The worksheet for this cell collection
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection
* @throws \PhpSpreadsheet\Exception
*/
public function __construct(\PHPExcel\Worksheet $parent)
public function __construct(\PhpSpreadsheet\Worksheet $parent)
{
parent::__construct($parent);
if (is_null($this->DBHandle)) {
@ -310,10 +307,10 @@ class SQLite3 extends CacheBase implements ICache
$this->DBHandle = new \SQLite3($_DBName);
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)')) {
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg());
throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg());
}
}

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\CachedObjectStorage;
namespace PhpSpreadsheet\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_Wincache
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -49,7 +46,7 @@ class Wincache extends CacheBase implements ICache
* and the 'nullify' the current cell object
*
* @return void
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
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_set($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) {
$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 {
if (!wincache_ucache_add($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) {
$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;
@ -78,11 +75,11 @@ class Wincache extends CacheBase implements ICache
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Cell $cell Cell to update
* @return \PhpSpreadsheet\Cell
* @throws \PhpSpreadsheet\Exception
*/
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$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
* @return boolean
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
public function isDataSet($pCoord)
{
@ -115,7 +112,7 @@ class Wincache extends CacheBase implements ICache
if ($success === false) {
// Entry no longer exists in Wincache, so clear it from the cache array
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;
}
@ -127,8 +124,8 @@ class Wincache extends CacheBase implements ICache
* Get cell at a specific coordinate
*
* @param string $pCoord Coordinate of the cell
* @throws \PHPExcel\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found
* @throws \PhpSpreadsheet\Exception
* @return \PhpSpreadsheet\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
{
@ -145,7 +142,7 @@ class Wincache extends CacheBase implements ICache
if ($success === false) {
// Entry no longer exists in WinCache, so clear it from the cache array
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 {
// 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
*
* @param string $pCoord Coordinate address of the cell to delete
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
public function deleteCacheData($pCoord)
{
@ -195,10 +192,10 @@ class Wincache extends CacheBase implements ICache
/**
* Clone the cell collection
*
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
* @throws \PHPExcel\Exception
* @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to
* @throws \PhpSpreadsheet\Exception
*/
public function copyCellCollection(\PHPExcel\Worksheet $parent)
public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent)
{
parent::copyCellCollection($parent);
// Get a new id for the new file name
@ -212,11 +209,11 @@ class Wincache extends CacheBase implements ICache
if ($success === false) {
// Entry no longer exists in WinCache, so clear it from the cache array
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)) {
$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
*
* @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
*/
public function __construct(\PHPExcel\Worksheet $parent, $arguments)
public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments)
{
$cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel;
namespace PhpSpreadsheet;
/**
* PHPExcel_CachedObjectStorageFactory
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -152,7 +149,7 @@ class CachedObjectStorageFactory
{
$activeMethods = array();
foreach (self::$storageMethods as $storageMethod) {
$cacheStorageClass = '\\PHPExcel\\CachedObjectStorage\\' . $storageMethod;
$cacheStorageClass = '\\PhpSpreadsheet\\CachedObjectStorage\\' . $storageMethod;
if (call_user_func(array($cacheStorageClass, 'cacheMethodIsAvailable'))) {
$activeMethods[] = $storageMethod;
}
@ -174,7 +171,7 @@ class CachedObjectStorageFactory
return false;
}
$cacheStorageClass = '\\PHPExcel\\CachedObjectStorage\\'.$method;
$cacheStorageClass = '\\PhpSpreadsheet\\CachedObjectStorage\\'.$method;
if (!call_user_func([$cacheStorageClass, 'cacheMethodIsAvailable'])) {
return false;
}
@ -187,7 +184,7 @@ class CachedObjectStorageFactory
}
if (self::$cacheStorageMethod === null) {
self::$cacheStorageClass = '\\PHPExcel\\CachedObjectStorage\\' . $method;
self::$cacheStorageClass = '\\PhpSpreadsheet\\CachedObjectStorage\\' . $method;
self::$cacheStorageMethod = $method;
}
return true;

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\CalcEngine;
namespace PhpSpreadsheet\CalcEngine;
/**
* PHPExcel_CalcEngine_CyclicReferenceStack
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\CalcEngine;
namespace PhpSpreadsheet\CalcEngine;
/**
* PHPExcel_CalcEngine_Logger
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/**
* PHPExcel_Calculation_Categories
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -57,26 +54,26 @@ class Categories
private $excelName;
/**
* PHPExcel function name
* Spreadsheet function name
*
* @var string
*/
private $phpExcelName;
private $spreadsheetName;
/**
* Create a new Categories
* @param string $pCategory Category (represented by CATEGORY_*)
* @param string $pExcelName Excel function name
* @param string $pPHPExcelName PHPExcel internal function name
* @param string $spreadsheetName Spreadsheet internal function name
* @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
$this->category = $pCategory;
$this->excelName = $pExcelName;
$this->phpExcelName = $pPHPExcelName;
$this->spreadsheetName = $spreadsheetName;
} else {
throw new Exception("Invalid parameters passed.");
}
@ -128,22 +125,22 @@ class Categories
}
/**
* Get PHPExcel function name
* Get PhpSpreadsheet function name
*
* @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
*/
public function setPHPExcelName($value)
public function setPhpSpreadsheetName($value)
{
$this->phpExcelName = $value;
$this->spreadsheetName = $value;
}
}

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/**
* PHPExcel_Calculation_Database
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -119,12 +116,12 @@ class Database
$k = array_search($criteriaName, $fieldNames);
if (isset($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);
}
}
// 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 (!$result) {
unset($database[$dataRow]);
@ -144,7 +141,7 @@ class Database
foreach ($database as $row) {
$colData[] = $row[$field];
}
return $colData;
}

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/**
* PHPExcel_Calculation_DateTime
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -92,7 +89,7 @@ class DateTime
return Functions::VALUE();
}
if ((is_object($dateValue)) && ($dateValue instanceof \DateTime)) {
$dateValue = \PHPExcel\Shared\Date::PHPToExcel($dateValue);
$dateValue = \PhpSpreadsheet\Shared\Date::PHPToExcel($dateValue);
} else {
$saveReturnDateType = Functions::getReturnDateType();
Functions::setReturnDateType(Functions::RETURNDATE_EXCEL);
@ -123,7 +120,7 @@ class DateTime
private static function adjustDateByMonths($dateValue = 0, $adjustmentMonths = 0)
{
// Execute function
$PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue);
$PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue);
$oMonth = (int) $PHPDateObject->format('m');
$oYear = (int) $PHPDateObject->format('Y');
@ -156,7 +153,7 @@ class DateTime
* open the worksheet.
*
* 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:
* NOW()
@ -173,7 +170,7 @@ class DateTime
$retValue = false;
switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL:
$retValue = (float) \PHPExcel\Shared\Date::PHPToExcel(time());
$retValue = (float) \PhpSpreadsheet\Shared\Date::PHPToExcel(time());
break;
case Functions::RETURNDATE_PHP_NUMERIC:
$retValue = (integer) time();
@ -197,7 +194,7 @@ class DateTime
* open the worksheet.
*
* 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:
* TODAY()
@ -212,16 +209,16 @@ class DateTime
$saveTimeZone = date_default_timezone_get();
date_default_timezone_set('UTC');
$retValue = false;
$excelDateTime = floor(\PHPExcel\Shared\Date::PHPToExcel(time()));
$excelDateTime = floor(\PhpSpreadsheet\Shared\Date::PHPToExcel(time()));
switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL:
$retValue = (float) $excelDateTime;
break;
case Functions::RETURNDATE_PHP_NUMERIC:
$retValue = (integer) \PHPExcel\Shared\Date::excelToTimestamp($excelDateTime);
$retValue = (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateTime);
break;
case Functions::RETURNDATE_PHP_OBJECT:
$retValue = \PHPExcel\Shared\Date::excelToDateTimeObject($excelDateTime);
$retValue = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($excelDateTime);
break;
}
date_default_timezone_set($saveTimeZone);
@ -236,12 +233,12 @@ class DateTime
* 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
* 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:
* 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,
* 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);
if (($month !== null) && (!is_numeric($month))) {
$month = \PHPExcel\Shared\Date::monthStringToNumber($month);
$month = \PhpSpreadsheet\Shared\Date::monthStringToNumber($month);
}
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;
$month = ($month !== null) ? \PHPExcel\Shared\StringHelper::testStringAsNumeric($month) : 0;
$day = ($day !== null) ? \PHPExcel\Shared\StringHelper::testStringAsNumeric($day) : 0;
$year = ($year !== null) ? \PhpSpreadsheet\Shared\StringHelper::testStringAsNumeric($year) : 0;
$month = ($month !== null) ? \PhpSpreadsheet\Shared\StringHelper::testStringAsNumeric($month) : 0;
$day = ($day !== null) ? \PhpSpreadsheet\Shared\StringHelper::testStringAsNumeric($day) : 0;
if ((!is_numeric($year)) ||
(!is_numeric($month)) ||
(!is_numeric($day))) {
@ -306,7 +303,7 @@ class DateTime
$month = (integer) $month;
$day = (integer) $day;
$baseYear = \PHPExcel\Shared\Date::getExcelCalendar();
$baseYear = \PhpSpreadsheet\Shared\Date::getExcelCalendar();
// Validate parameters
if ($year < ($baseYear-1900)) {
return Functions::NAN();
@ -336,14 +333,14 @@ class DateTime
}
// Execute function
$excelDateValue = \PHPExcel\Shared\Date::formattedPHPToExcel($year, $month, $day);
$excelDateValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel($year, $month, $day);
switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue;
case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::excelToTimestamp($excelDateValue);
return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue);
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.
*
* 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:
* TIME(hour,minute,second)
@ -429,13 +426,13 @@ class DateTime
switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL:
$date = 0;
$calendar = \PHPExcel\Shared\Date::getExcelCalendar();
if ($calendar != \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900) {
$calendar = \PhpSpreadsheet\Shared\Date::getExcelCalendar();
if ($calendar != \PhpSpreadsheet\Shared\Date::CALENDAR_WINDOWS_1900) {
$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:
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:
$dayAdjust = 0;
if ($hour < 0) {
@ -465,7 +462,7 @@ class DateTime
* value.
*
* 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:
* DATEVALUE(dateValue)
@ -571,7 +568,7 @@ class DateTime
return Functions::VALUE();
}
$excelDateValue = floor(
\PHPExcel\Shared\Date::formattedPHPToExcel(
\PhpSpreadsheet\Shared\Date::formattedPHPToExcel(
$PHPDateArray['year'],
$PHPDateArray['month'],
$PHPDateArray['day'],
@ -584,7 +581,7 @@ class DateTime
case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue;
case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::excelToTimestamp($excelDateValue);
return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue);
case Functions::RETURNDATE_PHP_OBJECT:
return new \DateTime($PHPDateArray['year'].'-'.$PHPDateArray['month'].'-'.$PHPDateArray['day'].' 00:00:00');
}
@ -601,7 +598,7 @@ class DateTime
* value.
*
* 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:
* TIMEVALUE(timeValue)
@ -629,7 +626,7 @@ class DateTime
$PHPDateArray = date_parse($timeValue);
if (($PHPDateArray !== false) && ($PHPDateArray['error_count'] == 0)) {
if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
$excelDateValue = \PHPExcel\Shared\Date::formattedPHPToExcel(
$excelDateValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel(
$PHPDateArray['year'],
$PHPDateArray['month'],
$PHPDateArray['day'],
@ -638,14 +635,14 @@ class DateTime
$PHPDateArray['second']
);
} 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()) {
case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue;
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:
return new \DateTime('1900-01-01 '.$PHPDateArray['hour'].':'.$PHPDateArray['minute'].':'.$PHPDateArray['second']);
}
@ -685,12 +682,12 @@ class DateTime
// Execute function
$difference = $endDate - $startDate;
$PHPStartDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($startDate);
$PHPStartDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($startDate);
$startDays = $PHPStartDateObject->format('j');
$startMonths = $PHPStartDateObject->format('n');
$startYears = $PHPStartDateObject->format('Y');
$PHPEndDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($endDate);
$PHPEndDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate);
$endDays = $PHPEndDateObject->format('j');
$endMonths = $PHPEndDateObject->format('n');
$endYears = $PHPEndDateObject->format('Y');
@ -805,12 +802,12 @@ class DateTime
}
// Execute function
$PHPStartDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($startDate);
$PHPStartDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($startDate);
$startDay = $PHPStartDateObject->format('j');
$startMonth = $PHPStartDateObject->format('n');
$startYear = $PHPStartDateObject->format('Y');
$PHPEndDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($endDate);
$PHPEndDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate);
$endDay = $PHPEndDateObject->format('j');
$endMonth = $PHPEndDateObject->format('n');
$endYear = $PHPEndDateObject->format('Y');
@ -1112,9 +1109,9 @@ class DateTime
case Functions::RETURNDATE_EXCEL:
return (float) $endDate;
case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::excelToTimestamp($endDate);
return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($endDate);
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
$PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue);
$PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue);
return (int) $PHPDateObject->format('j');
}
@ -1191,7 +1188,7 @@ class DateTime
}
// Execute function
$PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue);
$PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue);
$DoW = $PHPDateObject->format('w');
$firstDay = 1;
@ -1267,7 +1264,7 @@ class DateTime
}
// Execute function
$PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue);
$PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue);
$dayOfYear = $PHPDateObject->format('z');
$PHPDateObject->modify('-' . $dayOfYear . ' days');
$dow = $PHPDateObject->format('w');
@ -1306,7 +1303,7 @@ class DateTime
}
// Execute function
$PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue);
$PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue);
return (int) $PHPDateObject->format('n');
}
@ -1338,7 +1335,7 @@ class DateTime
}
// Execute function
$PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue);
$PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue);
return (int) $PHPDateObject->format('Y');
}
@ -1379,7 +1376,7 @@ class DateTime
} elseif ($timeValue < 0.0) {
return Functions::NAN();
}
$timeValue = \PHPExcel\Shared\Date::excelToTimestamp($timeValue);
$timeValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue);
return (int) gmdate('G', $timeValue);
}
@ -1420,7 +1417,7 @@ class DateTime
} elseif ($timeValue < 0.0) {
return Functions::NAN();
}
$timeValue = \PHPExcel\Shared\Date::excelToTimestamp($timeValue);
$timeValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue);
return (int) gmdate('i', $timeValue);
}
@ -1461,7 +1458,7 @@ class DateTime
} elseif ($timeValue < 0.0) {
return Functions::NAN();
}
$timeValue = \PHPExcel\Shared\Date::excelToTimestamp($timeValue);
$timeValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue);
return (int) gmdate('s', $timeValue);
}
@ -1505,9 +1502,9 @@ class DateTime
switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL:
return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject);
return (float) \PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject);
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:
return $PHPDateObject;
}
@ -1554,9 +1551,9 @@ class DateTime
switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL:
return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject);
return (float) \PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject);
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:
return $PHPDateObject;
}

View File

@ -1,14 +1,12 @@
<?php
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/** EULER */
define('EULER', 2.71828182845904523536);
/**
* PHPExcel_Calculation_Engineering
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @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,
* 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.
* PHPExcel follows Excel 2010 behaviour, and accepts nagative arguments.
* PhpSpreadsheet follows Excel 2010 behaviour, and accepts nagative arguments.
*
* Excel Function:
* 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,
* 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.
* PHPExcel follows Excel 2010 behaviour, and accepts nagative arguments.
* PhpSpreadsheet follows Excel 2010 behaviour, and accepts nagative arguments.
*
* Excel Function:
* ERFC(x)

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/**
* PHPExcel_Calculation_Exception
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class Exception extends \PHPExcel\Exception
class Exception extends \PhpSpreadsheet\Exception
{
/**
* Error handler callback

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/**
* PHPExcel_Calculation_ExceptionHandler
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -34,7 +31,7 @@ class ExceptionHandler
*/
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
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/** FINANCIAL_MAX_ITERATIONS */
define('FINANCIAL_MAX_ITERATIONS', 128);
@ -9,9 +9,7 @@ define('FINANCIAL_MAX_ITERATIONS', 128);
define('FINANCIAL_PRECISION', 1.0e-08);
/**
* PHPExcel_Calculation_Financial
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -67,10 +64,10 @@ class Financial
{
$months = 12 / $frequency;
$result = \PHPExcel\Shared\Date::excelToDateTimeObject($maturity);
$result = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($maturity);
$eom = self::isLastDayOfMonth($result);
while ($settlement < \PHPExcel\Shared\Date::PHPToExcel($result)) {
while ($settlement < \PhpSpreadsheet\Shared\Date::PHPToExcel($result)) {
$result->modify('-'.$months.' months');
}
if ($next) {
@ -81,7 +78,7 @@ class Financial
$result->modify('-1 day');
}
return \PHPExcel\Shared\Date::PHPToExcel($result);
return \PhpSpreadsheet\Shared\Date::PHPToExcel($result);
}

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/**
* PHPExcel_Calculation_FormulaParser
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/**
* PHPExcel_Calculation_FormulaToken
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,6 +1,6 @@
<?php
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/** MAX_VALUE */
define('MAX_VALUE', 1.2e308);
@ -16,9 +16,7 @@ define('PRECISION', 8.88E-016);
/**
* PHPExcel_Calculation_Functions
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -316,7 +313,7 @@ class Functions
}
if (!in_array($condition{0}, array('>', '<', '='))) {
if (!is_numeric($condition)) {
$condition = \PHPExcel\Calculation::wrapResult(strtoupper($condition));
$condition = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($condition));
}
return '=' . $condition;
} else {
@ -325,7 +322,7 @@ class Functions
if (!is_numeric($operand)) {
$operand = str_replace('"', '""', $operand);
$operand = \PHPExcel\Calculation::wrapResult(strtoupper($operand));
$operand = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($operand));
}
return $operator . $operand;
@ -518,7 +515,7 @@ class Functions
*/
public static function VERSION()
{
return 'PHPExcel ##VERSION##, ##DATE##';
return 'PhpSpreadsheet ##VERSION##, ##DATE##';
}

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/**
* PHPExcel_Calculation_Logical
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -102,9 +99,9 @@ class Logical
$returnValue = $returnValue && ($arg != 0);
} elseif (is_string($arg)) {
$arg = strtoupper($arg);
if (($arg == 'TRUE') || ($arg == \PHPExcel\Calculation::getTRUE())) {
if (($arg == 'TRUE') || ($arg == \PhpSpreadsheet\Calculation::getTRUE())) {
$arg = true;
} elseif (($arg == 'FALSE') || ($arg == \PHPExcel\Calculation::getFALSE())) {
} elseif (($arg == 'FALSE') || ($arg == \PhpSpreadsheet\Calculation::getFALSE())) {
$arg = false;
} else {
return Functions::VALUE();
@ -158,9 +155,9 @@ class Logical
$returnValue = $returnValue || ($arg != 0);
} elseif (is_string($arg)) {
$arg = strtoupper($arg);
if (($arg == 'TRUE') || ($arg == \PHPExcel\Calculation::getTRUE())) {
if (($arg == 'TRUE') || ($arg == \PhpSpreadsheet\Calculation::getTRUE())) {
$arg = true;
} elseif (($arg == 'FALSE') || ($arg == \PHPExcel\Calculation::getFALSE())) {
} elseif (($arg == 'FALSE') || ($arg == \PhpSpreadsheet\Calculation::getFALSE())) {
$arg = false;
} else {
return Functions::VALUE();
@ -202,9 +199,9 @@ class Logical
$logical = Functions::flattenSingleValue($logical);
if (is_string($logical)) {
$logical = strtoupper($logical);
if (($logical == 'TRUE') || ($logical == \PHPExcel\Calculation::getTRUE())) {
if (($logical == 'TRUE') || ($logical == \PhpSpreadsheet\Calculation::getTRUE())) {
return false;
} elseif (($logical == 'FALSE') || ($logical == \PHPExcel\Calculation::getFALSE())) {
} elseif (($logical == 'FALSE') || ($logical == \PhpSpreadsheet\Calculation::getFALSE())) {
return true;
} else {
return Functions::VALUE();

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/**
* PHPExcel_Calculation_LookupRef
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -69,7 +66,7 @@ class LookupRef
}
if ((!is_bool($referenceStyle)) || $referenceStyle) {
$rowRelative = $columnRelative = '$';
$column = \PHPExcel\Cell::stringFromColumnIndex($column-1);
$column = \PhpSpreadsheet\Cell::stringFromColumnIndex($column-1);
if (($relativity == 2) || ($relativity == 4)) {
$columnRelative = '';
}
@ -112,7 +109,7 @@ class LookupRef
if (is_array($cellAddress)) {
foreach ($cellAddress as $columnKey => $value) {
$columnKey = preg_replace('/[^a-z]/i', '', $columnKey);
return (integer) \PHPExcel\Cell::columnIndexFromString($columnKey);
return (integer) \PhpSpreadsheet\Cell::columnIndexFromString($columnKey);
}
} else {
if (strpos($cellAddress, '!') !== false) {
@ -124,12 +121,12 @@ class LookupRef
$endAddress = preg_replace('/[^a-z]/i', '', $endAddress);
$returnValue = array();
do {
$returnValue[] = (integer) \PHPExcel\Cell::columnIndexFromString($startAddress);
$returnValue[] = (integer) \PhpSpreadsheet\Cell::columnIndexFromString($startAddress);
} while ($startAddress++ != $endAddress);
return $returnValue;
} else {
$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);
$isMatrix = (is_numeric(key($cellAddress)));
list($columns, $rows) = \PHPExcel\Calculation::_getMatrixDimensions($cellAddress);
list($columns, $rows) = \PhpSpreadsheet\Calculation::_getMatrixDimensions($cellAddress);
if ($isMatrix) {
return $rows;
@ -234,7 +231,7 @@ class LookupRef
reset($cellAddress);
$isMatrix = (is_numeric(key($cellAddress)));
list($columns, $rows) = \PHPExcel\Calculation::_getMatrixDimensions($cellAddress);
list($columns, $rows) = \PhpSpreadsheet\Calculation::_getMatrixDimensions($cellAddress);
if ($isMatrix) {
return $columns;
@ -254,10 +251,10 @@ class LookupRef
* @category Logical Functions
* @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 \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)
*/
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();
$pCell = array_pop($args);
@ -292,13 +289,13 @@ class LookupRef
* 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 \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
*
* @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);
if (is_null($cellAddress) || $cellAddress === '') {
@ -311,9 +308,9 @@ class LookupRef
list($cellAddress1, $cellAddress2) = explode(':', $cellAddress);
}
if ((!preg_match('/^'.\PHPExcel\Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress1, $matches)) ||
((!is_null($cellAddress2)) && (!preg_match('/^'.\PHPExcel\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_CELLREF.'$/i', $cellAddress1, $matches)) ||
((!is_null($cellAddress2)) && (!preg_match('/^'.\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress2, $matches)))) {
if (!preg_match('/^'.\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $cellAddress1, $matches)) {
return Functions::REF();
}
@ -325,7 +322,7 @@ class LookupRef
$pSheet = $pCell->getWorksheet();
}
return \PHPExcel\Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, false);
return \PhpSpreadsheet\Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, false);
}
if (strpos($cellAddress, '!') !== false) {
@ -336,7 +333,7 @@ class LookupRef
$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 {
$startCell = $endCell = $cellAddress;
}
list($startCellColumn, $startCellRow) = \PHPExcel\Cell::coordinateFromString($startCell);
list($endCellColumn, $endCellRow) = \PHPExcel\Cell::coordinateFromString($endCell);
list($startCellColumn, $startCellRow) = \PhpSpreadsheet\Cell::coordinateFromString($startCell);
list($endCellColumn, $endCellRow) = \PhpSpreadsheet\Cell::coordinateFromString($endCell);
$startCellRow += $rows;
$startCellColumn = \PHPExcel\Cell::columnIndexFromString($startCellColumn) - 1;
$startCellColumn = \PhpSpreadsheet\Cell::columnIndexFromString($startCellColumn) - 1;
$startCellColumn += $columns;
if (($startCellRow <= 0) || ($startCellColumn < 0)) {
return Functions::REF();
}
$endCellColumn = \PHPExcel\Cell::columnIndexFromString($endCellColumn) - 1;
$endCellColumn = \PhpSpreadsheet\Cell::columnIndexFromString($endCellColumn) - 1;
if (($width != null) && (!is_object($width))) {
$endCellColumn = $startCellColumn + $width - 1;
} else {
$endCellColumn += $columns;
}
$startCellColumn = \PHPExcel\Cell::stringFromColumnIndex($startCellColumn);
$startCellColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCellColumn);
if (($height != null) && (!is_object($height))) {
$endCellRow = $startCellRow + $height - 1;
@ -418,7 +415,7 @@ class LookupRef
if (($endCellRow <= 0) || ($endCellColumn < 0)) {
return Functions::REF();
}
$endCellColumn = \PHPExcel\Cell::stringFromColumnIndex($endCellColumn);
$endCellColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex($endCellColumn);
$cellAddress = $startCellColumn.$startCellRow;
if (($startCellColumn != $endCellColumn) || ($startCellRow != $endCellRow)) {
@ -431,7 +428,7 @@ class LookupRef
$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
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/**
* PHPExcel_Calculation_MathTrig
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -556,9 +553,9 @@ class MathTrig
}
try {
$matrix = new \PHPExcel\Shared\JAMA\Matrix($matrixData);
$matrix = new \PhpSpreadsheet\Shared\JAMA\Matrix($matrixData);
return $matrix->det();
} catch (\PHPExcel\Exception $ex) {
} catch (\PhpSpreadsheet\Exception $ex) {
return Functions::VALUE();
}
}
@ -609,9 +606,9 @@ class MathTrig
}
try {
$matrix = new \PHPExcel\Shared\JAMA\Matrix($matrixData);
$matrix = new \PhpSpreadsheet\Shared\JAMA\Matrix($matrixData);
return $matrix->inverse()->getArray();
} catch (\PHPExcel\Exception $ex) {
} catch (\PhpSpreadsheet\Exception $ex) {
return Functions::VALUE();
}
}
@ -650,7 +647,7 @@ class MathTrig
}
++$rowA;
}
$matrixA = new \PHPExcel\Shared\JAMA\Matrix($matrixAData);
$matrixA = new \PhpSpreadsheet\Shared\JAMA\Matrix($matrixAData);
$rowB = 0;
foreach ($matrixData2 as $matrixRow) {
if (!is_array($matrixRow)) {
@ -666,14 +663,14 @@ class MathTrig
}
++$rowB;
}
$matrixB = new \PHPExcel\Shared\JAMA\Matrix($matrixBData);
$matrixB = new \PhpSpreadsheet\Shared\JAMA\Matrix($matrixBData);
if ($columnA != $rowB) {
return Functions::VALUE();
}
return $matrixA->times($matrixB)->getArray();
} catch (\PHPExcel\Exception $ex) {
} catch (\PhpSpreadsheet\Exception $ex) {
var_dump($ex->getMessage());
return Functions::VALUE();
}
@ -1201,11 +1198,11 @@ class MathTrig
foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) {
$arg = str_replace('"', '""', $arg);
$arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg));
$arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
}
$testCondition = '='.$arg.$condition;
if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
// Is it a value within our criteria
$returnValue += $sumArgs[$key];
}
@ -1249,10 +1246,10 @@ class MathTrig
// Loop through arguments
foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) {
$arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg));
$arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
}
$testCondition = '='.$arg.$condition;
if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
// Is it a value within our criteria
$returnValue += $sumArgs[$key];
}

View File

@ -1,6 +1,6 @@
<?php
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/** LOG_GAMMA_X_MAX_VALUE */
define('LOG_GAMMA_X_MAX_VALUE', 2.55e305);
@ -15,9 +15,7 @@ define('EPS', 2.22e-16);
define('SQRT2PI', 2.5066282746310005024157652848110452530069867406099);
/**
* PHPExcel_Calculation_Statistical
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -866,10 +863,10 @@ class Statistical
$aCount = 0;
foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) {
$arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg));
$arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
}
$testCondition = '='.$arg.$condition;
if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
if ((is_null($returnValue)) || ($arg > $returnValue)) {
$returnValue += $arg;
++$aCount;
@ -1165,7 +1162,7 @@ class Statistical
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();
}
@ -1287,10 +1284,10 @@ class Statistical
// Loop through arguments
foreach ($aArgs as $arg) {
if (!is_numeric($arg)) {
$arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg));
$arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
}
$testCondition = '='.$arg.$condition;
if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
// Is it a value within our criteria
++$returnValue;
}
@ -1323,7 +1320,7 @@ class Statistical
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();
}
@ -1609,7 +1606,7 @@ class Statistical
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);
}
@ -1780,7 +1777,7 @@ class Statistical
$newValues = Functions::flattenArray($newValues);
$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)) {
$newValues = $bestFitExponential->getXValues();
}
@ -1904,7 +1901,7 @@ class Statistical
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();
}
@ -2026,7 +2023,7 @@ class Statistical
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) {
return array(
array(
@ -2092,7 +2089,7 @@ class Statistical
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) {
return array(
array(
@ -2279,10 +2276,10 @@ class Statistical
// Loop through arguments
foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) {
$arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg));
$arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
}
$testCondition = '='.$arg.$condition;
if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
if ((is_null($returnValue)) || ($arg > $returnValue)) {
$returnValue = $arg;
}
@ -2438,10 +2435,10 @@ class Statistical
// Loop through arguments
foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) {
$arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg));
$arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg));
}
$testCondition = '='.$arg.$condition;
if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
if ((is_null($returnValue)) || ($arg < $returnValue)) {
$returnValue = $arg;
}
@ -2917,7 +2914,7 @@ class Statistical
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();
}
@ -2983,7 +2980,7 @@ class Statistical
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();
}
@ -3276,7 +3273,7 @@ class Statistical
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();
}
@ -3419,7 +3416,7 @@ class Statistical
$newValues = Functions::flattenArray($newValues);
$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)) {
$newValues = $bestFitLinear->getXValues();
}

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Calculation;
namespace PhpSpreadsheet\Calculation;
/**
* PHPExcel_Calculation_TextData
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -85,7 +82,7 @@ class TextData
$stringValue = Functions::flattenSingleValue($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) {
@ -109,7 +106,7 @@ class TextData
{
$stringValue = Functions::flattenSingleValue($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)) {
@ -135,7 +132,7 @@ class TextData
if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
$characters = (int) $characters;
} 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) {
$arg = (int) $arg;
} else {
$arg = ($arg) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE();
$arg = ($arg) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
}
}
$returnValue .= $arg;
@ -214,7 +211,7 @@ class TextData
$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($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 (\PHPExcel\Shared\StringHelper::countCharacters($needle) == 0) {
if (($offset > 0) && (\PhpSpreadsheet\Shared\StringHelper::countCharacters($haystack) > $offset)) {
if (\PhpSpreadsheet\Shared\StringHelper::countCharacters($needle) == 0) {
return $offset;
}
if (function_exists('mb_strpos')) {
@ -271,11 +268,11 @@ class TextData
if (!is_bool($needle)) {
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 (\PHPExcel\Shared\StringHelper::countCharacters($needle) == 0) {
if (($offset > 0) && (\PhpSpreadsheet\Shared\StringHelper::countCharacters($haystack) > $offset)) {
if (\PhpSpreadsheet\Shared\StringHelper::countCharacters($needle) == 0) {
return $offset;
}
if (function_exists('mb_stripos')) {
@ -341,7 +338,7 @@ class TextData
}
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')) {
@ -371,7 +368,7 @@ class TextData
}
if (is_bool($value)) {
$value = ($value) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE();
$value = ($value) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE();
}
if (empty($chars)) {
@ -402,7 +399,7 @@ class TextData
}
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'))) {
@ -424,7 +421,7 @@ class TextData
$value = Functions::flattenSingleValue($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')) {
@ -448,10 +445,10 @@ class TextData
$mixedCaseString = Functions::flattenSingleValue($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);
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);
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);
$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);
}
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)) {
$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)) {
return (float) $numberValue;

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Calculation\Token;
namespace PhpSpreadsheet\Calculation\Token;
/**
* PHPExcel_Calculation_Token_Stack
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -68,7 +65,7 @@ class Stack
'reference' => $reference
);
if ($type == 'Function') {
$localeFunction = \PHPExcel\Calculation::localeFunc($value);
$localeFunction = \PhpSpreadsheet\Calculation::localeFunc($value);
if ($localeFunction != $value) {
$this->stack[($this->count - 1)]['localeValue'] = $localeFunction;
}

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel;
namespace PhpSpreadsheet;
/**
* PHPExcel_Cell
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Cell
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -961,7 +958,7 @@ class Cell
public static function setValueBinder(Cell\IValueBinder $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;

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Cell;
namespace PhpSpreadsheet\Cell;
/**
* PHPExcel_Cell_AdvancedValueBinder
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Cell
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -32,33 +29,33 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
/**
* 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
* @return boolean
*/
public function bindValue(\PHPExcel\Cell $cell, $value = null)
public function bindValue(\PhpSpreadsheet\Cell $cell, $value = null)
{
// sanitize UTF-8 strings
if (is_string($value)) {
$value = \PHPExcel\Shared\StringHelper::sanitizeUTF8($value);
$value = \PhpSpreadsheet\Shared\StringHelper::sanitizeUTF8($value);
}
// Find out data type
$dataType = parent::dataTypeForValue($value);
// 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
if ($value == \PHPExcel\Calculation::getTRUE()) {
if ($value == \PhpSpreadsheet\Calculation::getTRUE()) {
$cell->setValueExplicit(true, DataType::TYPE_BOOL);
return true;
} elseif ($value == \PHPExcel\Calculation::getFALSE()) {
} elseif ($value == \PhpSpreadsheet\Calculation::getFALSE()) {
$cell->setValueExplicit(false, DataType::TYPE_BOOL);
return true;
}
// 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);
return true;
}
@ -95,14 +92,14 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
$cell->setValueExplicit($value, DataType::TYPE_NUMERIC);
// Set style
$cell->getWorksheet()->getStyle($cell->getCoordinate())
->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_PERCENTAGE_00);
->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_PERCENTAGE_00);
return true;
}
// Check for currency
$currencyCode = \PHPExcel\Shared\StringHelper::getCurrencyCode();
$decimalSeparator = \PHPExcel\Shared\StringHelper::getDecimalSeparator();
$thousandsSeparator = \PHPExcel\Shared\StringHelper::getThousandsSeparator();
$currencyCode = \PhpSpreadsheet\Shared\StringHelper::getCurrencyCode();
$decimalSeparator = \PhpSpreadsheet\Shared\StringHelper::getDecimalSeparator();
$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)) {
// Convert value to number
$value = (float) trim(str_replace(array($currencyCode, $thousandsSeparator, $decimalSeparator), array('', '', '.'), $value));
@ -110,7 +107,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
// Set style
$cell->getWorksheet()->getStyle($cell->getCoordinate())
->getNumberFormat()->setFormatCode(
str_replace('$', $currencyCode, \PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE)
str_replace('$', $currencyCode, \PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE)
);
return true;
} 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);
// Set style
$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;
}
@ -131,7 +128,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
$cell->setValueExplicit($days, DataType::TYPE_NUMERIC);
// Set style
$cell->getWorksheet()->getStyle($cell->getCoordinate())
->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME3);
->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME3);
return true;
}
@ -144,12 +141,12 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
$cell->setValueExplicit($days, DataType::TYPE_NUMERIC);
// Set style
$cell->getWorksheet()->getStyle($cell->getCoordinate())
->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4);
->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4);
return true;
}
// 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
$cell->setValueExplicit($d, DataType::TYPE_NUMERIC);
// 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"
if (strpos($value, "\n") !== false) {
$value = \PHPExcel\Shared\StringHelper::sanitizeUTF8($value);
$value = \PhpSpreadsheet\Shared\StringHelper::sanitizeUTF8($value);
$cell->setValueExplicit($value, DataType::TYPE_STRING);
// Set style
$cell->getWorksheet()->getStyle($cell->getCoordinate())

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Cell;
namespace PhpSpreadsheet\Cell;
/**
* PHPExcel_Cell_DataType
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Cell
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -67,7 +64,7 @@ class DataType
/**
* 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
* @return string
*/
@ -84,13 +81,13 @@ class DataType
*/
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)
return $pValue;
}
// 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"
$pValue = str_replace(array("\r\n", "\r"), "\n", $pValue);

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Cell;
namespace PhpSpreadsheet\Cell;
/**
* PHPExcel_Cell_DataValidation
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Cell
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Cell;
namespace PhpSpreadsheet\Cell;
/**
* PHPExcel_Cell_DefaultValueBinder
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Cell
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -32,20 +29,20 @@ class DefaultValueBinder implements IValueBinder
/**
* 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
* @return boolean
*/
public function bindValue(\PHPExcel\Cell $cell, $value = null)
public function bindValue(\PhpSpreadsheet\Cell $cell, $value = null)
{
// sanitize UTF-8 strings
if (is_string($value)) {
$value = \PHPExcel\Shared\StringHelper::sanitizeUTF8($value);
$value = \PhpSpreadsheet\Shared\StringHelper::sanitizeUTF8($value);
} elseif (is_object($value)) {
// Handle any objects that might be injected
if ($value instanceof \DateTime) {
$value = $value->format('Y-m-d H:i:s');
} elseif (!($value instanceof \PHPExcel\RichText)) {
} elseif (!($value instanceof \PhpSpreadsheet\RichText)) {
$value = (string) $value;
}
}
@ -70,7 +67,7 @@ class DefaultValueBinder implements IValueBinder
return DataType::TYPE_NULL;
} elseif ($pValue === '') {
return DataType::TYPE_STRING;
} elseif ($pValue instanceof \PHPExcel\RichText) {
} elseif ($pValue instanceof \PhpSpreadsheet\RichText) {
return DataType::TYPE_INLINE;
} elseif ($pValue{0} === '=' && strlen($pValue) > 1) {
return DataType::TYPE_FORMULA;

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Cell;
namespace PhpSpreadsheet\Cell;
/**
* PHPExcel_Cell_Hyperlink
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Cell
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Cell;
namespace PhpSpreadsheet\Cell;
/**
* PHPExcel_Cell_IValueBinder
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Cell
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -32,9 +29,9 @@ interface IValueBinder
/**
* 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
* @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
namespace PHPExcel;
namespace PhpSpreadsheet;
/**
* PHPExcel_Chart
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Chart
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -671,7 +668,7 @@ class Chart
set_include_path(get_include_path() . PATH_SEPARATOR . $libraryPath);
}
$rendererName = '\\PHPExcel\\Chart\\Renderer\\'.$libraryName;
$rendererName = '\\PhpSpreadsheet\\Chart\\Renderer\\'.$libraryName;
$renderer = new $rendererName($this);
if ($outputDestination == 'php://output') {

View File

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

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Chart;
namespace PhpSpreadsheet\Chart;
/**
* PHPExcel_Chart_DataSeries
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Chart
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -148,7 +145,7 @@ class DataSeries
$this->plotCategory = $plotCategory;
$this->smoothLine = $smoothLine;
$this->plotStyle = $plotStyle;
if (is_null($plotDirection)) {
$plotDirection = self::DIRECTION_COL;
}
@ -363,7 +360,7 @@ class DataSeries
return $this;
}
public function refresh(\PHPExcel\Worksheet $worksheet)
public function refresh(\PhpSpreadsheet\Worksheet $worksheet)
{
foreach ($this->plotValues as $plotValues) {
if ($plotValues !== null) {

View File

@ -1,11 +1,11 @@
<?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
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Chart
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -108,9 +107,9 @@ class DataSeriesValues
*
* @param string $dataType Datatype of this data series
* Typical values are:
* \PHPExcel\Chart\DataSeriesValues::DATASERIES_TYPE_STRING
* \PhpSpreadsheet\Chart\DataSeriesValues::DATASERIES_TYPE_STRING
* Normally used for axis point values
* \PHPExcel\Chart\DataSeriesValues::DATASERIES_TYPE_NUMBER
* \PhpSpreadsheet\Chart\DataSeriesValues::DATASERIES_TYPE_NUMBER
* Normally used for chart data values
* @return DataSeriesValues
* @throws Exception
@ -272,7 +271,7 @@ class DataSeriesValues
*/
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);
if ($refreshDataSource) {
@ -287,11 +286,11 @@ class DataSeriesValues
return $var !== null;
}
public function refresh(\PHPExcel\Worksheet $worksheet, $flatten = true)
public function refresh(\PhpSpreadsheet\Worksheet $worksheet, $flatten = true)
{
if ($this->dataSource !== null) {
$calcEngine = \PHPExcel\Calculation::getInstance($worksheet->getParent());
$newDataValues = \PHPExcel\Calculation::unwrapResult(
$calcEngine = \PhpSpreadsheet\Calculation::getInstance($worksheet->getParent());
$newDataValues = \PhpSpreadsheet\Calculation::unwrapResult(
$calcEngine->_calculateFormulaValue(
'='.$this->dataSource,
null,
@ -299,7 +298,7 @@ class DataSeriesValues
)
);
if ($flatten) {
$this->dataValues = \PHPExcel\Calculation\Functions::flattenArray($newDataValues);
$this->dataValues = \PhpSpreadsheet\Calculation\Functions::flattenArray($newDataValues);
foreach ($this->dataValues as &$dataValue) {
if ((!empty($dataValue)) && ($dataValue[0] == '#')) {
$dataValue = 0.0;
@ -312,9 +311,9 @@ class DataSeriesValues
list(, $cellRange) = $cellRange;
}
$dimensions = \PHPExcel\Cell::rangeDimension(str_replace('$', '', $cellRange));
$dimensions = \PhpSpreadsheet\Cell::rangeDimension(str_replace('$', '', $cellRange));
if (($dimensions[0] == 1) || ($dimensions[1] == 1)) {
$this->dataValues = \PHPExcel\Calculation\Functions::flattenArray($newDataValues);
$this->dataValues = \PhpSpreadsheet\Calculation\Functions::flattenArray($newDataValues);
} else {
$newArray = array_values(array_shift($newDataValues));
foreach ($newArray as $i => $newDataSet) {

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Chart;
namespace PhpSpreadsheet\Chart;
/**
* PHPExcel_Chart_Exception
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Chart
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class Exception extends \PHPExcel\Exception
class Exception extends \PhpSpreadsheet\Exception
{
/**
* Error handler callback

View File

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

View File

@ -1,11 +1,11 @@
<?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
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Chart
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,11 +1,11 @@
<?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
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Chart
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Chart;
namespace PhpSpreadsheet\Chart;
/**
* PHPExcel_Chart_PlotArea
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Chart
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -115,11 +112,11 @@ class PlotArea
public function setPlotSeries($plotSeries = array())
{
$this->plotSeries = $plotSeries;
return $this;
}
public function refresh(\PHPExcel\Worksheet $worksheet)
public function refresh(\PhpSpreadsheet\Worksheet $worksheet)
{
foreach ($this->plotSeries as $plotSeries) {
$plotSeries->refresh($worksheet);

View File

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

View File

@ -1,13 +1,11 @@
<?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 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Chart_Renderer
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -113,7 +110,7 @@ class JpGraph
} else {
// Format labels according to any formatting code
if (!is_null($datasetLabelFormatCode)) {
$datasetLabels[$i] = \PHPExcel\Style\NumberFormat::toFormattedString($datasetLabel, $datasetLabelFormatCode);
$datasetLabels[$i] = \PhpSpreadsheet\Style\NumberFormat::toFormattedString($datasetLabel, $datasetLabelFormatCode);
}
}
++$testCurrentIndex;
@ -565,7 +562,7 @@ class JpGraph
private function renderAreaChart($groupCount, $dimensions = '2d')
{
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php');
$this->renderCartesianPlotArea();
@ -577,7 +574,7 @@ class JpGraph
private function renderLineChart($groupCount, $dimensions = '2d')
{
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php');
$this->renderCartesianPlotArea();
@ -589,7 +586,7 @@ class JpGraph
private function renderBarChart($groupCount, $dimensions = '2d')
{
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_bar.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_bar.php');
$this->renderCartesianPlotArea();
@ -601,9 +598,9 @@ class JpGraph
private function renderScatterChart($groupCount)
{
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php');
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_regstat.php');
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_scatter.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_regstat.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php');
$this->renderCartesianPlotArea('linlin');
@ -615,7 +612,7 @@ class JpGraph
private function renderBubbleChart($groupCount)
{
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_scatter.php');
$this->renderCartesianPlotArea('linlin');
@ -627,9 +624,9 @@ class JpGraph
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') {
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_pie3d.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_pie3d.php');
}
$this->renderPiePlotArea($doughnut);
@ -704,7 +701,7 @@ class JpGraph
private function renderRadarChart($groupCount)
{
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_radar.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_radar.php');
$this->renderRadarPlotArea();
@ -716,7 +713,7 @@ class JpGraph
private function renderStockChart($groupCount)
{
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_stock.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_stock.php');
$this->renderCartesianPlotArea('intint');
@ -728,7 +725,7 @@ class JpGraph
private function renderContourChart($groupCount, $dimensions)
{
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_contour.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_contour.php');
$this->renderCartesianPlotArea('intint');
@ -740,11 +737,11 @@ class JpGraph
private function renderCombinationChart($groupCount, $dimensions, $outputDestination)
{
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_bar.php');
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php');
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_regstat.php');
require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_bar.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_scatter.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_regstat.php');
require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php');
$this->renderCartesianPlotArea();
@ -877,7 +874,7 @@ class JpGraph
/**
* Create a new jpgraph
*/
public function __construct(\PHPExcel\Chart $chart)
public function __construct(\PhpSpreadsheet\Chart $chart)
{
$this->graph = null;
$this->chart = $chart;

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Chart;
namespace PhpSpreadsheet\Chart;
/**
* PHPExcel_Chart_Title
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Chart
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -72,7 +69,7 @@ class Title
public function setCaption($caption = null)
{
$this->caption = $caption;
return $this;
}

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel;
namespace PhpSpreadsheet;
/**
* PHPExcel_Comment
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Document;
namespace PhpSpreadsheet\Document;
/**
* PHPExcel_Document_Properties
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Document;
namespace PhpSpreadsheet\Document;
/**
* PHPExcel_Document_Security
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -169,7 +166,7 @@ class Security
public function setRevisionsPassword($pValue = '', $pAlreadyHashed = false)
{
if (!$pAlreadyHashed) {
$pValue = \PHPExcel\Shared\PasswordHasher::hashPassword($pValue);
$pValue = \PhpSpreadsheet\Shared\PasswordHasher::hashPassword($pValue);
}
$this->revisionsPassword = $pValue;
return $this;
@ -195,7 +192,7 @@ class Security
public function setWorkbookPassword($pValue = '', $pAlreadyHashed = false)
{
if (!$pAlreadyHashed) {
$pValue = \PHPExcel\Shared\PasswordHasher::hashPassword($pValue);
$pValue = \PhpSpreadsheet\Shared\PasswordHasher::hashPassword($pValue);
}
$this->workbookPassword = $pValue;
return $this;

View File

@ -1,11 +1,11 @@
<?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
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,11 +1,11 @@
<?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
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -44,7 +43,7 @@ class HashTable
protected $keyMap = [];
/**
* Create a new \PHPExcel\HashTable
* Create a new \PhpSpreadsheet\HashTable
*
* @param IComparable[] $pSource Optional source array to create HashTable from
* @throws Exception

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Helper;
namespace PhpSpreadsheet\Helper;
/**
* PHPExcel_Helper_HTML
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -623,7 +620,7 @@ class HTML
// Discard excess white space
$dom->preserveWhiteSpace = false;
$this->richTextObject = new \PHPExcel\RichText();
$this->richTextObject = new \PhpSpreadsheet\RichText();
$this->parseElements($dom);
// Clean any further spurious whitespace
@ -661,7 +658,7 @@ class HTML
$richtextRun->getFont()->setSize($this->size);
}
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) {
$richtextRun->getFont()->setBold(true);
@ -670,7 +667,7 @@ class HTML
$richtextRun->getFont()->setItalic(true);
}
if ($this->underline) {
$richtextRun->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_SINGLE);
$richtextRun->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE);
}
if ($this->superscript) {
$richtextRun->getFont()->setSuperScript(true);

View File

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

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel;
namespace PhpSpreadsheet;
/**
* PHPExcel_IOFactory
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -37,8 +34,8 @@ class IOFactory
* @static
*/
private static $searchLocations = array(
array( 'type' => 'IWriter', 'path' => 'PHPExcel/Writer/{0}.php', 'class' => '\\PHPExcel\\Writer\\{0}' ),
array( 'type' => 'IReader', 'path' => 'PHPExcel/Reader/{0}.php', 'class' => '\\PHPExcel\\Reader\\{0}' )
array( 'type' => 'IWriter', 'path' => 'PhpSpreadsheet/Writer/{0}.php', 'class' => '\\PhpSpreadsheet\\Writer\\{0}' ),
array( 'type' => 'IReader', 'path' => 'PhpSpreadsheet/Reader/{0}.php', 'class' => '\\PhpSpreadsheet\\Reader\\{0}' )
);
/**
@ -101,7 +98,7 @@ class IOFactory
* @static
* @access public
* @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}
*/
public static function addSearchLocation($type = '', $location = '', $classname = '')
@ -114,12 +111,12 @@ class IOFactory
*
* @static
* @access public
* @param Spreadsheet $phpExcel
* @param Spreadsheet $spreadsheet
* @param string $writerType Example: Excel2007
* @return Writer\IWriter
* @throws Writer\Exception
*/
public static function createWriter(Spreadsheet $phpExcel, $writerType = '')
public static function createWriter(Spreadsheet $spreadsheet, $writerType = '')
{
// Search type
$searchType = 'IWriter';
@ -129,7 +126,7 @@ class IOFactory
if ($searchLocation['type'] == $searchType) {
$className = str_replace('{0}', $writerType, $searchLocation['class']);
$instance = new $className($phpExcel);
$instance = new $className($spreadsheet);
if ($instance !== null) {
return $instance;
}

View File

@ -1,11 +1,11 @@
<?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
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader;
namespace PhpSpreadsheet\Reader;
/**
* PHPExcel_Reader_BaseReader
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -119,7 +116,7 @@ abstract class BaseReader implements IReader
*
* @param boolean $pValue
*
* @return PHPExcel_Reader_IReader
* @return IReader
*/
public function setReadEmptyCells($pValue = true)
{

View File

@ -1,13 +1,11 @@
<?php
namespace PHPExcel\Reader;
namespace PhpSpreadsheet\Reader;
use PHPExcel\Spreadsheet;
use PhpSpreadsheet\Spreadsheet;
/**
* PHPExcel_Reader_CSV
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @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]['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($worksheetInfo[0]['lastColumnIndex']);
$worksheetInfo[0]['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($worksheetInfo[0]['lastColumnIndex']);
$worksheetInfo[0]['totalColumns'] = $worksheetInfo[0]['lastColumnIndex'] + 1;
// Close file
@ -218,27 +215,27 @@ class CSV extends BaseReader implements IReader
* Loads Spreadsheet from file
*
* @param string $pFilename
* @return \PHPExcel\Spreadsheet
* @return \PhpSpreadsheet\Spreadsheet
* @throws Exception
*/
public function load($pFilename)
{
// Create new Spreadsheet
$objPHPExcel = new \PHPExcel\Spreadsheet();
$spreadsheet = new \PhpSpreadsheet\Spreadsheet();
// 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 Spreadsheet $objPHPExcel
* @param Spreadsheet $spreadsheet
* @return Spreadsheet
* @throws Exception
*/
public function loadIntoExisting($pFilename, Spreadsheet $objPHPExcel)
public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet)
{
$lineEnding = ini_get('auto_detect_line_endings');
ini_set('auto_detect_line_endings', true);
@ -255,11 +252,11 @@ class CSV extends BaseReader implements IReader
$this->skipBOM();
$this->checkSeparator();
// Create new PHPExcel object
while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) {
$objPHPExcel->createSheet();
// Create new PhpSpreadsheet object
while ($spreadsheet->getSheetCount() <= $this->sheetIndex) {
$spreadsheet->createSheet();
}
$sheet = $objPHPExcel->setActiveSheetIndex($this->sheetIndex);
$sheet = $spreadsheet->setActiveSheetIndex($this->sheetIndex);
$escapeEnclosures = array( "\\" . $this->enclosure,
$this->enclosure . $this->enclosure
@ -281,7 +278,7 @@ class CSV extends BaseReader implements IReader
// Convert encoding if necessary
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
@ -302,7 +299,7 @@ class CSV extends BaseReader implements IReader
ini_set('auto_detect_line_endings', $lineEnding);
// Return
return $objPHPExcel;
return $spreadsheet;
}
/**

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader;
namespace PhpSpreadsheet\Reader;
/**
* PHPExcel_Reader_DefaultReadFilter
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader;
namespace PhpSpreadsheet\Reader;
/**
* PHPExcel_Reader_Excel2003XML
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -80,7 +77,7 @@ class Excel2003XML extends BaseReader implements IReader
// Open file
$this->openFile($pFilename);
$fileHandle = $this->fileHandle;
// Read sample data (first 2 KB will do)
$data = fread($fileHandle, 2048);
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
* @throws Exception
@ -125,7 +122,7 @@ class Excel2003XML extends BaseReader implements IReader
$xml = simplexml_load_string(
$this->securityScan(file_get_contents($pFilename)),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$namespaces = $xml->getNamespaces(true);
@ -157,7 +154,7 @@ class Excel2003XML extends BaseReader implements IReader
$xml = simplexml_load_string(
$this->securityScan(file_get_contents($pFilename)),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$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;
$worksheetInfo[] = $tmpInfo;
@ -215,20 +212,20 @@ class Excel2003XML extends BaseReader implements IReader
/**
* Loads PHPExcel from file
* Loads PhpSpreadsheet from file
*
* @param string $pFilename
* @return \PHPExcel\Spreadsheet
* @return \PhpSpreadsheet\Spreadsheet
* @throws Exception
*/
public function load($pFilename)
{
// Create new PHPExcel
$objPHPExcel = new PHPExcel();
$objPHPExcel->removeSheetByIndex(0);
// Create new PhpSpreadsheet
$spreadsheet = new PhpSpreadsheet();
$spreadsheet->removeSheetByIndex(0);
// Load into this instance
return $this->loadIntoExisting($pFilename, $objPHPExcel);
return $this->loadIntoExisting($pFilename, $spreadsheet);
}
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 PHPExcel $objPHPExcel
* @return PHPExcel
* @throws Exception
* @param \PhpSpreadsheet\Spreadsheet $spreadsheet
* @return \PhpSpreadsheet\Spreadsheet
* @throws Exception
*/
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet)
{
$fromFormats = array('\-', '\ ');
$toFormats = array('-', ' ');
$underlineStyles = array (
\PHPExcel\Style\Font::UNDERLINE_NONE,
\PHPExcel\Style\Font::UNDERLINE_DOUBLE,
\PHPExcel\Style\Font::UNDERLINE_DOUBLEACCOUNTING,
\PHPExcel\Style\Font::UNDERLINE_SINGLE,
\PHPExcel\Style\Font::UNDERLINE_SINGLEACCOUNTING
\PhpSpreadsheet\Style\Font::UNDERLINE_NONE,
\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE,
\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING,
\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE,
\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING
);
$verticalAlignmentStyles = array (
\PHPExcel\Style\Alignment::VERTICAL_BOTTOM,
\PHPExcel\Style\Alignment::VERTICAL_TOP,
\PHPExcel\Style\Alignment::VERTICAL_CENTER,
\PHPExcel\Style\Alignment::VERTICAL_JUSTIFY
\PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM,
\PhpSpreadsheet\Style\Alignment::VERTICAL_TOP,
\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
\PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY
);
$horizontalAlignmentStyles = array (
\PHPExcel\Style\Alignment::HORIZONTAL_GENERAL,
\PHPExcel\Style\Alignment::HORIZONTAL_LEFT,
\PHPExcel\Style\Alignment::HORIZONTAL_RIGHT,
\PHPExcel\Style\Alignment::HORIZONTAL_CENTER,
\PHPExcel\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS,
\PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY
\PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL,
\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT,
\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT,
\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS,
\PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY
);
$timezoneObj = new \DateTimeZone('Europe/London');
@ -325,11 +322,11 @@ class Excel2003XML extends BaseReader implements IReader
$xml = simplexml_load_string(
$this->securityScan(file_get_contents($pFilename)),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$namespaces = $xml->getNamespaces(true);
$docProps = $objPHPExcel->getProperties();
$docProps = $spreadsheet->getProperties();
if (isset($xml->DocumentProperties[0])) {
foreach ($xml->DocumentProperties[0] as $propertyName => $propertyValue) {
switch ($propertyName) {
@ -374,27 +371,27 @@ class Excel2003XML extends BaseReader implements IReader
if (isset($xml->CustomDocumentProperties)) {
foreach ($xml->CustomDocumentProperties[0] as $propertyName => $propertyValue) {
$propertyAttributes = $propertyValue->attributes($namespaces['dt']);
$propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/', '\\PHPExcel\\Reader\\Excel2003XML::hex2str', $propertyName);
$propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_UNKNOWN;
$propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/', '\\PhpSpreadsheet\\Reader\\Excel2003XML::hex2str', $propertyName);
$propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_UNKNOWN;
switch ((string) $propertyAttributes) {
case 'string':
$propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_STRING;
$propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING;
$propertyValue = trim($propertyValue);
break;
case 'boolean':
$propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_BOOLEAN;
$propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN;
$propertyValue = (bool) $propertyValue;
break;
case 'integer':
$propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_INTEGER;
$propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_INTEGER;
$propertyValue = intval($propertyValue);
break;
case 'float':
$propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_FLOAT;
$propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_FLOAT;
$propertyValue = floatval($propertyValue);
break;
case 'dateTime.tz':
$propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_DATE;
$propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE;
$propertyValue = strtotime(trim($propertyValue));
break;
}
@ -440,7 +437,7 @@ class Excel2003XML extends BaseReader implements IReader
// echo $borderStyleKey.' = '.$borderStyleValue.'<br />';
switch ($borderStyleKey) {
case 'LineStyle':
$thisBorder['style'] = \PHPExcel\Style\Border::BORDER_MEDIUM;
$thisBorder['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUM;
// $thisBorder['style'] = $borderStyleValue;
break;
case 'Weight':
@ -540,14 +537,14 @@ class Excel2003XML extends BaseReader implements IReader
// echo '<h3>Worksheet: ', $worksheet_ss['Name'],'<h3>';
//
// Create new Worksheet
$objPHPExcel->createSheet();
$objPHPExcel->setActiveSheetIndex($worksheetID);
$spreadsheet->createSheet();
$spreadsheet->setActiveSheetIndex($worksheetID);
if (isset($worksheet_ss['Name'])) {
$worksheetName = self::convertStringEncoding((string) $worksheet_ss['Name'], $this->charSet);
// 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 name in line with the formula, not the reverse
$objPHPExcel->getActiveSheet()->setTitle($worksheetName, false);
$spreadsheet->getActiveSheet()->setTitle($worksheetName, false);
}
$columnID = 'A';
@ -555,12 +552,12 @@ class Excel2003XML extends BaseReader implements IReader
foreach ($worksheet->Table->Column as $columnData) {
$columnData_ss = $columnData->attributes($namespaces['ss']);
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'])) {
$columnWidth = $columnData_ss['Width'];
// 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;
}
@ -581,7 +578,7 @@ class Excel2003XML extends BaseReader implements IReader
foreach ($rowData->Cell as $cell) {
$cell_ss = $cell->attributes($namespaces['ss']);
if (isset($cell_ss['Index'])) {
$columnID = \PHPExcel\Cell::stringFromColumnIndex($cell_ss['Index']-1);
$columnID = \PhpSpreadsheet\Cell::stringFromColumnIndex($cell_ss['Index']-1);
}
$cellRange = $columnID.$rowID;
@ -595,14 +592,14 @@ class Excel2003XML extends BaseReader implements IReader
$columnTo = $columnID;
if (isset($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;
if (isset($cell_ss['MergeDown'])) {
$rowTo = $rowTo + $cell_ss['MergeDown'];
}
$cellRange .= ':'.$columnTo.$rowTo;
$objPHPExcel->getActiveSheet()->mergeCells($cellRange);
$spreadsheet->getActiveSheet()->mergeCells($cellRange);
}
$cellIsSet = $hasCalculatedValue = false;
@ -618,7 +615,7 @@ class Excel2003XML extends BaseReader implements IReader
}
if (isset($cell->Data)) {
$cellValue = $cellData = $cell->Data;
$type = \PHPExcel\Cell_DataType::TYPE_NULL;
$type = \PhpSpreadsheet\Cell_DataType::TYPE_NULL;
$cellData_ss = $cellData->attributes($namespaces['ss']);
if (isset($cellData_ss['Type'])) {
$cellDataType = $cellData_ss['Type'];
@ -634,33 +631,33 @@ class Excel2003XML extends BaseReader implements IReader
*/
case 'String':
$cellValue = self::convertStringEncoding($cellValue, $this->charSet);
$type = \PHPExcel\Cell\DataType::TYPE_STRING;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_STRING;
break;
case 'Number':
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
$cellValue = (float) $cellValue;
if (floor($cellValue) == $cellValue) {
$cellValue = (integer) $cellValue;
}
break;
case 'Boolean':
$type = \PHPExcel\Cell\DataType::TYPE_BOOL;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_BOOL;
$cellValue = ($cellValue != 0);
break;
case 'DateTime':
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC;
$cellValue = \PHPExcel\Shared\Date::PHPToExcel(strtotime($cellValue));
$type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
$cellValue = \PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime($cellValue));
break;
case 'Error':
$type = \PHPExcel\Cell\DataType::TYPE_ERROR;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_ERROR;
break;
}
}
if ($hasCalculatedValue) {
// echo 'FORMULA<br />';
$type = \PHPExcel\Cell\DataType::TYPE_FORMULA;
$columnNumber = \PHPExcel\Cell::columnIndexFromString($columnID);
$type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA;
$columnNumber = \PhpSpreadsheet\Cell::columnIndexFromString($columnID);
if (substr($cellDataFormula, 0, 3) == 'of:') {
$cellDataFormula = substr($cellDataFormula, 3);
// echo 'Before: ', $cellDataFormula,'<br />';
@ -706,7 +703,7 @@ class Excel2003XML extends BaseReader implements IReader
if ($columnReference{0} == '[') {
$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]));
}
}
@ -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 />';
//
$objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type);
$spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type);
if ($hasCalculatedValue) {
// echo 'Formula result is '.$cellValue.'<br />';
$objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($cellValue);
$spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($cellValue);
}
$cellIsSet = $rowHasData = true;
}
@ -741,7 +738,7 @@ class Excel2003XML extends BaseReader implements IReader
// echo $annotation,'<br />';
$annotation = strip_tags($node);
// 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']))) {
@ -751,10 +748,10 @@ class Excel2003XML extends BaseReader implements IReader
// echo 'Cell '.$columnID.$rowID.'<br />';
// print_r($this->styles[$style]);
// echo '<br />';
if (!$objPHPExcel->getActiveSheet()->cellExists($columnID.$rowID)) {
$objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValue(null);
if (!$spreadsheet->getActiveSheet()->cellExists($columnID.$rowID)) {
$spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setValue(null);
}
$objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styles[$style]);
$spreadsheet->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styles[$style]);
}
}
++$columnID;
@ -771,7 +768,7 @@ class Excel2003XML extends BaseReader implements IReader
if (isset($row_ss['Height'])) {
$rowHeight = $row_ss['Height'];
// 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 $objPHPExcel;
return $spreadsheet;
}
protected static function convertStringEncoding($string, $charset)
{
if ($charset != 'UTF-8') {
return \PHPExcel\Shared\StringHelper::convertEncoding($string, 'UTF-8', $charset);
return \PhpSpreadsheet\Shared\StringHelper::convertEncoding($string, 'UTF-8', $charset);
}
return $string;
}
@ -797,7 +794,7 @@ class Excel2003XML extends BaseReader implements IReader
protected function parseRichText($is = '')
{
$value = new \PHPExcel\RichText();
$value = new \PhpSpreadsheet\RichText();
$value->createText(self::convertStringEncoding($is, $this->charSet));

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader;
namespace PhpSpreadsheet\Reader;
/**
* PHPExcel_Reader_Excel2007
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -32,7 +29,7 @@ class Excel2007 extends BaseReader implements IReader
/**
* ReferenceHelper instance
*
* @var \PHPExcel\ReferenceHelper
* @var \PhpSpreadsheet\ReferenceHelper
*/
private $referenceHelper = null;
@ -49,7 +46,7 @@ class Excel2007 extends BaseReader implements IReader
public function __construct()
{
$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.");
}
$zipClass = \PHPExcel\Settings::getZipClass();
$zipClass = \PhpSpreadsheet\Settings::getZipClass();
// Check if zip class exists
// if (!class_exists($zipClass, false)) {
@ -83,7 +80,7 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, "_rels/.rels")
),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
if ($rels !== false) {
foreach ($rels->Relationship as $rel) {
@ -118,7 +115,7 @@ class Excel2007 extends BaseReader implements IReader
$worksheetNames = array();
$zipClass = \PHPExcel\Settings::getZipClass();
$zipClass = \PhpSpreadsheet\Settings::getZipClass();
$zip = new $zipClass;
$zip->open($pFilename);
@ -128,7 +125,7 @@ class Excel2007 extends BaseReader implements IReader
$this->securityScan(
$this->getFromZipArchive($zip, "_rels/.rels"),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
)
); //~ http://schemas.openxmlformats.org/package/2006/relationships");
foreach ($rels->Relationship as $rel) {
@ -138,7 +135,7 @@ class Excel2007 extends BaseReader implements IReader
$this->securityScan(
$this->getFromZipArchive($zip, "{$rel['Target']}"),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
)
); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"
@ -172,7 +169,7 @@ class Excel2007 extends BaseReader implements IReader
$worksheetInfo = array();
$zipClass = \PHPExcel\Settings::getZipClass();
$zipClass = \PhpSpreadsheet\Settings::getZipClass();
$zip = new $zipClass;
$zip->open($pFilename);
@ -181,7 +178,7 @@ class Excel2007 extends BaseReader implements IReader
//~ http://schemas.openxmlformats.org/package/2006/relationships"
$this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
foreach ($rels->Relationship as $rel) {
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")
),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$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']}")
),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
if ($xmlWorkbook->sheets) {
$dir = dirname($rel["Target"]);
@ -227,10 +224,10 @@ class Excel2007 extends BaseReader implements IReader
$xml = new \XMLReader();
$res = $xml->xml(
$this->securityScanFile(
'zip://'.\PHPExcel\Shared\File::realpath($pFilename).'#'."$dir/$fileWorksheet"
'zip://'.\PhpSpreadsheet\Shared\File::realpath($pFilename).'#'."$dir/$fileWorksheet"
),
null,
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$xml->setParserProperty(2, true);
@ -249,7 +246,7 @@ class Excel2007 extends BaseReader implements IReader
$xml->close();
$tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1;
$tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
$tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
$worksheetInfo[] = $tmpInfo;
}
@ -316,11 +313,11 @@ class Excel2007 extends BaseReader implements IReader
// echo 'GETTING SHARED FORMULA', PHP_EOL;
// echo 'Master is ', $sharedFormulas[$instance]['master'], PHP_EOL;
// echo 'Formula is ', $sharedFormulas[$instance]['formula'], PHP_EOL;
$master = \PHPExcel\Cell::coordinateFromString($sharedFormulas[$instance]['master']);
$current = \PHPExcel\Cell::coordinateFromString($r);
$master = \PhpSpreadsheet\Cell::coordinateFromString($sharedFormulas[$instance]['master']);
$current = \PhpSpreadsheet\Cell::coordinateFromString($r);
$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];
$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) {
$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
// so we need to load case-insensitively from the zip file
@ -370,14 +367,14 @@ class Excel2007 extends BaseReader implements IReader
}
// Initialisations
$excel = new \PHPExcel\Spreadsheet;
$excel = new \PhpSpreadsheet\Spreadsheet;
$excel->removeSheetByIndex(0);
if (!$this->readDataOnly) {
$excel->removeCellStyleXfByIndex(0); // remove the default style
$excel->removeCellXfByIndex(0); // remove the default style
}
$zipClass = \PHPExcel\Settings::getZipClass();
$zipClass = \PhpSpreadsheet\Settings::getZipClass();
$zip = new $zipClass;
$zip->open($pFilename);
@ -387,7 +384,7 @@ class Excel2007 extends BaseReader implements IReader
//~ http://schemas.openxmlformats.org/package/2006/relationships"
$this->securityScan($this->getFromZipArchive($zip, "xl/_rels/workbook.xml.rels")),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
foreach ($wbRels->Relationship as $rel) {
switch ($rel["Type"]) {
@ -398,7 +395,7 @@ class Excel2007 extends BaseReader implements IReader
$xmlTheme = simplexml_load_string(
$this->securityScan($this->getFromZipArchive($zip, "xl/{$rel['Target']}")),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
if (is_object($xmlTheme)) {
$xmlThemeName = $xmlTheme->attributes();
@ -433,7 +430,7 @@ class Excel2007 extends BaseReader implements IReader
//~ http://schemas.openxmlformats.org/package/2006/relationships"
$this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
foreach ($rels->Relationship as $rel) {
switch ($rel["Type"]) {
@ -441,7 +438,7 @@ class Excel2007 extends BaseReader implements IReader
$xmlCore = simplexml_load_string(
$this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
if (is_object($xmlCore)) {
$xmlCore->registerXPathNamespace("dc", "http://purl.org/dc/elements/1.1/");
@ -463,7 +460,7 @@ class Excel2007 extends BaseReader implements IReader
$xmlCore = simplexml_load_string(
$this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
if (is_object($xmlCore)) {
$docProps = $excel->getProperties();
@ -479,7 +476,7 @@ class Excel2007 extends BaseReader implements IReader
$xmlCore = simplexml_load_string(
$this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
if (is_object($xmlCore)) {
$docProps = $excel->getProperties();
@ -490,8 +487,8 @@ class Excel2007 extends BaseReader implements IReader
$cellDataOfficeChildren = $xmlProperty->children('http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes');
$attributeType = $cellDataOfficeChildren->getName();
$attributeValue = (string) $cellDataOfficeChildren->{$attributeType};
$attributeValue = \PHPExcel\Document\Properties::convertProperty($attributeValue, $attributeType);
$attributeType = \PHPExcel\Document\Properties::convertPropertyType($attributeType);
$attributeValue = \PhpSpreadsheet\Document\Properties::convertProperty($attributeValue, $attributeType);
$attributeType = \PhpSpreadsheet\Document\Properties::convertPropertyType($attributeType);
$docProps->setCustomProperty($propertyName, $attributeValue, $attributeType);
}
}
@ -510,7 +507,7 @@ class Excel2007 extends BaseReader implements IReader
//~ http://schemas.openxmlformats.org/package/2006/relationships"
$this->securityScan($this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$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"
$this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
if (isset($xmlStrings) && isset($xmlStrings->si)) {
foreach ($xmlStrings->si as $val) {
if (isset($val->t)) {
$sharedStrings[] = \PHPExcel\Shared\StringHelper::controlCharacterOOXML2PHP((string) $val->t);
$sharedStrings[] = \PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $val->t);
} elseif (isset($val->r)) {
$sharedStrings[] = $this->parseRichText($val);
}
@ -565,7 +562,7 @@ class Excel2007 extends BaseReader implements IReader
//~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"
$this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$numFmts = null;
if ($xmlStyles && $xmlStyles->numFmts[0]) {
@ -576,7 +573,7 @@ class Excel2007 extends BaseReader implements IReader
}
if (!$this->readDataOnly && $xmlStyles) {
foreach ($xmlStyles->cellXfs->xf as $xf) {
$numFmt = \PHPExcel\Style\NumberFormat::FORMAT_GENERAL;
$numFmt = \PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL;
if ($xf["numFmtId"]) {
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
// So we make allowance for them rather than lose formatting masks
if ((int)$xf["numFmtId"] < 164 &&
\PHPExcel\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]) !== '') {
$numFmt = \PHPExcel\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]);
\PhpSpreadsheet\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]) !== '') {
$numFmt = \PhpSpreadsheet\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]);
}
}
$quotePrefix = false;
@ -612,19 +609,19 @@ class Excel2007 extends BaseReader implements IReader
$styles[] = $style;
// add style to cellXf collection
$objStyle = new \PHPExcel\Style;
$objStyle = new \PhpSpreadsheet\Style;
self::readStyle($objStyle, $style);
$excel->addCellXf($objStyle);
}
foreach ($xmlStyles->cellStyleXfs->xf as $xf) {
$numFmt = \PHPExcel\Style\NumberFormat::FORMAT_GENERAL;
$numFmt = \PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL;
if ($numFmts && $xf["numFmtId"]) {
$tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]"));
if (isset($tmpNumFmt["formatCode"])) {
$numFmt = (string) $tmpNumFmt["formatCode"];
} 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;
// add style to cellStyleXf collection
$objStyle = new \PHPExcel\Style;
$objStyle = new \PhpSpreadsheet\Style;
self::readStyle($objStyle, $cellStyle);
$excel->addCellStyleXf($objStyle);
}
@ -651,7 +648,7 @@ class Excel2007 extends BaseReader implements IReader
// Conditional Styles
if ($xmlStyles->dxfs) {
foreach ($xmlStyles->dxfs->dxf as $dxf) {
$style = new \PHPExcel\Style(false, true);
$style = new \PhpSpreadsheet\Style(false, true);
self::readStyle($style, $dxf);
$dxfs[] = $style;
}
@ -662,7 +659,7 @@ class Excel2007 extends BaseReader implements IReader
if (intval($cellStyle['builtinId']) == 0) {
if (isset($cellStyles[intval($cellStyle['xfId'])])) {
// Set default style
$style = new \PHPExcel\Style;
$style = new \PhpSpreadsheet\Style;
self::readStyle($style, $cellStyles[intval($cellStyle['xfId'])]);
// 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"
$this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
// Set base date
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 (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"
$this->securityScan($this->getFromZipArchive($zip, "$dir/$fileWorksheet")),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$sharedFormulas = array();
@ -832,22 +829,22 @@ class Excel2007 extends BaseReader implements IReader
foreach ($xmlSheet->cols->col as $col) {
for ($i = intval($col["min"]) - 1; $i < intval($col["max"]); ++$i) {
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"])) {
//$docSheet->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($i))->setAutoSize(true);
//$docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setAutoSize(true);
}
if (self::boolean($col["hidden"])) {
// echo \PHPExcel\Cell::stringFromColumnIndex($i), ': HIDDEN COLUMN',PHP_EOL;
$docSheet->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($i))->setVisible(false);
// echo \PhpSpreadsheet\Cell::stringFromColumnIndex($i), ': HIDDEN COLUMN',PHP_EOL;
$docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setVisible(false);
}
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) {
$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) {
break;
@ -897,7 +894,7 @@ class Excel2007 extends BaseReader implements IReader
// Read cell?
if ($this->getReadFilter() !== null) {
$coordinates = \PHPExcel\Cell::coordinateFromString($r);
$coordinates = \PhpSpreadsheet\Cell::coordinateFromString($r);
if (!$this->getReadFilter()->readCell($coordinates[0], $coordinates[1], $docSheet->getTitle())) {
continue;
@ -916,7 +913,7 @@ class Excel2007 extends BaseReader implements IReader
if ((string)$c->v != '') {
$value = $sharedStrings[intval($c->v)];
if ($value instanceof \PHPExcel\RichText) {
if ($value instanceof \PhpSpreadsheet\RichText) {
$value = clone $value;
}
} else {
@ -983,7 +980,7 @@ class Excel2007 extends BaseReader implements IReader
}
// Rich text?
if ($value instanceof \PHPExcel\RichText && $this->readDataOnly) {
if ($value instanceof \PhpSpreadsheet\RichText && $this->readDataOnly) {
$value = $value->getPlainText();
}
@ -1012,7 +1009,7 @@ class Excel2007 extends BaseReader implements IReader
if (!$this->readDataOnly && $xmlSheet && $xmlSheet->conditionalFormatting) {
foreach ($xmlSheet->conditionalFormatting as $conditional) {
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;
}
}
@ -1022,7 +1019,7 @@ class Excel2007 extends BaseReader implements IReader
ksort($cfRules);
$conditionalStyles = array();
foreach ($cfRules as $cfRule) {
$objConditional = new \PHPExcel\Style\Conditional();
$objConditional = new \PhpSpreadsheet\Style\Conditional();
$objConditional->setConditionType((string)$cfRule["type"]);
$objConditional->setOperatorType((string)$cfRule["operator"]);
@ -1076,17 +1073,17 @@ class Excel2007 extends BaseReader implements IReader
$column = $autoFilter->getColumnByOffset((integer) $filterColumn["colId"]);
// Check for standard 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;
if ((isset($filters["blank"])) && ($filters["blank"] == 1)) {
// 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
// Entries can be either filter elements
foreach ($filters->filter as $filterRule) {
// 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
foreach ($filters->dateGroupItem as $dateGroupItem) {
@ -1103,29 +1100,29 @@ class Excel2007 extends BaseReader implements IReader
),
(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
if ($filterColumn->customFilters) {
$column->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER);
$column->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER);
$customFilters = $filterColumn->customFilters;
// Custom filters can an AND or an OR join;
// and there should only ever be one or two entries
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) {
$column->createRule()->setRule(
(string) $filterRule["operator"],
(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
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
foreach ($filterColumn->dynamicFilter as $filterRule) {
$column->createRule()->setRule(
@ -1134,7 +1131,7 @@ class Excel2007 extends BaseReader implements IReader
(string) $filterRule["val"],
(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"])) {
$column->setAttribute('val', (string) $filterRule["val"]);
}
@ -1145,21 +1142,21 @@ class Excel2007 extends BaseReader implements IReader
}
// Check for dynamic filters
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
foreach ($filterColumn->top10 as $filterRule) {
$column->createRule()->setRule(
(((isset($filterRule["percent"])) && ($filterRule["percent"] == 1))
? \PHPExcel\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_PERCENT
: \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE
),
(string) $filterRule["val"],
(((isset($filterRule["top"])) && ($filterRule["top"] == 1))
? \PHPExcel\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_TOP
: \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) {
foreach ($xmlSheet->rowBreaks->brk as $brk) {
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) {
foreach ($xmlSheet->colBreaks->brk as $brk) {
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);
// Extract all cell references in $range
foreach (\PHPExcel\Cell::extractAllCellReferencesInRange($stRange) as $reference) {
foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($stRange) as $reference) {
// Create validation
$docValidation = $docSheet->getCell($reference)->getDataValidation();
$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")
),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
foreach ($relsWorksheet->Relationship as $ele) {
if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink") {
@ -1316,7 +1313,7 @@ class Excel2007 extends BaseReader implements IReader
// Link url
$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);
if (isset($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")
),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
foreach ($relsWorksheet->Relationship as $ele) {
if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments") {
@ -1364,11 +1361,11 @@ class Excel2007 extends BaseReader implements IReader
// Loop through comments
foreach ($comments as $relName => $relPath) {
// 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(
$this->securityScan($this->getFromZipArchive($zip, $relPath)),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
// Utility variables
@ -1391,11 +1388,11 @@ class Excel2007 extends BaseReader implements IReader
// Loop through VML comments
foreach ($vmlComments as $relName => $relPath) {
// 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(
$this->securityScan($this->getFromZipArchive($zip, $relPath)),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$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")
),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$vmlRelationship = '';
@ -1484,7 +1481,7 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels')
),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$drawings = array();
foreach ($relsVML->Relationship as $ele) {
@ -1497,7 +1494,7 @@ class Excel2007 extends BaseReader implements IReader
$vmlDrawing = simplexml_load_string(
$this->securityScan($this->getFromZipArchive($zip, $vmlRelationship)),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$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');
$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'])) {
$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']]->setWidth($style['width']);
$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")
),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$drawings = array();
foreach ($relsWorksheet->Relationship as $ele) {
@ -1559,7 +1556,7 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, dirname($fileDrawing) . "/_rels/" . basename($fileDrawing) . ".rels")
),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$images = array();
@ -1580,7 +1577,7 @@ class Excel2007 extends BaseReader implements IReader
$xmlDrawing = simplexml_load_string(
$this->securityScan($this->getFromZipArchive($zip, $fileDrawing)),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
)->children("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing");
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;
$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;
$objDrawing = new \PHPExcel\Worksheet\Drawing;
$objDrawing = new \PhpSpreadsheet\Worksheet\Drawing;
$objDrawing->setName((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name"));
$objDrawing->setDescription((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr"));
$objDrawing->setPath(
"zip://".\PHPExcel\Shared\File::realpath($pFilename)."#" .
"zip://".\PhpSpreadsheet\Shared\File::realpath($pFilename)."#" .
$images[(string) self::getArrayItem(
$blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"),
"embed"
)],
false
);
$objDrawing->setCoordinates(\PHPExcel\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1));
$objDrawing->setOffsetX(\PHPExcel\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff));
$objDrawing->setOffsetY(\PHPExcel\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff));
$objDrawing->setCoordinates(\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1));
$objDrawing->setOffsetX(\PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff));
$objDrawing->setOffsetY(\PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff));
$objDrawing->setResizeProportional(false);
$objDrawing->setWidth(\PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx")));
$objDrawing->setHeight(\PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy")));
$objDrawing->setWidth(\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx")));
$objDrawing->setHeight(\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy")));
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) {
$shadow = $objDrawing->getShadow();
$shadow->setVisible(true);
$shadow->setBlurRadius(\PHPExcel\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad")));
$shadow->setDistance(\PHPExcel\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist")));
$shadow->setDirection(\PHPExcel\Shared\Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir")));
$shadow->setBlurRadius(\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad")));
$shadow->setDistance(\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist")));
$shadow->setDirection(\PhpSpreadsheet\Shared\Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir")));
$shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), "algn"));
$shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), "val"));
$shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), "val") / 1000);
@ -1622,11 +1619,11 @@ class Excel2007 extends BaseReader implements IReader
$objDrawing->setWorksheet($docSheet);
} else {
// ? Can charts be positioned with a oneCellAnchor ?
$coordinates = \PHPExcel\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1);
$offsetX = \PHPExcel\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff);
$offsetY = \PHPExcel\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff);
$width = \PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx"));
$height = \PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy"));
$coordinates = \PhpSpreadsheet\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1);
$offsetX = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff);
$offsetY = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff);
$width = \PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx"));
$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;
$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;
$objDrawing = new \PHPExcel\Worksheet\Drawing;
$objDrawing = new \PhpSpreadsheet\Worksheet\Drawing;
$objDrawing->setName((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name"));
$objDrawing->setDescription((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr"));
$objDrawing->setPath(
"zip://".\PHPExcel\Shared\File::realpath($pFilename)."#" .
"zip://".\PhpSpreadsheet\Shared\File::realpath($pFilename)."#" .
$images[(string) self::getArrayItem(
$blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"),
"embed"
)],
false
);
$objDrawing->setCoordinates(\PHPExcel\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1));
$objDrawing->setOffsetX(\PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff));
$objDrawing->setOffsetY(\PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff));
$objDrawing->setCoordinates(\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1));
$objDrawing->setOffsetX(\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff));
$objDrawing->setOffsetY(\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff));
$objDrawing->setResizeProportional(false);
if ($xfrm) {
$objDrawing->setWidth(\PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cx")));
$objDrawing->setHeight(\PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cy")));
$objDrawing->setRotation(\PHPExcel\Shared\Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot")));
$objDrawing->setWidth(\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cx")));
$objDrawing->setHeight(\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cy")));
$objDrawing->setRotation(\PhpSpreadsheet\Shared\Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot")));
}
if ($outerShdw) {
$shadow = $objDrawing->getShadow();
$shadow->setVisible(true);
$shadow->setBlurRadius(\PHPExcel\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad")));
$shadow->setDistance(\PHPExcel\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist")));
$shadow->setDirection(\PHPExcel\Shared\Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir")));
$shadow->setBlurRadius(\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad")));
$shadow->setDistance(\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist")));
$shadow->setDirection(\PhpSpreadsheet\Shared\Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir")));
$shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), "algn"));
$shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), "val"));
$shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), "val") / 1000);
}
$objDrawing->setWorksheet($docSheet);
} elseif (($this->includeCharts) && ($twoCellAnchor->graphicFrame)) {
$fromCoordinate = \PHPExcel\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1);
$fromOffsetX = \PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff);
$fromOffsetY = \PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff);
$toCoordinate = \PHPExcel\Cell::stringFromColumnIndex((string) $twoCellAnchor->to->col) . ($twoCellAnchor->to->row + 1);
$toOffsetX = \PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->to->colOff);
$toOffsetY = \PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->to->rowOff);
$fromCoordinate = \PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1);
$fromOffsetX = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff);
$fromOffsetY = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff);
$toCoordinate = \PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->to->col) . ($twoCellAnchor->to->row + 1);
$toOffsetX = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->to->colOff);
$toOffsetY = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->to->rowOff);
$graphic = $twoCellAnchor->graphicFrame->children("http://schemas.openxmlformats.org/drawingml/2006/main")->graphic;
$chartRef = $graphic->graphicData->children("http://schemas.openxmlformats.org/drawingml/2006/chart")->chart;
$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])) {
$extractedRange = str_replace('$', '', $range[1]);
$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 = '';
if (strpos((string)$definedName, '!') !== false) {
// Extract sheet name
$extractedSheetName = \PHPExcel\Worksheet::extractSheetTitle((string)$definedName, true);
$extractedSheetName = \PhpSpreadsheet\Worksheet::extractSheetTitle((string)$definedName, true);
$extractedSheetName = $extractedSheetName[0];
// Locate sheet
@ -1829,7 +1826,7 @@ class Excel2007 extends BaseReader implements IReader
}
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")
),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
foreach ($contentTypes->Override as $contentType) {
switch ($contentType["ContentType"]) {
@ -1872,9 +1869,9 @@ class Excel2007 extends BaseReader implements IReader
$this->getFromZipArchive($zip, $chartEntryRef)
),
'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 />';
// var_dump($charts[$chartEntryRef]);
@ -1906,13 +1903,13 @@ class Excel2007 extends BaseReader implements IReader
if (isset($color["rgb"])) {
return (string)$color["rgb"];
} 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"])) {
if (self::$theme !== null) {
$returnColour = self::$theme->getColourByIndex((int)$color["theme"]);
if (isset($color["tint"])) {
$tintAdjust = (float) $color["tint"];
$returnColour = \PHPExcel\Style\Color::changeBrightness($returnColour, $tintAdjust);
$returnColour = \PhpSpreadsheet\Style\Color::changeBrightness($returnColour, $tintAdjust);
}
return 'FF'.$returnColour;
}
@ -1951,7 +1948,7 @@ class Excel2007 extends BaseReader implements IReader
$docStyle->getFont()->getColor()->setARGB(self::readColor($style->font->color));
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"])) {
$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"]);
$diagonalDown = self::boolean((string) $style->border["diagonalDown"]);
if (!$diagonalUp && !$diagonalDown) {
$docStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_NONE);
$docStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_NONE);
} elseif ($diagonalUp && !$diagonalDown) {
$docStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_UP);
$docStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_UP);
} elseif (!$diagonalUp && $diagonalDown) {
$docStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_DOWN);
$docStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN);
} 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()->getRight(), $style->border->right);
@ -2035,17 +2032,17 @@ class Excel2007 extends BaseReader implements IReader
if (isset($style->protection)) {
if (isset($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 {
$docStyle->getProtection()->setLocked(\PHPExcel\Style\Protection::PROTECTION_UNPROTECTED);
$docStyle->getProtection()->setLocked(\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED);
}
}
if (isset($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 {
$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)
{
$value = new \PHPExcel\RichText();
$value = new \PhpSpreadsheet\RichText();
if (isset($is->t)) {
$value->createText(\PHPExcel\Shared\StringHelper::controlCharacterOOXML2PHP((string) $is->t));
$value->createText(\PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $is->t));
} else {
if (is_object($is->r)) {
foreach ($is->r as $run) {
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 {
$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"])) {
$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"]);
}
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"])) ||
(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"])) {
$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"])) {
$objText->getFont()->setUnderline((string)$run->rPr->u["val"]);
}
@ -2139,7 +2136,7 @@ class Excel2007 extends BaseReader implements IReader
$UIRels = simplexml_load_string(
$this->securityScan($dataRels),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
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
@ -2189,15 +2186,15 @@ class Excel2007 extends BaseReader implements IReader
}
if (strpos($item[1], 'pt') !== false) {
$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) {
$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) {
$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];

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader\Excel2007;
namespace PhpSpreadsheet\Reader\Excel2007;
/**
* PHPExcel_Reader_Excel2007_Chart
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader_Excel2007
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -52,7 +49,7 @@ class Chart
if (isset($color["rgb"])) {
return (string)$color["rgb"];
} 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) {
$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);
break;
case "plotVisOnly":
@ -187,13 +184,13 @@ class Chart
break;
}
}
$legend = new \PHPExcel\Chart\Legend($legendPos, $legendLayout, $legendOverlay);
$legend = new \PhpSpreadsheet\Chart\Legend($legendPos, $legendLayout, $legendOverlay);
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;
}
@ -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)
@ -237,7 +234,7 @@ class Chart
// echo $detailKey, ' => ',self::getAttribute($detail, 'val', 'string'),PHP_EOL;
$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)
@ -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;
$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)) {
$seriesSource = (string) $seriesDetail->numRef->f;
$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)) {
$seriesSource = (string) $seriesDetail->multiLvlStrRef->f;
$seriesData = self::chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlStrRef->multiLvlStrCache->children($namespacesChartMeta['c']), 's');
$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)) {
$seriesSource = (string) $seriesDetail->multiLvlNumRef->f;
$seriesData = self::chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlNumRef->multiLvlNumCache->children($namespacesChartMeta['c']), 's');
$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;
}
@ -389,7 +386,7 @@ class Chart
private static function parseRichText($titleDetailPart = null)
{
$value = new \PHPExcel\RichText();
$value = new \PhpSpreadsheet\RichText();
foreach ($titleDetailPart as $titleDetailElementKey => $titleDetailElement) {
if (isset($titleDetailElement->t)) {
@ -407,7 +404,7 @@ class Chart
$fontColor = (self::getAttribute($titleDetailElement->rPr, 'color', 'string'));
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');
@ -432,11 +429,11 @@ class Chart
$underscore = (self::getAttribute($titleDetailElement->rPr, 'u', 'string'));
if (!is_null($underscore)) {
if ($underscore == 'sng') {
$objText->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_SINGLE);
$objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE);
} elseif ($underscore == 'dbl') {
$objText->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_DOUBLE);
$objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE);
} else {
$objText->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_NONE);
$objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_NONE);
}
}

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader\Excel2007;
namespace PhpSpreadsheet\Reader\Excel2007;
/**
* PHPExcel_Reader_Excel2007_Theme
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader_Excel2007
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader\Excel5;
namespace PhpSpreadsheet\Reader\Excel5;
/**
* PHPExcel_Reader_Excel5_Escher
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package \PHPExcel\Reader\Excel5
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -103,7 +100,7 @@ class Escher
// Parse Escher stream
while ($this->pos < $this->dataSize) {
// 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) {
case self::DGGCONTAINER:
@ -175,15 +172,15 @@ class Escher
private function readDefault()
{
// 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
$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
$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);
// move stream pointer to next record
@ -195,14 +192,14 @@ class Escher
*/
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);
// move stream pointer to next record
$this->pos += 8 + $length;
// record is a container, read contents
$dggContainer = new \PHPExcel\Shared\Escher\DggContainer();
$dggContainer = new \PhpSpreadsheet\Shared\Escher\DggContainer();
$this->object->setDggContainer($dggContainer);
$reader = new Escher($dggContainer);
$reader->load($recordData);
@ -213,7 +210,7 @@ class Escher
*/
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);
// move stream pointer to next record
@ -225,14 +222,14 @@ class Escher
*/
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);
// move stream pointer to next record
$this->pos += 8 + $length;
// record is a container, read contents
$bstoreContainer = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer();
$bstoreContainer = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer();
$this->object->setBstoreContainer($bstoreContainer);
$reader = new Escher($bstoreContainer);
$reader->load($recordData);
@ -246,16 +243,16 @@ class Escher
// offset: 0; size: 2; recVer and 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);
// move stream pointer to next record
$this->pos += 8 + $length;
// add BSE to BstoreContainer
$BSE = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE();
$BSE = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE();
$this->object->addBSE($BSE);
$BSE->setBLIPType($recInstance);
@ -270,16 +267,16 @@ class Escher
$rgbUid = substr($recordData, 2, 16);
// 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
$size = \PHPExcel\Reader\Excel5::getInt4d($recordData, 20);
$size = \PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 20);
// 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
$foDelay = \PHPExcel\Reader\Excel5::getInt4d($recordData, 28);
$foDelay = \PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 28);
// offset: 32; size: 1; unused1
$unused1 = ord($recordData{32});
@ -300,7 +297,7 @@ class Escher
$blipData = substr($recordData, 36 + $cbName);
// record is a container, read contents
$reader = new \PHPExcel\Reader\Excel5\Escher($BSE);
$reader = new \PhpSpreadsheet\Reader\Excel5\Escher($BSE);
$reader->load($blipData);
}
@ -312,9 +309,9 @@ class Escher
// offset: 0; size: 2; recVer and 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);
// move stream pointer to next record
@ -339,7 +336,7 @@ class Escher
// offset: var; size: var; the raw image data
$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);
$this->object->setBlip($blip);
@ -353,9 +350,9 @@ class Escher
// offset: 0; size: 2; recVer and 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);
// move stream pointer to next record
@ -380,7 +377,7 @@ class Escher
// offset: var; size: var; the raw image data
$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);
$this->object->setBlip($blip);
@ -394,9 +391,9 @@ class Escher
// offset: 0; size: 2; recVer and 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);
// move stream pointer to next record
@ -413,9 +410,9 @@ class Escher
// offset: 0; size: 2; recVer and 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);
// move stream pointer to next record
@ -427,7 +424,7 @@ class Escher
*/
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);
// move stream pointer to next record
@ -439,16 +436,16 @@ class Escher
*/
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);
// move stream pointer to next record
$this->pos += 8 + $length;
// record is a container, read contents
$dgContainer = new \PHPExcel\Shared\Escher\DgContainer();
$dgContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer();
$this->object->setDgContainer($dgContainer);
$reader = new \PHPExcel\Reader\Excel5\Escher($dgContainer);
$reader = new \PhpSpreadsheet\Reader\Excel5\Escher($dgContainer);
$escher = $reader->load($recordData);
}
@ -457,7 +454,7 @@ class Escher
*/
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);
// move stream pointer to next record
@ -471,16 +468,16 @@ class Escher
{
// 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);
// move stream pointer to next record
$this->pos += 8 + $length;
// 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
$this->object->setSpgrContainer($spgrContainer);
} else {
@ -497,11 +494,11 @@ class Escher
*/
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);
// add spContainer to spgrContainer
$spContainer = new \PHPExcel\Shared\Escher\DgContainer\SpgrContainer\SpContainer();
$spContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer();
$this->object->addChild($spContainer);
// move stream pointer to next record
@ -517,7 +514,7 @@ class Escher
*/
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);
// move stream pointer to next record
@ -532,9 +529,9 @@ class Escher
// offset: 0; size: 2; recVer and 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);
// move stream pointer to next record
@ -549,9 +546,9 @@ class Escher
// offset: 0; size: 2; recVer and 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);
// move stream pointer to next record
@ -563,38 +560,38 @@ class Escher
*/
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);
// move stream pointer to next record
$this->pos += 8 + $length;
// 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
$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)
$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
$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)
$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
$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)
$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
$endOffsetY = \PHPExcel\Reader\Excel5::getInt2d($recordData, 16);
$endOffsetY = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 16);
// 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
$this->object->setStartOffsetX($startOffsetX);
@ -603,7 +600,7 @@ class Escher
$this->object->setStartOffsetY($startOffsetY);
// 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
$this->object->setEndOffsetX($endOffsetX);
@ -617,7 +614,7 @@ class Escher
*/
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);
// move stream pointer to next record
@ -640,7 +637,7 @@ class Escher
$fopte = substr($data, 6 * $i, 6);
// 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
$opidOpid = (0x3FFF & $opid) >> 0;
@ -652,7 +649,7 @@ class Escher
$opidFComplex = (0x8000 & $opid) >> 15;
// 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) {
$complexData = substr($splicedComplexData, 0, $op);

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader\Excel5;
namespace PhpSpreadsheet\Reader\Excel5;
/**
* PHPExcel_Reader_Excel5_MD5
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader_Excel5
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader\Excel5;
namespace PhpSpreadsheet\Reader\Excel5;
/**
* PHPExcel_Reader_Excel5_RC4
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader_Excel5
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,8 +1,8 @@
<?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
{

View File

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

View File

@ -1,11 +1,11 @@
<?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
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class Exception extends \PHPExcel\Exception
class Exception extends \PhpSpreadsheet\Exception
{
/**
* Error handler callback

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader;
namespace PhpSpreadsheet\Reader;
/**
* PHPExcel_Reader_Gnumeric
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -51,7 +48,7 @@ class Gnumeric extends BaseReader implements IReader
public function __construct()
{
$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
* @throws Exception
@ -99,7 +96,7 @@ class Gnumeric extends BaseReader implements IReader
}
$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);
$worksheetNames = array();
@ -130,7 +127,7 @@ class Gnumeric extends BaseReader implements IReader
}
$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);
$worksheetInfo = array();
@ -158,7 +155,7 @@ class Gnumeric extends BaseReader implements IReader
break;
}
}
$tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
$tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
$worksheetInfo[] = $tmpInfo;
}
}
@ -180,30 +177,30 @@ class Gnumeric extends BaseReader implements IReader
}
/**
* Loads PHPExcel from file
* Loads PhpSpreadsheet from file
*
* @param string $pFilename
* @return PHPExcel
* @return PhpSpreadsheet
* @throws Exception
*/
public function load($pFilename)
{
// Create new PHPExcel
$objPHPExcel = new PHPExcel();
// Create new PhpSpreadsheet
$spreadsheet = new PhpSpreadsheet();
// 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 PHPExcel $objPHPExcel
* @return PHPExcel
* @param \PhpSpreadsheet\Spreadsheet $spreadsheet
* @return PhpSpreadsheet
* @throws Exception
*/
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet)
{
// Check if file exists
if (!file_exists($pFilename)) {
@ -219,14 +216,14 @@ class Gnumeric extends BaseReader implements IReader
// echo htmlentities($gFileData,ENT_QUOTES,'UTF-8');
// 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);
// var_dump($namespacesMeta);
//
$gnmXML = $xml->children($namespacesMeta['gnm']);
$docProps = $objPHPExcel->getProperties();
$docProps = $spreadsheet->getProperties();
// Document Properties are held differently, depending on the version of Gnumeric
if (isset($namespacesMeta['office'])) {
$officeXML = $xml->children($namespacesMeta['office']);
@ -340,12 +337,12 @@ class Gnumeric extends BaseReader implements IReader
$maxRow = $maxCol = 0;
// Create new Worksheet
$objPHPExcel->createSheet();
$objPHPExcel->setActiveSheetIndex($worksheetID);
$spreadsheet->createSheet();
$spreadsheet->setActiveSheetIndex($worksheetID);
// 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
// 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 (isset($sheet->PrintInformation->Margins)) {
@ -359,22 +356,22 @@ class Gnumeric extends BaseReader implements IReader
}
switch ($key) {
case 'top':
$objPHPExcel->getActiveSheet()->getPageMargins()->setTop($marginSize);
$spreadsheet->getActiveSheet()->getPageMargins()->setTop($marginSize);
break;
case 'bottom':
$objPHPExcel->getActiveSheet()->getPageMargins()->setBottom($marginSize);
$spreadsheet->getActiveSheet()->getPageMargins()->setBottom($marginSize);
break;
case 'left':
$objPHPExcel->getActiveSheet()->getPageMargins()->setLeft($marginSize);
$spreadsheet->getActiveSheet()->getPageMargins()->setLeft($marginSize);
break;
case 'right':
$objPHPExcel->getActiveSheet()->getPageMargins()->setRight($marginSize);
$spreadsheet->getActiveSheet()->getPageMargins()->setRight($marginSize);
break;
case 'header':
$objPHPExcel->getActiveSheet()->getPageMargins()->setHeader($marginSize);
$spreadsheet->getActiveSheet()->getPageMargins()->setHeader($marginSize);
break;
case 'footer':
$objPHPExcel->getActiveSheet()->getPageMargins()->setFooter($marginSize);
$spreadsheet->getActiveSheet()->getPageMargins()->setFooter($marginSize);
break;
}
}
@ -393,7 +390,7 @@ class Gnumeric extends BaseReader implements IReader
$maxCol = $column;
}
$column = \PHPExcel\Cell::stringFromColumnIndex($column);
$column = \PhpSpreadsheet\Cell::stringFromColumnIndex($column);
// Read cell?
if ($this->getReadFilter() !== null) {
@ -407,7 +404,7 @@ class Gnumeric extends BaseReader implements IReader
// echo 'Cell ', $column, $row,'<br />';
// echo 'Type is ', $ValueType,'<br />';
// echo 'Value is ', $cell,'<br />';
$type = \PHPExcel\Cell\DataType::TYPE_FORMULA;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA;
if ($ExprID > '') {
if (((string) $cell) > '') {
$this->expressions[$ExprID] = array(
@ -429,33 +426,33 @@ class Gnumeric extends BaseReader implements IReader
// echo 'SHARED EXPRESSION ', $ExprID,'<br />';
// echo 'New Value is ', $cell,'<br />';
}
$type = \PHPExcel\Cell\DataType::TYPE_FORMULA;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA;
} else {
switch ($ValueType) {
case '10': // NULL
$type = \PHPExcel\Cell\DataType::TYPE_NULL;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_NULL;
break;
case '20': // Boolean
$type = \PHPExcel\Cell\DataType::TYPE_BOOL;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_BOOL;
$cell = ($cell == 'TRUE') ? true: false;
break;
case '30': // Integer
$cell = intval($cell);
// Excel 2007+ doesn't differentiate between integer and float, so set the value and dropthru to the next (numeric) case
case '40': // Float
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
break;
case '50': // Error
$type = \PHPExcel\Cell\DataType::TYPE_ERROR;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_ERROR;
break;
case '60': // String
$type = \PHPExcel\Cell\DataType::TYPE_STRING;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_STRING;
break;
case '70': // Cell Range
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))) {
@ -463,7 +460,7 @@ class Gnumeric extends BaseReader implements IReader
$commentAttributes = $comment->attributes();
// Only comment objects are handled at the moment
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();
if (($styleAttributes['startRow'] <= $maxRow) &&
($styleAttributes['startCol'] <= $maxCol)) {
$startColumn = \PHPExcel\Cell::stringFromColumnIndex((int) $styleAttributes['startCol']);
$startColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex((int) $styleAttributes['startCol']);
$startRow = $styleAttributes['startRow'] + 1;
$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 += 1;
$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
if ((!$this->readDataOnly) ||
(\PHPExcel\Shared\Date::isDateTimeFormatCode((string) $styleAttributes['Format']))) {
(\PhpSpreadsheet\Shared\Date::isDateTimeFormatCode((string) $styleAttributes['Format']))) {
$styleArray = array();
$styleArray['numberformat']['code'] = (string) $styleAttributes['Format'];
// If readDataOnly is false, we set all formatting information
if (!$this->readDataOnly) {
switch ($styleAttributes['HAlign']) {
case '1':
$styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_GENERAL;
$styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL;
break;
case '2':
$styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_LEFT;
$styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT;
break;
case '4':
$styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_RIGHT;
$styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT;
break;
case '8':
$styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_CENTER;
$styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER;
break;
case '16':
case '64':
$styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS;
$styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS;
break;
case '32':
$styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY;
$styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY;
break;
}
switch ($styleAttributes['VAlign']) {
case '1':
$styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_TOP;
$styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_TOP;
break;
case '2':
$styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_BOTTOM;
$styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM;
break;
case '4':
$styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_CENTER;
$styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER;
break;
case '8':
$styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_JUSTIFY;
$styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY;
break;
}
@ -545,64 +542,64 @@ class Gnumeric extends BaseReader implements IReader
$styleArray['fill']['endcolor']['rgb'] = $RGB2;
switch ($shade) {
case '1':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_SOLID;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_SOLID;
break;
case '2':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR;
break;
case '3':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_GRADIENT_PATH;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH;
break;
case '4':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKDOWN;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKDOWN;
break;
case '5':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKGRAY;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRAY;
break;
case '6':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKGRID;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRID;
break;
case '7':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKHORIZONTAL;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKHORIZONTAL;
break;
case '8':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKTRELLIS;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKTRELLIS;
break;
case '9':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKUP;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKUP;
break;
case '10':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKVERTICAL;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKVERTICAL;
break;
case '11':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_GRAY0625;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY0625;
break;
case '12':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_GRAY125;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125;
break;
case '13':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTDOWN;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTDOWN;
break;
case '14':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRAY;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY;
break;
case '15':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRID;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRID;
break;
case '16':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL;
break;
case '17':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTTRELLIS;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTTRELLIS;
break;
case '18':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTUP;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTUP;
break;
case '19':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTVERTICAL;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTVERTICAL;
break;
case '20':
$styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_MEDIUMGRAY;
$styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_MEDIUMGRAY;
break;
}
}
@ -617,19 +614,19 @@ class Gnumeric extends BaseReader implements IReader
$styleArray['font']['strike'] = ($fontAttributes['StrikeThrough'] == '1') ? true : false;
switch ($fontAttributes['Underline']) {
case '1':
$styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_SINGLE;
$styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE;
break;
case '2':
$styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_DOUBLE;
$styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE;
break;
case '3':
$styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_SINGLEACCOUNTING;
$styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING;
break;
case '4':
$styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_DOUBLEACCOUNTING;
$styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING;
break;
default:
$styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_NONE;
$styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_NONE;
break;
}
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'}))) {
$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)) {
$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'})) {
$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)) {
@ -672,7 +669,7 @@ class Gnumeric extends BaseReader implements IReader
}
// var_dump($styleArray);
// 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;
$columnCount = (isset($columnAttributes['Count'])) ? $columnAttributes['Count'] : 1;
while ($c < $column) {
$objPHPExcel->getActiveSheet()->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth);
$spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth);
++$c;
}
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) {
$objPHPExcel->getActiveSheet()->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($c))->setVisible(false);
$spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setVisible(false);
}
++$c;
}
}
while ($c <= $maxCol) {
$objPHPExcel->getActiveSheet()->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth);
$spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth);
++$c;
}
}
@ -720,19 +717,19 @@ class Gnumeric extends BaseReader implements IReader
$rowCount = (isset($rowAttributes['Count'])) ? $rowAttributes['Count'] : 1;
while ($r < $row) {
++$r;
$objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight);
$spreadsheet->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight);
}
while (($r < ($row+$rowCount)) && ($r < $maxRow)) {
++$r;
$objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($rowHeight);
$spreadsheet->getActiveSheet()->getRowDimension($r)->setRowHeight($rowHeight);
if ($hidden) {
$objPHPExcel->getActiveSheet()->getRowDimension($r)->setVisible(false);
$spreadsheet->getActiveSheet()->getRowDimension($r)->setVisible(false);
}
}
}
while ($r < $maxRow) {
++$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)) {
foreach ($sheet->MergedRegions->Merge as $mergeCells) {
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[0] = trim($range[0], "'");
if ($worksheet = $objPHPExcel->getSheetByName($range[0])) {
if ($worksheet = $spreadsheet->getSheetByName($range[0])) {
$extractedRange = str_replace('$', '', $range[1]);
$objPHPExcel->addNamedRange(new \PHPExcel\NamedRange($name, $worksheet, $extractedRange));
$spreadsheet->addNamedRange(new \PhpSpreadsheet\NamedRange($name, $worksheet, $extractedRange));
}
}
}
// Return
return $objPHPExcel;
return $spreadsheet;
}
private static function parseBorderAttributes($borderAttributes)
@ -779,46 +776,46 @@ class Gnumeric extends BaseReader implements IReader
switch ($borderAttributes["Style"]) {
case '0':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_NONE;
$styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_NONE;
break;
case '1':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_THIN;
$styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break;
case '2':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUM;
$styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUM;
break;
case '3':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_SLANTDASHDOT;
$styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT;
break;
case '4':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_DASHED;
$styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DASHED;
break;
case '5':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_THICK;
$styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_THICK;
break;
case '6':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_DOUBLE;
$styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DOUBLE;
break;
case '7':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_DOTTED;
$styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DOTTED;
break;
case '8':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHED;
$styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED;
break;
case '9':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_DASHDOT;
$styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DASHDOT;
break;
case '10':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT;
$styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT;
break;
case '11':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_DASHDOTDOT;
$styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT;
break;
case '12':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT;
$styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT;
break;
case '13':
$styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT;
$styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT;
break;
}
return $styleArray;
@ -826,7 +823,7 @@ class Gnumeric extends BaseReader implements IReader
private function parseRichText($is = '')
{
$value = new \PHPExcel\RichText();
$value = new \PhpSpreadsheet\RichText();
$value->createText($is);
return $value;

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader;
namespace PhpSpreadsheet\Reader;
/**
* PHPExcel_Reader_HTML
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/** PHPExcel root directory */
/** PhpSpreadsheet root directory */
class HTML extends BaseReader implements IReader
{
@ -91,16 +88,16 @@ class HTML extends BaseReader implements IReader
'font' => array(
'underline' => true,
'color' => array(
'argb' => \PHPExcel\Style\Color::COLOR_BLUE,
'argb' => \PhpSpreadsheet\Style\Color::COLOR_BLUE,
),
),
), // Blue underlined
'hr' => array(
'borders' => array(
'bottom' => array(
'style' => \PHPExcel\Style\Border::BORDER_THIN,
'style' => \PhpSpreadsheet\Style\Border::BORDER_THIN,
'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
* @return PHPExcel
* @return PhpSpreadsheet
* @throws Exception
*/
public function load($pFilename)
{
// Create new PHPExcel
$objPHPExcel = new PHPExcel();
// Create new PhpSpreadsheet
$spreadsheet = new PhpSpreadsheet();
// 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;
}
// 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 $tableLevel = 0;
protected $nestedColumn = array('A');
@ -407,7 +404,7 @@ class HTML extends BaseReader implements IReader
$this->flushCell($sheet, $column, $row, $cellContent);
// if (isset($attributeArray['style']) && !empty($attributeArray['style'])) {
// $styleAry = $this->getPhpExcelStyleArray($attributeArray['style']);
// $styleAry = $this->getPhpSpreadsheetStyleArray($attributeArray['style']);
//
// if (!empty($styleAry)) {
// $sheet->getStyle($column . $row)->applyFromArray($styleAry);
@ -421,7 +418,7 @@ class HTML extends BaseReader implements IReader
++$columnTo;
}
$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;
}
$sheet->mergeCells($range);
@ -429,7 +426,7 @@ class HTML extends BaseReader implements IReader
} elseif (isset($attributeArray['rowspan'])) {
//create merging rowspan
$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;
}
$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 PHPExcel $objPHPExcel
* @return PHPExcel
* @param \PhpSpreadsheet\Spreadsheet $spreadsheet
* @return \PhpSpreadsheet\Spreadsheet
* @throws Exception
*/
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet)
{
// Open file to validate
$this->openFile($pFilename);
@ -477,11 +474,11 @@ class HTML extends BaseReader implements IReader
// Close after validating
fclose($this->fileHandle);
// Create new PHPExcel
while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) {
$objPHPExcel->createSheet();
// Create new PhpSpreadsheet
while ($spreadsheet->getSheetCount() <= $this->sheetIndex) {
$spreadsheet->createSheet();
}
$objPHPExcel->setActiveSheetIndex($this->sheetIndex);
$spreadsheet->setActiveSheetIndex($this->sheetIndex);
// Create a new DOM object
$dom = new domDocument;
@ -497,10 +494,10 @@ class HTML extends BaseReader implements IReader
$row = 0;
$column = 'A';
$content = '';
$this->processDomElement($dom, $objPHPExcel->getActiveSheet(), $row, $column, $content);
$this->processDomElement($dom, $spreadsheet->getActiveSheet(), $row, $column, $content);
// Return
return $objPHPExcel;
return $spreadsheet;
}
/**

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader;
namespace PhpSpreadsheet\Reader;
/**
* PHPExcel_Reader_IReadFilter
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader;
namespace PhpSpreadsheet\Reader;
/**
* PHPExcel_Reader_IReader
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -38,10 +35,10 @@ interface IReader
public function canRead($pFilename);
/**
* Loads PHPExcel from file
* Loads PhpSpreadsheet from file
*
* @param string $pFilename
* @return PHPExcel
* @return PhpSpreadsheet
* @throws Exception
*/
public function load($pFilename);

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader;
namespace PhpSpreadsheet\Reader;
/**
* PHPExcel_Reader_OOCalc
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @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.");
}
$zipClass = \PHPExcel\Settings::getZipClass();
$zipClass = \PhpSpreadsheet\Settings::getZipClass();
// Check if zip class exists
// if (!class_exists($zipClass, false)) {
@ -77,7 +74,7 @@ class OOCalc extends BaseReader implements IReader
$xml = simplexml_load_string(
$this->securityScan($zip->getFromName('META-INF/manifest.xml')),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$namespacesContent = $xml->getNamespaces(true);
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
* @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.");
}
$zipClass = \PHPExcel\Settings::getZipClass();
$zipClass = \PhpSpreadsheet\Settings::getZipClass();
$zip = new $zipClass;
if (!$zip->open($pFilename)) {
@ -127,7 +124,7 @@ class OOCalc extends BaseReader implements IReader
$res = $xml->xml(
$this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'),
null,
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$xml->setParserProperty(2, true);
@ -172,7 +169,7 @@ class OOCalc extends BaseReader implements IReader
$worksheetInfo = array();
$zipClass = \PHPExcel\Settings::getZipClass();
$zipClass = \PhpSpreadsheet\Settings::getZipClass();
$zip = new $zipClass;
if (!$zip->open($pFilename)) {
@ -183,7 +180,7 @@ class OOCalc extends BaseReader implements IReader
$res = $xml->xml(
$this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'),
null,
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$xml->setParserProperty(2, true);
@ -242,7 +239,7 @@ class OOCalc extends BaseReader implements IReader
$tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells);
$tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1;
$tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
$tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
$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;
//
// }
@ -287,19 +284,19 @@ class OOCalc extends BaseReader implements IReader
}
/**
* Loads PHPExcel from file
* Loads PhpSpreadsheet from file
*
* @param string $pFilename
* @return \PHPExcel\Spreadsheet
* @return \PhpSpreadsheet\Spreadsheet
* @throws Exception
*/
public function load($pFilename)
{
// Create new Spreadsheet
$objPHPExcel = new \PHPExcel\Spreadsheet();
$spreadsheet = new \PhpSpreadsheet\Spreadsheet();
// Load into this instance
return $this->loadIntoExisting($pFilename, $objPHPExcel);
return $this->loadIntoExisting($pFilename, $spreadsheet);
}
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 \PHPExcel\Spreadsheet $objPHPExcel
* @return \PHPExcel\Spreadsheet
* @param \PhpSpreadsheet\Spreadsheet $spreadsheet
* @return \PhpSpreadsheet\Spreadsheet
* @throws Exception
*/
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet)
{
// Check if file exists
if (!file_exists($pFilename)) {
@ -332,7 +329,7 @@ class OOCalc extends BaseReader implements IReader
$timezoneObj = new DateTimeZone('Europe/London');
$GMT = new \DateTimeZone('UTC');
$zipClass = \PHPExcel\Settings::getZipClass();
$zipClass = \PhpSpreadsheet\Settings::getZipClass();
$zip = new $zipClass;
if (!$zip->open($pFilename)) {
@ -343,14 +340,14 @@ class OOCalc extends BaseReader implements IReader
$xml = simplexml_load_string(
$this->securityScan($zip->getFromName("meta.xml")),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$namespacesMeta = $xml->getNamespaces(true);
// echo '<pre>';
// print_r($namespacesMeta);
// echo '</pre><hr />';
$docProps = $objPHPExcel->getProperties();
$docProps = $spreadsheet->getProperties();
$officeProperty = $xml->children($namespacesMeta['office']);
foreach ($officeProperty as $officePropertyData) {
$officePropertyDC = array();
@ -399,26 +396,26 @@ class OOCalc extends BaseReader implements IReader
$docProps->setCreated($creationDate);
break;
case 'user-defined':
$propertyValueType = \PHPExcel\Document\Properties::PROPERTY_TYPE_STRING;
$propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING;
foreach ($propertyValueAttributes as $key => $value) {
if ($key == 'name') {
$propertyValueName = (string) $value;
} elseif ($key == 'value-type') {
switch ($value) {
case 'date':
$propertyValue = \PHPExcel\Document\Properties::convertProperty($propertyValue, 'date');
$propertyValueType = \PHPExcel\Document\Properties::PROPERTY_TYPE_DATE;
$propertyValue = \PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'date');
$propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE;
break;
case 'boolean':
$propertyValue = \PHPExcel\Document\Properties::convertProperty($propertyValue, 'bool');
$propertyValueType = \PHPExcel\Document\Properties::PROPERTY_TYPE_BOOLEAN;
$propertyValue = \PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'bool');
$propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN;
break;
case 'float':
$propertyValue = \PHPExcel\Document\Properties::convertProperty($propertyValue, 'r4');
$propertyValueType = \PHPExcel\Document\Properties::PROPERTY_TYPE_FLOAT;
$propertyValue = \PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'r4');
$propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_FLOAT;
break;
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(
$this->securityScan($zip->getFromName("content.xml")),
'SimpleXMLElement',
\PHPExcel\Settings::getLibXmlLoaderOptions()
\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
);
$namespacesContent = $xml->getNamespaces(true);
// echo '<pre>';
@ -458,14 +455,14 @@ class OOCalc extends BaseReader implements IReader
// echo '<h2>Worksheet '.$worksheetDataAttributes['name'].'</h2>';
// Create new Worksheet
$objPHPExcel->createSheet();
$objPHPExcel->setActiveSheetIndex($worksheetID);
$spreadsheet->createSheet();
$spreadsheet->setActiveSheetIndex($worksheetID);
if (isset($worksheetDataAttributes['name'])) {
$worksheetName = (string) $worksheetDataAttributes['name'];
// 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 name in line with the formula, not the reverse
$objPHPExcel->getActiveSheet()->setTitle($worksheetName, false);
$spreadsheet->getActiveSheet()->setTitle($worksheetName, false);
}
$rowID = 1;
@ -526,7 +523,7 @@ class OOCalc extends BaseReader implements IReader
}
$text = implode("\n", $textArray);
// echo $text, '<br />';
$objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setText($this->parseRichText($text));
$spreadsheet->getActiveSheet()->getComment($columnID.$rowID)->setText($this->parseRichText($text));
// ->setAuthor( $author )
}
@ -554,7 +551,7 @@ class OOCalc extends BaseReader implements IReader
// echo 'Value Type is '.$cellDataOfficeAttributes['value-type'].'<br />';
switch ($cellDataOfficeAttributes['value-type']) {
case 'string':
$type = \PHPExcel\Cell\DataType::TYPE_STRING;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_STRING;
$dataValue = $allCellDataText;
if (isset($dataValue->a)) {
$dataValue = $dataValue->a;
@ -563,27 +560,27 @@ class OOCalc extends BaseReader implements IReader
}
break;
case 'boolean':
$type = \PHPExcel\Cell\DataType::TYPE_BOOL;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_BOOL;
$dataValue = ($allCellDataText == 'TRUE') ? true : false;
break;
case 'percentage':
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
$dataValue = (float) $cellDataOfficeAttributes['value'];
if (floor($dataValue) == $dataValue) {
$dataValue = (integer) $dataValue;
}
$formatting = \PHPExcel\Style\NumberFormat::FORMAT_PERCENTAGE_00;
$formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_PERCENTAGE_00;
break;
case 'currency':
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
$dataValue = (float) $cellDataOfficeAttributes['value'];
if (floor($dataValue) == $dataValue) {
$dataValue = (integer) $dataValue;
}
$formatting = \PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE;
$formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE;
break;
case 'float':
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
$dataValue = (float) $cellDataOfficeAttributes['value'];
if (floor($dataValue) == $dataValue) {
if ($dataValue == (integer) $dataValue) {
@ -594,21 +591,21 @@ class OOCalc extends BaseReader implements IReader
}
break;
case 'date':
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
$dateObj = new DateTime($cellDataOfficeAttributes['date-value'], $GMT);
$dateObj->setTimeZone($timezoneObj);
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)) {
$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 {
$formatting = \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX15;
$formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15;
}
break;
case 'time':
$type = \PHPExcel\Cell\DataType::TYPE_NUMERIC;
$dataValue = \PHPExcel\Shared\Date::PHPToExcel(strtotime('01-01-1970 '.implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS'))));
$formatting = \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC;
$dataValue = \PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime('01-01-1970 '.implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS'))));
$formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4;
break;
}
// echo 'Data value is '.$dataValue.'<br />';
@ -616,12 +613,12 @@ class OOCalc extends BaseReader implements IReader
// echo 'Hyperlink is '.$hyperlink.'<br />';
// }
} else {
$type = \PHPExcel\Cell\DataType::TYPE_NULL;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_NULL;
$dataValue = null;
}
if ($hasCalculatedValue) {
$type = \PHPExcel\Cell\DataType::TYPE_FORMULA;
$type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA;
// echo 'Formula: ', $cellDataFormula, PHP_EOL;
$cellDataFormula = substr($cellDataFormula, strpos($cellDataFormula, ':=')+1);
$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 range reference
$value = preg_replace('/\[\.([^\.]+)\]/Ui', '$1', $value); // Simple cell reference
$value = \PHPExcel\Calculation::translateSeparator(';', ',', $value, $inBraces);
$value = \PhpSpreadsheet\Calculation::translateSeparator(';', ',', $value, $inBraces);
}
}
unset($value);
@ -648,21 +645,21 @@ class OOCalc extends BaseReader implements IReader
if ($i > 0) {
++$columnID;
}
if ($type !== \PHPExcel\Cell\DataType::TYPE_NULL) {
if ($type !== \PhpSpreadsheet\Cell\DataType::TYPE_NULL) {
for ($rowAdjust = 0; $rowAdjust < $rowRepeats; ++$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) {
// echo 'Forumla result is '.$dataValue.'<br />';
$objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->setCalculatedValue($dataValue);
$spreadsheet->getActiveSheet()->getCell($columnID.$rID)->setCalculatedValue($dataValue);
}
if ($formatting !== null) {
$objPHPExcel->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode($formatting);
$spreadsheet->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode($formatting);
} 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) {
$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
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;
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;
if (isset($cellDataTableAttributes['number-rows-spanned'])) {
$rowTo = $rowTo + $cellDataTableAttributes['number-rows-spanned'] - 1;
}
$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 $objPHPExcel;
return $spreadsheet;
}
private function parseRichText($is = '')
{
$value = new \PHPExcel\RichText();
$value = new \PhpSpreadsheet\RichText();
$value->createText($is);

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Reader;
namespace PhpSpreadsheet\Reader;
/**
* PHPExcel_Reader_SYLK
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Reader
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -144,7 +141,7 @@ class SYLK extends BaseReader implements IReader
$columnIndex = 0;
// 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 (;)
// 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;
// Close file
@ -181,30 +178,30 @@ class SYLK extends BaseReader implements IReader
}
/**
* Loads PHPExcel from file
* Loads PhpSpreadsheet from file
*
* @param string $pFilename
* @return \PHPExcel\Spreadsheet
* @return \PhpSpreadsheet\Spreadsheet
* @throws Exception
*/
public function load($pFilename)
{
// Create new Spreadsheet
$objPHPExcel = new \PHPExcel\Spreadsheet();
$spreadsheet = new \PhpSpreadsheet\Spreadsheet();
// 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 \PHPExcel\Spreadsheet $objPHPExcel
* @return \PHPExcel\Spreadsheet
* @param \PhpSpreadsheet\Spreadsheet $spreadsheet
* @return \PhpSpreadsheet\Spreadsheet
* @throws Exception
*/
public function loadIntoExisting($pFilename, \PHPExcel\Spreadsheet $objPHPExcel)
public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet)
{
// Open file
$this->openFile($pFilename);
@ -216,10 +213,10 @@ class SYLK extends BaseReader implements IReader
rewind($fileHandle);
// Create new Worksheets
while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) {
$objPHPExcel->createSheet();
while ($spreadsheet->getSheetCount() <= $this->sheetIndex) {
$spreadsheet->createSheet();
}
$objPHPExcel->setActiveSheetIndex($this->sheetIndex);
$spreadsheet->setActiveSheetIndex($this->sheetIndex);
$fromFormats = array('\-', '\ ');
$toFormats = array('-', ' ');
@ -231,7 +228,7 @@ class SYLK extends BaseReader implements IReader
// loop through one row (line) at a time in the file
while (($rowData = fgets($fileHandle)) !== false) {
// 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 (;)
// is escaped like this (;;)
@ -264,16 +261,16 @@ class SYLK extends BaseReader implements IReader
$formatArray['font']['bold'] = true;
break;
case 'T':
$formatArray['borders']['top']['style'] = \PHPExcel\Style\Border::BORDER_THIN;
$formatArray['borders']['top']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break;
case 'B':
$formatArray['borders']['bottom']['style'] = \PHPExcel\Style\Border::BORDER_THIN;
$formatArray['borders']['bottom']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break;
case 'L':
$formatArray['borders']['left']['style'] = \PHPExcel\Style\Border::BORDER_THIN;
$formatArray['borders']['left']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break;
case 'R':
$formatArray['borders']['right']['style'] = \PHPExcel\Style\Border::BORDER_THIN;
$formatArray['borders']['right']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break;
}
}
@ -332,7 +329,7 @@ class SYLK extends BaseReader implements IReader
if ($columnReference{0} == '[') {
$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]));
}
@ -345,14 +342,14 @@ class SYLK extends BaseReader implements IReader
break;
}
}
$columnLetter = \PHPExcel\Cell::stringFromColumnIndex($column-1);
$cellData = \PHPExcel\Calculation::unwrapResult($cellData);
$columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column-1);
$cellData = \PhpSpreadsheet\Calculation::unwrapResult($cellData);
// Set cell value
$objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData);
$spreadsheet->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData);
if ($hasCalculatedValue) {
$cellData = \PHPExcel\Calculation::unwrapResult($cellData);
$objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData);
$cellData = \PhpSpreadsheet\Calculation::unwrapResult($cellData);
$spreadsheet->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData);
}
// Read cell formatting
} elseif ($dataType == 'F') {
@ -385,16 +382,16 @@ class SYLK extends BaseReader implements IReader
$styleData['font']['bold'] = true;
break;
case 'T':
$styleData['borders']['top']['style'] = \PHPExcel\Style\Border::BORDER_THIN;
$styleData['borders']['top']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break;
case 'B':
$styleData['borders']['bottom']['style'] = \PHPExcel\Style\Border::BORDER_THIN;
$styleData['borders']['bottom']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break;
case 'L':
$styleData['borders']['left']['style'] = \PHPExcel\Style\Border::BORDER_THIN;
$styleData['borders']['left']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break;
case 'R':
$styleData['borders']['right']['style'] = \PHPExcel\Style\Border::BORDER_THIN;
$styleData['borders']['right']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN;
break;
}
}
@ -402,25 +399,25 @@ class SYLK extends BaseReader implements IReader
}
}
if (($formatStyle > '') && ($column > '') && ($row > '')) {
$columnLetter = \PHPExcel\Cell::stringFromColumnIndex($column-1);
$columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column-1);
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 > '')) {
$columnLetter = \PHPExcel\Cell::stringFromColumnIndex($column-1);
$objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($styleData);
$columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column-1);
$spreadsheet->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($styleData);
}
if ($columnWidth > '') {
if ($startCol == $endCol) {
$startCol = \PHPExcel\Cell::stringFromColumnIndex($startCol-1);
$objPHPExcel->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth);
$startCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCol-1);
$spreadsheet->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth);
} else {
$startCol = \PHPExcel\Cell::stringFromColumnIndex($startCol-1);
$endCol = \PHPExcel\Cell::stringFromColumnIndex($endCol-1);
$objPHPExcel->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth);
$startCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCol-1);
$endCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($endCol-1);
$spreadsheet->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth);
do {
$objPHPExcel->getActiveSheet()->getColumnDimension(++$startCol)->setWidth($columnWidth);
$spreadsheet->getActiveSheet()->getColumnDimension(++$startCol)->setWidth($columnWidth);
} while ($startCol != $endCol);
}
}
@ -444,7 +441,7 @@ class SYLK extends BaseReader implements IReader
fclose($fileHandle);
// Return
return $objPHPExcel;
return $spreadsheet;
}
/**

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel;
namespace PhpSpreadsheet;
/**
* PHPExcel_ReferenceHelper (Singleton)
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -258,7 +255,7 @@ class ReferenceHelper
($pNumCols > 0 || $pNumRows > 0) ?
uksort($aDataValidationCollection, array('self','cellReverseSort')) :
uksort($aDataValidationCollection, array('self','cellSort'));
foreach ($aDataValidationCollection as $key => $value) {
$newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows);
if ($key != $newReference) {
@ -802,17 +799,17 @@ class ReferenceHelper
/**
* 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 $newName New name
*/
public function updateNamedFormulas(Spreadsheet $pPhpExcel, $oldName = '', $newName = '')
public function updateNamedFormulas(Spreadsheet $spreadsheet, $oldName = '', $newName = '')
{
if ($oldName == '') {
return;
}
foreach ($pPhpExcel->getWorksheetIterator() as $sheet) {
foreach ($spreadsheet->getWorksheetIterator() as $sheet) {
foreach ($sheet->getCellCollection(false) as $cellID) {
$cell = $sheet->getCell($cellID);
if (($cell !== null) && ($cell->getDataType() == Cell\DataType::TYPE_FORMULA)) {

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel;
namespace PhpSpreadsheet;
/**
* PHPExcel_RichText
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_RichText
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -152,7 +149,7 @@ class RichText implements IComparable
if (is_array($pElements)) {
$this->richTextElements = $pElements;
} else {
throw new Exception("Invalid \PHPExcel\RichText\ITextElement[] array passed.");
throw new Exception("Invalid \PhpSpreadsheet\RichText\ITextElement[] array passed.");
}
return $this;
}

View File

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

View File

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

View File

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

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel;
namespace PhpSpreadsheet;
/**
* PHPExcel_Settings
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Settings
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -31,7 +28,7 @@ class Settings
{
/** constants */
/** Available Zip library classes */
const PCLZIP = '\\PHPExcel\\Shared\\ZipArchive';
const PCLZIP = '\\PhpSpreadsheet\\Shared\\ZipArchive';
const ZIPARCHIVE = '\\ZipArchive';
/** Optional Chart Rendering libraries */
@ -105,10 +102,10 @@ class Settings
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
* e.g. \PHPExcel\Settings::PCLZip or \PHPExcel\Settings::ZipArchive
* @param string $zipClass The Zip handler class that PhpSpreadsheet should use for Zip file management
* e.g. \PhpSpreadsheet\Settings::PCLZip or \PhpSpreadsheet\Settings::ZipArchive
* @return boolean Success or failure
*/
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
*
* @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
* e.g. \PHPExcel\Settings::PCLZip or \PHPExcel\Settings::ZipArchive
* e.g. \PhpSpreadsheet\Settings::PCLZip or \PhpSpreadsheet\Settings::ZipArchive
*/
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
* 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
*
* @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
* e.g. \PHPExcel\Settings::CHART_RENDERER_JPGRAPH
* e.g. \PhpSpreadsheet\Settings::CHART_RENDERER_JPGRAPH
*
* @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
* @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
* e.g. \PHPExcel\Settings::CHART_RENDERER_JPGRAPH
* e.g. \PhpSpreadsheet\Settings::CHART_RENDERER_JPGRAPH
*/
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
*/
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
* e.g. \PHPExcel\Settings::PDF_RENDERER_TCPDF,
* \PHPExcel\Settings::PDF_RENDERER_DOMPDF
* or \PHPExcel\Settings::PDF_RENDERER_MPDF
* e.g. \PhpSpreadsheet\Settings::PDF_RENDERER_TCPDF,
* \PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF
* or \PhpSpreadsheet\Settings::PDF_RENDERER_MPDF
* @param string $libraryBaseDir Directory path to the library's base folder
*
* @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
* e.g. \PHPExcel\Settings::PDF_RENDERER_TCPDF,
* \PHPExcel\Settings::PDF_RENDERER_DOMPDF
* or \PHPExcel\Settings::PDF_RENDERER_MPDF
* e.g. \PhpSpreadsheet\Settings::PDF_RENDERER_TCPDF,
* \PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF
* or \PhpSpreadsheet\Settings::PDF_RENDERER_MPDF
*
* @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
* @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
* e.g. \PHPExcel\Settings::PDF_RENDERER_TCPDF,
* \PHPExcel\Settings::PDF_RENDERER_DOMPDF
* or \PHPExcel\Settings::PDF_RENDERER_MPDF
* e.g. \PhpSpreadsheet\Settings::PDF_RENDERER_TCPDF,
* \PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF
* or \PhpSpreadsheet\Settings::PDF_RENDERER_MPDF
*/
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
*/
public static function getPdfRendererPath()

View File

@ -1,11 +1,11 @@
<?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
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Shared
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -35,7 +34,7 @@ class CodePage
*
* @param integer $codePage Microsoft Code Page Indentifier
* @return string Code Page Name
* @throws \PHPExcel\Exception
* @throws \PhpSpreadsheet\Exception
*/
public static function numberToName($codePage = 1252)
{
@ -45,7 +44,7 @@ class CodePage
case 437:
return 'CP437'; // OEM US
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:
return 'CP737'; // OEM Greek
case 775:
@ -147,12 +146,12 @@ class CodePage
case 32768:
return 'MAC'; // Apple Roman
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:
return 'UTF-7'; // Unicode (UTF-7)
case 65001:
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
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
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Shared
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@ -311,10 +310,10 @@ class Date
/**
* Is a given cell a date/time?
*
* @param \PHPExcel\Cell $pCell
* @param \PhpSpreadsheet\Cell $pCell
* @return boolean
*/
public static function isDateTime(\PHPExcel\Cell $pCell)
public static function isDateTime(\PhpSpreadsheet\Cell $pCell)
{
return self::isDateTimeFormat(
$pCell->getWorksheet()->getStyle(
@ -327,10 +326,10 @@ class Date
/**
* Is a given number format a date/time?
*
* @param \PHPExcel\Style\NumberFormat $pFormat
* @param \PhpSpreadsheet\Style\NumberFormat $pFormat
* @return boolean
*/
public static function isDateTimeFormat(\PHPExcel\Style\NumberFormat $pFormat)
public static function isDateTimeFormat(\PhpSpreadsheet\Style\NumberFormat $pFormat)
{
return self::isDateTimeFormatCode($pFormat->getFormatCode());
}
@ -346,7 +345,7 @@ class Date
*/
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)
return false;
}
@ -358,28 +357,28 @@ class Date
// Switch on formatcode
switch ($pFormatCode) {
// Explicitly defined date formats
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDD:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DDMMYYYY:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DMYSLASH:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DMYMINUS:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DMMINUS:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_MYMINUS:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DATETIME:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME1:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME2:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME3:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME5:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME6:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME7:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME8:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDDSLASH:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX14:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX15:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX16:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX17:
case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX22:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMYSLASH:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMYMINUS:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMMINUS:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_MYMINUS:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME1:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME2:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME3:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME5:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME6:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME7:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME8:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDDSLASH:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX14:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX16:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX17:
case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX22:
return true;
}
@ -425,15 +424,15 @@ class Date
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;
}
if (strpos($dateValue, ':') !== false) {
$timeValue = \PHPExcel\Calculation\DateTime::TIMEVALUE($dateValue);
if ($timeValue === \PHPExcel\Calculation\Functions::VALUE()) {
$timeValue = \PhpSpreadsheet\Calculation\DateTime::TIMEVALUE($dateValue);
if ($timeValue === \PhpSpreadsheet\Calculation\Functions::VALUE()) {
return false;
}
$dateValueNew += $timeValue;

View File

@ -1,11 +1,9 @@
<?php
namespace PHPExcel\Shared;
namespace PhpSpreadsheet\Shared;
/**
* PHPExcel_Shared_Drawing
*
* Copyright (c) 2006 - 2015 PHPExcel
* Copyright (c) 2006 - 2016 PhpSpreadsheet
*
* This library is free software; you can redistribute it and/or
* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Shared
* @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet)
* @category PhpSpreadsheet
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @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.
*
* @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
*/
public static function pixelsToCellDimension($pValue, \PHPExcel\Style\Font $pDefaultFont)
public static function pixelsToCellDimension($pValue, \PhpSpreadsheet\Style\Font $pDefaultFont)
{
// Font name and size
$name = $pDefaultFont->getName();
$size = $pDefaultFont->getSize();
if (isset(\PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size])) {
if (isset(\PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size])) {
// 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 {
// We don't have data for this particular font and size, use approximation by
// 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;
@ -86,22 +83,22 @@ class Drawing
* Convert column width from (intrinsic) Excel units to pixels
*
* @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
*/
public static function cellDimensionToPixels($pValue, \PHPExcel\Style\Font $pDefaultFont)
public static function cellDimensionToPixels($pValue, \PhpSpreadsheet\Style\Font $pDefaultFont)
{
// Font name and size
$name = $pDefaultFont->getName();
$size = $pDefaultFont->getSize();
if (isset(\PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size])) {
if (isset(\PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size])) {
// 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 {
// We don't have data for this particular font and size, use approximation by
// 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

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