예제 #1
0
 /**
  * Returns value under given key from cache
  *
  * @param string $key
  *
  * @return null|array
  */
 public function get($key)
 {
     $cachePath = $this->createCachePath($key);
     if (!$this->backend->has($cachePath)) {
         return null;
     }
     return unserialize($this->backend->read($cachePath));
 }
 /**
  * Loads existing resized image image from a backend
  */
 public function load()
 {
     $thumbnailMetadata = $this->backend->getWithMetadata($this->getFilePath(), array('mimetype', 'timestamp'));
     $this->timestamp = $thumbnailMetadata['timestamp'];
     $this->resizedImageSize = $thumbnailMetadata['size'];
     $this->resizedImageMimeType = $thumbnailMetadata['mimetype'];
     $this->resizedImageData = $this->backend->read($this->getFilePath());
 }