Download the PHP package loco/loco without Composer
On this page you can find all versions of the php package loco/loco. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package loco
Short Description Loco SDK for PHP, including REST API client
License MIT
Homepage https://github.com/loco/loco-php-sdk
Informations about the package loco
Loco SDK for PHP
Installation
Installation is via Composer.
Add the latest stable version of loco/loco to your project's composer.json
file as follows:
REST API Client
The SDK includes a REST client for the Loco API.
Client usage
The client is built on Guzzle. Basic usage is to construct with your API key and call the endpoint methods directly. The following example simply verifies your credentials:
See the example directory for more.
Advanced options
Additionally the ApiClient::factory
method can take any arguments accepted by Guzzle's client constructor.
See Request Options and Handlers and Middleware for full details.
Command Line Client
A Console interface supporting all methods of the Loco API is at bin/console
. Just run it to see all the available options.
The console reads from config.json, but you can override your API key from the command line. Run the following to verify your credentials:
Documentation
- Check the Loco API documentation for full details on each endpoint.
- See the example directory for more working code examples.
Breaking changes in v2.0
Updating from Guzzle 3 to Guzzle 6 brought some necessary breaking changes with it. If you're upgrading from 1.0.18, please note the following:
- The structure of
config.json
has changed. Note in particular a single root object containing your values as per the example config. - The version number of the SDK is no longer synced to the version of the API. Each release will however be built against the latest version of the live service.
All versions of loco with dependencies
ext-zip Version *
ext-json Version *
guzzlehttp/guzzle-services Version ^1.1
guzzlehttp/psr7 Version ^1.8|^2.1
symfony/console Version ~4.0|~5.0|^6.0