public function cacheserverConnectionInfo()
{
$info = [];
$cacheserver_binding = (array) $this->getBindings()->getByType('cacheserver');
if (!empty($cacheserver_binding)) {
do {
$next_binding = array_shift($cacheserver_binding);
if (is_null($next_binding)) {
break;
}
$cache_binding = $next_binding;
} while (!is_null($cache_binding) && $cache_binding->get('environment') != $this->id);
$password = $cache_binding->get('password');
$hostname = $cache_binding->get('host');
$port = $cache_binding->get('port');
$url = "redis://pantheon:{$password}@{$hostname}:{$port}";
$command = "redis-cli -h {$hostname} -p {$port} -a {$password}";
$info = ['password' => $password, 'host' => $hostname, 'port' => $port, 'url' => $url, 'command' => $command];
}
return $info;
}