public function set($key, $value, $lifeTime = 900)
    {
        //~ Check if enabled
        if (!$this->isEnabled()) {
            return false;
        }

        //~ Clear expired Cache files
        $this->clearExpired();

        $pKey = $this->prefix() . $key;
        $file = $this->directory . substr(md5($pKey), 0, 10) . '.dat';
        if ((bool) file_put_contents($file, serialize($value))) {
            $this->cache[$pKey] = time() + $lifeTime;
            $this->save();

            return true;
        } else {
            return false;
        }
    }
public function set($key, $value, $lifeTime = 900)
    {
        //~ Check if enabled
        if (!$this->isEnabled()) {
            return false;
        }

        //~ Clear expired Cache files
        $this->clearExpired();

        $pKey = $this->prefix() . $key;
        $file = $this->directory . substr(md5($pKey), 0, 10) . '.dat';
        if ((bool) file_put_contents($file, serialize($value))) {
            $this->cache[$pKey] = time() + $lifeTime;
            $this->save();

            return true;
        } else {
            return false;
        }
    }
public function set ( $ key , $ value , $ lifeTime = 900 ) { //~ Check if enabled if ( ! $ this -> isEnabled ( ) ) { return false ; } //~ Clear expired Cache files $ this -> clearExpired ( ) ; $ pKey = $ this -> prefix ( ) . $ key ; $ file = $ this -> directory . substr ( md5 ( $ pKey ) , 0 , 10 ) . '.dat' ; if ( ( bool ) file_put_contents ( $ file , serialize ( $ value ) ) ) { $ this -> cache [ $ pKey ] = time ( ) + $ lifeTime ; $ this -> save ( ) ; return true ; } else { return false ; } }
Sets a value in the Cache for the specified key.

@param string  $key The key name
@param mixed   $value The content to put in Cache
@param integer $lifeTime Time to keep the content in Cache in seconds
@return boolean
Sets a value in the Cache for the specified key .