PHP Components
The Gluo Layout
Gluo is split into two packages:
- byjg/gluo — the project starter. This is what you type in
composer create-project byjg/gluo my-api. After creation the project is yours: the namespace is renamed, and the files insrc/,config/,db/anddocker/belong to you. - byjg/gluo-core — the framework core, installed in
vendor/. It provides the base classes (BaseLoginController,BaseRepository,BaseService,BaseUser), the attributes (RequireAuthenticated,RequireRole,ValidateRequest), utilities (JwtContext,OpenApiContext,FakeApiRequester), the builder (migration, OpenAPI generation, code generator) and the test harness. Improvements arrive with a plaincomposer update.
byjg/gluo-core is the glue ("gluo" is Esperanto for glue) that binds the byjg components into a REST architecture.
Class Dependency
Component Description
Your project (byjg/gluo starter)
The starter keeps its own dependencies to a minimum:
- byjg/gluo-core - The Gluo framework core (see below)
- byjg/scriptify - Transform any PHP class into an executable script callable from the command line (used by
composer terminal)
Everything else arrives through byjg/gluo-core, so a framework upgrade is a single composer update byjg/gluo-core.
Framework core dependencies (byjg/gluo-core)
The core binds these byjg components together:
- byjg/config - A very basic and minimalist PSR-11 implementation for config management and dependency injection
- byjg/anydataset-db - Relational database abstraction layer, part of the Anydataset project
- byjg/micro-orm - A micro framework for creating a very simple decoupled ORM
- byjg/authuser - Simple and customizable library for user authentication using repository and service layer architecture
- byjg/mailwrapper - Lightweight wrapper for sending email with a decoupled interface
- byjg/restserver - Create RESTful services with customizable output handlers and auto-generate routes from swagger.json
- byjg/swagger-test - Tools for testing REST calls based on the OpenAPI specification using PHPUnit
- byjg/migration - Framework-agnostic database migration tool using pure SQL commands
- byjg/jinja-php - Lightweight PHP implementation of the Jinja2 template engine (powers the code generator templates)
- byjg/cache-engine - PSR-6 and PSR-16 cache implementation
- byjg/serializer - Serialization utilities for JSON, XML, and YAML
Core Infrastructure Components
These are the foundational components used by multiple dependencies:
- byjg/anydataset - Agnostic data source abstraction layer
- byjg/xmlutil - XML manipulation utilities
- byjg/uri - URI manipulation and PSR-7 HTTP message support
- byjg/jwt-wrapper - JWT token handling wrapper
- byjg/webrequest - PSR-18 HTTP client implementation
- byjg/convert - Conversion utilities
- byjg/singleton-pattern - Singleton pattern implementation
Dependency Legend
- o--o - Required dependency (composer require)
- Green - Your project (the byjg/gluo starter)
- Yellow - The Gluo framework core (updatable via composer)
- White - Component dependencies
External Dependencies
The project also depends on several external packages:
- zircote/swagger-php - Generate interactive documentation for RESTful APIs using PHP attributes
- Various PSR interfaces (PSR-3, PSR-6, PSR-7, PSR-11, PSR-16, PSR-18)
- symfony/ components (yaml, console, etc.)
- firebase/php-jwt - JWT implementation
- phpmailer/phpmailer - Email sending library
- aws/aws-sdk-php - AWS SDK for PHP (used by mailwrapper)