Download the PHP package bcdh/exist-db-rest-client without Composer
On this page you can find all versions of the php package bcdh/exist-db-rest-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package exist-db-rest-client
Laravel eXist-db REST Client
A small Laravel-friendly client for querying eXist-db over its REST API, parsing XML responses, and applying XSLT transformations.
Version compatibility
1.1.x: Laravel 81.2.x(v1.2.0): Laravel 91.3.x: planned for Laravel 102.x: planned for Laravel 11+
The latest released bridge line is 1.2.x for Laravel 9.
The default branch, master, is the development branch. Use a tagged release when installing the package in an application.
Requirements
Current master branch requirements:
- PHP
^7.2|^8.0 - Laravel /
illuminate/support^5.5|^6.0|^7.0|^8.0 - PHP XSL extension for XSLT transformations
- An accessible eXist-db REST endpoint
Installation
Install the version that matches your Laravel line:
For Laravel 8, use:
Laravel package discovery will register the service provider automatically.
If you are integrating the package into an older Laravel application without package discovery, register the provider manually in config/app.php:
Publish the package configuration:
Then adjust config/exist-db.php:
Basic usage
getDocument() returns the parsed XML result. getRawResult() returns the raw XML string from eXist-db.
Using the client outside Laravel
You can also pass configuration directly:
Query helpers
Query supports:
setQuery($xquery)for inline XQuerysetStoredQuery($path)for stored XQuery resourcessetCollection($collection)setResource($resource)bindVariable($name, $value)for XQuery variable substitutionbindParam($name, $value)for request parameterssetBody($body)for request payloadsget(),post(),put(), anddelete()
Example with a stored query and request parameter:
Example uploading XML into a collection:
Result parsing
Results are parsed with sabre/xml. You can pass your own Sabre\Xml\Service instance to any request method:
Typical parsed output looks like this:
XSLT transformations
XMLResult::transform() applies an XSL stylesheet to either the full document or a selected fragment.
Transform a single result node:
Transform a collection of nodes with a custom root tag:
Running tests
The test suite expects a local eXist-db instance at http://localhost:8080/exist/rest/ with the default admin/admin credentials.
Run:
All versions of exist-db-rest-client with dependencies
illuminate/support Version ^9.0
guzzlehttp/guzzle Version ^7.0
sabre/xml Version ^3.0