Download the PHP package remluben/cockpit-client without Composer
On this page you can find all versions of the php package remluben/cockpit-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download remluben/cockpit-client
More information about remluben/cockpit-client
Files in remluben/cockpit-client
Package cockpit-client
Short Description A simple readonly api client for the cockpit headless cms
License MIT
Informations about the package cockpit-client
Cockpit Client
NOTE:
This library can be used with the new Cockpit - Content Platform, a brand-new version of the Cockpit headless api-first CMS.
As for this basic version the API client is readonly. This is likely going to change in future versions.
A PHP API client for a very simple straightforward readonly access to the cockpit headless CMS data.
Installation
You can install the package via composer:
That's it. No more steps required in first place.
Usage
This section provides usage information. We refer to an instance of the \Remluben\CockpitClient\Client
class as client.
Basics
At first ensure to setup your client with sensible Guzzle settings to avoid timeouts and bad performance. Next you can call any method the client provides you with to fetch data from your Cockpit installation.
Error handling
Handling errors should be quite strait forward. Whenever something unexpected happens, a bad HTTP status code or an error is returned via API response the client reacts by throwing an Exception.
In other words, this means: only for HTTP status code 200 with a valid JSON response the request is considered as successful.
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
This software is released under the MIT license.