ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_CachedObjectStorage_Wincache Class Reference
+ Inheritance diagram for PHPExcel_CachedObjectStorage_Wincache:
+ Collaboration diagram for PHPExcel_CachedObjectStorage_Wincache:

Public Member Functions

 addCacheData ($pCoord, PHPExcel_Cell $cell)
 Add or Update a cell in cache identified by coordinate address.
 isDataSet ($pCoord)
 Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
 getCacheData ($pCoord)
 Get cell at a specific coordinate.
 deleteCacheData ($pCoord)
 Delete a cell in cache identified by coordinate address.
 copyCellCollection (PHPExcel_Worksheet $parent)
 Clone the cell collection.
 unsetWorksheetCells ()
 __construct (PHPExcel_Worksheet $parent, $arguments)
 __destruct ()
- Public Member Functions inherited from PHPExcel_CachedObjectStorage_CacheBase
 __construct (PHPExcel_Worksheet $parent)
 updateCacheData (PHPExcel_Cell $cell)
 Add or Update a cell in cache.
 getCellList ()
 Get a list of all cell addresses currently held in cache.
 getSortedCellList ()
 Sort the list of all cell addresses currently held in cache by row and column.
- Public Member Functions inherited from PHPExcel_CachedObjectStorage_ICache
 updateCacheData (PHPExcel_Cell $cell)
 Add or Update a cell in cache.
 getCellList ()
 Get a list of all cell addresses currently held in cache.
 getSortedCellList ()
 Get the list of all cell addresses currently held in cache sorted by column and row.

Private Member Functions

 _storeData ()

Private Attributes

 $_cachePrefix = null
 $_cacheTime = 600

Additional Inherited Members

- Protected Member Functions inherited from PHPExcel_CachedObjectStorage_CacheBase
 _getUniqueID ()
- Protected Attributes inherited from PHPExcel_CachedObjectStorage_CacheBase
 $_parent
 $_currentObject = null
 $_currentObjectID = null
 $_cellCache = array()

Detailed Description

Definition at line 36 of file Wincache.php.

Constructor & Destructor Documentation

PHPExcel_CachedObjectStorage_Wincache::__construct ( PHPExcel_Worksheet  $parent,
  $arguments 
)

Definition at line 210 of file Wincache.php.

References PHPExcel_CachedObjectStorage_CacheBase\_getUniqueID().

{
$cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;
if (is_null($this->_cachePrefix)) {
$baseUnique = $this->_getUniqueID();
$this->_cachePrefix = substr(md5($baseUnique),0,8).'.';
$this->_cacheTime = $cacheTime;
}
} // function __construct()

+ Here is the call graph for this function:

PHPExcel_CachedObjectStorage_Wincache::__destruct ( )

Definition at line 223 of file Wincache.php.

References PHPExcel_CachedObjectStorage_CacheBase\getCellList().

Referenced by _storeData(), copyCellCollection(), and unsetWorksheetCells().

{
$cacheList = $this->getCellList();
foreach($cacheList as $cellID) {
wincache_ucache_delete($this->_cachePrefix.$cellID.'.cache');
}
} // function __destruct()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Function Documentation

PHPExcel_CachedObjectStorage_Wincache::_storeData ( )
private

Definition at line 43 of file Wincache.php.

References __destruct().

Referenced by addCacheData(), and getCacheData().

{
$this->_currentObject->detach();
$obj = serialize($this->_currentObject);
if (wincache_ucache_exists($this->_cachePrefix.$this->_currentObjectID.'.cache')) {
if (!wincache_ucache_set($this->_cachePrefix.$this->_currentObjectID.'.cache', $obj, $this->_cacheTime)) {
$this->__destruct();
throw new Exception('Failed to store cell '.$cellID.' in WinCache');
}
} else {
if (!wincache_ucache_add($this->_cachePrefix.$this->_currentObjectID.'.cache', $obj, $this->_cacheTime)) {
$this->__destruct();
throw new Exception('Failed to store cell '.$cellID.' in WinCache');
}
}
$this->_currentObjectID = $this->_currentObject = null;
} // function _storeData()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_CachedObjectStorage_Wincache::addCacheData (   $pCoord,
PHPExcel_Cell  $cell 
)

Add or Update a cell in cache identified by coordinate address.

Parameters
string$pCoordCoordinate address of the cell to update
PHPExcel_Cell$cellCell to update
Returns
void
Exceptions
Exception

Implements PHPExcel_CachedObjectStorage_ICache.

Definition at line 71 of file Wincache.php.

References _storeData().

{
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
$this->_storeData();
}
$this->_cellCache[$pCoord] = true;
$this->_currentObjectID = $pCoord;
$this->_currentObject = $cell;
return $cell;
} // function addCacheData()

+ Here is the call graph for this function:

PHPExcel_CachedObjectStorage_Wincache::copyCellCollection ( PHPExcel_Worksheet  $parent)

Clone the cell collection.

Returns
void

Reimplemented from PHPExcel_CachedObjectStorage_CacheBase.

Definition at line 169 of file Wincache.php.

References __destruct(), PHPExcel_CachedObjectStorage_CacheBase\_getUniqueID(), deleteCacheData(), and PHPExcel_CachedObjectStorage_CacheBase\getCellList().

{
// Get a new id for the new file name
$baseUnique = $this->_getUniqueID();
$newCachePrefix = substr(md5($baseUnique),0,8).'.';
$cacheList = $this->getCellList();
foreach($cacheList as $cellID) {
if ($cellID != $this->_currentObjectID) {
$success = false;
$obj = wincache_ucache_get($this->_cachePrefix.$cellID.'.cache', $success);
if ($success === false) {
// Entry no longer exists in WinCache, so clear it from the cache array
throw new Exception('Cell entry '.$cellID.' no longer exists in Wincache');
}
if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->_cacheTime)) {
$this->__destruct();
throw new Exception('Failed to store cell '.$cellID.' in Wincache');
}
}
}
$this->_cachePrefix = $newCachePrefix;
} // function copyCellCollection()

+ Here is the call graph for this function:

PHPExcel_CachedObjectStorage_Wincache::deleteCacheData (   $pCoord)

Delete a cell in cache identified by coordinate address.

Parameters
string$pCoordCoordinate address of the cell to delete
Exceptions
Exception

Reimplemented from PHPExcel_CachedObjectStorage_CacheBase.

Definition at line 155 of file Wincache.php.

Referenced by copyCellCollection(), getCacheData(), and isDataSet().

{
// Delete the entry from Wincache
wincache_ucache_delete($this->_cachePrefix.$pCoord.'.cache');
// Delete the entry from our cell address array
} // function deleteCacheData()

+ Here is the caller graph for this function:

PHPExcel_CachedObjectStorage_Wincache::getCacheData (   $pCoord)

Get cell at a specific coordinate.

Parameters
string$pCoordCoordinate of the cell
Exceptions
Exception
Returns
PHPExcel_Cell Cell that was found, or null if not found

Implements PHPExcel_CachedObjectStorage_ICache.

Definition at line 117 of file Wincache.php.

References PHPExcel_CachedObjectStorage_CacheBase\$_currentObject, _storeData(), and deleteCacheData().

{
if ($pCoord === $this->_currentObjectID) {
}
$this->_storeData();
// Check if the entry that has been requested actually exists
$obj = null;
if (parent::isDataSet($pCoord)) {
$success = false;
$obj = wincache_ucache_get($this->_cachePrefix.$pCoord.'.cache', $success);
if ($success === false) {
// Entry no longer exists in WinCache, so clear it from the cache array
throw new Exception('Cell entry '.$cellID.' no longer exists in WinCache');
}
} else {
// Return null if requested entry doesn't exist in cache
return null;
}
// Set current entry to the requested entry
$this->_currentObjectID = $pCoord;
$this->_currentObject = unserialize($obj);
// Re-attach the parent worksheet
$this->_currentObject->attach($this->_parent);
// Return requested entry
} // function getCacheData()

+ Here is the call graph for this function:

PHPExcel_CachedObjectStorage_Wincache::isDataSet (   $pCoord)

Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?

Parameters
string$pCoordCoordinate address of the cell to check
Returns
void
boolean

Reimplemented from PHPExcel_CachedObjectStorage_CacheBase.

Definition at line 91 of file Wincache.php.

References deleteCacheData().

{
// Check if the requested entry is the current object, or exists in the cache
if (parent::isDataSet($pCoord)) {
if ($this->_currentObjectID == $pCoord) {
return true;
}
// Check if the requested entry still exists in cache
$success = wincache_ucache_exists($this->_cachePrefix.$pCoord.'.cache');
if ($success === false) {
// Entry no longer exists in Wincache, so clear it from the cache array
throw new Exception('Cell entry '.$cellID.' no longer exists in WinCache');
}
return true;
}
return false;
} // function isDataSet()

+ Here is the call graph for this function:

PHPExcel_CachedObjectStorage_Wincache::unsetWorksheetCells ( )

Definition at line 194 of file Wincache.php.

References __destruct().

{
if(!is_null($this->_currentObject)) {
$this->_currentObject->detach();
$this->_currentObject = $this->_currentObjectID = null;
}
// Flush the WinCache cache
$this->__destruct();
$this->_cellCache = array();
// detach ourself from the worksheet, so that it can then delete this object successfully
$this->_parent = null;
} // function unsetWorksheetCells()

+ Here is the call graph for this function:

Field Documentation

PHPExcel_CachedObjectStorage_Wincache::$_cachePrefix = null
private

Definition at line 38 of file Wincache.php.

PHPExcel_CachedObjectStorage_Wincache::$_cacheTime = 600
private

Definition at line 40 of file Wincache.php.


The documentation for this class was generated from the following file: