PHPackages                             nations-original/php-simple-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. nations-original/php-simple-framework

ActiveLibrary[Framework](/categories/framework)

nations-original/php-simple-framework
=====================================

A simple PHP framework for Nations Original.

v1.1.8(1mo ago)3881ISCPHPPHP 8.3.\*CI failing

Since Jun 13Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/Ondottr/PHP_SF_Platform)[ Packagist](https://packagist.org/packages/nations-original/php-simple-framework)[ RSS](/packages/nations-original-php-simple-framework/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (25)Used By (1)

PHP Simple Framework
====================

[](#php-simple-framework)

A lightweight, modern PHP 8.3+ framework built on top of Symfony and Doctrine, designed for rapid web application development with clean attribute-based configuration.

**Package:** `nations-original/php-simple-framework`**Namespace:** `PHP_SF\System\`**License:** ISC **Author:** Dmytro Dyvulskyi — CEO &amp; Lead Developer, Nations Original

---

Documentation
-------------

[](#documentation)

Full documentation is available at **[wiki.nations-original.com/framework](https://wiki.nations-original.com/framework)**.

The wiki covers every aspect of the framework in depth — from installation and first steps to advanced topics like dual-kernel architecture, caching, message queues, and testing. If you are new to the framework, start there.

SectionTopics[Getting Started](https://wiki.nations-original.com/framework/getting-started)Installation, constants, creating your first page[Core](https://wiki.nations-original.com/framework/core)Lifecycle, controllers, routing, middleware, views, sessions, redirects[Dual Kernel](https://wiki.nations-original.com/framework/core/dual-kernel)PHP\_SF kernel + Symfony kernel coexistence, bootstrap order[Data &amp; Persistence](https://wiki.nations-original.com/framework/data)Entities, repositories, validation, cache, fixtures, enums[Infrastructure](https://wiki.nations-original.com/framework/infrastructure)Docker, Redis, RabbitMQ, template cache, kernel config[Supporting Features](https://wiki.nations-original.com/framework/supporting)Helper functions, translation, events, CRUD controller[Development &amp; Testing](https://wiki.nations-original.com/framework/dev)PHPUnit, dev mode[Frontend](https://wiki.nations-original.com/framework/frontend)Asset building with Webpack---

Getting Started
---------------

[](#getting-started)

This package is the framework core. To start a new project, use the template:

```
composer create-project nations-original/php-simple-framework-template my-app
```

To add the framework to an existing Symfony project:

```
composer require nations-original/php-simple-framework
```

Requires PHP **8.3+** with strict typing, plus `ext-apcu`, `ext-redis`. See [Installation guide](https://wiki.nations-original.com/framework/getting-started/installation) for full prerequisites.

---

Overview
--------

[](#overview)

PHP Simple Framework sits alongside Symfony's kernel inside the same PHP process. When a request comes in, the framework's router tries to match it first using its own attribute-based routing. If no match is found, the request falls through to Symfony. This gives you the performance and simplicity of a hand-rolled framework while retaining the full power of the Symfony ecosystem (DI container, console, bundles, Doctrine) when you need it.

See [Dual Kernel Architecture](https://wiki.nations-original.com/framework/core/dual-kernel) for a detailed explanation.

### Request Lifecycle

[](#request-lifecycle)

1. `public/index.php` bootstraps autoloader, global functions, and constants
2. `PHP_SF\System\Kernel` boots — registers controllers, translations and templates
3. `Router` resolves the URL against registered `#[Route]` attributes (cached in Redis)
4. Middleware chain executes (pre-dispatch)
5. Controller method is called, producing a `Response`, `RedirectResponse`, or JSON
6. Response is sent; output buffer is flushed

Full 17-step trace: [Request &amp; Response Lifecycle](https://wiki.nations-original.com/framework/core/lifecycle).

---

Core Concepts
-------------

[](#core-concepts)

### Routing

[](#routing)

Routes are declared with PHP 8 attributes directly on controller methods. No separate routing file needed.

```
use PHP_SF\System\Attributes\Route;

#[Route(url: 'posts/{id}', httpMethod: 'GET', name: 'post_show')]
public function show(int $id): Response { ... }
```

- URL parameters use `{param}` syntax with automatic type casting
- Named routes for URL generation via `routeLink('post_show', ['id' => 42])`
- Route-level middleware assignment
- Routes are cached in Redis after first resolution

Full reference: [Routing](https://wiki.nations-original.com/framework/core/routing).

### Controllers

[](#controllers)

Extend `AbstractController` and return a `Response`, JSON, or redirect.

```
use PHP_SF\System\Classes\Abstracts\AbstractController;
use PHP_SF\System\Attributes\Route;

class PostController extends AbstractController
{
    #[Route(url: 'posts', httpMethod: 'GET', name: 'post_index')]
    public function post_list_view(): Response
    {
        return $this->render(new post_list_view());
    }

    #[Route(url: 'api/posts', httpMethod: 'GET', name: 'api_post_index')]
    public function api_posts(): Response
    {
        return $this->ok(['posts' => [...]]);
    }
}
```

Available JSON shortcut methods: `ok()`, `created()`, `badRequest()`, `unauthorized()`, `forbidden()`, `notFound()`, `conflict()`, `unprocessableEntity()`, etc.

Full reference: [Controllers](https://wiki.nations-original.com/framework/core/controllers).

### Views

[](#views)

Views are PHP classes that extend `AbstractView` and implement a `show()` method. Output buffering captures the rendered HTML; the framework injects the configured header and footer automatically.

Full reference: [Views](https://wiki.nations-original.com/framework/core/views).

### Middleware

[](#middleware)

Middleware files extend `Middleware` and are referenced by name on `#[Route]` attributes. Middleware can be composed with:

- `MiddlewareAll` — all listed middleware must pass
- `MiddlewareAny` — at least one must pass
- `MiddlewareCustom` — custom composition logic

Full reference: [Middleware](https://wiki.nations-original.com/framework/core/middleware).

### Entities

[](#entities)

Entities extend `AbstractEntity` and use Doctrine ORM attributes alongside PHP\_SF validation attributes.

```
use PHP_SF\System\Classes\Abstracts\AbstractEntity;
use PHP_SF\System\Attributes\Validator as Validate;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity(repositoryClass: PostRepository::class)]
class Post extends AbstractEntity
{
    #[ORM\Column]
    #[Validate\Length(min: 3, max: 255)]
    #[TranslatablePropertyName]
    protected string $title;
}
```

- Properties must be `protected` (AbstractEntity uses reflection)
- `#[TranslatablePropertyName]` enables localized validation error messages
- Doctrine lifecycle callbacks via `App/DoctrineLifecycleCallbacks/`

Full reference: [Entities](https://wiki.nations-original.com/framework/data/entities) · [Validation](https://wiki.nations-original.com/framework/data/validation).

### Multi-Database &amp; EntityManager

[](#multi-database--entitymanager)

The framework supports multiple simultaneous Doctrine entity managers. Use the `em()` helper with a connection name — never rely on the default EM.

```
em('postgresql')->getRepository(User::class)->find($id);
em('mysql')->persist($post);
em('mariadb')->flush();
```

Full reference: [Repositories](https://wiki.nations-original.com/framework/data/repositories).

### Caching

[](#caching)

The `ca()` helper returns the best available cache adapter automatically. Specific adapters are also accessible directly.

```
ca()->set('key', $value, 3600);   // auto-selects APCu → Redis → Memcached
aca()->set('key', $value);        // APCu cache adapter
rca()->set('key', $value);        // Redis cache adapter
mca()->set('key', $value);        // Memcached cache adapter
```

Full reference: [Cache](https://wiki.nations-original.com/framework/data/cache) · [Redis](https://wiki.nations-original.com/framework/infrastructure/redis).

### Helper Functions

[](#helper-functions)

Global helper functions cover the most common framework operations without requiring dependency injection.

FunctionPurpose`em(string $name)`Get a Doctrine EntityManager by connection name`qb(string $name)`Get a Doctrine QueryBuilder`ca()`Get the auto-selected cache adapter`rca()` / `aca()` / `mca()`Get Redis / APCu / Memcached adapter`rc()`Get the Redis client`s()`Get the current Session`routeLink(string $name, array $params)`Generate a URL from a named route`_t(string $key)`Translate a stringFull reference: [Helper Functions](https://wiki.nations-original.com/framework/supporting/helpers).

### Translation

[](#translation)

Translation files live in `lang/` and are loaded during kernel boot. Use `_t('key')` anywhere in templates or controllers.

Full reference: [Translation](https://wiki.nations-original.com/framework/supporting/translation).

### Message Queues (RabbitMQ)

[](#message-queues-rabbitmq)

RabbitMQ publisher and consumer are available via `PHP_SF\System\Database\RabbitMQ` and `RabbitMQConsumer`. Queue names are defined in `App/Enums/Amqp/QueueEnum.php`.

Full reference: [RabbitMQ](https://wiki.nations-original.com/framework/infrastructure/rabbitmq).

---

Namespace Structure
-------------------

[](#namespace-structure)

NamespacePathPurpose`PHP_SF\System\``src/`Framework core (routing, kernel, cache, base classes)`PHP_SF\Framework\``app/`Framework-provided app skeleton (controllers, middleware)`PHP_SF\Templates\``templates/`Built-in template files`PHP_SF\Tests\``tests/`Framework test suite---

License
-------

[](#license)

ISC — see [LICENSE.MD](LICENSE.MD).

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance92

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 87.2% 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 ~34 days

Recently: every ~1 days

Total

20

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e2ef3a4d15187330175911558005884892b23d2eac2f2f2322585376e463acc?d=identicon)[Ondottr](/maintainers/Ondottr)

---

Top Contributors

[![Ondottr](https://avatars.githubusercontent.com/u/33568483?v=4)](https://github.com/Ondottr "Ondottr (163 commits)")[![dmytro-dyvulskyi](https://avatars.githubusercontent.com/u/141229358?v=4)](https://github.com/dmytro-dyvulskyi "dmytro-dyvulskyi (24 commits)")

### Embed Badge

![Health badge](/badges/nations-original-php-simple-framework/health.svg)

```
[![Health](https://phpackages.com/badges/nations-original-php-simple-framework/health.svg)](https://phpackages.com/packages/nations-original-php-simple-framework)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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