oryx / mvc
Lightweight MVC framework for rapid prototyping - A librarian package built on PHP League ecosystem
v1.0
2026-03-27 19:37 UTC
Requires
- php: ^8.2
- laminas/laminas-diactoros: ^2.0|^3.0
- league/container: ^3.0|^4.0
- league/plates: ^3.0|^4.0
- league/route: ^5.0
- psr/container: ^1.0|^2.0
- psr/http-message: ^1.0|^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2026-03-30 08:43:23 UTC
README
Lightweight MVC framework for rapid prototyping - A librarian package built on PHP League ecosystem.
Requirements
- PHP 8.2+
Installation
composer install
Development Server
php -S 0.0.0.0:1213 -t public
Architecture
src/
├── Application.php # Entry point, DI container + router config
├── AbstractController.php # Base controller with render/json helpers
├── ControllerInterface.php # Contract for controllers
├── Controller/
│ └── HomeController.php # Concrete controllers extend AbstractController
├── Http/
│ └── RequestHandler.php # Handles PSR-7 request/response operations
├── Model/
│ ├── AbstractModel.php # In-memory CRUD model
│ └── ModelInterface.php
├── ServiceProvider.php # Dependency injection container configuration
└── View/
├── PlatesView.php # League Plates template engine wrapper
└── ViewInterface.php
Components
- Controller: Handles HTTP requests
- Model: Data layer (abstract, implement as needed)
- View: Template rendering via Plates
- ServiceProvider: Configures dependency injection container
- RequestHandler: PSR-7 request/response handling utilities
Available Commands
composer test # Run PHPUnit tests composer analyse # Run PHPStan static analysis
Testing
Run all tests:
composer test
Run a single test class:
vendor/bin/phpunit tests/Unit/ApplicationTest.php
Run a single test method:
vendor/bin/phpunit --filter testCreateReturnsDataWithId
Run tests matching a pattern:
vendor/bin/phpunit --filter AbstractModel
Static Analysis
Run PHPStan (level 6):
composer analyse
# or
vendor/bin/phpstan analyse
Note: PHPStan runs against src/ only. Tests are excluded from analysis.
For detailed coding standards, architecture patterns, and development guidelines, refer to AGENTS.md.