Download the PHP package marrow/framework without Composer
On this page you can find all versions of the php package marrow/framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package framework
This repository contains the framework core. It is not a ready-to-use application project: for starting an application, it is recommended to use the associated skeleton repository.
Table of contents
- About
- Requirements
- Installation
- Framework architecture
- Container and dependency injection
- Modules
- HTTP routing
- ORM and database
- Security and middleware
- CLI
- Health checks
- Package ecosystem
- Repository structure
- Testing and quality
- Contributing
About
Marrow is a PHP 8.2+ framework designed for modular, scalable, and testable applications. The project core includes the following building blocks:
- dependency container with automatic resolution via reflection;
- module system with explicit dependencies;
- HTTP kernel and console kernel;
- router with groups, named routes, and middleware;
- lightweight ORM based on models, relationships, and migrations;
- authentication and authorization system;
- Twig template engine;
- event handling, jobs, queue workers, and scheduling;
- pluggable health checks (database, cache, disk, queue) aggregated into a single
/healthreport.
The framework follows a modern architectural direction: clear separation of concerns, explicit dependencies, isolated modules, and service injection instead of global resolution.
Requirements
- PHP 8.2 or newer
- Composer 2+
- Common extensions:
pdo,mbstring,json - An application project using the recommended skeleton
The framework core is distributed as a Composer package. The skeleton remains the simplest way to bootstrap a complete and coherent application.
Installation
Recommended option: use the skeleton
Direct package option
Framework architecture
The core is structured around a few central classes:
Application: application runtime entry point; loads the environment, initializes base services, and boots modules;Container: IoC container with binding, singleton support, automatic instantiation, and inter-module access validation;ModuleManager: registers modules, validates imports, sorts them topologically, and triggers theregister()andboot()phases;Router: manages HTTP routes, middleware, groups, and resources;Kernel: HTTP and console kernel;Model: base model class for application data objects, schema access, relations, and write operations;Template\Engine: Twig rendering engine;Dispatcher: internal event bus.
Folder structure
Container and dependency injection
Marrow relies on a dependency container that resolves services through reflection on PHP types. It supports:
- automatic resolution by type hint;
- explicit binding via
bind()orsingleton(); - pre-created instances via
instance(); - named injection via the
#[Inject('...')]attribute; - access validation between modules based on declared exports.
Example:
The container also handles transitive dependencies and contextual resolution based on the calling module, which helps protect access to module providers.
Modules
A module is the main building block of Marrow. Each module is declared via the #[Module] attribute and has a two-phase lifecycle:
register(): register bindings and module services;boot(): load routes, Twig namespaces, event listeners, and other runtime elements.
Example:
Module validation
The ModuleManager validates:
- missing dependencies (
importsnot registered); - dependency cycles;
- boot order using topological sorting.
This ensures a module only starts when its dependencies are correctly declared and resolvable.
HTTP routing
Marrow’s router is fluent and framework-oriented. It supports:
- standard HTTP methods (
GET,POST,PUT,PATCH,DELETE); - route groups with
prefix,middleware, andnamespace; - REST resource management;
- URL generation by route name;
- controller parameter resolution and HTTP request handling.
Example:
Routing also relies on the container to instantiate controllers and inject the required dependencies.
Route also exposes two chainable shortcuts for the two most common middleware cases:
A module doesn't have to live under the application's local modules/ directory either — see Package ecosystem.
ORM and database
Marrow includes a model-oriented ORM without exposing a generic query builder as the primary design layer. Model classes can define attributes, casts, relationships, and scopes.
Example:
Included features:
- relationships such as
hasMany,belongsTo,belongsToMany,hasOne, andhasManyThrough; - query scopes;
- eager loading;
- migrations;
- soft deletes;
- support for PHP enums when applicable.
Security and middleware
The framework exposes a shared middleware pipeline for HTTP requests. Middlewares can be declared in a classic style (handle) or using a hook pattern (processRequest, processResponse, processException).
This enables handling:
- authentication;
- CORS;
- CSRF;
- data sanitization;
- sessions;
- throttling;
- HTTP header protection.
Security configuration is typed through ShieldConfig, and HTTP concerns are separated from application logic to keep the system more readable and maintainable.
CLI
The core includes a set of Symfony Console commands useful for generating modules, managing migrations, inspecting routes, and starting the development server.
Typical commands:
The command system is extensible and can also register module-specific commands.
Health checks
Health\HealthManager aggregates pluggable probes (database, cache, disk space, queue backlog) into one report, meant to be exposed behind a /health route for load balancers, uptime monitors, or container orchestrators:
Thresholds are configured per check in config/health.php. Writing a custom check is a two-method interface (name(), run(): HealthResult) — see the full guide in docs/health.md.
Package ecosystem
A module isn't limited to the application's local modules/ directory: BaseModule::path() resolves Views/, routes.php, and migrations by reflecting on the module class's own file location, so a module ships just as well from vendor/. Installing a package that declares its module in its own composer.json (extra.marrow.modules) is enough on its own — PackageDiscovery picks it up automatically at boot, no edit to config/modules.php required.
Official companion packages built on this mechanism, each an independent, self-documented Composer package (own README.md/LICENSE, installable on its own):
| Package | Purpose |
|---|---|
marrow/form-builder |
Django-style declarative forms — define fields on the backend, render and validate them without duplicating rules on the frontend |
marrow/anvil |
Local Docker Compose development environment (Sail's role, under its own name) |
marrow/ai-context |
Generates AGENTS.md — a live map of routes/modules/config for AI coding agents and new contributors |
See Modules (HMVC) for how the discovery mechanism itself works, if you want to ship your own.
Repository structure
This repository is a framework package. For a complete application project, it is preferable to use the corresponding skeleton, which provides the base runtime structure, modules, and configuration files.
Testing and quality
The project is configured for automated validation:
The scripts are defined in composer.json, including:
pestfor tests;phpstanfor static analysis;- a quality standard consistent with a modern PHP framework core.
Contributing
Contributions are welcome in line with the project conventions:
- PHP 8.2+ code with strict typing;
- PSR-12 and coherent conventions;
- tests for functional changes;
- respect for compatibility and versioning semantics;
- explicit PRs with a clear description of changes.
Recommended workflow
Then open a PR with a concise description of the feature or bug fix.
Marrow aims to provide a solid foundation for modular, testable, and maintainable PHP applications without relying on excessive abstractions or opaque conventions.
All versions of framework with dependencies
doctrine/dbal Version ^4.4
firebase/php-jwt Version ^7.0
league/flysystem Version ^3.29
monolog/monolog Version ^3.10
symfony/cache Version ^7.0
symfony/console Version ^7.0
symfony/http-client Version ^7.0
symfony/http-foundation Version ^7.0
symfony/mailer Version ^7.0
symfony/process Version ^7.0
symfony/rate-limiter Version ^7.0
symfony/var-dumper Version ^7.0
twig/twig Version ^3.27
vlucas/phpdotenv Version ^5.6