Example #1
0
 public function __construct(Unsee_Hash $hash, $imgKey = null)
 {
     $newImage = is_null($imgKey);
     if ($newImage) {
         $imgKey = uniqid();
     }
     parent::__construct($hash->key . '_' . $imgKey);
     if ($newImage) {
         $keys = Unsee_Image::keys($hash->key . '*');
         $this->num = count($keys);
         $this->expireAt(time() + $hash->ttl());
     }
     $this->setSecureParams();
 }
Example #2
0
 public function __construct()
 {
     parent::__construct(Unsee_Session::getCurrent());
     $this->expireAt(time() + static::$ttl);
 }
Example #3
0
 public static function keys($keys)
 {
     $redis = Zend_Registry::get('Redis');
     $redis->select(static::DB);
     self::$prevDb = static::DB;
     return $redis->keys($keys);
 }
Example #4
0
 /**
  * Deletes the hash
  */
 public function delete()
 {
     // Delete images
     $images = $this->getImages();
     foreach ($images as $item) {
         $item->delete();
     }
     parent::delete();
 }