Download the PHP package kingsquare/communibase-connector-php without Composer
On this page you can find all versions of the php package kingsquare/communibase-connector-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kingsquare/communibase-connector-php
More information about kingsquare/communibase-connector-php
Files in kingsquare/communibase-connector-php
Package communibase-connector-php
Short Description This is the Communibase connector for PHP.
License MIT
Informations about the package communibase-connector-php
A general-purpose Communibase client for PHP projects, compatible with composer packaging-projects.
A connector may be constructed to do REST-calls on the Communibase API.
The behaviour of this package should always Mimic the node-version
Usage
The easiest way to install the connector is to use Composer:
Now you should be able to install the package by updating your composer environment
The connector is available and usable as follows:
API
"entityType" should be the Communibase Entitytype, e.g. "Person", "Invoice", etc. To see all the entity types your API key allows, see the API docs and insert your API key there.
"selectors" may be provided MongoDb style as array-definitions.
"params" is a key value store for e.g. fields, limit, page and/or sort . See API docs for more details. In addition to the nodeJS version of this parameter, the fields value may also be an array of fields. This will work more intuitively in PHP environments.
Whenever a function like or returns null, the property should be available containing an error message
Entity
An entity is an associative array containing a key/value store of data in Communibase.
E.g.
Error handling
The connector may throw an error when something goes wrong. Default error handling is as follows:
A special type of error handling involves "Validity" errors for posted documents.
Query Logging
It is also possible to add a query logger to the connector.
Stack query data for debug/dev purposes:
$connector->setQueryLogger(new DebugStack());
Query data available after run via $connector->getQueryLogger()->queries
Echo query for debug/dev purposes (handy for cli):
$connector->setQueryLogger(new EchoQueryLogger());
Echoes each query to the current output stream.
Create own query logging:
$connector->setQueryLogger(new MyOwnQueryLogger());
MyOwnQueryLogger
implements QueryLogger
and does something with the data.. possible db/api call
Contributions / Bugreports
If you're using this app and have questions and/or feedback, please file an issue on Github.
Also we welcome new features and code, so please don't hesitate to get that pull request online!