コード例 #1
0
 /**
  * Saves the resized image in backend
  *
  * @return bool true if saved successfully
  */
 public function save()
 {
     if (!$this->backend->hasDirectory($this->getDirectory())) {
         $this->backend->createDir($this->getDirectory());
     }
     $saved = $this->backend->put($this->getFilePath(), $this->resizedImageData);
     if ($saved) {
         $this->timestamp = time();
     }
     return $saved;
 }
コード例 #2
0
 /**
  * Sets the value in cache under given key
  *
  * @param string $key
  * @param mixed  $value
  *
  * @return bool true if successful
  */
 public function set($key, $value)
 {
     return $this->backend->put($this->createCachePath($key), serialize($value));
 }