PHP using LEVELDB

Source: Internet
Author: User
1) leveldb
Leveldb is a fast-developing database key-value storage engine developed by Google, which can be mapped in the order of string key values in accordance with BSD-licensed open source leveldb.

API http://leveldb.googlecode.com/svn/trunk/doc/index.html
2) Php-leveldb
php-leveldbleveldb PHP extension, simple interface

$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 '));

One-click Installation

#!/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

Note Modify php.ini Add extension = leveldb.so and restart PHP

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.