MCRouter::createSimple
Simplified constructor
public static function createSimple(
Vector $servers,
): MCRouter;
Parameters
Vector $servers
- List of memcache servers to connect to
Returns
MCRouter
- Instance of MCRouter
Examples
The following example shows you how use MCRouter::createSimple
to create an instance of MCRouter
. You only need to pass it a Vector
containing one or more locations of Memcached servers; default configurations are used after that (e.g, route = 'PoolRoute|P'
).
function simple_mcrouter(): void {
$servers = Vector {\getenv('HHVM_TEST_MCROUTER')};
$mc = \MCRouter::createSimple($servers);
\var_dump($mc is \MCRouter);
}
simple_mcrouter();
bool(true)