public function set($key, $value, $lifeTime)
    {

        $path = $this->getKeyPath($key);
        $dir = dirname($path);

        if (!is_dir($dir))
            mkdir($dir, 0777, true);

        $this->_lifeTimes[$key] = intval($lifeTime);

        //Save the life times
        $this->_format->save($this->_lifeTimePath, $this->_lifeTimes);

        //Save the cache content
        $this->_format->save($path, $value);

        return $this;
    }
public function set($key, $value, $lifeTime)
    {

        $path = $this->getKeyPath($key);
        $dir = dirname($path);

        if (!is_dir($dir))
            mkdir($dir, 0777, true);

        $this->_lifeTimes[$key] = intval($lifeTime);

        //Save the life times
        $this->_format->save($this->_lifeTimePath, $this->_lifeTimes);

        //Save the cache content
        $this->_format->save($path, $value);

        return $this;
    }
public function set ( $ key , $ value , $ lifeTime ) { $ path = $ this -> getKeyPath ( $ key ) ; $ dir = dirname ( $ path ) ; if ( ! is_dir ( $ dir ) ) mkdir ( $ dir , 0777 , true ) ; $ this -> _lifeTimes [ $ key ] = intval ( $ lifeTime ) ; //Save the life times $ this -> _format -> save ( $ this -> _lifeTimePath , $ this -> _lifeTimes ) ; //Save the cache content $ this -> _format -> save ( $ path , $ value ) ; return $ this ; }
Sets the value of an cache item to the given value

@param $key string The key that needs to be checked
@param $value mixed The value that needs to be cached
@param $lifeTime int The life-time of the cache item in seconds

@return $this
Sets the value of an cache item to the given value