Skip to main content
MaplePHP

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.

PHP 8.2+PSR-compliantBeta
composer create-project maplephp/maplephp my-app --stability=beta

PSR-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.

1

Install the project

composer create-project maplephp/maplephp my-app --stability=beta
cd my-app
./maple serve
2

Define a route

// routers/web.php
$router->get("/hello/{name}", [App\Controllers\HelloController::class, "greet"]);
3

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/core

HttpKernel, CliKernel, App singleton, router dispatcher, DB, migrations

maplephp/http

PSR-7 ServerRequest, Response, Stream, Uri, HTTP client

maplephp/container

PSR-11 DI container with reflection-based autowiring

maplephp/emitron

PSR-15 middleware dispatcher with built-in handlers

maplephp/validate

50+ validators: email, URL, phone, dates, passwords, identity numbers

maplephp/cache

PSR-6 and PSR-16 with FileSystem and Memcached handlers

maplephp/log

PSR-3 logger with StreamHandler (auto-rotation), ErrorLogHandler, DBHandler

maplephp/unitary

Testing framework — 100k+ tests/sec, built-in mocking