• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • 位置: php 中文手册 -> PECL扩展库

    tokyo_tyrant(键值对数据库)

    tokyo Tyrant 是一款支持高并发的分布式持久存储系统,对任何原有 Memcached客户端来讲,可以将 Tokyo Tyrant 看成是一个 Memcached,但是,它的数据是可以持久存储的。

    安装此 PECL 扩展相关的信息可在手册中标题为 PECL 扩展的安装章节中找到。

    • --with-tokyo-tyrant[=DIR] DIR is the prefix to the Tokyo Tyrant installation
    • --with-tokyo-cabinet-dir[=DIR] DIR is the prefix to the Tokyo Cabinet installation
    • --disable-tokyo-tyrant-session Disable Tokyo Tyrant session handler support

    Configuring session handler

    • tokyo_tyrant.session_salt="randomlongstring"
    • session.save_handler=tokyo_tyrant
    • session.save_path="tcp://hostname1:2000,tcp://hostname2:2000"

    范例

    Example #1 Putting and getting a key-value pair

    <?php
    $tt = new TokyoTyrant("localhost");
    $tt->put("key", "value");
    echo $tt->get("key");
    ?>
    

    以上例程会输出:

    value