时间:2021-07-01 10:21:17 帮助过:62人阅读
API http://leveldb.googlecode.com/svn/trunk/doc/index.html
2)php-leveldb
php-leveldbleveldb的PHP扩展,接口简单
$path = '/tmp/leveldb.log' ; $db = new LevelDb( $path ); echo "* setting (foo=bar): \n" ; var_dump( $db ->set( 'foo' , 'bar' )); echo "* getting (foo): \n" ; var_dump( $db ->get( 'foo' )); echo "* delete (foo): \n" ; var_dump( $db -> delete ( 'foo' )); echo "* getting (foo): \n" ; var_dump( $db ->get( 'foo' )); |
一键安装
#!/bin/sh #目录 BUILD= /home/venkman/data/server cd $BUILD #下载leveldb svn export http: //leveldb .googlecode.com /svn/trunk/ leveldb cd leveldb make cd $BUILD #php-leveldb git clone git: //github .com /arraypad/php-leveldb .git cd php-leveldb phpize . /configure --with-leveldb=$BUILD /leveldb --with-php-config= /home/venkman/data/server/php/bin/php-config make make install |
注意修改php.ini增加extension = leveldb.so并重启php