You are here

protected function MemcacheProfilerStorage::appendValue in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/Profiler/MemcacheProfilerStorage.php \Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage::appendValue()

Append data to an existing item on the memcache server.

Parameters

string $key:

string $value:

int $expiration:

Return value

bool

Overrides BaseMemcacheProfilerStorage::appendValue

File

vendor/symfony/http-kernel/Profiler/MemcacheProfilerStorage.php, line 89

Class

MemcacheProfilerStorage
Memcache Profiler Storage.

Namespace

Symfony\Component\HttpKernel\Profiler

Code

protected function appendValue($key, $value, $expiration = 0) {
  $memcache = $this
    ->getMemcache();
  if (method_exists($memcache, 'append')) {

    // Memcache v3.0
    if (!($result = $memcache
      ->append($key, $value, false, $expiration))) {
      return $memcache
        ->set($key, $value, false, $expiration);
    }
    return $result;
  }

  // simulate append in Memcache <3.0
  $content = $memcache
    ->get($key);
  return $memcache
    ->set($key, $content . $value, false, $expiration);
}