sardorbek_1408 / yadro-framework
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
Requires
- php: >=8.2
- ext-dom: *
- ext-libxml: *
- psr/container: ^2.0
- psr/event-dispatcher: ^1.0
- psr/http-message: ^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
- psr/log: ^3.0
Requires (Dev)
None
Suggests
- monolog/monolog: Full-featured PSR-3 logger
- nyholm/psr7: Lightweight PSR-7 implementation alternative
Provides
None
Conflicts
None
Replaces
None
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.mddocs/COMPONENTS.mddocs/AUDIT.md
License
MIT