watsonhaw / lychee-php
A lightweight, IDE-friendly PHP web framework.
v0.4.1
2026-09-17 15:13 UTC
Requires
- php: ^8.2
- league/flysystem: ^3.0
- league/flysystem-path-prefixing: ^3.0
- league/flysystem-read-only: ^3.0
- overtrue/flysystem-cos: ^5.0
- psr/log: ^3.0
- ramsey/uuid: ^4.0
- topthink/think-cache: ^3.0
- topthink/think-container: ^3.0
- topthink/think-validate: ^3.0
- twig/twig: ^3.0
- watsonhaw/think-orm: ^0.2
- yzh52521/flysystem-oss: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^12.0
Suggests
- workerman/workerman: Required for the WebSocket module (^5.0). Install when config/websocket.php is present.
Provides
None
Conflicts
None
Replaces
None
- dev-master
- v0.4.1
- v0.4.0
- v0.3.0
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.1
- v0.1.0
- dev-refactor_orm
- dev-refactor_exception_log
- dev-revert_view
- dev-refactor_make_console
- dev-refactor_error_view
- dev-update_docs
- dev-refactor_file_upload
- dev-refactor_remove_dto_support
- dev-chore_validate
- dev-refactor_request
- dev-chore_base_controller
- dev-feat_log_max_files
- dev-refactor_logger
- dev-refactor_exception
- dev-refactor_cron
- dev-feat_cron
- dev-refactor_migrate
- dev-refactor_error_message
- dev-fix_route_prefix
- dev-feat_app_route_prefix
- dev-feat_controller_console
- dev-fix_migrate
- dev-refactor_resource_controller
- dev-refacto_env
This package is auto-updated.
Last update: 2026-09-17 16:04:23 UTC
README
轻量级、IDE 友好的 PHP Web 框架,PHP ^8.2。
特性
- 基于 PSR-11 的轻量容器
- 注解路由 + 中间件管道
- 基于 Twig 的模板引擎
- 数据库迁移与数据填充
- 队列、定时任务、会话、认证、文件系统
- 按需加载:仅启动已配置的模块
环境要求
- PHP >= 8.2
- Composer
安装
composer require watsonhaw/lychee-php
快速开始
// public/index.php require __DIR__ . '/../vendor/autoload.php'; use Lychee\Application; $app = new Application( basePath: dirname(__DIR__), controllerNamespace: 'App\\controller', ); $app->run();
目录结构
your-app/
├── app/
│ ├── controller/ # 控制器
│ ├── model/ # 模型
│ ├── middleware/ # 中间件
│ └── view/ # Twig 模板
├── config/ # 配置文件(按需创建)
├── database/
│ ├── migrations/ # 迁移文件
│ └── seeders/ # 数据填充
├── public/
│ └── index.php # Web 入口
├── runtime/ # 运行时缓存、日志
└── lee # 命令行入口
命令行
php lee list # 查看所有命令 php lee migrate:run # 执行迁移 php lee migrate:rollback # 回滚迁移 php lee migrate:create create_users_table # 创建迁移模板 php lee seed:run # 数据填充 php lee seed:create UserSeeder # 创建 Seeder 模板 php lee cron:run # 执行定时任务 php lee queue:work # 队列消费
按需加载
框架仅启动 config/ 目录下存在配置文件的模块。例如创建 config/queue.php 即启用队列模块。
文档
完整文档请访问 lychee-php