73 self::cache_in_memory,
74 self::cache_in_memory_gzip,
75 self::cache_in_memory_serialized,
77 self::cache_to_phpTemp,
78 self::cache_to_discISAM,
80 self::cache_to_memcache,
81 self::cache_to_wincache,
82 self::cache_to_sqlite,
83 self::cache_to_sqlite3,
93 self::cache_in_memory => array(
95 self::cache_in_memory_gzip => array(
97 self::cache_in_memory_serialized => array(
99 self::cache_igbinary => array(
101 self::cache_to_phpTemp => array(
'memoryCacheSize' =>
'1MB'
103 self::cache_to_discISAM => array(
'dir' => NULL
105 self::cache_to_apc => array(
'cacheTime' => 600
107 self::cache_to_memcache => array(
'memcacheServer' =>
'localhost',
108 'memcachePort' => 11211,
111 self::cache_to_wincache => array(
'cacheTime' => 600
113 self::cache_to_sqlite => array(
115 self::cache_to_sqlite3 => array(
168 $activeMethods = array();
169 foreach(self::$_storageMethods as $storageMethod) {
170 $cacheStorageClass =
'PHPExcel_CachedObjectStorage_' . $storageMethod;
171 if (call_user_func(array($cacheStorageClass,
'cacheMethodIsAvailable'))) {
172 $activeMethods[] = $storageMethod;
175 return $activeMethods;
187 public static function initialize($method = self::cache_in_memory, $arguments = array())
189 if (!in_array($method,self::$_storageMethods)) {
193 $cacheStorageClass =
'PHPExcel_CachedObjectStorage_'.$method;
194 if (!call_user_func(array( $cacheStorageClass,
195 'cacheMethodIsAvailable'))) {
199 self::$_storageMethodParameters[$method] = self::$_storageMethodDefaultParameters[$method];
200 foreach($arguments as $k => $v) {
201 if (array_key_exists($k, self::$_storageMethodParameters[$method])) {
202 self::$_storageMethodParameters[$method][$k] = $v;
206 if (self::$_cacheStorageMethod === NULL) {
207 self::$_cacheStorageClass =
'PHPExcel_CachedObjectStorage_' . $method;
208 self::$_cacheStorageMethod = $method;
222 $cacheMethodIsAvailable = TRUE;
223 if (self::$_cacheStorageMethod === NULL) {
227 if ($cacheMethodIsAvailable) {
229 self::$_storageMethodParameters[self::$_cacheStorageMethod]
231 if ($instance !== NULL) {
246 self::$_cacheStorageMethod = NULL;
247 self::$_cacheStorageClass = NULL;
248 self::$_storageMethodParameters = array();
An exception for terminatinating execution or to throw for unit testing.
static $_storageMethodParameters
static $_cacheStorageMethod
static getInstance(PHPExcel_Worksheet $parent)
Initialise the cache storage.
static getCacheStorageClass()
Return the current cache storage class.
static getCacheStorageMethods()
Return the list of all available cache storage methods.
static $_storageMethodDefaultParameters
const cache_in_memory_gzip
static getCacheStorageMethod()
Return the current cache storage method.
static initialize($method=self::cache_in_memory, $arguments=array())
Identify the cache storage method to use.
static finalize()
Clear the cache storage.
static getAllCacheStorageMethods()
Return the list of all possible cache storage methods.
const cache_in_memory_serialized
static $_cacheStorageClass