MaplePHP
Your code. Your libraries. Your framework.
A high-performance PHP 8.2+ framework built on PSR standards. MVC architecture, dependency injection, routing, middleware, and full CLI support — with every component swappable.
composer create-project maplephp/maplephp my-app --stability=betaPSR-first
Built around PSR standards from the ground up.
- PSR-7 request and response objects
- PSR-11 dependency injection container
- PSR-15 middleware pipeline
- PSR-3 logging interface
- PSR-6 and PSR-16 caching
Modular architecture
Each maplephp/* package is independently installable.
- Use only the packages you need
- Swap any component with a PSR-compatible alternative
- No global state or magic facades
- Explicit dependency injection throughout
- Works as a full framework or piecemeal
Full-stack tooling
Web and CLI covered from a single project.
- FastRoute-based HTTP routing
- CLI command system with prompts
- Doctrine DBAL query builder
- Schema migration runner
- Twig template engine
Quick start
Install, define a route, create a controller, run the dev server.
Install the project
composer create-project maplephp/maplephp my-app --stability=beta
cd my-app
./maple serveDefine a route
// routers/web.php
$router->get("/hello/{name}", [App\Controllers\HelloController::class, "greet"]);Create a controller
namespace App\Controllers;
use MaplePHP\Core\Routing\DefaultController;
use MaplePHP\Http\Interfaces\PathInterface;
use Psr\Http\Message\ResponseInterface;
class HelloController extends DefaultController
{
public function greet(ResponseInterface $response, PathInterface $path): ResponseInterface
{
$name = $path->select("name")->last();
$response->getBody()->write("Hello, {$name}!");
return $response;
}
}Library ecosystem
Every maplephp/* package is independently installable via Composer.
maplephp/coreHttpKernel, CliKernel, App singleton, router dispatcher, DB, migrations
maplephp/httpPSR-7 ServerRequest, Response, Stream, Uri, HTTP client
maplephp/containerPSR-11 DI container with reflection-based autowiring
maplephp/emitronPSR-15 middleware dispatcher with built-in handlers
maplephp/validate50+ validators: email, URL, phone, dates, passwords, identity numbers
maplephp/cachePSR-6 and PSR-16 with FileSystem and Memcached handlers
maplephp/logPSR-3 logger with StreamHandler (auto-rotation), ErrorLogHandler, DBHandler
maplephp/unitaryTesting framework — 100k+ tests/sec, built-in mocking