Skip to content
Permalink
Browse files

Add public methods to allow test stub to be deleted.

Tests 'use' the classes, and should be afforded by object's public
interfaces.
  • Loading branch information...
markstory committed Aug 12, 2017
1 parent f534945 commit 94b41748713f048dbd0c9105ba036db8485e4f1b
Showing with 26 additions and 3 deletions.
  1. +26 −3 src/Cache/Engine/MemcachedEngine.php
@@ -153,7 +153,7 @@ public function init(array $config = [])
$servers = [];
foreach ($this->_config['servers'] as $server) {
$servers[] = $this->_parseServerString($server);
$servers[] = $this->parseServerString($server);
}
if (!$this->_Memcached->addServers($servers)) {
@@ -176,7 +176,7 @@ public function init(array $config = [])
$sasl = method_exists($this->_Memcached, 'setSaslAuthData');
if (!$sasl) {
throw new InvalidArgumentException(
'Memcached extension is not build with SASL support'
'Memcached extension is not built with SASL support'
);
}
$this->_Memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, true);
@@ -243,7 +243,7 @@ protected function _setOptions()
* @param string $server The server address string.
* @return array Array containing host, port
*/
protected function _parseServerString($server)
public function parseServerString($server)
{
$socketTransport = 'unix://';
if (strpos($server, $socketTransport) === 0) {
@@ -267,6 +267,29 @@ protected function _parseServerString($server)
return [$host, (int)$port];
}
/**
* Backwards compatible alias of parseServerString
*
* @param string $server The server address string.
* @return array Array containing host, port
* @deprecated 3.4.13 Will be removed in 4.0.0
*/
protected function _parseServerString($server)
{
return $this->parseServerString($server);
}
/**
* Read an option value from the memcached connection.
*
* @param string $name The option name to read.
* @return string|integer|null|bool
*/
public function getOption($name)
{
return $this->_Memcached->getOption($name);
}
/**
* Write data for key into cache. When using memcached as your cache engine
* remember that the Memcached pecl extension does not support cache expiry

0 comments on commit 94b4174

Please sign in to comment.
You can’t perform that action at this time.