Download the PHP package dldl/webservice without Composer
On this page you can find all versions of the php package dldl/webservice. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dldl/webservice
More information about dldl/webservice
Files in dldl/webservice
Package webservice
Short Description WebService library that can be used to normalize WebServices calls and add cache support and more.
License MIT
Homepage https://dldl.io
Informations about the package webservice
dLdLWebService
⚠ Development for this library has stopped since HTTPlug is more complete and plays the same role.
This PHP library allows you to follow a normalized way to connect to your web services, with support for logs and cache following PSR-3 and PSR-6.
Installation
Install it using Composer:
Usage
Here is a simple example to see how this library can be used:
Of course, you may perform specific actions in the catch blocks.
The main idea is to split the web service requests into three parts:
- Connector, in charge to connect to the web service and to grab and/or send raw data from a predefined request
- Parser, in charge to transform this raw data to business objects
- WebService, in charge to check business conditions calling services but also to delegate the call to connectors and to parsers
This allows to separate the way data is retrieve from the way data is aim to be used. It can be easy to cache, log, add extensions such as proxies and change the type of connector at any moment (for example, to move from a SOAP to a REST web service).
Connectors must implement the ConnectorInterface
. The easiest way is to extend the AbstractConnector
class which provides
logs and cache out of the box. Connectors can use any technology such as cURL
, Guzzle
, Soap
or any specific library
but must be independent to the data it handles.
Contribution
Every functionality must be tested and documented. To contribute:
- Clone the repository
- Install dependencies, using composer:
composer install
- Run tests, using PHPUnit:
./vendor/bin/phpunit