Re: Who kown this memcache_get_stats function ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 6, 2009 at 12:16 AM, hack988 hack988<hack988@xxxxxxxxxxxxx> wrote:
> Nobody Kown this?This is my second question in this mail-list :(.I
> don't kown why it's no reply by anybody.
>
> 2009/9/5 hack988 hack988 <hack988@xxxxxxxxxxxxx>:
>> I found memcache_get_stats for memcached in some php code.
>> I'm search it at php.net's function list,but it no matched result :(.
>> I had found explain for Memcache::getStats()  at this link
>> http://www.php.net/manual/en/function.memcache-getstats.php
>> In this link,tell me that
>> ==========================================
>> Also you can use memcache_get_stats() function.
>> ==========================================
>> But I can't find memcache_get_stats function's explain in online manual.
>> Anybody can help me for using this function?Or give an more detail
>> link for this function?
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Having taken a quick gander at the manual, specifically
memcache_connect(), it appears that the memcache extension has a
procedural style API similar to the procedural style MySQLi API.

$db = mysqli_connect() and mysqli_query($db, ...) vs. $db = new
mysqli() and $db->query(), so $memc = memcache_connect() and
memcache_get_stats($memc) vs. $memc = new memcache and
$memc->get_stats();

Now, on another note, the Memcache extension is pretty old and crusty
and doesn't support a lot of the awesome functionality that's been
built into Memcached as of late.  Specifically, setting/getting a key
based on a specific server, CAS (which can be used to prevent race
conditions), and a whole bunch of other nice options (like a JSON
based serializer for cross-platform compatibility between Memcached
servers).  Instead, I would suggest you use the newer, shinier, more
featureful memcached extension ( http://php.net/memcached
http://pecl.php.net/package/memcached ).  Despite being so similarly
named, the Memcached extension is much better (and I believe faster).
The only disadvantage is that it has to be built with libmemcached (so
you have to have that installed, which could be a problem) and that it
only offers an object oriented API, but neither of those should be an
issue.

Have a look at PECL/Memcached and I wish you the best of luck in your
memcached deployment,  It's difficult, but it's a hell of a lot of fun
and a completely different way of viewing data in PHP.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux