Added a cacheMethodIsAvailable() method to all cell cache classes, making it easier to identify if all the necessary classes/functions are available for each caching option.

Renamed the factory getCacheStorageMethods() method to getAllCacheStorageMethods(), returning all cache options in the library.
Wrote a new factory getCacheStorageMethods() method to return an array of those cache methods that are available with the current build of PHP (extensions tested, etc).
Refactored factory initialize() method to use the cacheMethodIsAvailable(), so factoring the logic for testing methods out of the factory.

git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@83741 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker
2011-12-09 12:10:46 +00:00
parent 93e8a05780
commit cd7f0a1c51
9 changed files with 127 additions and 35 deletions
@@ -227,4 +227,19 @@ class PHPExcel_CachedObjectStorage_SQLite3 extends PHPExcel_CachedObjectStorage_
$this->_DBHandle = null;
} // function __destruct()
/**
* Identify whether the caching method is currently available
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build
*
* @return boolean
*/
public static function cacheMethodIsAvailable() {
if (!class_exists('SQLite3')) {
return false;
}
return true;
}
}