src/Fasim/Cache/simulate/Memcached.php
public function get($key, $cache_cb = null, $cas_token = null)
    {
        $keyString = $this->getKey($key);
        $this->writeSocket("get $keyString");

        $s = $this->readSocket();

        if (is_null($s) || 'VALUE' != substr($s, 0, 5)) {
            $this->resultCode = Memcached::RES_FAILURE;
            $this->resultMessage = 'Get fail.';
            return false;

        } else {
            $s_result = '';
            $s = $this->readSocket();
            while ('END' != $s) {
                $s_result .= $s;
                $s = $this->readSocket();
            }
            $this->resultCode = Memcached::RES_SUCCESS;
            $this->resultMessage = '';

            return unserialize($s_result);
        }
    }
public function get($key, $cache_cb = null, $cas_token = null)
    {
        $keyString = $this->getKey($key);
        $this->writeSocket("get $keyString");

        $s = $this->readSocket();

        if (is_null($s) || 'VALUE' != substr($s, 0, 5)) {
            $this->resultCode = Memcached::RES_FAILURE;
            $this->resultMessage = 'Get fail.';
            return false;

        } else {
            $s_result = '';
            $s = $this->readSocket();
            while ('END' != $s) {
                $s_result .= $s;
                $s = $this->readSocket();
            }
            $this->resultCode = Memcached::RES_SUCCESS;
            $this->resultMessage = '';

            return unserialize($s_result);
        }
    }
public function get ( $ key , $ cache_cb = null , $ cas_token = null ) { $ keyString = $ this -> getKey ( $ key ) ; $ this -> writeSocket ( "get $keyString" ) ; $ s = $ this -> readSocket ( ) ; if ( is_null ( $ s ) || 'VALUE' != substr ( $ s , 0 , 5 ) ) { $ this -> resultCode = Memcached :: RES_FAILURE ; $ this -> resultMessage = 'Get fail.' ; return false ; } else { $ s_result = '' ; $ s = $ this -> readSocket ( ) ; while ( 'END' != $ s ) { $ s_result .= $ s ; $ s = $ this -> readSocket ( ) ; } $ this -> resultCode = Memcached :: RES_SUCCESS ; $ this -> resultMessage = '' ; return unserialize ( $ s_result ) ; } }
Retrieve an item

@param   string  $key
@param   callable    $cache_cb       Ignored
@param   float   $cas_token          Ignored
@return  mixed
Retrieve an item