[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/objectcache/ -> MemcachedBagOStuff.php (summary)

Base class for memcached clients. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

File Size: 179 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

MemcachedBagOStuff:: (12 methods):
  applyDefaultParams()
  get()
  set()
  cas()
  delete()
  add()
  getClient()
  encodeKey()
  encodeKeyCallback()
  fixExpiry()
  decodeKey()
  debugLog()


Class: MemcachedBagOStuff  - X-Ref

Base class for memcached clients.

applyDefaultParams( $params )   X-Ref
Fill in the defaults for any parameters missing from $params, using the
backwards-compatible global variables

param: array $params
return: array

get( $key, &$casToken = null )   X-Ref

param: string $key
param: mixed $casToken [optional]
return: mixed

set( $key, $value, $exptime = 0 )   X-Ref

param: string $key
param: mixed $value
param: int $exptime
return: bool

cas( $casToken, $key, $value, $exptime = 0 )   X-Ref

param: mixed $casToken
param: string $key
param: mixed $value
param: int $exptime
return: bool

delete( $key, $time = 0 )   X-Ref

param: string $key
param: int $time
return: bool

add( $key, $value, $exptime = 0 )   X-Ref

param: string $key
param: int $value
param: int $exptime (default 0)
return: mixed

getClient()   X-Ref
Get the underlying client object. This is provided for debugging
purposes.

return: BagOStuff

encodeKey( $key )   X-Ref
Encode a key for use on the wire inside the memcached protocol.

We encode spaces and line breaks to avoid protocol errors. We encode
the other control characters for compatibility with libmemcached
verify_key. We leave other punctuation alone, to maximise backwards
compatibility.
param: string $key
return: string

encodeKeyCallback( $m )   X-Ref

param: array $m
return: string

fixExpiry( $expiry )   X-Ref
TTLs higher than 30 days will be detected as absolute TTLs
(UNIX timestamps), and will result in the cache entry being
discarded immediately because the expiry is in the past.
Clamp expiries >30d at 30d, unless they're >=1e9 in which
case they are likely to really be absolute (1e9 = 2011-09-09)

param: int $expiry
return: int

decodeKey( $key )   X-Ref
Decode a key encoded with encodeKey(). This is provided as a convenience
function for debugging.

param: string $key
return: string

debugLog( $text )   X-Ref
Send a debug message to the log

param: string $text



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1