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

AbandonedArchivedLibrary

osmphp/core
===========

Enables modular software development in any PHP project

v0.10.19(4y ago)35601GPL-3.0-onlyPHPPHP &gt;=8.0

Since Feb 2Pushed 4y ago2 watchersCompare

[ Source](https://github.com/osmphp/core)[ Packagist](https://packagist.org/packages/osmphp/core)[ RSS](/packages/osmphp-core/feed)WikiDiscussions v0.10 Synced 1w ago

READMEChangelog (10)Dependencies (4)Versions (82)Used By (1)

 [![Build Status](https://github.com/osmphp/core/workflows/tests/badge.svg)](https://github.com/osmphp/core/actions) [![Total Downloads](https://camo.githubusercontent.com/419e889846f0183cc5bc69bda2e708137f10bbe1481b1ec3b98fab0e5212bc7f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f736d7068702f636f7265)](https://packagist.org/packages/osmphp/core) [![Latest Stable Version](https://camo.githubusercontent.com/5130cda22f843efda76d20c543eab8698039f7ecdd2d9f4a2755f0ee4f9868e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f736d7068702f636f7265)](https://packagist.org/packages/osmphp/core) [![License](https://camo.githubusercontent.com/9b1c043daa11a96a4891b282188b551ee8f582186777f135ca486de94014d0cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f736d7068702f636f7265)](https://packagist.org/packages/osmphp/core)

- [About osmphp/core](#about-osmphpcore)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Getting Started](#getting-started)
- [Using The Library](#using-the-library)
- [Contributing](#contributing)
- [License](#license)
- [Commercial License &amp; Support](#commercial-license--support)

About `osmphp/core`
-------------------

[](#about-osmphpcore)

`osmphp/core` enables modular software development in any PHP project - dividing the application code into modules - reusable, extensible and pluggable parts.

A module is a directory responsible for a single feature or concept of your application. For example one module may handle products in e-commerce application, another - authorize users into the application's restricted area, yet another one - enable the application to be used in the command line, and so on.

`osmphp/core` is different from other frameworks in several ways:

- **Unprecedented extensibility**. From your module, add new and modify existing (even protected) methods of any other module class.
- **Smaller footprint, faster execution**. Class property values are computed only when (and if) they are accessed, unless you explicitly assign them.
- **Simple object instantiation**. Classes know and use their default dependencies, you don't have to pass them when creating an object. Unless you want to, for example, when mocking a dependency in a unit test. It also completely removes the hassle of configuring a dependency injection container.
- **Auto-wiring**. Plug-in your class into the application just by extending a certain class, or by adding an attribute. The application intimately knows the class definitions of all the modules, and wires them together without additional configuration files.

Prerequisites
-------------

[](#prerequisites)

This library requires:

- PHP 8
    - `mbstring` extension
- Composer

Install them if necessary.

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

[](#installation)

Install the `osmphp/core` Composer package:

```
    composer require osmphp/core

```

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

[](#getting-started)

Prepare the project for using the library as described below. In the future, this package will come preinstalled with a project template, and you will not have to write this boilerplate code.

1. Create an application class in the `src/App.php` file (assuming that your project is configured to autoload the `App\` namespace from the `src/` directory; if it's not the case, adjust the code snippets accordingly):

    ```
