PHPackages                             citomni/kernel - 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. citomni/kernel

ActiveLibrary[Framework](/categories/framework)

citomni/kernel
==============

Ultra-lean application kernel for CitOmni-based apps. PHP 8.2+, PSR-4, deterministic boot, zero runtime magic.

v1.0.2.1(7mo ago)0237MITPHPPHP ^8.2

Since Sep 28Pushed 1mo agoCompare

[ Source](https://github.com/citomni/kernel)[ Packagist](https://packagist.org/packages/citomni/kernel)[ Docs](https://github.com/citomni/kernel)[ GitHub Sponsors](https://github.com/LarsGMortensen)[ Fund](https://ko-fi.com/)[ RSS](/packages/citomni-kernel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (5)Used By (7)

CitOmni Kernel
==============

[](#citomni-kernel)

Ultra-lean application kernel for CitOmni-based applications.

`citomni/kernel` is the smallest common runtime layer in the CitOmni ecosystem. It provides the structural primitives shared by CitOmni-based applications and packages, while deliberately avoiding transport runtimes, persistence logic, and framework-level magic.

The package exists to keep application boot deterministic, explicit, cheap to execute, and frugal with resources. In CitOmni terms, that means performance is not treated as a luxury feature bolted on later, but as part of the architectural contract from day one.

Small runtime surface. Predictable behavior. Less waste. Green by design.

What this package is
--------------------

[](#what-this-package-is)

The kernel provides:

- `App` as the central application object
- `Cfg` as a strict, deep, read-only configuration wrapper
- `Arr` for deterministic array normalization and merge helpers
- `Mode` for execution-mode selection
- thin abstract base classes for:
    - `BaseController`
    - `BaseCommand`
    - `BaseOperation`
    - `BaseRepository`
    - `BaseService`

In practice, the kernel gives the rest of CitOmni a shared structural contract without trying to become a transport runtime on its own.

What this package is not
------------------------

[](#what-this-package-is-not)

The kernel does **not** provide:

- HTTP routing runtime
- request / response handling
- session handling
- cookies
- CSRF protection
- template rendering
- CLI command dispatch
- error handling / exception rendering
- mail, logging, DB access, or other infrastructure services

Those concerns belong in mode packages such as `citomni/http` and `citomni/cli`, or in provider/application code.

Design goals
------------

[](#design-goals)

CitOmni kernel is built around four priorities:

1. Determinism

    - Boot order must be explicit and reviewable.
    - Merge rules must be stable.
    - No hidden registration or discovery.
2. Low overhead

    - Minimal indirection.
    - Minimal runtime work.
    - No namespace scanning or reflection-driven service discovery.
    - Less framework work per request/process.
3. High performance

    - Predictable data shapes.
    - Fail-fast behavior.
    - Cheap runtime primitives.
    - Lower overhead means lower CPU time, lower memory churn, and less wasted work.
4. Maintainable structure

    - Transport concerns stay outside the kernel.
    - Persistence concerns stay outside the kernel.
    - Shared contracts stay small and explicit.

CitOmni's performance philosophy is practical rather than theatrical: do less, allocate less, surprise less. That is good for latency, good for hosting costs, and, at scale, simply better engineering hygiene.

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

[](#installation)

Install through Composer:

```
composer require citomni/kernel
```

In real applications, `citomni/kernel` is normally used together with one or both mode packages:

- `citomni/http`
- `citomni/cli`

Package structure
-----------------

[](#package-structure)

Current package structure:

```
citomni/kernel/
├── .gitignore
├── composer.json
├── CONVENTIONS.md
├── LICENSE
├── NOTICE
├── README.md
├── TRADEMARKS.md
├── src/
│   ├── App.php
│   ├── Arr.php
│   ├── Cfg.php
│   ├── Mode.php
│   ├── Command/
│   │   └── BaseCommand.php
│   ├── Controller/
│   │   └── BaseController.php
│   ├── Operation/
│   │   └── BaseOperation.php
│   ├── Repository/
│   │   └── BaseRepository.php
│   └── Service/
│       └── BaseService.php
└── tests/
    └── Command/
        └── BaseCommandTest.php

```

PSR-4 autoload root:

```
"CitOmni\\Kernel\\": "src/"
```

Architectural role
------------------

[](#architectural-role)

Within CitOmni, the kernel defines the smallest shared contract used by applications and packages.

Conceptually:

- Adapters speak transport protocols.
- Operations decide what happens.
- Repositories talk to storage.
- Services provide reusable tools.
- Utils compute.
- Exceptions encode failure semantics.

The kernel itself only ships the shared primitives and thin base classes behind that structure. It does not implement transport runtimes or infrastructure services itself.

Entry-point constants
---------------------

[](#entry-point-constants)

CitOmni applications define a few constants early in the entrypoint.

Typical HTTP entrypoint:

```
