protected function MemcacheProfilerStorage::appendValue

Append data to an existing item on the memcache server

Parameters

string $key:

string $value:

int $expiration:

Return value

boolean

Overrides BaseMemcacheProfilerStorage::appendValue

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php, line 91

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);
}