Skip to content
Ray Fung edited this page Feb 26, 2026 · 4 revisions

Razy Framework

A modular PHP framework built for manageable development environments. Multi-site, distributor-based architecture with high performance and flexibility.

PHP 8.2+ PSR-4 / PSR-11 / PSR-12 / PSR-16 4,564 Tests 8,178 Assertions MIT License

🚀 Tutorial — Build Your First App → 🗺️ Learning Roadmap — 30 min → 1 day → 1 week → Get Started → GitHub

Features

📦

Modular Architecture

Reusable modules with controllers, views, plugins, and APIs. Vendor/package namespace structure with semantic versioning.

🌐

Multi-Site Distribution

Run multiple sites from one codebase. Distributors manage domains, modules, and configurations independently.

🔌

Plugin System

Extend Template, Collection, Statement, and Pipeline with custom plugins. Shared plugin trait across subsystems.

🗄️

Database Abstraction

Multi-driver support (MySQL, PostgreSQL, SQLite) with fluent Statement builder, Strategy-pattern SQL syntax builders, and Simple Syntax for shorthand SQL.

🎨

Template Engine

High-performance templating with variable tags, modifiers, function tags, and advanced block types (WRAPPER, RECURSION).

📡

Event System

Inter-module communication via EventEmitter pattern. Fire events, listen across modules, collect responses.

🔗

Cross-Module API

Provider/Consumer pattern for module-to-module integration. Handshake-based access control.

CLI & PHAR

Full CLI tooling via Razy.phar. Interactive shell, module validation, GitHub installer, and more.

🧪

Testing Suite

PHPUnit 10.5 with 4,564 tests and 8,178 assertions across 102 test classes. PSR-12 linting with PHP CS Fixer.

🏗️

Dependency Injection

PSR-11 compliant DI Container with auto-wiring, singleton/transient bindings, and alias support. Semantic exception hierarchy with 17 typed exceptions.

Quick Start

# Install via Composer
composer require rayfunghk/razy

# Build Razy environment
php Razy.phar build

# Initialize a new distributor
php Razy.phar init dist mysite

# Generate .htaccess rewrite rules
php Razy.phar rewrite mysite

# Run interactive shell
php Razy.phar runapp mysite

Architecture Overview

Bootstrap→Application→Domain→Distributor→Modules→Routing

The framework follows a pipeline from bootstrap to route execution. Each distributor manages its own set of modules, which are loaded in dependency order and go through a well-defined lifecycle.

Learn more about the architecture →

Roadmap to v1.0

Feature Status
GitHub Module Installer ✅ Done
Simplified Application Flow ✅ Done
App Container CLI (runapp) ✅ Done
Revamped Action & Validate ✅ Done
Cache System (PSR-16) ✅ Done
Thread System ✅ Done
Table/Column Class Revamp ✅ Done
DI Container (PSR-11) ✅ Done
Semantic Exception Hierarchy ✅ Done
Statement Builder Refactor ✅ Done
Cross-Distributor Communication Planned

Next → Installation

Clone this wiki locally