update : 2015.11.03
php.shukuma.com

검색:
 
 
Set Memcached options

Memcached::setOptions

(PECL memcached >= 2.0.0)

Memcached::setOptionsSet Memcached options

설명

public bool Memcached::setOptions ( array $options )

Memcached::setOptions() is a variation of the Memcached::setOption() that takes an array of options to be set.

인수

options

An associative array of options where the key is the option to set and the value is the new value for the option.

반환값

성공 시 TRUE를, 실패 시 FALSE를 반환합니다.

예제

Example #1 Setting Memcached options

<?php
$m 
= new Memcached();
var_dump($m->getOption(Memcached::OPT_HASH) == Memcached::HASH_DEFAULT);

$m->setOptions(array(Memcached::OPT_HASH => Memcached::HASH_MURMURMemcached::OPT_PREFIX_KEY => "widgets"));

var_dump($m->getOption(Memcached::OPT_HASH) == Memcached::HASH_DEFAULT);
echo 
"Prefix key is now: "$m->getOption(Memcached::OPT_PREFIX_KEY), "\n";
?>

위 예제의 출력:

bool(true)
bool(false)
Prefix key is now: widgets

참고