| @@ 36-45 (lines=10) @@ | ||
| 33 | $client = new Memcached($config['persistent_id']); |
|
| 34 | $client->addServer($config['host'], $config['port']); |
|
| 35 | ||
| 36 | foreach ($config['redundant_servers'] as $server) { |
|
| 37 | if (!isset($server['host'])) { |
|
| 38 | continue; |
|
| 39 | } |
|
| 40 | $port = $config['port']; |
|
| 41 | if (isset($server['port'])) { |
|
| 42 | $port = $server['port']; |
|
| 43 | } |
|
| 44 | $client->addServer($server['host'], $port); |
|
| 45 | } |
|
| 46 | ||
| 47 | foreach ($config['driver_options'] as $constant => $value) { |
|
| 48 | $client->setOption(constant($constant), $value); |
|
| @@ 35-44 (lines=10) @@ | ||
| 32 | $client = new Memcache(); |
|
| 33 | $client->connect($config['host'], $config['port']); |
|
| 34 | ||
| 35 | foreach ($config['redundant_servers'] as $server) { |
|
| 36 | if (!isset($server['host'])) { |
|
| 37 | continue; |
|
| 38 | } |
|
| 39 | $port = $config['port']; |
|
| 40 | if (isset($server['port'])) { |
|
| 41 | $port = $server['port']; |
|
| 42 | } |
|
| 43 | $client->addserver($server['host'], $port); |
|
| 44 | } |
|
| 45 | ||
| 46 | return new MemcacheCachePool($client); |
|
| 47 | } |
|