PHPackages                             webfiori/framework - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. webfiori/framework

ActiveLibrary[Framework](/categories/framework)

webfiori/framework
==================

WebFiori framework. Made to make the web bloom.

v2.4.7(4y ago)2122.8k1[20 issues](https://github.com/WebFiori/framework/issues)6MITPHPPHP &gt;=5.6CI passing

Since Mar 10Pushed 3w ago2 watchersCompare

[ Source](https://github.com/WebFiori/framework)[ Packagist](https://packagist.org/packages/webfiori/framework)[ Fund](https://paypal.me/IbrahimBinAlshikh)[ Fund](https://www.buymeacoffee.com/ibrahimdev)[ RSS](/packages/webfiori-framework/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (5)Versions (123)Used By (6)

WebFiori Framework
==================

[](#webfiori-framework)

[![](https://camo.githubusercontent.com/f4abc7aa878a4465db6ab6ae18bbfb7c763af4a6d12d4a379692e0886be589f5/68747470733a2f2f77656266696f72692e636f6d2f6173736574732f696d616765732f66617669636f6e2e706e67)](https://camo.githubusercontent.com/f4abc7aa878a4465db6ab6ae18bbfb7c763af4a6d12d4a379692e0886be589f5/68747470733a2f2f77656266696f72692e636f6d2f6173736574732f696d616765732f66617669636f6e2e706e67)

 [![](https://github.com/WebFiori/framework/actions/workflows/php85.yml/badge.svg?branch=main)](https://github.com/WebFiori/framework/actions) [ ![](https://camo.githubusercontent.com/6c35bd361555e6ecfe1c0a10c369e8a2ae1e47a21a3b3d063a5ae60053601998/68747470733a2f2f636f6465636f762e696f2f67682f57656246696f72692f6672616d65776f726b2f6272616e63682f6d61696e2f67726170682f62616467652e737667) ](https://codecov.io/gh/WebFiori/framework) [ ![](https://camo.githubusercontent.com/b776519f55b6604740ef45fe0c3eb3f86f7a9161e4d200d9f35e614d9447d24e/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d57656246696f72695f6672616d65776f726b266d65747269633d616c6572745f737461747573) ](https://sonarcloud.io/dashboard?id=WebFiori_framework) [ ![](https://camo.githubusercontent.com/c505861d399dfb82ae5987cdbdb618d6fcd02afc01d9b4a5b94daa39250e6c6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f6672616d65776f726b2e7376673f6c6162656c3d6c6174657374) ](https://github.com/WebFiori/framework/releases) [ ![](https://camo.githubusercontent.com/47652ac58f45fffaa0050edd3beab204a4484f35a9e30327c85ca34ba375d983/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77656266696f72692f6672616d65776f726b3f636f6c6f723d6c696768742d677265656e) ](https://packagist.org/packages/webfiori/framework)

> **Note:** This repo contains the core of the framework. The application template can be found at [`webfiori/app`](https://github.com/webfiori/app).

Overview
--------

[](#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.

Requirements
------------

[](#requirements)

- PHP 8.1 or later
- Extensions: `json`, `mbstring`, `fileinfo`, `openssl`
- Composer

Supported PHP Versions
----------------------

[](#supported-php-versions)

PHP VersionStatus8.1[![](https://github.com/WebFiori/framework/actions/workflows/php81.yml/badge.svg?branch=main)](https://github.com/WebFiori/framework/actions/workflows/php81.yml)8.2[![](https://github.com/WebFiori/framework/actions/workflows/php82.yml/badge.svg?branch=main)](https://github.com/WebFiori/framework/actions/workflows/php82.yml)8.3[![](https://github.com/WebFiori/framework/actions/workflows/php83.yml/badge.svg?branch=main)](https://github.com/WebFiori/framework/actions/workflows/php83.yml)8.4[![](https://github.com/WebFiori/framework/actions/workflows/php84.yml/badge.svg?branch=main)](https://github.com/WebFiori/framework/actions/workflows/php84.yml)8.5[![](https://github.com/WebFiori/framework/actions/workflows/php85.yml/badge.svg?branch=main)](https://github.com/WebFiori/framework/actions/workflows/php85.yml)Quick Start
-----------

[](#quick-start)

```
composer create-project webfiori/app my-project
cd my-project
php -S localhost:8080 -t public
```

Key Features
------------

[](#key-features)

### Routing &amp; HTTP

[](#routing--http)

- Route groups, URI parameters, and middleware assignment
- OpenAPI 3.1 specification generation from annotated controllers

### Security

[](#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

[](#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

[](#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

[](#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

[](#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 `QueueStorage` interface

### Dependency Injection

[](#dependency-injection)

- Container with `bind()`, `singleton()`, and `instance()` registration
- Automatic constructor dependency resolution
- Integrated with framework core services

### Task Scheduling

[](#task-scheduling)

- CRON-based background task execution
- Scheduler daemon for development environments
- Task arguments and conditional execution

### Observability

[](#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

[](#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
------------

[](#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
------------------

[](#standard-libraries)

LibraryBuildLatest[HTTP](https://github.com/WebFiori/http)[![](https://github.com/WebFiori/http/actions/workflows/php84.yml/badge.svg?branch=master)](https://github.com/WebFiori/http/actions)[![](https://camo.githubusercontent.com/e78fa3e990f31c36962797564042eb40e5ea1edd45e2de1703658eba16a30d3e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f687474702e737667)](https://github.com/WebFiori/http/releases)[Database](https://github.com/WebFiori/database)[![](https://github.com/WebFiori/database/actions/workflows/php84.yml/badge.svg?branch=main)](https://github.com/WebFiori/database/actions)[![](https://camo.githubusercontent.com/143f84408507c7dc313b4b031a169088d70136dfaea372c72ae49715667514c7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f64617461626173652e737667)](https://github.com/WebFiori/database/releases)[CLI](https://github.com/WebFiori/cli)[![](https://github.com/WebFiori/cli/actions/workflows/php84.yml/badge.svg?branch=main)](https://github.com/WebFiori/cli/actions)[![](https://camo.githubusercontent.com/2070452932f9911f8ec52338027d298a573b18b84451fdf66f69aa067cc5c646/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f636c692e737667)](https://github.com/WebFiori/cli/releases)[Cache](https://github.com/WebFiori/cache)[![](https://github.com/WebFiori/cache/actions/workflows/php84.yml/badge.svg?branch=main)](https://github.com/WebFiori/cache/actions)[![](https://camo.githubusercontent.com/d93f87c1cca7e938605b580da221444c94fcfb59e60d00fc42d8db5079dbd901/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f63616368652e737667)](https://github.com/WebFiori/cache/releases)[UI](https://github.com/WebFiori/ui)[![](https://github.com/WebFiori/ui/actions/workflows/php84.yml/badge.svg?branch=master)](https://github.com/WebFiori/ui/actions)[![](https://camo.githubusercontent.com/7907f59f1cfce2fc5dbd874b2596e1d46636f0e5901e0d8cb154a6cbbee1da47/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f75692e737667)](https://github.com/WebFiori/ui/releases)[Mailer](https://github.com/WebFiori/mail)[![](https://github.com/WebFiori/mail/actions/workflows/php84.yml/badge.svg?branch=main)](https://github.com/WebFiori/mail/actions)[![](https://camo.githubusercontent.com/94dcdb083f7d409d8efd9cf58159d45242c53b15c2b0546452c1d91dfa1ad519/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f6d61696c2e737667)](https://github.com/WebFiori/mail/releases)[File](https://github.com/WebFiori/file)[![](https://github.com/WebFiori/file/actions/workflows/php84.yml/badge.svg?branch=main)](https://github.com/WebFiori/file/actions)[![](https://camo.githubusercontent.com/323e1a66f61c877d3b93c1f9f9e311f5a8b849b1ee4bcae7ea09850f4755c75d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f66696c652e737667)](https://github.com/WebFiori/file/releases)[Json](https://github.com/WebFiori/json)[![](https://github.com/WebFiori/json/actions/workflows/php84.yml/badge.svg?branch=master)](https://github.com/WebFiori/json/actions)[![](https://camo.githubusercontent.com/fbf64710b0bbb25c49636a2c5c8fc20fde5c92f126b4846737bf492fc2f78f70/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f6a736f6e2e737667)](https://github.com/WebFiori/json/releases)[Collections](https://github.com/WebFiori/collections)[![](https://github.com/WebFiori/collections/actions/workflows/php84.yml/badge.svg?branch=master)](https://github.com/WebFiori/collections/actions)[![](https://camo.githubusercontent.com/8a836c357808d8a2f0c86bf0a1c2b44bb49983d564125c7e913490a041626a67/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f636f6c6c656374696f6e732e737667)](https://github.com/WebFiori/collections/releases)[Error Handler](https://github.com/WebFiori/err)[![](https://github.com/WebFiori/err/actions/workflows/php84.yml/badge.svg?branch=main)](https://github.com/WebFiori/err/actions)[![](https://camo.githubusercontent.com/10e8639a1f1b68998be15fd80ebeae2a1db272f9f61fa63cec83a510a24949a2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f6572722e737667)](https://github.com/WebFiori/err/releases)[Container](https://github.com/WebFiori/container)[![](https://github.com/WebFiori/container/actions/workflows/php84.yml/badge.svg?branch=main)](https://github.com/WebFiori/container/actions)[![](https://camo.githubusercontent.com/024ff3835d67ad60c686c2401ece14e9be20003f1e90d5749b95fd8c10b23cfb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f636f6e7461696e65722e737667)](https://github.com/WebFiori/container/releases)[Queue](https://github.com/WebFiori/queue)[![](https://github.com/WebFiori/queue/actions/workflows/php84.yml/badge.svg?branch=main)](https://github.com/WebFiori/queue/actions)[![](https://camo.githubusercontent.com/e22655d0ebefe2e7fae75def43fca70a1b5167c1565484d3e625dce07ba7a4e1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f71756575652e737667)](https://github.com/WebFiori/queue/releases)[Event](https://github.com/WebFiori/event)[![](https://github.com/WebFiori/event/actions/workflows/php84.yml/badge.svg?branch=main)](https://github.com/WebFiori/event/actions)[![](https://camo.githubusercontent.com/8628a18acf46aa350257dac5dbbfe992fa38edad597182e1d0aac84f858ce913/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f6576656e742e737667)](https://github.com/WebFiori/event/releases)[Log](https://github.com/WebFiori/log)[![](https://github.com/WebFiori/log/actions/workflows/php84.yml/badge.svg?branch=main)](https://github.com/WebFiori/log/actions)[![](https://camo.githubusercontent.com/2645f19f579a1cb109b1d898c2092b306504af6582e97545abcd27ceb8bb1c2a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f57656246696f72692f6c6f672e737667)](https://github.com/WebFiori/log/releases)Documentation
-------------

[](#documentation)

- [Getting Started Guide](https://webfiori.com/learn)
- [API Reference](https://webfiori.com/docs)

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](https://webfiori.com/contribute) for guidelines.

Security
--------

[](#security-1)

To report security vulnerabilities, please email . See [SECURITY.md](SECURITY.md) for supported versions.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE) for details.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance43

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 99.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~28 days

Recently: every ~8 days

Total

94

Last Release

24d ago

Major Versions

v1.1.0-beta-3 → v2.0.0-beta.12020-11-14

v2.4.7 → v3.0.0-RC02022-08-22

PHP version history (3 changes)v1.0.0PHP &gt;=5.6

v3.0.0-RC0PHP &gt;=7.0

3.0.0-Beta.29PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c25e43acaa22b4fb758a710b69c2ab75947a6642925e3bec9c98196b1f2a433?d=identicon)[usernane](/maintainers/usernane)

---

Top Contributors

[![usernane](https://avatars.githubusercontent.com/u/12120015?v=4)](https://github.com/usernane "usernane (5663 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (25 commits)")[![ibeladi-mrsool](https://avatars.githubusercontent.com/u/11488356?v=4)](https://github.com/ibeladi-mrsool "ibeladi-mrsool (8 commits)")

---

Tags

frameworkhacktoberfesthactoberfesthtmlmvcmysqlphpphp-languagerest-apiwebweb-developmentwebfioriwebfiori-frameworkwebsitephpapiframeworkthemeswebfioriWeb APIs

### Embed Badge

![Health badge](/badges/webfiori-framework/health.svg)

```
[![Health](https://phpackages.com/badges/webfiori-framework/health.svg)](https://phpackages.com/packages/webfiori-framework)
```

###  Alternatives

[digitalstars/simplevk

Powerful PHP library/framework for VK API bots, supporting LongPoll &amp; Callback &amp; OAuth

934.2k3](/packages/digitalstars-simplevk)[patricksavalle/slim-rest-api

Production-grade REST-API App-class for PHP SLIM, in production on https://zaplog.pro (https://api.zaplog.pro/v1)

101.4k](/packages/patricksavalle-slim-rest-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
