monkeyslegion@2.0,PHP 8.4+,26 packages

A Modern PHP Platform. Not Just a Framework.

Attribute-first architecture, compiled infrastructure, PSR-aligned internals, first-party auth & security, and a unique AI orchestration engine — all delivered through a modular 26-package ecosystem.

What Defines MonkeysLegion v2

Not a minimal micro-framework. Not a legacy enterprise stack. A modern PHP application platform.

PHP 8.4 Baseline

Property hooks and strict typing are first-class design inputs, not future compatibility goals. Every package targets PHP 8.4+.

🏷️

Attribute-First Architecture

Routes, validation, providers, listeners, and commands live next to the code they control — no YAML, no route files, no registration layers.

🔧

Compiled Container & Config

Autowiring in dev, compiled static PHP arrays in production. Zero runtime reflection, zero parsing overhead.

📐

PSR-Aligned Internals

PSR-7, 11, 14, 15, 16, and 17 are part of the architecture. Replacement and modular adoption stay easy.

🛡️

Integrated Security & Auth

JWT, OAuth2, TOTP 2FA, RBAC, rate limiting, CSRF, CORS, security headers — first-party, not scattered across packages.

🤖

AI-Native Direction

Apex is a full orchestration layer — multi-provider routing, schemas, pipelines, crews, guardrails, budgeting, and MCP support.

Architecture at a Glance

Convention-based discovery, compiled configuration, and a clear separation of concerns.

TEXT
my-app/
├─ app/
│  ├─ Controller/
│  ├─ Dto/
│  ├─ Entity/
│  └─ Auth/
├─ config/
│  ├─ app.php
│  ├─ database.php
│  └─ *.mlc
├─ public/
├─ resources/
│  └─ views/
├─ var/
│  ├─ cache/
│  └─ migrations/
├─ storage/
├─ tests/
└─ bin/

How it works

  • Controllers & DTOs are discovered automatically via attributes
  • Configuration lives in .mlc files with typed parsing and caching
  • Templates compile to optimized PHP under resources/views
  • Migrations are generated into var/migrations from entity diffs
  • Runtime artifacts compile into cache directories for zero-overhead production.

The Package Ecosystem

MonkeysLegion isn't a monolith. It's built from 26 independently-versioned packages that compose beautifully together.

26
Composer Packages
8.4
PHP Minimum
6 Supported
PSR Standards
Decoupled
Architecture
🤖

Apex AI

First-party AI orchestration, agent crews, and tool calling built directly into the framework.

🔐

Auth & Security

JWT, OAuth2, TOTP 2FA, API keys, RBAC, and Argon2id out of the box.

🚀

Core & Router

Attribute-based HTTP routing, compiled DI, and rapid boot lifecycle.

Get everything with one command

$ composer require monkeyscloud/monkeyslegion-skeleton my-app

The Request Pipeline

Every HTTP request flows through a PSR-15 middleware stack before reaching your controller.

Benchmarked, not marketed.

All numbers produced on Apple Silicon with PHP 8.5.3, no opcache preloading, warm JIT, identical test harnesses.

Operation
Ops/sec
vs Laravel
vs Symfony
Entity creation
6M
~140× faster
~114× faster
DTO construction
10.9M
~60× faster
~54× faster
Resource serialization
43.8K
~5.5× faster
~3.6× faster
Enum operations
8.7M
~25× faster
~22× faster
Property hooks (email)
11.1M
N/A
N/A
Computed properties
41M
N/A
N/A
Peak memory (cold boot)
4MB
≈ 22 MB
≈ 14 MB