elasticmind/lalaz-framework
最新稳定版本:v1.1.10
Composer 安装命令:
composer create-project elasticmind/lalaz-framework
包简介
The Lalaz framework.
关键字:
README 文档
README
Welcome to Lalaz Framework v1.0 – A modern, fast, and elegant PHP framework designed for developers who value clean code, excellent performance, and great developer experience.
🚀 Why Lalaz?
Lalaz Framework combines the best practices from modern PHP development with a focus on:
- ⚡ Performance - Router cache (50x faster), Config cache (300x faster)
- 🔐 Security - Built-in CSRF protection, security headers, bcrypt hashing
- 🎨 Clean Architecture - PSR-compliant, dependency injection, middleware pipeline
- 📝 Great DX - Intuitive CLI, detailed error messages, extensive documentation
- 🧪 Well Tested - 308 tests, 847 assertions, 100% passing
- 🔧 Flexible - Template-engine agnostic, multiple database adapters
📚 Documentation Structure
Getting Started
- Installation Guide - Requirements, setup, and your first app
- Routing - Define routes, parameters, groups, and middleware
- Controllers - Handle requests and return responses
- Middleware - Filter and modify HTTP requests
Core Concepts
- Database - Query builder, migrations, and seeders
- Models - ActiveRecord pattern and relationships
- Views - Templates, view helpers, and rendering
- Validation - Form validation and error handling
Advanced Topics
- Security - CSRF, security headers, and authentication
- Logging - PSR-3 logging with multiple writers
- Events & Jobs - Event system and background processing
- CLI Commands - All available CLI commands
Production
- Performance - Optimization tips and caching strategies
- Deployment - Production setup and best practices
⚡ Quick Start
Installation
composer require lalaz/framework
Create Your First Route
<?php // routes/web.php use Lalaz\Lalaz; $router = Lalaz::router(); $router->get('/', function() { return 'Welcome to Lalaz Framework!'; }); $router->get('/hello/{name}', function($name) { return "Hello, {$name}!"; });
Run Development Server
php lalaz serve
Visit http://localhost:8080 and you're ready! 🎉
🎯 Key Features
Routing
- Clean, expressive syntax
- Route parameters and constraints
- Route groups with shared middleware
- 50x faster with route caching
Database
- Fluent query builder
- ActiveRecord models with relationships
- Migration system for version control
- Support for MySQL, PostgreSQL, SQLite
Views
- Template-engine agnostic design
- Built-in Twig provider
- View helpers for common tasks
- Layout and component support
Security
- CSRF protection out of the box
- Security headers middleware (4 presets)
- Bcrypt password hashing
- SQL injection prevention
Performance
- Router cache: 50x faster (1ms → 0.02ms)
- Config cache: 300x faster (2-3ms → 0.01ms)
- OPcache optimization
- ~90ms saved per request in production
CLI Tools
- 9 code generators (controller, model, migration, etc.)
- Database migrations and seeders
- Cache management commands
- Queue/job workers
- Built-in development server
📦 What's Included
Core Components
- Router with middleware support
- HTTP Request/Response objects
- Dependency injection container
- Session management
- File upload handling
Data Layer
- Query builder with fluent interface
- ActiveRecord pattern
- Relationships (hasMany, belongsTo, belongsToMany)
- Database migrations
- Database seeders
View Layer
- Template engine support
- View helpers (asset, route, CSRF, etc.)
- Flash messages
- Layout inheritance
Validation
- 15+ built-in validation rules
- Custom validation callbacks
- Localized error messages
- Array and JSON serialization
Logging
- PSR-3 compliant logger
- Multiple formatters (Text, JSON)
- Multiple writers (File, Console)
- Automatic log rotation
- Level filtering
Queue System
- Background job processing
- Event system
- Job scheduling
- Daemon mode for continuous processing
🤝 Requirements
- PHP 8.1 or higher
- Composer
- PDO extension (for database)
- One of: MySQL 5.7+, PostgreSQL 9.6+, or SQLite 3
📖 Learning Path
Beginners
Intermediate
Advanced
🎓 Philosophy
Lalaz Framework is built on these core principles:
- Simplicity - Keep things simple and intuitive
- Performance - Fast by default, optimized for production
- Security - Secure defaults, easy to maintain
- Flexibility - Don't force patterns, provide tools
- Testing - Everything should be testable
- Documentation - If it's not documented, it doesn't exist
🔗 Useful Links
- GitHub Repository: elasticmind-io/lalaz-framework
- CLI Reference: CLI Commands Guide
- API Documentation: Coming soon
- Community Forum: Coming soon
💡 Need Help?
- 📖 Check the detailed documentation
- 💬 Ask questions in GitHub Discussions
- 🐛 Report bugs in GitHub Issues
- 📧 Email: ola@elasticmind.io
📝 License
Lalaz Framework is open-source software licensed under the MIT license.
Ready to build something amazing? Start with the Installation Guide! 🚀
统计信息
- 总下载量: 188
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-12