public function add($key, $data, $ttl)
    {
        if (!$this->enabled)
            return true;

        try {
            $data = $this->storageFormat($key, $data, $ttl);
            $nKey = $this->key($key);

            // Store the cache object
            $ret = @$this->getConnection()->add($nKey, $data, $this->flags, $ttl);

            $this->Logger->debug("". (($ret) ? "Successful" : "Failed to") . " add '{$key}'\n");

            return $ret;

        } catch (Exception $e) {
            throw new CacheException($e->getMessage(), $e->getCode());
        }
    }
public function add($key, $data, $ttl)
    {
        if (!$this->enabled)
            return true;

        try {
            $data = $this->storageFormat($key, $data, $ttl);
            $nKey = $this->key($key);

            // Store the cache object
            $ret = @$this->getConnection()->add($nKey, $data, $this->flags, $ttl);

            $this->Logger->debug("". (($ret) ? "Successful" : "Failed to") . " add '{$key}'\n");

            return $ret;

        } catch (Exception $e) {
            throw new CacheException($e->getMessage(), $e->getCode());
        }
    }
public function add ( $ key , $ data , $ ttl ) { if ( ! $ this -> enabled ) return true ; try { $ data = $ this -> storageFormat ( $ key , $ data , $ ttl ) ; $ nKey = $ this -> key ( $ key ) ; // Store the cache object $ ret = @ $ this -> getConnection ( ) -> add ( $ nKey , $ data , $ this -> flags , $ ttl ) ; $ this -> Logger -> debug ( "" . ( ( $ ret ) ? "Successful" : "Failed to" ) . " add '{$key}'\n" ) ; return $ ret ; } catch ( Exception $ e ) { throw new CacheException ( $ e -> getMessage ( ) , $ e -> getCode ( ) ) ; } }
Stores data into the cache store by key, with a given timeout in seconds
UNLESS an entry already exists under that key.
The implementation must support native serialization of objects and arrays
so that the caller does not need to serialize manually.

@param string $key  Cache key associated to the data
@param mixed  $data Data to be stored in the cache store.  Only serializable
data types or objects can be stored in the cache.
@param int    $ttl  Time-to-live or duration in seconds the value is
retained in the cache store before expiring or becoming invalid. If
set to 0, the value will not expire.

@return boolean True upon success, false on failure
Stores data into the cache store by key with a given timeout in seconds UNLESS an entry already exists under that key . The implementation must support native serialization of objects and arrays so that the caller does not need to serialize manually .