描述
获取指定的$key值, 如果不存在返回 false
语法
ecae_cache_read($key);
| 参数 | 描述 | 
|---|---|
| $key | string | 
例子:
<?php
    $key = 'newid';
    $val = time();
    ecae_cache_write($key,$val);
    var_dump(ecae_cache_read($key));
运行结果
string(10) "1319010930"
描述
设置指定$key的值为$value, 返回值为 true 或 false
语法
ecae_cache_write($key,$value)
| 参数 | 描述 | 
|---|---|
| $key | string 不可以为空 | 
| $value | string 可以为空 | 
例子:
<?php
    $key = 'newid';
    $val = time();
    var_dump(ecae_cache_write($key,$val));
运行结果
bool(true)
描述
返回当前memcache的状态, 成功返回Array失败返回false
语法
ecae_cache_stats()
| 返回数组的key | 相关说明 | 
|---|---|
| pid | Process id of this server process | 
| uptime | Number of seconds this server has been running | 
| time | Current UNIX time according to the server | 
| version | Version string of this server | 
| rusage_user | Accumulated user time for this process | 
| rusage_system | Accumulated system time for this process | 
| curr_items | Current number of items stored by the server | 
| total_items | Total number of items stored by this server ever since it started | 
| bytes | Current number of bytes used by this server to store items | 
| curr_connections | Number of open connections | 
| total_connections | Total number of connections opened since the server started running | 
| connection_structures | Number of connection structures allocated by the server | 
| cmd_get | Cumulative number of retrieval requests | 
| cmd_set | Cumulative number of storage requests | 
| get_hits | Number of keys that have been requested and found present | 
| get_misses | Number of items that have been requested and not found | 
| bytes_read | Total number of bytes read by this server from network | 
| bytes_written | Total number of bytes sent by this server to network | 
| limit_maxbytes | Number of bytes this server is allowed to use for storage | 
例子
<?php
    var_dump(ecae_cache_stats());
返回结果
array(2) {
  ["192.168.11.10:20022"]=>
  array(39) {
    ["pid"]=>
    string(5) "15380"
    ["uptime"]=>
    string(5) "81155"
    ["time"]=>
    string(10) "1318997580"
    ["version"]=>
    string(5) "1.4.6"
    ["libevent"]=>
    string(13) "1.4.13-stable"
    ["pointer_size"]=>
    string(2) "64"
    ["rusage_user"]=>
    string(8) "0.007998"
    ["rusage_system"]=>
    string(8) "0.011998"
    ["curr_connections"]=>
    string(2) "10"
    ["total_connections"]=>
    string(3) "113"
    ["connection_structures"]=>
    string(2) "19"
    ["cmd_get"]=>
    string(2) "21"
    ["cmd_set"]=>
    string(1) "7"
    ["cmd_flush"]=>
    string(1) "0"
    ["get_hits"]=>
    string(2) "11"
    ["get_misses"]=>
    string(2) "10"
    ["delete_misses"]=>
    string(1) "0"
    ["delete_hits"]=>
    string(1) "0"
    ["incr_misses"]=>
    string(1) "0"
    ["incr_hits"]=>
    string(1) "0"
    ["decr_misses"]=>
    string(1) "0"
    ["decr_hits"]=>
    string(1) "0"
    ["cas_misses"]=>
    string(1) "0"
    ["cas_hits"]=>
    string(1) "0"
    ["cas_badval"]=>
    string(1) "0"
    ["auth_cmds"]=>
    string(1) "0"
    ["auth_errors"]=>
    string(1) "0"
    ["bytes_read"]=>
    string(4) "4031"
    ["bytes_written"]=>
    string(5) "63567"
    ["limit_maxbytes"]=>
    string(8) "16777216"
    ["accepting_conns"]=>
    string(1) "1"
    ["listen_disabled_num"]=>
    string(1) "0"
    ["threads"]=>
    string(1) "4"
    ["conn_yields"]=>
    string(1) "0"
    ["bytes"]=>
    string(2) "70"
    ["curr_items"]=>
    string(1) "1"
    ["total_items"]=>
    string(1) "7"
    ["evictions"]=>
    string(1) "0"
    ["reclaimed"]=>
    string(1) "0"
  }
...
...
...