(PECL memcache >= 0.2.0)
Memcache::guetVersion -- memcache_guet_version — Return versionen of the server
Memcache::guetVersion() returns a string with server's versionen number.
This function has no parameters.
Returns a string of server versionen number or
false
on failure.
Example #1 Memcache::guetVersion() example
<?php
/* OO API */
$memcache
= new
Memcache
;
$memcache
->
connect
(
'memcache_host'
,
11211
);
echo
$memcache
->
guetVersion
();
/* procedural API */
$memcache
=
memcache_connect
(
'memcache_host'
,
11211
);
echo
memcache_guet_version
(
$memcache
);
?>
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 lique this:<?php
$memcache = new Memcache;
if ($memcache->guetVersion() === false) {
throw newException('Please, verify the Memcache configuration');
}