PHPackages                             scarwu/oni - 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. [CLI &amp; Console](/categories/cli)
4. /
5. scarwu/oni

ActiveLibrary[CLI &amp; Console](/categories/cli)

scarwu/oni
==========

A Lightweight PHP Framework for Web &amp; CLI

1.3.0(2y ago)4184[1 issues](https://github.com/scarwu/Oni/issues)1MITPHPPHP &gt;=7.3.0

Since Aug 25Pushed 3w ago1 watchersCompare

[ Source](https://github.com/scarwu/Oni)[ Packagist](https://packagist.org/packages/scarwu/oni)[ Docs](https://github.com/scarwu/Oni)[ RSS](/packages/scarwu-oni/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (14)Used By (1)

Oni
===

[](#oni)

A lightweight PHP framework for Web and CLI applications.

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

[](#requirements)

- PHP 8.4+
- Composer

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

[](#installation)

```
composer require scarwu/oni
```

For local development:

```
./setup.sh
```

Project Layout
--------------

[](#project-layout)

```
src/Oni/Core     Shared base class and namespace loader
src/Oni/Web      Web app, controllers, request/response, views, stores
src/Oni/CLI      CLI app, task base class, IO, ANSI helpers
example/CLI      Example CLI application
tests            PHPUnit test suite and fixtures
docs/specs       Current behavior specifications

```

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

[](#core-concepts)

Oni has two application stacks that share `Oni\Core`:

- `Oni\Web\App` handles HTTP requests, static files, cached pages, controller dispatch, and view rendering.
- `Oni\CLI\App` handles command-line task routing and task lifecycle execution.
- `Oni\Core\Loader` registers application namespaces to filesystem paths via `Loader::append($namespace, $path)`.
- `Oni\Core\Basic` provides the shared `setAttr()` / `getAttr()` configuration container.

Web Applications
----------------

[](#web-applications)

A web app configures controller, view, static, and cache paths before calling `run()`.

```
