Memcache::getVersion
(PECL memcache >= 0.2.0)
Memcache::getVersion — Return version of the server
Описание
string Memcache::getVersion
( void
)
Memcache::getVersion() returns a string with server's version number. Also you can use memcache_get_version() function.
Возвращаемые значения
Returns a string of server version number или FALSE
в случае возникновения ошибки.
Примеры
Пример #1 Memcache::getVersion() example
<?php
/* OO API */
$memcache = new Memcache;
$memcache->connect('memcache_host', 11211);
echo $memcache->getVersion();
/* procedural API */
$memcache = memcache_connect('memcache_host', 11211);
echo memcache_get_version($memcache);
?>
Смотрите также
- Memcache::getExtendedStats() - Get statistics from all servers in pool
- Memcache::getStats() - Get statistics of the server
- Функция Memcache::add() - Add an item to the server
- Функция Memcache::addServer() - Add a memcached server to connection pool
- Функция Memcache::close() - Close memcached server connection
- Функция Memcache::connect() - Open memcached server connection
- Функция Memcache::decrement() - Decrement item's value
- Функция Memcache::delete() - Delete item from the server
- Функция Memcache::flush() - Flush all existing items at the server
- Функция Memcache::get() - Retrieve item from the server
- Функция Memcache::getExtendedStats() - Get statistics from all servers in pool
- Функция Memcache::getServerStatus() - Returns server status
- Функция Memcache::getStats() - Get statistics of the server
- Функция Memcache::getVersion() - Return version of the server
- Функция Memcache::increment() - Increment item's value
- Функция Memcache::pconnect() - Open memcached server persistent connection
- Функция Memcache::replace() - Replace value of the existing item
- Функция Memcache::set() - Store data at the server
- Функция Memcache::setCompressThreshold() - Enable automatic compression of large values
- Функция Memcache::setServerParams() - Changes server parameters and status at runtime
Коментарии
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');
}