public function MemcacheMock::replace

Replace value of the existing item.

Parameters

string $key:

mixed $var:

integer $flag:

integer $expire:

Return value

boolean

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Profiler/Mock/MemcacheMock.php, line 152

Class

MemcacheMock
MemcacheMock for simulating Memcache extension in tests.

Namespace

Symfony\Component\HttpKernel\Tests\Profiler\Mock

Code

public function replace($key, $var, $flag = null, $expire = null) {
  if (!$this->connected) {
    return false;
  }
  if (isset($this->storage[$key])) {
    $this
      ->storeData($key, $var);
    return true;
  }
  return false;
}