sinri/ark-couchdb 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sinri/ark-couchdb

Composer 安装命令:

composer require sinri/ark-couchdb

包简介

The CouchDB component for Ark 2

README 文档

README

The CouchDB component for Ark 2

CouchDB is a NoSQL database providing HTTP API to serve clients. This library provided raw API client (with cURL) and entity class to cover basic use. Now it is not fully accomplished, only base requirement considered.

Agent

To connect to the CouchDB instance, you must establish an ArkCouchDBAgent class with connection arguments.

$agent = new \sinri\ark\database\couchdb\ArkCouchDBAgent($host, $port, $username, $password);

Each API request is independent, so you can share this agent instance anywhere in your project.

API Client

All CouchDB APIs are requested through HTTP by cURL. For the request and response, two class defined, ArkCouchDBRequest and ArkCouchDBResponse. The two classes are use by the extended classes of ArkCouchDBAbstractApi, which provided a method callApi. This method receives a request instance and would output a response instance.

Request

You should set request with those properties,

  • $api; The sub URL for the API.
  • $method; The constant defined for METHOD.
  • $headers; The headers, as an associated array.
  • $queries; The queries, as an associated array.
  • $body; The body. If type is of a JSON, you can set it as an array or object.
  • $bodyType; The constant defined for METHOD.

Response

Response is simple, you can get the response HTTP code and headers, and the raw text and parsed json object (as array).

Implemented API

Four kinds of API clients are provided,

  • Server
  • Database
  • Document
  • DesignDoc

You can check each PHPDoc for use and see the original doc online by reference tag.

Object Entities

Alike PDO, two kinds of object entities designed. One for database and one for documents. You must extend them before use.

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 1

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固