Download the PHP package enflow/redirect-pizza-php-sdk without Composer
On this page you can find all versions of the php package enflow/redirect-pizza-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download enflow/redirect-pizza-php-sdk
More information about enflow/redirect-pizza-php-sdk
Files in enflow/redirect-pizza-php-sdk
Package redirect-pizza-php-sdk
Short Description An SDK to easily work with the redirect.pizza API
License MIT
Homepage https://github.com/enflow/redirect-pizza-php-sdk
Informations about the package redirect-pizza-php-sdk
SDK to easily work with the redirect.pizza API
This package is the official PHP SDK for the redirect.pizza API, built with Saloon v4.
Behind the scenes, the SDK uses Saloon to make the HTTP requests.
Installation
Upgrading from 2.x? See UPGRADE.md.
Usage
Setting a timeout
By default, the SDK will wait for a response for 10 seconds. You can change this by passing a timeoutInSeconds option to the constructor:
Handling errors
The SDK will throw an exception if the API returns an error. For validation errors, the SDK will throw a ValidationException.
For all other errors, the SDK will throw a \RedirectPizza\PhpSdk\Exceptions\RedirectPizzaException.
Redirects
Domains
Email forwards
Analytics (beta)
Raw hits and cursor pagination
Unlike redirects, domains, and users (page-based), raw hits use cursor pagination. The API returns meta.next_cursor; the SDK follows that cursor until it is null.
rawHits() returns an iterable that walks every page for you:
For more control (for example limiting page size), build the Saloon paginator yourself:
Each page is fetched only as you iterate. Stop early by breaking out of the loop when you have enough results.
Team
Users
Utils
These endpoints do not require authentication.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Michel Bardelmeijer
- All Contributors
This package is greatly inspired by the Oh Dear PHP SDK by Freek van der Herten and Mattias Geniar.
License
The MIT License (MIT). Please see License File for more information.