Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Memcache Functions : Memcache::setServerParams

Memcache::setServerParams

Changes server parameters and status at runtime ()
bool Memcache::setServerParams ( string host [, int port [, int timeout [, int retry_interval [, bool status [, callback failure_callback]]]]] )

Example 1324. Memcache::setServerParams() example

<?php

function _callback_memcache_failure($host, $port) {
   print
"memcache '$host:$port' failed";
}

/* OO API */

$memcache = new Memcache;

// Add the server in offline mode
$memcache->addServer('memcache_host', 11211, false, 1, 1, -1, false);

// Bring the server back online
$memcache->setServerParams('memcache_host', 11211, 1, 15, true, '_callback_memcache_failure');

/* procedural API */

$memcache_obj = memcache_connect('memcache_host', 11211);
memcache_set_server_params($memcache_obj, 'memcache_host', 11211, 1, 15, true, '_callback_memcache_failure');

?>

Change Language


Follow Navioo On Twitter
Memcache::add
Memcache::addServer
Memcache::close
Memcache::connect
memcache_debug
Memcache::decrement
Memcache::delete
Memcache::flush
Memcache::get
Memcache::getExtendedStats
Memcache::getServerStatus
Memcache::getStats
Memcache::getVersion
Memcache::increment
Memcache::pconnect
Memcache::replace
Memcache::set
Memcache::setCompressThreshold
Memcache::setServerParams
eXTReMe Tracker