示例#1
0
文件: APC.php 项目: Garybaldy/rotio
 /**
  * Get cell at a specific coordinate
  *
  * @param 	string 			$pCoord		Coordinate of the cell
  * @throws 	Exception
  * @return 	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 = apc_fetch($this->_cachePrefix . $pCoord . '.cache');
         if ($obj === false) {
             //	Entry no longer exists in APC, so clear it from the cache array
             parent::deleteCacheData($pCoord);
             throw new Exception('Cell entry no longer exists in APC');
         }
     } 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;
 }