php使用leveldb

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 14:35:261647browse

1)leveldb
leveldb是一个Google开发的速度飞快的数据库键值存储引擎,可按照字符串键值顺序映射,按照BSD许可开源LevelDB。

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP的XML Parser(转)Next article:php 学习中