diff --git a/Classes/PHPExcel/CachedObjectStorage/APC.php b/Classes/PHPExcel/CachedObjectStorage/APC.php index f6d974fe..56ae7f8b 100644 --- a/Classes/PHPExcel/CachedObjectStorage/APC.php +++ b/Classes/PHPExcel/CachedObjectStorage/APC.php @@ -46,7 +46,7 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach if (!apc_store($this->_cachePrefix.$this->_currentObjectID.'.cache',serialize($this->_currentObject),$this->_cacheTime)) { $this->__destruct(); - throw new Exception('Failed to store cell '.$cellID.' in APC'); + throw new Exception('Failed to store cell '.$this->_currentObjectID.' in APC'); } $this->_currentCellIsDirty = false; } @@ -94,7 +94,7 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach if ($success === false) { // Entry no longer exists in APC, so clear it from the cache array parent::deleteCacheData($pCoord); - throw new Exception('Cell entry '.$cellID.' no longer exists in APC'); + throw new Exception('Cell entry '.$pCoord.' no longer exists in APC'); } return true; } @@ -121,7 +121,7 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach if ($obj === false) { // Entry no longer exists in APC, so clear it from the cache array parent::deleteCacheData($pCoord); - throw new Exception('Cell entry '.$cellID.' no longer exists in APC'); + throw new Exception('Cell entry '.$pCoord.' no longer exists in APC'); } } else { // Return null if requested entry doesn't exist in cache diff --git a/Classes/PHPExcel/CachedObjectStorage/DiscISAM.php b/Classes/PHPExcel/CachedObjectStorage/DiscISAM.php index 84ffcc95..8a6f1508 100644 --- a/Classes/PHPExcel/CachedObjectStorage/DiscISAM.php +++ b/Classes/PHPExcel/CachedObjectStorage/DiscISAM.php @@ -38,6 +38,8 @@ class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage private $_fileName = null; private $_fileHandle = null; + private $_cacheDirectory = NULL; + private function _storeData() { if ($this->_currentCellIsDirty) { @@ -116,7 +118,7 @@ class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage parent::copyCellCollection($parent); // Get a new id for the new file name $baseUnique = $this->_getUniqueID(); - $newFileName = PHPExcel_Shared_File::sys_get_temp_dir().'/PHPExcel.'.$baseUnique.'.cache'; + $newFileName = $this->_cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache'; // Copy the existing cell cache file copy ($this->_fileName,$newFileName); $this->_fileName = $newFileName; @@ -140,11 +142,15 @@ class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage } // function unsetWorksheetCells() - public function __construct(PHPExcel_Worksheet $parent) { + public function __construct(PHPExcel_Worksheet $parent, $arguments) { + $this->_cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== NULL)) + ? $arguments['dir'] + : PHPExcel_Shared_File::sys_get_temp_dir(); + parent::__construct($parent); if (is_null($this->_fileHandle)) { $baseUnique = $this->_getUniqueID(); - $this->_fileName = PHPExcel_Shared_File::sys_get_temp_dir().'/PHPExcel.'.$baseUnique.'.cache'; + $this->_fileName = $this->_cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache'; $this->_fileHandle = fopen($this->_fileName,'a+'); } } // function __construct() diff --git a/Classes/PHPExcel/CachedObjectStorage/Memcache.php b/Classes/PHPExcel/CachedObjectStorage/Memcache.php index 28b74e39..4a134105 100644 --- a/Classes/PHPExcel/CachedObjectStorage/Memcache.php +++ b/Classes/PHPExcel/CachedObjectStorage/Memcache.php @@ -50,7 +50,7 @@ class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage 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 Exception('Failed to store cell '.$cellID.' in MemCache'); + throw new Exception('Failed to store cell '.$this->_currentObjectID.' in MemCache'); } } $this->_currentCellIsDirty = false; @@ -99,7 +99,7 @@ class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage if ($success === false) { // Entry no longer exists in Memcache, so clear it from the cache array parent::deleteCacheData($pCoord); - throw new Exception('Cell entry '.$cellID.' no longer exists in MemCache'); + throw new Exception('Cell entry '.$pCoord.' no longer exists in MemCache'); } return true; } @@ -126,7 +126,7 @@ class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage if ($obj === false) { // Entry no longer exists in Memcache, so clear it from the cache array parent::deleteCacheData($pCoord); - throw new Exception('Cell entry '.$cellID.' no longer exists in MemCache'); + throw new Exception('Cell entry '.$pCoord.' no longer exists in MemCache'); } } else { // Return null if requested entry doesn't exist in cache diff --git a/Classes/PHPExcel/CachedObjectStorage/Wincache.php b/Classes/PHPExcel/CachedObjectStorage/Wincache.php index 14435b13..93ce9549 100644 --- a/Classes/PHPExcel/CachedObjectStorage/Wincache.php +++ b/Classes/PHPExcel/CachedObjectStorage/Wincache.php @@ -48,12 +48,12 @@ class PHPExcel_CachedObjectStorage_Wincache extends PHPExcel_CachedObjectStorage 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 Exception('Failed to store cell '.$cellID.' in WinCache'); + throw new 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 Exception('Failed to store cell '.$cellID.' in WinCache'); + throw new Exception('Failed to store cell '.$this->_currentObjectID.' in WinCache'); } } $this->_currentCellIsDirty = false; @@ -103,7 +103,7 @@ class PHPExcel_CachedObjectStorage_Wincache extends PHPExcel_CachedObjectStorage if ($success === false) { // Entry no longer exists in Wincache, so clear it from the cache array parent::deleteCacheData($pCoord); - throw new Exception('Cell entry '.$cellID.' no longer exists in WinCache'); + throw new Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); } return true; } @@ -132,7 +132,7 @@ class PHPExcel_CachedObjectStorage_Wincache extends PHPExcel_CachedObjectStorage if ($success === false) { // Entry no longer exists in WinCache, so clear it from the cache array parent::deleteCacheData($pCoord); - throw new Exception('Cell entry '.$cellID.' no longer exists in WinCache'); + throw new Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); } } else { // Return null if requested entry doesn't exist in cache diff --git a/Classes/PHPExcel/CachedObjectStorageFactory.php b/Classes/PHPExcel/CachedObjectStorageFactory.php index d4c94797..cd402b23 100644 --- a/Classes/PHPExcel/CachedObjectStorageFactory.php +++ b/Classes/PHPExcel/CachedObjectStorageFactory.php @@ -37,7 +37,7 @@ class PHPExcel_CachedObjectStorageFactory { ), self::cache_to_phpTemp => array( 'memoryCacheSize' => '1MB' ), - self::cache_to_discISAM => array( + self::cache_to_discISAM => array( 'dir' => NULL ), self::cache_to_apc => array( 'cacheTime' => 600 ), diff --git a/Documentation/PHPExcel developer documentation.doc b/Documentation/PHPExcel developer documentation.doc index 563ece1a..02b7839d 100644 Binary files a/Documentation/PHPExcel developer documentation.doc and b/Documentation/PHPExcel developer documentation.doc differ diff --git a/changelog.txt b/changelog.txt index ee582a8c..3015f5c4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -39,8 +39,10 @@ Fixed in SVN: - Bugfix: (MBaker) Work item 16246 - reader/CSV fails on this file auto_detect_line_endings now set in CSV reader - Bugfix: (MBaker) Work item 16212 - $arguments improperly used in CachedObjectStorage/PHPTemp.php -- General: (MBaker) Work item 15405 - Two easy to fix Issues concerning PHPExcel_Token_Stack (l10n/UC) -- General: (MBaker) Work item 15461 - Locale file paths not fit for windows +- Bugfix: (MBaker) Work item 16643 - Bug In Cache System (cell reference when throwing caching errors) +- General: (MBaker) Work item 15405 - Two easy to fix Issues concerning PHPExcel_Token_Stack (l10n/UC) +- General: (MBaker) Work item 15461 - Locale file paths not fit for windows +- General: (MBaker) Work item 16643 - Add file directory as a cache option for cache_to_discISAM 2011-02-27 (v1.7.6):