Exemplo n.º 1
0
 /**
  * Get cell at a specific coordinate
  *
  * @param 	string 			$pCoord		Coordinate of the cell
  * @throws 	PHPExcel_Exception
  * @return 	PHPExcel_Cell 	Cell that was found, or null if not found
  */
 public function getCacheData($pCoord)
 {
     if ($pCoord === $this->_currentObjectID) {
         return $this->_currentObject;
     }
     $this->_storeData();
     //	Check if the entry that has been requested actually exists
     if (parent::isDataSet($pCoord)) {
         $obj = $this->_memcache->get($this->_cachePrefix . $pCoord . '.cache');
         if ($obj === false) {
             //	Entry no longer exists in Memcache, so clear it from the cache array
             parent::deleteCacheData($pCoord);
             throw new PHPExcel_Exception('Cell entry ' . $pCoord . ' no longer exists in MemCache');
         }
     } 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 this as the cell's parent
     $this->_currentObject->attach($this);
     //	Return requested entry
     return $this->_currentObject;
 }
Exemplo n.º 2
0
 /**
  * Get cell at a specific coordinate
  *
  * @param	string			$pCoord		Coordinate of the cell
  * @throws	Exception
  * @return	PHPExcel_Cell	Cell that was found, or null if not found
  */
 public function getCacheData($pCoord)
 {
     if ($pCoord === $this->_currentObjectID) {
         return $this->_currentObject;
     }
     $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
             parent::deleteCacheData($pCoord);
             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
     return $this->_currentObject;
 }