webfiori/framework
Composer 安装命令:
composer require webfiori/framework
包简介
WebFiori framework. Made to make the web bloom.
README 文档
README
Note: This repo contains the core of the framework. The application template can be found at
webfiori/app.
Overview
WebFiori is a modular, object-oriented PHP framework designed for building secure web applications and APIs. It provides a complete toolkit — routing, middleware, authorization, database management, job queues, and more — while remaining lightweight and free of heavy external dependencies.
Motivation
WebFiori is designed around two architectural decisions:
-
Self-contained ecosystem. Each component (HTTP, database, cache, sessions, mail, queue, CLI, authorization) is an independent library with no external runtime dependencies. This eliminates transitive dependency conflicts and simplifies security auditing.
-
Interface-driven extensibility. Storage backends for sessions, cache, queues, and authorization are defined by interfaces. Swap implementations without modifying application code.
The framework provides the orchestration layer. The libraries can be used together as a full stack or independently in any PHP project.
Requirements
- PHP 8.1 or later
- Extensions:
json,mbstring,fileinfo,openssl - Composer
Supported PHP Versions
| PHP Version | Status |
|---|---|
| 8.1 | |
| 8.2 | |
| 8.3 | |
| 8.4 | |
| 8.5 |
Quick Start
composer create-project webfiori/app my-project
cd my-project
php -S localhost:8080 -t public
Key Features
Routing & HTTP
- Route groups, URI parameters, and middleware assignment
- OpenAPI 3.1 specification generation from annotated controllers
Security
- CSRF protection middleware with automatic token injection
- CORS middleware with per-route configuration
- Rate limiting with configurable windows and trusted IPs
- Session encryption at rest (AES-256-GCM)
- Maintenance mode with IP allowlisting and Retry-After headers
Authorization
- Role-Based Access Control (RBAC) with role inheritance
- Attribute-Based Access Control (ABAC) with policy evaluation
- Database-backed or in-memory storage for roles and permissions
#[PreAuthorize]and#[RequiresAuth]attributes for declarative access control
Database
- Query builder supporting MySQL, MSSQL, and SQLite
- Schema migrations with run, rollback, dry-run, fresh, and status commands
- Database seeders
- Connection management with environment variable resolution
Middleware
- Priority-based execution with dependency resolution
- Before, after, and after-send lifecycle hooks
- Middleware groups for bulk assignment to routes
- Built-in: session, CSRF, CORS, rate limiting, caching, maintenance mode, authorization
Job Queue
- Dispatching with priority and delayed execution
- Automatic retry with configurable attempts and backoff
- Payload encryption (AES-256-GCM) via environment key
- Failed job tracking and retry commands
- Pluggable storage backends via
QueueStorageinterface
Dependency Injection
- Container with
bind(),singleton(), andinstance()registration - Automatic constructor dependency resolution
- Integrated with framework core services
Task Scheduling
- CRON-based background task execution
- Scheduler daemon for development environments
- Task arguments and conditional execution
Observability
- Health check system with HTTP endpoint (200/503)
- Built-in checks for cache and storage availability
- Extensible via
HealthCheckInterface - Structured file-based logging with daily rotation and level filtering
Additional Capabilities
- Internationalization (i18n) with LTR/RTL support
- Theming system for multiple UI variants
- Programmatic DOM manipulation in PHP
- Templated HTML email delivery with attachments
- CLI scaffolding commands for controllers, middleware, migrations, and more
- Event dispatcher for decoupled application components
- Pluggable cache layer with full-response and HTTP caching (ETag/304)
- Environment variable resolution in configuration (
env:prefix) - File upload handling with validation
Architecture
WebFiori is composed of independent, interface-driven packages. Storage backends for sessions, cache, queues, and authorization are pluggable — implement the interface and swap the default.
Request lifecycle: Request → Middleware (before) → Route Dispatch → Middleware (after) → Response → Middleware (afterSend)
Standard Libraries
| Library | Build | Latest |
|---|---|---|
| HTTP | ||
| Database | ||
| CLI | ||
| Cache | ||
| UI | ||
| Mailer | ||
| File | ||
| Json | ||
| Collections | ||
| Error Handler | ||
| Container | ||
| Queue | ||
| Event | ||
| Log |
Documentation
Contributing
See CONTRIBUTING.md for guidelines.
Security
To report security vulnerabilities, please email ibrahim@webfiori.com. See SECURITY.md for supported versions.
License
MIT — see LICENSE for details.
webfiori/framework 适用场景与选型建议
webfiori/framework 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 23.1k 次下载、GitHub Stars 达 21, 最近一次更新时间为 2019 年 05 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「php」 「api」 「themes」 「webfiori」 「Web APIs」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 webfiori/framework 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 webfiori/framework 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 webfiori/framework 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
A PSR-7 compatible library for making CRUD API endpoints
Alfabank REST API integration
High-performance, opinionated PHP 8 web framework with O(1) routing, parallel async MySQL, type-safe asset bridge, and React-island frontend
Zero-dependency raw PHP DNS resolver, domain-ownership verification, and intoDNS/MxToolbox-style diagnostics. Queries authoritative nameservers directly over sockets — never trusts the recursive cache for ownership checks.
The skeleton application for the Geoffrey agent framework.
统计信息
- 总下载量: 23.1k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 21
- 点击次数: 14
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-05-01