A progressive PHP framework for building effecient and scalable server-side applications.
Welcome to the AssegaiPHP common library! This package provides a set of common classes and utilities that can be used in any AssegaiPHP project.
The package includes the following features:
- HttpClient class: A simple and flexible class for performing HTTP requests. It supports
GET,POST,PUT,DELETEand other request methods, and can also handle request headers and parameters. - Queue contracts: Versioned JSON job encoding, callback job-type discovery, typed hydration, and canonical one-delivery process results shared by first-party queue drivers.
- Utility classes: A collection of classes for common tasks such as logging, path manipulation, and more.
All classes are designed to be injectable and can be easily integrated into any AssegaiPHP application.
For commit and pull request conventions in this repo, see:
To install the package, simply require it in your composer.json file:
composer require assegaiphp/commonYou can then use the classes in your application by importing the namespace:
use Assegai\Common\Http\HttpClient;Queue transports use JsonQueueJobCodec to preserve a job's top-level class and JSON-safe state. During consumption, QueueJobTypeResolver reads the processor's first parameter and the codec hydrates that declared domain type. Legacy JSON objects remain readable, while processors declared only as object receive stdClass.
You can also use the #[Injectable] attribute to easily inject the HttpClient class into your controllers and services.
We hope you find the AssegaiPHP common library useful in your projects! If you have any questions or feedback, please open an issue on the GitHub repository.
