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
This commit is contained in:
Mark Baker 2011-12-09 12:19:54 +00:00
parent cd7f0a1c51
commit fc62320de8
1 changed files with 6 additions and 4 deletions

View File

@ -125,12 +125,14 @@ class PHPExcel_CachedObjectStorageFactory {
public static function getInstance(PHPExcel_Worksheet $parent) { public static function getInstance(PHPExcel_Worksheet $parent) {
if (is_null(self::$_cacheStorageMethod)) { if (is_null(self::$_cacheStorageMethod)) {
self::initialize(); $cacheMethodIsAvailable = self::initialize();
} }
$instance = new self::$_cacheStorageClass($parent,self::$_storageMethodParameters[self::$_cacheStorageMethod]); if ($cacheMethodIsAvailable) {
if (!is_null($instance)) { $instance = new self::$_cacheStorageClass($parent,self::$_storageMethodParameters[self::$_cacheStorageMethod]);
return $instance; if (!is_null($instance)) {
return $instance;
}
} }
return false; return false;