All constants are uppercase #25
This commit is contained in:
parent
d84d9ba730
commit
02e233634a
|
@ -12,7 +12,7 @@ PHPExcel uses an average of about 1k/cell in your worksheets, so large workbooks
|
||||||
By default, PHPExcel still holds all cell objects in memory, but you can specify alternatives. To enable cell caching, you must call the PHPExcel_Settings::setCacheStorageMethod() method, passing in the caching method that you wish to use.
|
By default, PHPExcel still holds all cell objects in memory, but you can specify alternatives. To enable cell caching, you must call the PHPExcel_Settings::setCacheStorageMethod() method, passing in the caching method that you wish to use.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_in_memory;
|
$cacheMethod = PHPExcel_CachedObjectStorageFactory::CACHE_IN_MEMORY;
|
||||||
|
|
||||||
PHPExcel_Settings::setCacheStorageMethod($cacheMethod);
|
PHPExcel_Settings::setCacheStorageMethod($cacheMethod);
|
||||||
```
|
```
|
||||||
|
@ -23,28 +23,28 @@ A separate cache is maintained for each individual worksheet, and is automatical
|
||||||
|
|
||||||
Currently, the following caching methods are available.
|
Currently, the following caching methods are available.
|
||||||
|
|
||||||
#### PHPExcel_CachedObjectStorageFactory::cache_in_memory
|
#### PHPExcel_CachedObjectStorageFactory::CACHE_IN_MEMORY
|
||||||
|
|
||||||
The default. If you don't initialise any caching method, then this is the method that PHPExcel will use. Cell objects are maintained in PHP memory as at present.
|
The default. If you don't initialise any caching method, then this is the method that PHPExcel will use. Cell objects are maintained in PHP memory as at present.
|
||||||
|
|
||||||
#### PHPExcel_CachedObjectStorageFactory::cache_in_memory_serialized
|
#### PHPExcel_CachedObjectStorageFactory::CACHE_IN_MEMORY_SERIALIZED
|
||||||
|
|
||||||
Using this caching method, cells are held in PHP memory as an array of serialized objects, which reduces the memory footprint with minimal performance overhead.
|
Using this caching method, cells are held in PHP memory as an array of serialized objects, which reduces the memory footprint with minimal performance overhead.
|
||||||
|
|
||||||
#### PHPExcel_CachedObjectStorageFactory::cache_in_memory_gzip
|
#### PHPExcel_CachedObjectStorageFactory::CACHE_IN_MEMORY_GZIP
|
||||||
|
|
||||||
Like cache_in_memory_serialized, this method holds cells in PHP memory as an array of serialized objects, but gzipped to reduce the memory usage still further, although access to read or write a cell is slightly slower.
|
Like cache_in_memory_serialized, this method holds cells in PHP memory as an array of serialized objects, but gzipped to reduce the memory usage still further, although access to read or write a cell is slightly slower.
|
||||||
|
|
||||||
#### PHPExcel_CachedObjectStorageFactory::cache_igbinary
|
#### PHPExcel_CachedObjectStorageFactory::CACHE_IGBINARY
|
||||||
|
|
||||||
Uses PHPs igbinary extension (if its available) to serialize cell objects in memory. This is normally faster and uses less memory than standard PHP serialization, but isnt available in most hosting environments.
|
Uses PHPs igbinary extension (if its available) to serialize cell objects in memory. This is normally faster and uses less memory than standard PHP serialization, but isnt available in most hosting environments.
|
||||||
|
|
||||||
#### PHPExcel_CachedObjectStorageFactory::cache_to_discISAM
|
#### PHPExcel_CachedObjectStorageFactory::CACHE_TO_DISCISAM
|
||||||
|
|
||||||
When using cache_to_discISAM all cells are held in a temporary disk file, with only an index to their location in that file maintained in PHP memory. This is slower than any of the cache_in_memory methods, but significantly reduces the memory footprint. By default, PHPExcel will use PHP's temp directory for the cache file, but you can specify a different directory when initialising cache_to_discISAM.
|
When using CACHE_TO_DISCISAM all cells are held in a temporary disk file, with only an index to their location in that file maintained in PHP memory. This is slower than any of the CACHE_IN_MEMORY methods, but significantly reduces the memory footprint. By default, PHPExcel will use PHP's temp directory for the cache file, but you can specify a different directory when initialising CACHE_TO_DISCISAM.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$cacheMethod = PHPExcel_CachedObjectStorageFactory:: cache_to_discISAM;
|
$cacheMethod = PHPExcel_CachedObjectStorageFactory::CACHE_TO_DISCISAM;
|
||||||
$cacheSettings = array(
|
$cacheSettings = array(
|
||||||
'dir' => '/usr/local/tmp'
|
'dir' => '/usr/local/tmp'
|
||||||
);
|
);
|
||||||
|
@ -53,12 +53,12 @@ PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
|
||||||
|
|
||||||
The temporary disk file is automatically deleted when your script terminates.
|
The temporary disk file is automatically deleted when your script terminates.
|
||||||
|
|
||||||
#### PHPExcel_CachedObjectStorageFactory::cache_to_phpTemp
|
#### 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.
|
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.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$cacheMethod = PHPExcel_CachedObjectStorageFactory:: cache_to_phpTemp;
|
$cacheMethod = PHPExcel_CachedObjectStorageFactory::CACHE_TO_PHPTEMP;
|
||||||
$cacheSettings = array(
|
$cacheSettings = array(
|
||||||
'memoryCacheSize' => '8MB'
|
'memoryCacheSize' => '8MB'
|
||||||
);
|
);
|
||||||
|
@ -67,12 +67,12 @@ PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
|
||||||
|
|
||||||
The php://temp file is automatically deleted when your script terminates.
|
The php://temp file is automatically deleted when your script terminates.
|
||||||
|
|
||||||
#### PHPExcel_CachedObjectStorageFactory::cache_to_apc
|
#### PHPExcel_CachedObjectStorageFactory::CACHE_TO_APC
|
||||||
|
|
||||||
When using cache_to_apc, cell objects are maintained in APC 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.
|
When using CACHE_TO_APC, cell objects are maintained in APC 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.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_APC;
|
$cacheMethod = PHPExcel_CachedObjectStorageFactory::CACHE_TO_APC;
|
||||||
$cacheSettings = array(
|
$cacheSettings = array(
|
||||||
'cacheTime' => 600
|
'cacheTime' => 600
|
||||||
);
|
);
|
||||||
|
@ -81,14 +81,14 @@ 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.
|
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
|
#### PHPExcel_CachedObjectStorageFactory::CACHE_TO_MEMCACHE
|
||||||
|
|
||||||
When using cache_to_memcache, cell objects are maintained in memcache with only an index maintained in PHP memory to identify that the cell exists.
|
When using CACHE_TO_MEMCACHE, cell objects are maintained in memcache 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:
|
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:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_memcache;
|
$cacheMethod = PHPExcel_CachedObjectStorageFactory::CACHE_TO_MEMCACHE;
|
||||||
$cacheSettings = array(
|
$cacheSettings = array(
|
||||||
'memcacheServer' => 'localhost',
|
'memcacheServer' => 'localhost',
|
||||||
'memcachePort' => 11211,
|
'memcachePort' => 11211,
|
||||||
|
@ -99,12 +99,12 @@ 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.
|
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
|
#### PHPExcel_CachedObjectStorageFactory::CACHE_TO_WINCACHE
|
||||||
|
|
||||||
When using cache_to_wincache, cell objects are maintained in Wincache 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.
|
When using CACHE_TO_WINCACHE, cell objects are maintained in Wincache 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.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_wincache;
|
$cacheMethod = PHPExcel_CachedObjectStorageFactory::CACHE_TO_WINCACHE;
|
||||||
$cacheSettings = array(
|
$cacheSettings = array(
|
||||||
'cacheTime' => 600
|
'cacheTime' => 600
|
||||||
);
|
);
|
||||||
|
@ -113,11 +113,11 @@ 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.
|
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.
|
||||||
|
|
||||||
#### PHPExcel_CachedObjectStorageFactory::cache_to_sqlite
|
#### PHPExcel_CachedObjectStorageFactory::CACHE_TO_SQLITE
|
||||||
|
|
||||||
Uses an SQLite 2 "in-memory" database for caching cell data. Unlike other caching methods, neither cells nor an index are held in PHP memory - an indexed database table makes it unnecessary to hold any index in PHP memory, which makes this the most memory-efficient of the cell caching methods.
|
Uses an SQLite 2 "in-memory" database for caching cell data. Unlike other caching methods, neither cells nor an index are held in PHP memory - an indexed database table makes it unnecessary to hold any index in PHP memory, which makes this the most memory-efficient of the cell caching methods.
|
||||||
|
|
||||||
#### PHPExcel_CachedObjectStorageFactory::cache_to_sqlite3;
|
#### PHPExcel_CachedObjectStorageFactory::CACHE_TO_SQLITE3;
|
||||||
|
|
||||||
Uses an SQLite 3 "in-memory" database for caching cell data. Unlike other caching methods, neither cells nor an index are held in PHP memory - an indexed database table makes it unnecessary to hold any index in PHP memory, which makes this the most memory-efficient of the cell caching methods.
|
Uses an SQLite 3 "in-memory" database for caching cell data. Unlike other caching methods, neither cells nor an index are held in PHP memory - an indexed database table makes it unnecessary to hold any index in PHP memory, which makes this the most memory-efficient of the cell caching methods.
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ class Settings
|
||||||
* Set the Zip handler Class that PhpSpreadsheet should use for Zip file management (PCLZip or ZipArchive)
|
* Set the Zip handler Class that PhpSpreadsheet should use for Zip file management (PCLZip or ZipArchive)
|
||||||
*
|
*
|
||||||
* @param string $zipClass The Zip handler class that PhpSpreadsheet should use for Zip file management
|
* @param string $zipClass The Zip handler class that PhpSpreadsheet should use for Zip file management
|
||||||
* e.g. \PhpOffice\PhpSpreadsheet\Settings::PCLZip or \PhpOffice\PhpSpreadsheet\Settings::ZipArchive
|
* e.g. \PhpOffice\PhpSpreadsheet\Settings::PCLZIP or \PhpOffice\PhpSpreadsheet\Settings::ZIPARCHIVE
|
||||||
* @return bool Success or failure
|
* @return bool Success or failure
|
||||||
*/
|
*/
|
||||||
public static function setZipClass($zipClass)
|
public static function setZipClass($zipClass)
|
||||||
|
@ -122,7 +122,7 @@ class Settings
|
||||||
*
|
*
|
||||||
* @return string Name of the Zip handler Class that PhpSpreadsheet is configured to use
|
* @return string Name of the Zip handler Class that PhpSpreadsheet is configured to use
|
||||||
* for Zip file management
|
* for Zip file management
|
||||||
* e.g. \PhpOffice\PhpSpreadsheet\Settings::PCLZip or \PhpOffice\PhpSpreadsheet\Settings::ZipArchive
|
* e.g. \PhpOffice\PhpSpreadsheet\Settings::PCLZIP or \PhpOffice\PhpSpreadsheet\Settings::ZIPARCHIVE
|
||||||
*/
|
*/
|
||||||
public static function getZipClass()
|
public static function getZipClass()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue