{"id":40056661,"url":"https://github.com/dldl/webservice","last_synced_at":"2026-01-19T06:37:04.319Z","repository":{"id":56970022,"uuid":"72241149","full_name":"dldl/webservice","owner":"dldl","description":"WebService library that can be used to normalize WebServices calls and add cache support and more.","archived":false,"fork":false,"pushed_at":"2017-04-06T10:28:49.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-20T05:06:31.622Z","etag":null,"topics":["php","php-library","webservice"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/dldl/webservice","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dldl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-28T20:51:11.000Z","updated_at":"2017-04-10T09:47:45.000Z","dependencies_parsed_at":"2022-08-21T10:50:42.123Z","dependency_job_id":null,"html_url":"https://github.com/dldl/webservice","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/dldl/webservice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dldl%2Fwebservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dldl%2Fwebservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dldl%2Fwebservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dldl%2Fwebservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dldl","download_url":"https://codeload.github.com/dldl/webservice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dldl%2Fwebservice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28562408,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T03:31:16.861Z","status":"ssl_error","status_checked_at":"2026-01-19T03:31:15.069Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","php-library","webservice"],"created_at":"2026-01-19T06:37:04.251Z","updated_at":"2026-01-19T06:37:04.308Z","avatar_url":"https://github.com/dldl.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"dLdLWebService\n==============\n\n**⚠ Development for this library has stopped since [HTTPlug](https://github.com/php-http/httplug) is more complete and plays the same role.**\n\nThis PHP library allows you to follow a normalized way to connect to your web services, with support for logs and cache following\nPSR-3 and PSR-6.\n\n[![Build Status](https://travis-ci.org/dldl/webservice.svg?branch=master)](https://travis-ci.org/dldl/webservice)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/d5e04165-7382-4cfa-aa34-8860f96af5ab/mini.png)](https://insight.sensiolabs.com/projects/d5e04165-7382-4cfa-aa34-8860f96af5ab)\n[![Latest Stable Version](https://poser.pugx.org/dldl/webservice/v/stable)](https://packagist.org/packages/dldl/webservice)\n![Licence](https://img.shields.io/github/license/dldl/webservice.svg)\n\nInstallation\n------------\n\nInstall it using Composer:\n\n```sh\ncomposer require dldl/webservice\n```\n\nUsage\n-----\n\nHere is a simple example to see how this library can be used:\n\n```php\n\u003c?php\n\nnamespace MyApp\\WebService;\n\nuse dLdL\\WebService\\WebServiceInterface;\nuse dLdL\\WebService\\ConnectorInterface;\nuse dLdL\\WebService\\ParserInterface;\nuse dLdL\\WebService\\Exception\\WebServiceException;\nuse dLdL\\WebService\\Http\\Request;\n\nclass FacebookWebService implements WebServiceInterface\n{\n    private $connector;\n    private $parser;\n    private $host;\n\n    public function __construct(ConnectorInterface $connector, ParserInterface $parser, $host)\n    {\n        $this-\u003econnector = $connector;\n        $this-\u003eparser = $parser;\n        $this-\u003ehost = $host;\n    }\n\n    public function getConnector()\n    {\n        return $this-\u003econnector;\n    }\n    \n    public function getPosts($facebookUsername)\n    {\n        try {\n            $this-\u003egetConnector()-\u003econnect($this-\u003ehost);\n        } catch (WebServiceException $e) {\n            return [];\n        }\n        \n        $request = new Request($facebookUsername . '/feed');\n        $this-\u003egetConnector()-\u003egetCache()-\u003egetConfig()-\u003eadd($request, 60*60*24);\n        \n        try {\n            $postData = $this-\u003egetConnector()-\u003esendRequest($request);\n        } catch (WebServiceException $e) {\n            return [];\n        }\n        \n        $this-\u003egetConnector()-\u003edisconnect();\n        \n        return $this-\u003eparser-\u003eparse($postData);\n    }\n}\n```\n\nOf course, you may perform specific actions in the catch blocks.\n\nThe main idea is to split the web service requests into three parts:\n\n - *Connector*, in charge to connect to the web service and to grab and/or send raw data from a predefined request\n - *Parser*, in charge to transform this raw data to business objects\n - *WebService*, in charge to check business conditions calling services but also to delegate the call to *connectors*\n   and to *parsers*\n \nThis allows to separate the way data is retrieve from the way data is aim to be used. It can be easy to cache, log,\nadd extensions such as proxies and change the type of connector at any moment (for example, to move from a SOAP to a\nREST web service).\n\nConnectors must implement the `ConnectorInterface`. The easiest way is to extend the `AbstractConnector` class which provides\nlogs and cache out of the box. Connectors can use any technology such as `cURL`, `Guzzle`, `Soap` or any specific library\nbut must be independent to the data it handles.\n\nContribution\n------------\n\nEvery functionality must be tested and documented. To contribute:\n\n 1. Clone the repository\n 2. Install dependencies, using composer: `composer install`\n 3. Run tests, using PHPUnit: `./vendor/bin/phpunit`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdldl%2Fwebservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdldl%2Fwebservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdldl%2Fwebservice/lists"}