Download the PHP package tugrul/apigen without Composer
On this page you can find all versions of the php package tugrul/apigen. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download tugrul/apigen
More information about tugrul/apigen
Files in tugrul/apigen
Download tugrul/apigen
More information about tugrul/apigen
Files in tugrul/apigen
Please rate this library. Is it a good library?
Informations about the package apigen
Tugrul ApiGen
Generate REST API SDK clients from annotated PHP interfaces.
Define your API surface as a PHP interface, decorate methods with attributes, run the generator — done. ApiGen handles URL building, parameter binding, body encoding, authentication, and response decoding. You bring the PSR-18 HTTP client of your choice.
Requirements
| Requirement | Version |
|---|---|
| PHP | ≥ 8.1 |
| psr/http-client | ^1.0 |
| psr/http-factory | ^1.0 |
| psr/http-message | ^1.1 || ^2.0 |
Installation
Documentation
| Topic | Description |
|---|---|
| Quick Start | Define → Generate → Use in 5 minutes |
| Attributes Reference | Every attribute, target, and parameter |
| Authentication | Built-in strategies, OAuth 2, custom auth |
| Code Generation | StubGenerator, naming strategies, PSR-4 paths |
| CLI Tool | apigen generate, apigen list, config files |
| Client Configuration | ClientBuilder, middleware, custom decoders |
| ProxyRegistry | Group multiple stubs under one object |
| Error Handling | ApiException, error table |
| Testing | Running tests, testing your own stubs |
| Architecture | Package structure, request lifecycle |
Key Features
- Attribute-driven — HTTP verbs, path/query/header/body binding, auth, encoding, and response types are all declared with native PHP 8 attributes. No XML, no YAML, no code to write beyond the interface.
- PSR-18 transport — bring your own HTTP client. Guzzle, Symfony HttpClient, Buzz, or any PSR-18 implementation.
- Pluggable auth — Bearer token, API key, Basic, HMAC, OAuth 2 client credentials, or your own
AuthStrategy. Per-endpoint overrides with#[UseAuth]. - OAuth 2 token caching — in-memory, PHP session, filesystem, or any PSR-16 store (Redis, Memcached, APCu). Auto-refresh with configurable leeway.
- Five naming strategies — control the generated class name and output namespace. Default, Suffix, Sub-namespace, Callable, and per-interface Map.
- PSR-4 aware output paths — reads
composer.jsonto compute the correct subdirectory offset, avoiding double-nesting of namespace roots. - CLI tool —
apigen generateandapigen listcommands with config file support. - Middleware — chain pre/post request hooks for logging, retry, rate-limiting, and more.
At a Glance
License
MIT
All versions of apigen with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
The package tugrul/apigen contains the following files
Loading the files please wait ...