PHPackages                             unifiedcodes/arbor - 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. unifiedcodes/arbor

ActiveLibrary[Framework](/categories/framework)

unifiedcodes/arbor
==================

A modular PHP micro-framework for fast, modern application development.

v1.1.1(9mo ago)0181Apache-2.0PHPPHP &gt;=8.1

Since Sep 9Pushed 2w ago1 watchersCompare

[ Source](https://github.com/unifiedcodes/arbor)[ Packagist](https://packagist.org/packages/unifiedcodes/arbor)[ Docs](https://github.com/unifiedcodes/arbor)[ RSS](/packages/unifiedcodes-arbor/feed)WikiDiscussions main Synced today

READMEChangelog (2)DependenciesVersions (4)Used By (1)

Arbor
=====

[](#arbor)

*A modular yet minimal PHP framework for fast, modern application development.*

🌐 [Website](https://unifiedcodes.com/arbor) - 📖 [Docs](https://unifiedcodes.com/arbor/docs) - 💡 [Examples](https://unifiedcodes.com/arbor/examples) - 👤 [About Author](https://unifiedcodes.com/arbor/author)

Table of Contents
-----------------

[](#table-of-contents)

- [Introduction](#introduction)
- [Installation](#installation)
- [Usage](#usage)
- [Features](#features)
    - [Bootstrap &amp; Environment Handling](#%EF%B8%8F-bootstrap--environment-handling)
    - [Dependency Injection &amp; Container](#-dependency-injection--container)
    - [Configuration System](#-configuration-system)
    - [Service Contracts](#-service-contracts)
    - [HTTP Lifecycle](#-http-lifecycle)
    - [Fragment System](#-fragment-system)
    - [Routing System](#-routing-system)
    - [Middleware Pipeline](#-middleware-pipeline)
    - [File Uploads](#-file-uploads)
    - [View &amp; Template System](#%EF%B8%8F-view--template-system)
    - [Flash Messaging System](#-flash-messaging-system)
    - [Filtering &amp; Pipeline System](#-filtering--pipeline-system)
    - [Validation System](#-validation-system)
    - [Helpers](#-helpers)
    - [Autoloader (legacy)](#-autoloader-legacy-to-be-use-only-when-composer-is-not-used)
    - [Database Layer &amp; ORM](#-database-layer--orm)
    - [Exception Handling](#-exception-handling)
    - [Session Management](#-session-management)
    - [Facade System](#-facade-system)
- [Contributing](#contributing)
- [Support](#support)
- [License](#license)

Introduction
------------

[](#introduction)

Arbor is a lightweight, highly modular PHP framework designed to give you full control over HTTP routing, middleware, dependency injection, configuration and more, while remaining fast and easy to extend.

Installation
------------

[](#installation)

#### Clone the repository

[](#clone-the-repository)

```
git clone https://github.com/unifiedcodes/arbor.git
cd arbor
```

#### Or use composer

[](#or-use-composer)

```
composer require unifiedcodes/arbor
cd arbor
```

Usage
-----

[](#usage)

Point your web server document root to the `public/` directory.

```
use Arbor\bootstrap\App;

require_once '../vendor/autoload.php';

$autoloader = new Autoloader('../src/');

$app = (new App())
    ->withConfig('../configs/')
    ->onEnvironment('development')
    ->boot();

$response = $app->handleHTTP();
$response->send();
```

Features
--------

[](#features)

### Bootstrap &amp; Environment Handling

[](#bootstrap--environment-handling)

- Centralized entry point via `Arbor\bootstrap\App`
- Fluent API to configure app, load environment-specific configs, and boot services
- Isolated app modules (e.g., `admin/`, `web/`) with independent routes, configs, uploads, providers
- URL resolution and environment-aware bootstrapping
- Configuration scope from globals defaults to app specific to environment specific.

### Dependency Injection &amp; Container

[](#dependency-injection--container)

- Fast and flexible DI container with `ServiceContainer`
- Attribute injection supported via `ConfigValue` attribute
- Provider system for lazy-loaded services with `Providers` and `Registry`
- Service resolution with `Resolver` and `ServiceBond`
- Contextual resolution support

### Configuration System

[](#configuration-system)

- Environment-aware config loading from PHP files via `Configurator`
- Supports app-specific overrides and merged configs
- Attribute-based configuration injection

### Service Contracts

[](#service-contracts)

- All critical services (HTTP, Router, Container, etc.) are abstracted with interfaces
- Easy to swap implementations or mock in testing
- Comprehensive contract system covering containers, handlers, HTTP, metadata, sessions, and validation

### HTTP Lifecycle

[](#http-lifecycle)

- Fully-featured HTTP stack inspired by PSR standards
- `Request`, `ServerRequest`, `Response`, `UploadedFile`, `Streams`, `Cookies`, `Headers`
- RequestContext, RequestStack, and SubKernel support for advanced routing scenarios
- HTTP client for external API communication
- Response factory for streamlined response creation

### Fragment System

[](#fragment-system)

- Fragment engine for internally calling Controllers with or without a parent HTTP request context

### Routing System

[](#routing-system)

- Efficient trie-based router for dynamic routes
- Route groups, attributes, error routing, and sub-request handling
- URL building and route method management
- Advanced route dispatching and metadata handling

### Middleware Pipeline

[](#middleware-pipeline)

- General-purpose pipeline class
- Used in HTTP kernel and route dispatcher for global and route-specific middlewares
- Extensible and reusable for other application pipelines

### File Uploads

[](#file-uploads)

- Secure file uploader.
- Pluggable processor system per file type (e.g., `ImageProcessor`)
- Contract-based file processing interface

### View &amp; Template System

[](#view--template-system)

- Comprehensive View module
- Templates remain simple `.php` files, staying true to Arbor's minimal‑framework philosophy
- Supports both dumb components (simple includes) and dynamic controller-rendered components

### Flash Messaging System

[](#flash-messaging-system)

- Complete flash messaging system with `Flasher`, `Message`, and `View` components
- Session-based message persistence across requests
- Flexible message formatting and display

### Filtering &amp; Pipeline System

[](#filtering--pipeline-system)

- Advanced filtering system with `Filters`, `Registry`, and `StageList`
- Contract-based stage interfaces for extensible filtering
- Multi-stage filtering pipeline support

### Validation System

[](#validation-system)

- Comprehensive validation framework with:
    - `Validator` and `ValidatorFactory` for validation orchestration
    - `Definition` and `Parser` for validation rule definition
    - `Evaluator` for rule execution
    - `ErrorsFormatter` for user-friendly error messages
    - `RuleList` and `Registry` for rule management
- Contract-based rule interface for custom validation rules
- Detailed validation exception handling

### Helpers

[](#helpers)

- Auto-loaded utility functions to ease development
- URL helpers and common utility functions

### Autoloader (legacy, to be use only when composer is not used)

[](#autoloader-legacy-to-be-use-only-when-composer-is-not-used)

- PSR-compliant autoloader
- Supports multiple root directories
- Integrated with bootstrap system

### Database Layer &amp; ORM

[](#database-layer--orm)

- **Essential ORM Implementation**:

    - `BaseModel` and `Model` classes for Active Record pattern
    - `ModelQuery` for eloquent-style query building
    - `AttributesTrait` for model attribute management
    - `Pivot` model for many-to-many relationships
- **Relationship Support**:

    - `HasOne` - One-to-one relationships
    - `HasMany` - One-to-many relationships
    - `BelongsTo` - Inverse one-to-many relationships
    - `BelongsToMany` - Many-to-many relationships
    - `MorphOne` - Polymorphic one-to-one relationships
    - `MorphMany` - Polymorphic one-to-many relationships
    - `MorphToMany` - Polymorphic many-to-many relationships
- **Query System**:

    - SQL-dialect agnostic query builder
    - `Grammar` &amp; `Compiler` for MySQL (PostgreSQL &amp; SQLite support coming soon)
    - Safe value bindings with `PlaceholderParser`
    - Connection pool and transformer pipeline
    - Database resolver for multiple connection management

### Exception Handling

[](#exception-handling)

- Central exception handler
- Validation-specific exception handling
- Graceful error output and formatting

### Session Management

[](#session-management)

- Full session handling with `Session` class
- Contract-based session interface for custom implementations
- Integrated with flash messaging and authentication systems

### Facade System

[](#facade-system)

- facades for major components:
    - `Config` - Configuration access
    - `Container` - Dependency injection container
    - `DB` - Database operations
    - `Route` - Routing operations
    - `Session` - Session management
    - `Flash` - Flash messaging
- Simplified static access to framework services

---

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

[](#contributing)

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/YourFeature`)
3. Commit your changes (`git commit -m 'Add awesome feature'`)
4. Push to the branch (`git push origin feature/YourFeature`)
5. Open a Pull Request at

Bug reports and improvements are welcome via GitHub [Issues](https://github.com/unifiedcodes/arbor/issues)

Support
-------

[](#support)

- Email -
- WhatsApp - +91 75 808 908 75

License
-------

[](#license)

Arbor is licensed under the [Apache License 2.0](LICENSE).

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance79

Regular maintenance activity

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~3 days

Total

3

Last Release

292d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/66333228?v=4)[Harshit Mishra](/maintainers/harshittmishra)[@harshittmishra](https://github.com/harshittmishra)

---

Top Contributors

[![harshittmishra](https://avatars.githubusercontent.com/u/66333228?v=4)](https://github.com/harshittmishra "harshittmishra (246 commits)")

---

Tags

psrphpframeworkdependency-injectionmodularmicro-frameworkarbor

### Embed Badge

![Health badge](/badges/unifiedcodes-arbor/health.svg)

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

PHPackages © 2026

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