public function add($data)
    {

        if(empty($data) || !$this->_getAdapter()->isClientConnected()) {
            return false;
        }

        if(!$this->_getAdapter()->add($this->_cacheKey, json_encode($data))) {
            return false;
        }

        // overflow handling
        if($this->getUsage() >= $this->getSize()) {
            if (!empty ($this->_overflowCallback) && is_callable ($this->_overflowCallback)) {
                call_user_func_array ($this->_overflowCallback, array ($this->readAndFlush()));
            } else {
                $this->_overflowHandler();
            }
        }
    }
public function add($data)
    {

        if(empty($data) || !$this->_getAdapter()->isClientConnected()) {
            return false;
        }

        if(!$this->_getAdapter()->add($this->_cacheKey, json_encode($data))) {
            return false;
        }

        // overflow handling
        if($this->getUsage() >= $this->getSize()) {
            if (!empty ($this->_overflowCallback) && is_callable ($this->_overflowCallback)) {
                call_user_func_array ($this->_overflowCallback, array ($this->readAndFlush()));
            } else {
                $this->_overflowHandler();
            }
        }
    }
public function add ( $ data ) { if ( empty ( $ data ) || ! $ this -> _getAdapter ( ) -> isClientConnected ( ) ) { return false ; } if ( ! $ this -> _getAdapter ( ) -> add ( $ this -> _cacheKey , json_encode ( $ data ) ) ) { return false ; } // overflow handling if ( $ this -> getUsage ( ) >= $ this -> getSize ( ) ) { if ( ! empty ( $ this -> _overflowCallback ) && is_callable ( $ this -> _overflowCallback ) ) { call_user_func_array ( $ this -> _overflowCallback , array ( $ this -> readAndFlush ( ) ) ) ; } else { $ this -> _overflowHandler ( ) ; } } }
Add data to buffer

@param  mixed   $data
@return boolean
Add data to buffer