ekspress-digital / php-rql
此包已被弃用,不再维护。没有建议的替代包。
用于 RethinkDB 查询语言(ReQL)的 PHP 客户端驱动程序
2.3.2
2017-10-04 11:52 UTC
Requires
- php: >=5.3.0
Requires (Dev)
- jakub-onderka/php-parallel-lint: dev-master
- phpunit/phpunit: ~4.8
- squizlabs/php_codesniffer: ~2.5
README
用于 RethinkDB 查询语言(ReQL)的 PHP 客户端驱动程序。
PHP-RQL 在 Apache License 2.0 许可证下授权 https://apache.ac.cn/licenses/LICENSE2.0
持续集成
要在命令行中运行测试,请先在包根目录下运行 composer install
,然后运行 composer test
。这需要 composer
可在 $PATH
中使用。
文档
阅读 PHP-RQL 的 API 文档。
官方的 JavaScript 驱动程序文档提供了更多关于可用术语的详细信息。大多数 JavaScript 驱动程序的示例只需少量更改即可转换为 PHP-RQL。
示例
<?php // Load the driver require_once("rdb/rdb.php"); // Connect to localhost $conn = r\connect('localhost'); // Create a test table r\db("test")->tableCreate("tablePhpTest")->run($conn); // Insert a document $document = array('someKey' => 'someValue'); $result = r\table("tablePhpTest")->insert($document) ->run($conn); echo "Insert: $result\n"; // How many documents are in the table? $result = r\table("tablePhpTest")->count()->run($conn); echo "Count: $result\n"; // List the someKey values of the documents in the table // (using a mapping-function) $result = r\table("tablePhpTest")->map(function($x) { return $x('someKey'); })->run($conn); foreach ($result as $doc) { print_r($doc); } // Delete the test table r\db("test")->tableDrop("tablePhpTest")->run($conn); ?>
发布说明
...可在主网站上找到: http://php-rql.dnsalias.net
归属
- PHP-RQL 使用 Nikolai Kordulla 的 pb4php http://code.google.com/p/pb4php/。
- API 文档基于官方 RethinkDB API 文档。
- API 文档使用 Tim Whitlock 的 jTokenizer (http://timwhitlock.info) 和 Michel Fortin 的 PHP Markdown (https://michelf.ca/) 构建。