Ejemplo 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
     $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 \PHPExcel\Exception('Cell entry ' . $pCoord . ' 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 this as the cell's parent
     $this->currentObject->attach($this);
     //    Return requested entry
     return $this->currentObject;
 }