PHPackages                             comphp/runtime - 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. comphp/runtime

ActiveLibrary[Framework](/categories/framework)

comphp/runtime
==============

Bootstrap, lifecycle, module, service provider, event, and executive support for PHP applications.

0.3.1(3w ago)11814MITPHPPHP ^8.5

Since May 15Pushed 3w agoCompare

[ Source](https://github.com/commonphp/runtime)[ Packagist](https://packagist.org/packages/comphp/runtime)[ RSS](/packages/comphp-runtime/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (14)

CommonPHP Runtime
=================

[](#commonphp-runtime)

[![Latest Stable Version](https://camo.githubusercontent.com/dc16327a0ba2e06e0972ce396ea742c891b0ecfd6f26254f3c3c3f6d31b61d1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b61676973742d706c616365686f6c6465722d6c69676874677265792e737667)](https://camo.githubusercontent.com/dc16327a0ba2e06e0972ce396ea742c891b0ecfd6f26254f3c3c3f6d31b61d1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b61676973742d706c616365686f6c6465722d6c69676874677265792e737667)[![PHP Version](https://camo.githubusercontent.com/f9dab509b766874e090f4122a99762a7f0b08ded23a495e18701a9a4937d036d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e352d626c75652e737667)](https://camo.githubusercontent.com/f9dab509b766874e090f4122a99762a7f0b08ded23a495e18701a9a4937d036d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e352d626c75652e737667)[![Tests](https://camo.githubusercontent.com/2d99df1a50e1b88911431621ac53021f1e19f253366c120869d0a706c794ad8f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d706c616365686f6c6465722d6c69676874677265792e737667)](https://camo.githubusercontent.com/2d99df1a50e1b88911431621ac53021f1e19f253366c120869d0a706c794ad8f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d706c616365686f6c6465722d6c69676874677265792e737667)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)[![Total Downloads](https://camo.githubusercontent.com/7532a17a7f33bf9827daf3054690d66410dfb0ac19759a07394e2596dae705e0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f776e6c6f6164732d706c616365686f6c6465722d6c69676874677265792e737667)](https://camo.githubusercontent.com/7532a17a7f33bf9827daf3054690d66410dfb0ac19759a07394e2596dae705e0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f776e6c6f6164732d706c616365686f6c6465722d6c69676874677265792e737667)

CommonPHP Runtime is the bootstrap/runtime foundation for CommonPHP applications. It provides the small layer that starts an application, creates the runtime container, runs an executive, emits lifecycle events, and returns or exits with an integer status code.

The package handles kernel execution, initialization context, dotenv loading, two-phase container creation, modules, service providers, events, drivers, logging access, path resolution, runtime context, and runtime error handling.

What It Is Not
--------------

[](#what-it-is-not)

CommonPHP Runtime is not an HTTP framework, router, ORM, config system, filesystem abstraction, session library, cache library, security system, or advanced logging system. It is the boot ROM, not the whole operating system.

See [package boundaries](docs/package-boundaries.md) for what belongs here and what belongs in separate CommonPHP packages.

Features
--------

[](#features)

- Abstract `Kernel` for application boot and execution.
- `ExecutiveInterface` for web, console, worker, or custom runtime modes.
- Dotenv loading with `APP_ENV` and `APP_DEBUG` support.
- PHP-DI bootstrap and execution containers with a layered wrapper.
- Optional `InitializationContext` for replacing runtime collaborators before boot.
- Container attributes, compilation, proxy, and definition-cache options through `ContainerOptions`.
- Container configuration through kernel, module, explicit service providers, and execution configurators.
- Object-based lifecycle and runtime error events.
- PSR-3 logger binding with `NullLogger` fallback.
- Immutable `AppContext` snapshot for services.
- Root/path resolution through `PathResolverInterface`.
- Lightweight module registration model.
- Isolated lazy driver container plus single-driver and driver-pool traits.

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

[](#requirements)

- PHP `^8.5`
- `php-di/php-di:^7.1`
- `symfony/dotenv:^8.0`
- `psr/log:^3.0`

No additional PHP extensions are declared by this package.

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

[](#installation)

```
composer require comphp/runtime
```

If this package has not been published yet, this command represents the intended Packagist install command once published.

Quick Start
-----------

[](#quick-start)

```
