MediaWiki REL1_33
MemcachedPhpBagOStuff.php
Go to the documentation of this file.
1<?php
41 function __construct( $params ) {
42 parent::__construct( $params );
44
45 $this->client = new MemcachedClient( $params );
46 $this->client->set_servers( $params['servers'] );
47 $this->client->set_debug( $params['debug'] );
48 }
49
50 public function setDebug( $debug ) {
51 $this->client->set_debug( $debug );
52 }
53
54 public function getMulti( array $keys, $flags = 0 ) {
55 foreach ( $keys as $key ) {
56 $this->validateKeyEncoding( $key );
57 }
58
59 return $this->client->get_multi( $keys );
60 }
61}
Base class for memcached clients.
validateKeyEncoding( $key)
Ensure that a key is safe to use (contains no control characters and no characters above the ASCII ra...
applyDefaultParams( $params)
Fill in some defaults for missing keys in $params.
memcached client class implemented using (p)fsockopen()
A wrapper class for the pure-PHP memcached client, exposing a BagOStuff interface.
__construct( $params)
Available parameters are:
getMulti(array $keys, $flags=0)
Get an associative array containing the item for each of the keys that have items.
$debug
Definition mcc.php:31
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
$params