MDL-44515 import latest PHPExcel 1.8.0

This commit is contained in:
Petr Škoda
2014-03-14 12:10:52 +08:00
parent c0e88129d1
commit 7ec0e0629c
229 changed files with 15154 additions and 14964 deletions
@@ -2,7 +2,7 @@
/**
* PHPExcel
*
* Copyright (c) 2006 - 2012 PHPExcel
* Copyright (c) 2006 - 2014 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,7 +20,7 @@
*
* @category PHPExcel
* @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
@@ -31,7 +31,7 @@
*
* @category PHPExcel
* @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
@@ -40,14 +40,14 @@ class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage
*
* @var string
*/
private $_fileName = null;
private $_fileName = NULL;
/**
* File handle for this cache file
*
* @var resource
*/
private $_fileHandle = null;
private $_fileHandle = NULL;
/**
* Directory/Folder where the cache file is located
@@ -62,10 +62,10 @@ class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage
* and the 'nullify' the current cell object
*
* @return void
* @throws Exception
* @throws PHPExcel_Exception
*/
private function _storeData() {
if ($this->_currentCellIsDirty) {
protected function _storeData() {
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
$this->_currentObject->detach();
fseek($this->_fileHandle,0,SEEK_END);
@@ -86,7 +86,7 @@ class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage
* @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update
* @return void
* @throws Exception
* @throws PHPExcel_Exception
*/
public function addCacheData($pCoord, PHPExcel_Cell $cell) {
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
@@ -105,7 +105,7 @@ class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage
* Get cell at a specific coordinate
*
* @param string $pCoord Coordinate of the cell
* @throws Exception
* @throws PHPExcel_Exception
* @return PHPExcel_Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord) {
@@ -124,14 +124,28 @@ class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage
$this->_currentObjectID = $pCoord;
fseek($this->_fileHandle,$this->_cellCache[$pCoord]['ptr']);
$this->_currentObject = unserialize(fread($this->_fileHandle,$this->_cellCache[$pCoord]['sz']));
// Re-attach the parent worksheet
$this->_currentObject->attach($this->_parent);
// Re-attach this as the cell's parent
$this->_currentObject->attach($this);
// Return requested entry
return $this->_currentObject;
} // function getCacheData()
/**
* Get a list of all cell addresses currently held in cache
*
* @return array of string
*/
public function getCellList() {
if ($this->_currentObjectID !== null) {
$this->_storeData();
}
return parent::getCellList();
}
/**
* Clone the cell collection
*