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)
  • 相关阅读:
    codeforces 689 E. Mike and Geometry Problem 组合数学 优先队列
    01 编程 | 边界问题
    Leetcode 445. 两数相加 II
    Leetcode 485. 最大连续1的个数
    005.字符串输入与字符统计
    Leetcode 002. 两数相加
    000 Python常识与快捷键(未完)
    002 第一个Python简易游戏
    001 Python中的变量和字符串
    004.数组的不同遍历方式
  • 原文地址:https://www.cnblogs.com/liqiu/p/2585030.html
Copyright © 2011-2022 走看看