Domanda

Sto usando la libreria PHP Memcached (basata su libmemcached) e mi chiedo come posso cambiare costanti predefinite in PHP. Vorrei usare la distribuzione delle chiavi basata su ketama.

Memcached è compilato come estensione PHP.

Grazie.

È stato utile?

Soluzione

usa setOption:

$this->_Memcache =& new Memcached();
$this->_Memcache->setOption(Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_PHP);
$this->_Memcache->setOption(Memcached::OPT_NO_BLOCK, true);
$this->_Memcache->setOption(Memcached::OPT_TCP_NODELAY, true);
$this->_Memcache->setOption(Memcached::OPT_BUFFER_WRITES, true);
$this->_Memcache->setOption(Memcached::OPT_SERVER_FAILURE_LIMIT,3);
$this->_Memcache->setOption(Memcached::OPT_HASH,Memcached::HASH_CRC);

etc ... etc ...

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top