Memcache::getVersion

(PECL memcache >= 0.2.0)

Memcache::getVersionRetorna a versão do servidor

Descrição

Memcache::getVersion(): string|false

Memcache::getVersion() retorna uma string com o número da versão do servidor. Também pode ser usada a função memcache_get_version().

Parâmetros

Esta função não possui parâmetros.

Valor Retornado

Retorna uma string com a versão do servidor ou false em caso de falha.

Exemplos

Exemplo #1 Exemplo de Memcache::getVersion()

<?php

/* API orientada a objeto */
$memcache = new Memcache;
$memcache->connect('memcache_host', 11211);
echo
$memcache->getVersion();

/* API procedural */
$memcache = memcache_connect('memcache_host', 11211);
echo
memcache_get_version($memcache);

?>

Veja Também

adicione uma nota

Notas Enviadas por Usuários (em inglês) 1 note

up
0
b dot willemsen8 at gmail dot com
10 years ago
I also use this method to verify that Memcache is properly configured on the server since it returns false if there is something wrong. So you can do something like this:

<?php
$memcache
= new Memcache;

if (
$memcache->getVersion() === false) {
throw new
Exception('Please, verify the Memcache configuration');
}
To Top