AGENTS.md for ByJG PHP components
A ready-made AGENTS.md that teaches any AI coding agent how to work with the ByJG PHP components. Download it into your project.
PHP libraries and components
View all tagsA ready-made AGENTS.md that teaches any AI coding agent how to work with the ByJG PHP components. Download it into your project.
Read any data source with the same code: a database, JSON, XML, a CSV or fixed-width file, a NoSQL store.
Read an XML document as a table: choose the node that is a row, map each field with XPath, iterate the rows.
Classify text in PHP (spam or not, topic, language) with Bayesian filters that ask an LLM when they are unsure and learn from its answer. Two engines:
PSR-6 and PSR-16 caching over memory, files, Redis or Memcached, extended with atomic increment, decrement and compare-and-swap.
Configuration and dependency injection in one PSR-11 container, with environments that inherit from each other and autowiring only where you choose it.
One API for every relational database, from a connection URI: MySQL, PostgreSQL, SQL Server, Oracle, SQLite,
Version your database with plain SQL files, from any framework or none.
Run code by feature flag without if blocks: register handlers, or mark methods with an attribute, and dispatch.
Busca que entende o português do Brasil: "brasília" e "brazilia" viram a mesma chave, apesar dos erros de ortografia.
The Gluo framework core — the glue ("gluo" is Esperanto for glue) that binds the
Use the ByJG components in Laravel with no effort: composer require a component, and its connector wires it into your application.
Gluo (Esperanto for glue) is a production-ready PHP REST API starter: create a project you fully own, powered by an updatable framework core — so you focus on business logic, not infrastructure.
Image operations in one fluent line over GD: resize, crop, rotate, stamp, write text, and convert between formats, SVG included.
Jinja2 templates in pure PHP: the same template renders in your Python and your PHP code.
Read a JSON document as a table: point at a path, declare the fields, iterate the rows.
Keep using $_SESSION, but store the session in a signed JWT cookie instead of on the server: no Redis, no sticky sessions.
Create and validate JWT tokens in a few lines, with the same API for a shared secret or a key pair, and no weak keys accepted.
Typed PHP objects for Chat Completions requests (messages, tools, tool calls) that work with both OpenAI and Ollama.
One interface to send email, whatever the service behind it. Change the provider, or add a new one, without changing your code.
One interface to publish and consume messages, whatever the broker behind it. Change the queue, or write a new connector, without changing your code.
A small ORM that maps any class to a table, and lets you choose the pattern per entity: Repository, Data Mapper or Active Record.
One entry point to convert data from any supported format to any other: load it once, ask for the format you need.
One interface for document databases and one for key/value stores, whatever the service behind them.
Symmetric encryption without storing or sending a key: each message derives its own key from a shared key seed.
Sponsor
Run PHP code in parallel with one API (threads, thread pools and JavaScript-like promises) that works on any PHP: real threads on ZTS, forked processes on the CLI, child processes under PHP-FPM.
A PSR-7 URI that also works as a connection string//, amqp// URIs of the ByJG components.
It creates a simple abstraction layer to publish and consume messages from the RabbitMQ Server using the component byjg/message-queue-client.
A simple and efficient abstraction layer for publishing and consuming messages from Redis queues using the byjg/message-queue-client framework.
Utilities for the two things that go wrong when work is spread across processes: something is not
A REST server whose routes can come straight from your OpenAPI specification: document the API once, and that document is the router.
Run any existing PHP method from the command line, or install it as a system service, without writing a command class.
Turn numbers and UUIDs into short, URL-friendly strings, and back.
The singleton pattern as one trait: add it to a class, and that class has exactly one instance.
One interface to send SMS through any provider, and the right provider chosen by the phone number's country.
Publish a PHP class as a SOAP service with attributes: the WSDL and an HTML documentation page are generated for you.
A finite state machine for business workflows: states from an enum, transitions with conditions, and side effects that run only after you persist the move.
The text conversions UTF-8 code keeps rewriting, in one place: HTML entities, accents, emoji, MIME encoded words and ASCII-only text.
Test your REST API against its OpenAPI specification with PHPUnit: every request and response is checked against the contract.
Read delimited (CSV) and fixed-width text files as rows, from disk or from a URL.
Users, passwords, tokens and per-user properties behind one service, on any database, without adopting a framework.
Digital wallets with an audit trail you can trust: reserved funds, idempotent operations, and a transaction chain that cannot be rewritten unnoticed.
A PSR-18 HTTP client on cURL, with its own PSR-7 messages, parallel requests and a mock client for tests, in one small package.
Write numbers and money amounts in words, with each language's grammar: English, Portuguese and Italian.
Build, query and convert XML without fighting DOM: a fluent API, XPath with namespaces, and PHP models mapped to XML with attributes.