webbj74 / jsdl-loader
A stand-alone JSON Service Description loader for Guzzle based on the ServiceDescriptionLoader class from Guzzle 3.x
Installs: 136 043
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 7
Forks: 0
Open Issues: 0
Requires
- php: >=5.5
Requires (Dev)
- phpcompatibility/php-compatibility: *
- phpmd/phpmd: @stable
- phpunit/phpunit: ^5.5 || ^6.0 || ^7.0 || ^8.0
- squizlabs/php_codesniffer: *
Suggests
- guzzlehttp/guzzle-services: Use service descriptions with Guzzle.
This package is not auto-updated.
Last update: 2025-03-01 20:34:50 UTC
README
A stand-alone JSON Service Description loader for Guzzle 5.x based on the ServiceDescriptionLoader class from Guzzle 3.x
Usage
This software is still pre-release.
Add to composer:
$ composer require "webbj74/jsdl-loader:~0.1"
or
$ composer require "webbj74/jsdl-loader:dev-master"
Based on the guzzle/guzzle-services example.
use GuzzleHttp\Client;
use GuzzleHttp\Command\Guzzle\Description;
use GuzzleHttp\Command\Guzzle\GuzzleClient;
use Webbj74\JSDL\Loader\ServiceDescriptionLoader;
$client = new Client();
$jsdlLoader = new ServiceDescriptionLoader();
$description = new Description($jsdlLoader->load($pathToServiceDescription));
// Create a new Guzzle Service Description client
$guzzleClient = new GuzzleClient($client, $description);