Search by

sardorbek_1408 / yadro-framework

Sardorbek

Lightweight modular PHP 8.2+ enterprise framework core with optional first-party components

Package info

github.com/sardorergashev09uzb-commits/yadro-framework

Type:project

pkg:composer/sardorbek_1408/yadro-framework

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.2.2 2026-08-28 05:27 UTC

This package is auto-updated.

Last update: 2026-08-28 05:27:26 UTC


README

PHP 8.2+ modular application framework: stable Core, replaceable Modules, optional first-party components.

Core must be stable. Modules must be replaceable bricks. Dependencies flow through contracts and DI.

Requirements

  • PHP 8.2+
  • PDO (MySQL/SQLite) for database features

Quick start

cd yadro
php -S localhost:8000 -t public

php bin/yadro make:module Blog
php bin/yadro make:migration create_posts_table
php bin/yadro migrate
php bin/yadro make:crud Post --module=Blog --context=admin
php bin/yadro module:list

Architecture

Application / Modules / Optional components
              ↓
     Contracts (Cache, Mail, Storage, Logger, UserProvider)
              ↓
Core: HTTP · Router · Container · Events · Database · Config · Module system

Rule: Core never imports Modules\*. Removing Admin/Cache/Mail must not break Core.

Lifecycle

Bootstrap → Core providers register → Modules discover/validate/register
         → Core providers boot → Modules boot

DI

Auto-wiring, interface binding, singleton/transient/scoped/factory, contextual binding, circular chain errors, php bin/yadro container:show Class.

Modules

  • Manifest: modules/{Name}/module.php
  • Required vs optional dependencies
  • CLI: module:list, module:enable, module:disable
  • Missing required dependency → explicit exception

Database

Connection, QueryBuilder (operator whitelist), Schema/Blueprint, Migrations, Model (fillable, casts, soft deletes, relations). migrate:fresh blocked in production.

Security

CSRF, XSS escaper, headers, PasswordHasher, AuthGuard, Gate, local-only generator, mass assignment protection.

Optional components

Disable via config/components.php or 'admin' => false in config/modules.php.

CRUD

Shared CrudConfig + CrudService. Admin vs Home = policy/config/UI only.

Testing

php tests/ArchitectureTest.php
php tests/ContainerTest.php
php tests/DatabaseTest.php
php tests/GeneratorTest.php
php tests/ComponentsTest.php
php tests/IsolationTest.php
php tests/SecurityAuditTest.php
composer test

Deployment

Set APP_ENV=production, strong APP_KEY, no public generator access, run migrations in CI/CD.

Docs

  • docs/ARCHITECTURE.md
  • docs/COMPONENTS.md
  • docs/AUDIT.md

License

MIT