oryx/mvc

Lightweight MVC framework for rapid prototyping - A librarian package built on PHP League ecosystem

Maintainers

Package info

github.com/pbrilius/mvc

pkg:composer/oryx/mvc

Statistics

Installs: 1

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0 2026-03-27 19:37 UTC

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.