rollingwolf/queryable-php

QueryablePHP是node库Queryable的PHP版本

dev-master / 1.0.1.x-dev 2015-03-11 06:47 UTC

This package is not auto-updated.

Last update: 2024-09-28 17:49:08 UTC


README

Queryable的PHP版本Queryable

这是Queryable的PHP版本,Queryable是一个小巧的NoSQL-like数据库,允许对对象数组进行结构化查询。它以JSON字符串的形式存储。

示例

$config = array(
    'dbDir' => realpath('.'),
    'dbName' => 'test.db'
);
$DB = \rollingWolf\QueryablePHP\QueryablePHP::open($config);
$DB->insert('[{president:"George Washington",took_office:1789},{president:"John Adams",took_office:1797},{president:"Thomas Jefferson",took_office:1801},{president:"James Madison",took_office:1809}]');
$DB->find('{president:"/^T/i"}');
$DB->save();

该脚本允许使用slack JSON(PHP与javascript风格),因此不需要在president周围使用双引号。