Skip to content

Commit

Permalink
Add public methods to allow test stub to be deleted.
Browse files Browse the repository at this point in the history
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 94b4174
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions src/Cache/Engine/MemcachedEngine.php
Expand Up @@ -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)) {
Expand All @@ -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);
Expand Down Expand Up @@ -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) {
Expand All @@ -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
Expand Down

0 comments on commit 94b4174

Please sign in to comment.