From fc62320de8ef8501855a9a7bdaf4271f179e3d6f Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Fri, 9 Dec 2011 12:19:54 +0000 Subject: [PATCH] modify cell cache getInstance() method to validate response from initialize() if it hasn't been called explicitly by a user call git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@83743 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/CachedObjectStorageFactory.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Classes/PHPExcel/CachedObjectStorageFactory.php b/Classes/PHPExcel/CachedObjectStorageFactory.php index 849de05a..47776286 100644 --- a/Classes/PHPExcel/CachedObjectStorageFactory.php +++ b/Classes/PHPExcel/CachedObjectStorageFactory.php @@ -125,12 +125,14 @@ class PHPExcel_CachedObjectStorageFactory { public static function getInstance(PHPExcel_Worksheet $parent) { if (is_null(self::$_cacheStorageMethod)) { - self::initialize(); + $cacheMethodIsAvailable = self::initialize(); } - $instance = new self::$_cacheStorageClass($parent,self::$_storageMethodParameters[self::$_cacheStorageMethod]); - if (!is_null($instance)) { - return $instance; + if ($cacheMethodIsAvailable) { + $instance = new self::$_cacheStorageClass($parent,self::$_storageMethodParameters[self::$_cacheStorageMethod]); + if (!is_null($instance)) { + return $instance; + } } return false;