Download the PHP package programmatordev/php-api-sdk without Composer
On this page you can find all versions of the php package programmatordev/php-api-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download programmatordev/php-api-sdk
More information about programmatordev/php-api-sdk
Files in programmatordev/php-api-sdk
Package php-api-sdk
Short Description A fluent PHP library for creating API SDKs with PSR-18, PSR-17, PSR-6 and PSR-3 support
License MIT
Homepage https://github.com/programmatordev/php-api-sdk
Informations about the package php-api-sdk
PHP API SDK
These docs describe how to create API SDKs with this package.
This package is built for two developer audiences:
- SDK authors: developers creating concrete API SDKs with this library.
- SDK users: developers consuming those SDKs in applications.
The goal is to keep SDK authoring fluent and compact, keep SDK usage focused on real API resources, and still expose enough control for developers who need to customize or work around an SDK.
The practical guides below show how to build resources, map responses, and configure the HTTP pipeline. Read Design Approach for more about the reasoning behind the API shape.
Requirements
- PHP
>=8.1 - PSR-18 HTTP client support
- PSR-17 request and stream factory support
The package uses PHP-HTTP discovery for PSR-18 clients and PSR-17 factories. When the php-http/discovery Composer plugin is enabled, missing implementations can be installed automatically from the supported virtual packages.
Installation
SDK packages may still require or suggest concrete PSR-18 and PSR-17 implementations when they want tighter control over the default HTTP stack.
Guides
- Getting Started: create a small SDK with an API facade, resource, entity, and response mapping.
- Design Approach: the reasoning behind fluent SDK authoring, clean SDK usage, and hackability.
- API: SDK facade setup methods, configuration, and extension points.
- Resource Authoring: deeper guide for resource methods, query/header options, request bodies, entity mapping, collections, envelopes, and API-specific resource chains.
- Resources: resource classes and endpoint request helpers.
- Responses: decoded data, raw responses, entities, collections, envelopes, and context.
- Authentication: configure bearer, basic, header, query, HTTPlug, and custom authentication.
- HTTP Client: configure PSR-18 clients and PSR-17 factories.
- Cache: configure PSR-6 HTTP response caching.
- Logging: configure PSR-3 logging and HTTP/cache log output.
- Plugins: configure HTTPlug middleware and priority ordering.
- Hooks: run SDK-author callbacks around requests and responses.
Upgrading
See Upgrade to 3.0 for the high-level changes.
All versions of php-api-sdk with dependencies
ext-simplexml Version *
nyholm/append-query-string Version ^1.0
php-http/cache-plugin Version ^2.1
php-http/client-common Version ^2.7
php-http/discovery Version ^1.20
php-http/logger-plugin Version ^1.3
php-http/message Version ^1.16
psr/cache Version ^2.0|^3.0
psr/http-client Version ^1.0
psr/http-client-implementation Version ^1.0
psr/http-factory Version ^1.1
psr/http-factory-implementation Version ^1.0
psr/log Version ^2.0|^3.0