Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

Commit

Permalink
Bugfix: Work Item GH-193 - Fix to empty worksheet garbage collection …
Browse files Browse the repository at this point in the history
…when using cell caching
  • Loading branch information
Mark Baker committed Dec 29, 2013
1 parent 30070f3 commit 2bcaa01
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Classes/PHPExcel/CachedObjectStorage/APC.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach
* @throws PHPExcel_Exception
*/
protected function _storeData() {
if ($this->_currentCellIsDirty) {
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
$this->_currentObject->detach();

if (!apc_store($this->_cachePrefix.$this->_currentObjectID.'.cache',serialize($this->_currentObject),$this->_cacheTime)) {
Expand Down
2 changes: 1 addition & 1 deletion Classes/PHPExcel/CachedObjectStorage/DiscISAM.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage
* @throws PHPExcel_Exception
*/
protected function _storeData() {
if ($this->_currentCellIsDirty) {
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
$this->_currentObject->detach();

fseek($this->_fileHandle,0,SEEK_END);
Expand Down
2 changes: 1 addition & 1 deletion Classes/PHPExcel/CachedObjectStorage/Igbinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class PHPExcel_CachedObjectStorage_Igbinary extends PHPExcel_CachedObjectStorage
* @throws PHPExcel_Exception
*/
protected function _storeData() {
if ($this->_currentCellIsDirty) {
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
$this->_currentObject->detach();

$this->_cellCache[$this->_currentObjectID] = igbinary_serialize($this->_currentObject);
Expand Down
2 changes: 1 addition & 1 deletion Classes/PHPExcel/CachedObjectStorage/Memcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage
* @throws PHPExcel_Exception
*/
protected function _storeData() {
if ($this->_currentCellIsDirty) {
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
$this->_currentObject->detach();

$obj = serialize($this->_currentObject);
Expand Down
2 changes: 1 addition & 1 deletion Classes/PHPExcel/CachedObjectStorage/MemoryGZip.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class PHPExcel_CachedObjectStorage_MemoryGZip extends PHPExcel_CachedObjectStora
* @throws PHPExcel_Exception
*/
protected function _storeData() {
if ($this->_currentCellIsDirty) {
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
$this->_currentObject->detach();

$this->_cellCache[$this->_currentObjectID] = gzdeflate(serialize($this->_currentObject));
Expand Down
2 changes: 1 addition & 1 deletion Classes/PHPExcel/CachedObjectStorage/MemorySerialized.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjec
* @throws PHPExcel_Exception
*/
protected function _storeData() {
if ($this->_currentCellIsDirty) {
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
$this->_currentObject->detach();

$this->_cellCache[$this->_currentObjectID] = serialize($this->_currentObject);
Expand Down
2 changes: 1 addition & 1 deletion Classes/PHPExcel/CachedObjectStorage/PHPTemp.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_
* @throws PHPExcel_Exception
*/
protected function _storeData() {
if ($this->_currentCellIsDirty) {
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
$this->_currentObject->detach();

fseek($this->_fileHandle,0,SEEK_END);
Expand Down
2 changes: 1 addition & 1 deletion Classes/PHPExcel/CachedObjectStorage/SQLite.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class PHPExcel_CachedObjectStorage_SQLite extends PHPExcel_CachedObjectStorage_C
* @throws PHPExcel_Exception
*/
protected function _storeData() {
if ($this->_currentCellIsDirty) {
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
$this->_currentObject->detach();

if (!$this->_DBHandle->queryExec("INSERT OR REPLACE INTO kvp_".$this->_TableName." VALUES('".$this->_currentObjectID."','".sqlite_escape_string(serialize($this->_currentObject))."')"))
Expand Down
2 changes: 1 addition & 1 deletion Classes/PHPExcel/CachedObjectStorage/SQLite3.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class PHPExcel_CachedObjectStorage_SQLite3 extends PHPExcel_CachedObjectStorage_
* @throws PHPExcel_Exception
*/
protected function _storeData() {
if ($this->_currentCellIsDirty) {
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
$this->_currentObject->detach();

$this->_insertQuery->bindValue('id',$this->_currentObjectID,SQLITE3_TEXT);
Expand Down
2 changes: 1 addition & 1 deletion Classes/PHPExcel/CachedObjectStorage/Wincache.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PHPExcel_CachedObjectStorage_Wincache extends PHPExcel_CachedObjectStorage
* @throws PHPExcel_Exception
*/
protected function _storeData() {
if ($this->_currentCellIsDirty) {
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
$this->_currentObject->detach();

$obj = serialize($this->_currentObject);
Expand Down
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Fixed in develop branch for release v1.8.0:
- Bugfix: (PowerKiKi) Work Item GH-270/GH-31 - Binary comparison of strings are case insensitive
- Bugfix: (MBaker) Work Item GH-275 - Insert New Row/Column Before is not correctly updating formula references
- Bugfix: (MBaker) Work Item GH-257 - Passing an array of cells to _generateRow() in the HTML/PDF Writer causes caching problems with last cell in the range
- Bugfix: (MBaker) Work Item GH-193 - Fix to empty worksheet garbage collection when using cell caching
- Feature: (amerov) - Implementation of the Excel HLOOKUP() function
- Feature: (MBaker) - Added "Quote Prefix" to style settings (Excel2007 Reader and Writer only)
- Feature: (MBaker) - Added Horizontal FILL alignment for Excel5 and Excel2007 Readers/Writers, and Horizontal DISTRIBUTED alignment for Excel2007 Reader/Writer
Expand Down

0 comments on commit 2bcaa01

Please sign in to comment.