zoukankan      html  css  js  c++  java
  • PHP 加速器的安装 xcache

    安装
    # wget http://xcache.lighttpd.net/pub/Releases/1.3.1/xcache-1.3.1.tar.gz
    # tar xzvf xcache-1.3.1.tar.gz
    # cd xcache-1.3.1
    # /usr/local/php-5.3.5/bin/phpize
    # /configure --with-php-config=/usr/local/php-5.3.5/bin/php-config --enable-xcache
    # make 
    # make install
    # cat xcache.ini >> /usr/local/php-5.3.5/lib/php.ini
     
    # vim /usr/local/php-5.3.5/lib/php.ini
     
    extension = xcache.so
     
    test
    <?php
    $key = 'key1';
    if(!xcache_isset($key)){
        xcache_set($key,'test',120); //save for 2 minutes
    }
    $value = xcache_get($key);
    echo $value;
    ?>
     
    xcache Api
    Common Used Functions:
    mixed xcache_get(string name)
    bool  xcache_set(string name, mixed value [, int ttl])
    bool  xcache_isset(string name)
    bool  xcache_unset(string name)
    bool  xcache_unset_by_prefix(string prefix)
    int   xcache_inc(string name [, int value [, int ttl]])
    int   xcache_dec(string name [, int value [, int ttl]])
     
    Administrator Functions(See xcache/admin/*.php):
    int    xcache_count(int type)
    array  xcache_info(int type, int id)
    array  xcache_list(int type, int id)
    void   xcache_clear_cache(int type, int id)
    string xcache_coredump(int op_type)
     
    Coverager Functions:
    array xcache_coverager_decode(string data)
    void  xcache_coverager_start([bool clean = true])
    void  xcache_coverager_stop([bool clean = false])
    array xcache_coverager_get([bool clean = false])
     
    Opcode Functions(See xcache/Decompiler.class.php):
    string xcache_asm(string filename)
    string xcache_dasm_file(string filename)
    string xcache_dasm_string(string code)
    string xcache_encode(string filename)
    bool   xcache_decode(string filename)
     
    string xcache_get_op_type(int op_type)
    string xcache_get_data_type(int type)
    string xcache_get_opcode(int opcode)
    string xcache_get_op_spec(int op_type)
    string xcache_get_opcode_spec(int opcode)
    mixed  xcache_get_special_value(zval value)
    string xcache_is_autoglobal(string name)
  • 相关阅读:
    Java中使用责任链模式
    Java中使用策略模式
    C++字符画圈
    C/C++结构体
    C++判断闰年&日期之差&给定日期求星期几
    C++重载<运算符及排序结构体
    Spring Boot笔记 #02# 构建RESTful Web服务(官方)
    IntelliJ IDEA修改默认的全局Maven路径
    Spring Boot笔记 #01# 快速入门(官方)
    获取某个时间的前一天
  • 原文地址:https://www.cnblogs.com/liqiu/p/2585030.html
Copyright © 2011-2022 走看看