ceallan

ceallan

<?= 'say hello!' ?>

  • 财富值967
  • 威望值35
  • 总积分1437

个人信息

  • 2015-05-27 已签到
    连续签到22天,获得了20个金钱
  • 2015-05-26 已签到
    连续签到21天,获得了20个金钱
  • 2015-05-25 已签到
    连续签到20天,获得了20个金钱
  • 2015-05-24 已签到
    连续签到19天,获得了20个金钱
  • 2015-05-23 已签到
    连续签到18天,获得了20个金钱
  • 2015-05-22 已签到
    连续签到17天,获得了20个金钱
  • 回复了 的回答

    缓存依赖 $dependency

    
        /**
         * Stores a value identified by a key into cache.
         * If the cache already contains such a key, the existing value and
         * expiration time will be replaced with the new ones, respectively.
         *
         * @param mixed $key a key identifying the value to be cached. This can be a simple string or
         * a complex data structure consisting of factors representing the key.
         * @param mixed $value the value to be cached
         * @param integer $duration the number of seconds in which the cached value will expire. 0 means never expire.
         * @param Dependency $dependency dependency of the cached item. If the dependency changes,
         * the corresponding value in the cache will be invalidated when it is fetched via [[get()]].
         * This parameter is ignored if [[serializer]] is false.
         * @return boolean whether the value is successfully stored into cache
         */
        public function set($key, $value, $duration = 0, $dependency = null)
        {
            if ($dependency !== null && $this->serializer !== false) {
                $dependency->evaluateDependency($this);
            }
            if ($this->serializer === null) {
                $value = serialize([$value, $dependency]);
            } elseif ($this->serializer !== false) {
                $value = call_user_func($this->serializer[0], [$value, $dependency]);
            }
            $key = $this->buildKey($key);
    
            return $this->setValue($key, $value, $duration);
        }
    

    这个缓存的时候,可以针对这个缓存做依赖,换句话说,就是你依赖的其他缓存变动,这个缓存就会失效

  • 2015-05-21 已签到
    连续签到16天,获得了20个金钱
  • 缓存依赖 $dependency

    
        /**
         * Stores a value identified by a key into cache.
         * If the cache already contains such a key, the existing value and
         * expiration time will be replaced with the new ones, respectively.
         *
         * @param mixed $key a key identifying the value to be cached. This can be a simple string or
         * a complex data structure consisting of factors representing the key.
         * @param mixed $value the value to be cached
         * @param integer $duration the number of seconds in which the cached value will expire. 0 means never expire.
         * @param Dependency $dependency dependency of the cached item. If the dependency changes,
         * the corresponding value in the cache will be invalidated when it is fetched via [[get()]].
         * This parameter is ignored if [[serializer]] is false.
         * @return boolean whether the value is successfully stored into cache
         */
        public function set($key, $value, $duration = 0, $dependency = null)
        {
            if ($dependency !== null && $this->serializer !== false) {
                $dependency->evaluateDependency($this);
            }
            if ($this->serializer === null) {
                $value = serialize([$value, $dependency]);
            } elseif ($this->serializer !== false) {
                $value = call_user_func($this->serializer[0], [$value, $dependency]);
            }
            $key = $this->buildKey($key);
    
            return $this->setValue($key, $value, $duration);
        }
    
  • 2015-05-20 已签到
    连续签到15天,获得了20个金钱
经理 等级规则
1437/2000
资料完整度
60/100
用户活跃度
0/100

Ta的关注

161

Ta的粉丝

60

Ta的访客

105