oryx/mvc
最新稳定版本:v1.0
Composer 安装命令:
composer require oryx/mvc
包简介
Lightweight MVC framework for rapid prototyping - A librarian package built on PHP League ecosystem
README 文档
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.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-Source-Code
- 更新时间: 2026-03-27