PHPackages                             chani/safi-core - 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. chani/safi-core

ActiveLibrary

chani/safi-core
===============

Safi Microframework Core - Pure DI, HTTP Context, Middleware Pipeline &amp; Driver Contracts

v0.1.0(today)002MITPHPPHP ^8.5

Since Jul 23Pushed todayCompare

[ Source](https://github.com/chani/safi-core)[ Packagist](https://packagist.org/packages/chani/safi-core)[ RSS](/packages/chani-safi-core/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (8)Versions (2)Used By (2)

Safi Core (`safi-core`)
=======================

[](#safi-core-safi-core)

Core package for the Safi Microframework (PHP 8.5+). Built around pure constructor injection, explicit composition root wiring, an HTTP context pipeline, attribute routing, and driver contracts.

---

Architecture Principles
-----------------------

[](#architecture-principles)

### 1. Pure Constructor Injection (`Assembler`)

[](#1-pure-constructor-injection-assembler)

- **No Service Locators:** Controllers and services never pull from a global container. All dependencies are explicitly declared in constructors via PHP 8.5 property promotion.
- **Composition Root:** The `Assembler` is used exclusively during application startup (`init.inc.php` or CLI entry points) to wire components together deterministically.

### 2. HTTP Pipeline &amp; Context (`Context`)

[](#2-http-pipeline--context-context)

- Combines `Request`, `Response`, and `LoggerInterface` into a strict `Context` object flowing through the `MiddlewarePipeline`.
- Eliminates messy parameter lists and keeps infrastructure concerns out of domain logic.

### 3. Attribute Routing (`#[Route]`)

[](#3-attribute-routing-route)

- Routes are defined via PHP attributes directly on controller methods.
- **Default Lockdown:** All endpoints require authentication (`401 Unauthorized`) unless explicitly configured as `public: true`.

---

Package Layout
--------------

[](#package-layout)

```
src/
├── Attributes/       # #[Route] definition
├── Cli/              # Command interface & kernel
│   └── Commands/     # Core maintenance tasks
├── Contracts/        # Interfaces (Router, View, Database, Search)
├── Event/            # Synchronous event dispatcher
├── Exception/        # Core exceptions
├── Http/             # Request, Response, Context, Pipeline
├── Services/         # Cache, JobQueue, Security
└── Util/             # Token-based class finder

```

---

License
-------

[](#license)

Distributed under the **MIT License**. Author: **Jean Bruenn**

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity40

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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/550669?v=4)[Jean-Michel Brünn](/maintainers/chani)[@chani](https://github.com/chani)

---

Top Contributors

[![chani](https://avatars.githubusercontent.com/u/550669?v=4)](https://github.com/chani "chani (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/chani-safi-core/health.svg)

```
[![Health](https://phpackages.com/badges/chani-safi-core/health.svg)](https://phpackages.com/packages/chani-safi-core)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.5k](/packages/laravel-framework)[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[cakephp/cakephp

The CakePHP framework

8.9k19.5M1.8k](/packages/cakephp-cakephp)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k46](/packages/civicrm-civicrm-core)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k16](/packages/tempest-framework)[moonshine/moonshine

Laravel administration panel

1.3k253.1k86](/packages/moonshine-moonshine)

PHPackages © 2026

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