Download the PHP package dynart/micro without Composer
On this page you can find all versions of the php package dynart/micro. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package micro
Micro PHP Framework
A lightweight PHP micro framework with dependency injection, routing, templating, i18n, form handling, and CLI support. No magic, no bloat — just the essentials.
| **Quick links** | [API Docs](https://micro.dynart.net/docs/api/) • [Coverage Report](https://micro.dynart.net/reports/coverage-html/) • [Test Repo](https://github.com/goph-R/dynart-micro-test) |
📦 Installation
⚡ Quick Start
index.php
Controllers/HomeController.php
composer.json
config.ini.php
🏗️ Architecture
🧱 Components
💡 DI Container — Micro
Static service locator with reflection-based auto-wiring. All services are singletons.
Classes with a postConstruct() method get it called automatically after creation.
🛣️ Routing — Router
Path variables use ? wildcards. Controller methods return string for HTML or array for JSON.
PHP 8 attributes (active by default, controlled by app.use_route_attributes):
⚙️ Configuration — Config
INI-based with dot-notation keys, environment variable substitution, and path aliases.
🎨 View / Templating — View
PHP templates (.phtml) with namespaces, layouts, blocks, and theme overrides.
Layout system:
📝 Forms — Form
CSRF protection, field binding, validators, error tracking. Work in progress
🌐 Internationalization — Translation
INI-based locale files with variable substitution.
Auto locale detection via LocaleResolver middleware (Accept-Language header + URL prefix):
📡 Events — EventService
Pub/sub observer pattern with DI-compatible callables.
Built-in events: app:init_finished, webapp:route_matched, cliapp:command_matched
💻 CLI Support — CliApp
Argument parsing with named params and boolean flags.
🔐 JWT Authentication — JwtAuth
Attribute-driven authorization backed by JWT tokens. Enable with useJwtAuth(). Route attributes are active by default — no extra setup needed.
Controller annotations:
Config:
The framework only validates the token and resolves permissions. Issuing tokens (e.g. after OAuth with Google/Facebook) is the application's responsibility. Requires firebase/php-jwt ^7.0.
Events emitted by JwtAuth: jwtauth:user_set, jwtauth:authorization_granted, jwtauth:authorization_denied
🔌 Middleware
Implement MiddlewareInterface and register. Runs after init(), before process().
🗂️ Project Structure
🔍 Related Packages
| Package | Description |
|---|---|
| dynart-micro-entities | ORM / entity layer with PDO, query builder, dirty tracking |
📄 License
Apache 2.0
All versions of micro with dependencies
katzgrau/klogger Version dev-master
firebase/php-jwt Version ^7.0
ext-ctype Version *
ext-pdo Version *