bachi/ couchdb
CouchDB 客户端,PHP 版本需 >=5.5
1.1.0
2015-07-01 16:49 UTC
Requires
- php: >=5.5.0
- doctrine/common: ~2.3.0
- guzzlehttp/guzzle: ^6.0
This package is auto-updated.
Last update: 2024-09-12 03:44:50 UTC
README
适用于 >=PHP 5.5 的 CouchDB 客户端,具有事件系统。
灵感来自 Doctrine/MongoDB 和 Doctrine/CouchDB
安装
Composer
您可以通过 composer 安装 CouchDB 客户端。将以下行添加到您的 composer.json
文件中。
$ composer require bachi/couchdb
不使用 composer?
现在开始使用 composer! https://getcomposer.org.cn
用法
初始化
$client = new \GuzzleHttp\Client(['base_uri' => 'http://localhost:5984', 'http_errors' => false]); $connection = new \CouchDB\Connection($client);
创建数据库
$database = $conn->createDatabase('foobar'); // or with magic method $database = $conn->foobar;
获取数据库实例
$database = $conn->selectDatabase('foobar'); // or with magic method $database = $conn->foobar;
删除数据库
if (true === $conn->hasDatabase('foobar')) { $conn->dropDatabase('foobar'); } // or with magic methods if (isset($conn->foobar)){ unset($conn->foobar); }
单元测试 (PHPUnit)
测试套件位于 tests
文件夹中。
运行测试套件
phpunit
它是绿色的吗?
鸣谢
- Markus Bachmann markus.bachmann@bachi.biz
- [所有贡献者] (https://github.com/Baachi/CouchDB/contributors)
许可协议
CouchDB 客户端在 MIT 许可证下发布。有关详细信息,请参阅捆绑的 LICENSE 文件。