public function MemcacheMock::get

Retrieve item from the server.

Parameters

string|array $key:

integer|array $flags:

Return value

mixed

File

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

Class

MemcacheMock
MemcacheMock for simulating Memcache extension in tests.

Namespace

Symfony\Component\HttpKernel\Tests\Profiler\Mock

Code

public function get($key, &$flags = null) {
  if (!$this->connected) {
    return false;
  }
  if (is_array($key)) {
    $result = array();
    foreach ($key as $k) {
      if (isset($this->storage[$k])) {
        $result[] = $this
          ->getData($k);
      }
    }
    return $result;
  }
  return $this
    ->getData($key);
}