PHPExcel_CachedObjectStorageFactory::cache_to_phpTemp;
Like cache_to_discISAM, when using cache_to_phpTemp all cells are held in the php://temp I/O
stream, with only an index to their location maintained in PHP memory. In PHP, the php://memory
wrapper stores data in the memory: php://temp behaves similarly, but uses a temporary file for
storing the data when a certain memory limit is reached. The default is 1 MB, but you can change
this when initialising cache_to_phpTemp.
$cacheMethod = PHPExcel_CachedObjectStorageFactory:: cache_to_phpTemp;
$cacheSettings = array( ' memoryCacheSize ' => '8MB'
);
PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
The php://temp file is automatically deleted when your script terminates.
PHPExcel_CachedObjectStorageFactory::cache_to_apc;
When using cache_to_apc, cell objects are maintained in APC
1
with only an index maintained in PHP
memory to identify that the cell exists. By default, an APC cache timeout of 600 seconds is used,
which should be enough for most applications: although it is possible to change this when initialising
cache_to_APC.
$cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_APC;
$cacheSettings = array( 'cacheTime' => 600
);
PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
When your script terminates all entries will be cleared from APC, regardless of the cacheTime
value, so it cannot be used for persistent storage using this mechanism.
PHPExcel_CachedObjectStorageFactory::cache_to_memcache
When using cache_to_memcache, cell objects are maintained in memcache
2
with only an index
maintained in PHP memory to identify that the cell exists.
By default, PHPExcel looks for a memcache server on localhost at port 11211. It also sets a
memcache timeout limit of 600 seconds. If you are running memcache on a different server or port,
then you can change these defaults when you initialise cache_to_memcache:
$cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_memcache;
$cacheSettings = array( 'memcacheServer' => 'localhost',
'memcachePort' => 11211,
'cacheTime' => 600
);
PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
When your script terminates all entries will be cleared from memcache, regardless of the
cacheTime value, so it cannot be used for persistent storage using this mechanism.
PHPExcel_CachedObjectStorageFactory::cache_to_wincache;
When using cache_to_wincache, cell objects are maintained in Wincache
3
with only an index
maintained in PHP memory to identify that the cell exists. By default, a Wincache cache timeout of
600 seconds is used, which should be enough for most applications: although it is possible to change
this when initialising cache_to_wincache.
$cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_wincache;
$cacheSettings = array( 'cacheTime' => 600
);
PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
When your script terminates all entries will be cleared from Wincache, regardless of the cacheTime
value, so it cannot be used for persistent storage using this mechanism.
1
You must have APC enabled for PHP to use this option.
2
You must have a memcache server running, and have enabled memcache for your PHP to use this
option.
3
You must have Wincache enabled for PHP to use this option.
PHPExcel Developer Documentation
10