Download the PHP package phillipsharring/handlr-backend without Composer
On this page you can find all versions of the php package phillipsharring/handlr-backend. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download phillipsharring/handlr-backend
More information about phillipsharring/handlr-backend
Files in phillipsharring/handlr-backend
Download phillipsharring/handlr-backend
More information about phillipsharring/handlr-backend
Files in phillipsharring/handlr-backend
Vendor phillipsharring
Package handlr-backend
Short Description Handlr is a lightweight PHP middleware style framework.
License MIT
Homepage https://github.com/phillipsharring/handlr-mono/tree/main/packages/backend
Package handlr-backend
Short Description Handlr is a lightweight PHP middleware style framework.
License MIT
Homepage https://github.com/phillipsharring/handlr-mono/tree/main/packages/backend
Please rate this library. Is it a good library?
Informations about the package handlr-backend
Handlr Backend
A lightweight PHP middleware-style framework built around the Pipe + Handler pattern.
📖 Documentation: https://phillipsharring.github.io/handlr-mono/backend/
Installation
For a ready-to-go project structure, scaffold a full app with composer create-project phillipsharring/handlr-app (see the app skeleton).
Architecture
Handlr separates HTTP concerns from business logic:
- Pipe - middleware that sees
Request/Response. Handles auth, validation, CORS, CSRF, etc. - Handler - pure business logic. Receives typed
HandlerInput, returnsHandlerResult. No HTTP awareness. - HandlerInput - validated input object. Used identically for HTTP requests and event listeners.
- HandlerResult - structured result:
ok($data)orfail($errors).
Below the Pipe layer, everything is Handler/HandlerInput - whether it came from HTTP or an event dispatch.
What's Included
Core
Request/Response- HTTP abstractionsRouter/RouteGroup- routing with middleware pipelines and{param:type}constraintsKernel- request dispatcherContainer- dependency injection with singleton/bind patternsEventManager- synchronous pub/sub
Database
Db- lazy PDO wrapper with transaction supportNullDb- throws on query (for simulation/test modes)Table- CRUD base class (insert, update, delete, findWhere, findById, paginate)Record- domain object base class with UUID supportQuery- read-only query base class (rows, row, scalar, count, column)MigrationRunner/Seeder- database lifecycle
Auth & Security
AuthContext- request-scoped user identity holderAuthorizationService- RBAC permission checking via injectablePermissionsProviderInterfaceAuthSubject/AuthorizedUser- authenticated user contract and implementation- Session-based auth pipes:
StartSessionPipe,SessionAuthPipe,RequireAuthPipe - Permission guard pipes:
RequirePermissionPipe,RequireAllPermissionsPipe CsrfService- token generation, validation, and rotation- CSRF pipes:
EnsureCsrfTokenPipe,VerifyCsrfTokenPipe CorsPipe/VerifyOriginPipe- origin validation
Validation
Validatorwith rule strings ('string|min:3','int|min:1,max:50')- 20+ built-in rules, 9 sanitizers
ValidatedInputFactory- pipe-to-handler validation bridge
API
Presenter- response envelope builder (success, error, validation error formatting)
Utilities
SortableListtrait - column sort extraction and meta generationTreeSortKeyService- hierarchical sort key computation with lockingLogger- file-based PSR-3 logger
Code Generation
make:migration,make:seeder,make:record,make:table,make:handler,make:pipe,make:scaffold
Standard Pipes
| Pipe | Purpose |
|---|---|
ErrorPipe |
Global exception handler |
LogPipe |
Request logging |
JsonPipe |
JSON body parsing |
ViewPipe |
Template rendering |
StartSessionPipe |
PHP session initialization |
SessionAuthPipe |
Session-to-AuthContext bridge |
RequireAuthPipe |
401 if not authenticated |
RequirePermissionPipe |
403 if missing any listed permission |
RequireAllPermissionsPipe |
403 if missing all listed permissions |
CorsPipe |
Same-origin CORS headers |
VerifyOriginPipe |
Origin/Referer validation for writes |
EnsureCsrfTokenPipe |
Token initialization + cookie transport |
VerifyCsrfTokenPipe |
Token validation + rotation |
Quick Example
Requirements
- PHP >= 8.4
- PDO extension
License
MIT
All versions of handlr-backend with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.4
ext-pdo Version *
psr/log Version ^3.0
vlucas/phpdotenv Version ^5.6
ramsey/uuid Version ^4.7
adbario/php-dot-notation Version ^3.3
symfony/console Version ^7.0
symfony/filesystem Version ^7.0
symfony/process Version ^7.0
ext-pdo Version *
psr/log Version ^3.0
vlucas/phpdotenv Version ^5.6
ramsey/uuid Version ^4.7
adbario/php-dot-notation Version ^3.3
symfony/console Version ^7.0
symfony/filesystem Version ^7.0
symfony/process Version ^7.0
The package phillipsharring/handlr-backend contains the following files
Loading the files please wait ...