PHPackages                             lum/lum-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lum/lum-core

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lum/lum-core
============

Lum Core library and plugins

v3.0.2(3y ago)09411MITPHP

Since Sep 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/supernovus/lum.core.php)[ Packagist](https://packagist.org/packages/lum/lum-core)[ RSS](/packages/lum-lum-core/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (2)Versions (57)Used By (11)

lum.core.php
============

[](#lumcorephp)

Summary
-------

[](#summary)

A small class with a singleton instance that can be used to manage the lifecycle of a PHP application, acting as a director for models, controllers, and views.

It also supports additional plugins that have a ton of extra functionality.

Despite the name of the package and class, this is not in fact the singular *core* library that everything else in the **Lum.php** collections builds upon. It used to be in the `1.x` days, but has since become just the App Director singleton class. See [lum-compat](https://github.com/supernovus/lum.compat.php)for the *true* fundamental core class that the whole PHP library set uses.

Classes
-------

[](#classes)

ClassDescriptionLum\\CoreThe Core class itself.Lum\\Plugins\\CaptureA helper for capturing PHP output.Lum\\Plugins\\ControllersA plugin for loading controllers.Lum\\Plugins\\InstanceA base class for loading class instances.Lum\\Plugins\\ModelsA plugin for loading models.Lum\\Plugins\\PluginsA meta-plugin for loading plugins.Lum\\Plugins\\SessA plugin for managing PHP Sessions.Lum\\Plugins\\ViewsA plugin for loading views.Traits
------

[](#traits)

TraitDescriptionLum\\Loader\\ContentA loader trait for parsing PHP content.Lum\\Loader\\FilesA loader trait for finding files in a folder.Lum\\Loader\\InstanceA loader trait for creating an object instance.Lum\\Loader\\NamespacesA loader trait for finding classes in namespaces.Note on Plugins
---------------

[](#note-on-plugins)

Prior to `v3.0` most of the additional plugins were included in the `core`package itself, but I decided that it made more sense to split them off into their own packages. A *suggested*[lum-core-plugins](https://github.com/supernovus/lum.core-plugins.php)*meta-package* will be available to install all of the plugins that used to be included in this package.

Creating a Core instance
------------------------

[](#creating-a-core-instance)

You only need to do this **once** in your application, generally right at the beginning (either at the very top of the main PHP script, or right after a `namespace` declaration if the script itself is inside a *PHP Namespace*.)

```
require_once 'vendor/autoload.php';  // Register Composer autoloaders.
\Lum\Autoload::register();           // If using spl_autoload, call this.
$core = \Lum\Core::getInstance();    // Create your Core object.
```

The first line is a standard for anything using *Composer*, and the second line is a compatibility function from `lum-compat` that allows the use of classic *SPL* autoloading along side *Composer* autoloading.

The last line is the one that actually creates the *singleton instance*.

You **cannot** use the `new \Lum\Core()` style constructor with this class. The constructor is *protected* and can only be called via `getInstance()`.

Getting the current Core instance
---------------------------------

[](#getting-the-current-core-instance)

Any time you need the Core, you simply call the `getInstance()` method.

```
$core = \Lum\Core::getInstance();  // Return the current core instance.
```

Since this is using a *singleton instance*, it will always return the same object no matter where or how many times it is called.

Using plugins
-------------

[](#using-plugins)

The plugins are loaded automatically when first called. For instance:

```
$lum = \Lum\Core::getInstance();
$lum->conf->setDir('./conf'); // Load Conf plugin and call setDir() on it.
$lum->router = ['extend'=>true, 'auto_prefix'=>true]; // Load Router plugin.
$lum->router->loadRoutes($lum->conf->routes); // Load routes into Router.
$lum->controllers->addNS("\\MyApp\\Controllers"); // Load Controllers plugin.
$lum->models->addNS("\\MyApp\\Models"); // Load Models plugin.
$lum->controllers->use_screens(); // Use default view loaders.
$lum->dispatch(); // Call an extension method added by Router plugin.
```

The above example is written assuming `lum-core-plugins` is also installed, as the `conf` and `router` plugins have been split into their own packages and are no longer included by default, but `lum-core-plugins` includes all of the split-off plugins.

Official URLs
-------------

[](#official-urls)

This library can be found in two places:

- [Github](https://github.com/supernovus/lum.core.php)
- [Packageist](https://packagist.org/packages/lum/lum-core)

Author
------

[](#author)

Timothy Totten

License
-------

[](#license)

[MIT](https://spdx.org/licenses/MIT.html)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity72

Established project with proven stability

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 ~24 days

Recently: every ~74 days

Total

54

Last Release

1100d ago

Major Versions

v1.x-dev → v2.0.02021-12-13

v2.x-dev → v3.0.02022-07-22

PHP version history (2 changes)v1.0.0PHP ^7.0

v1.5.1PHP ^7.0 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ff04349507190155013e4a94a8b14860a7ac57afce4ba97961c7c79bd023dd7?d=identicon)[supernovus](/maintainers/supernovus)

### Embed Badge

![Health badge](/badges/lum-lum-core/health.svg)

```
[![Health](https://phpackages.com/badges/lum-lum-core/health.svg)](https://phpackages.com/packages/lum-lum-core)
```

PHPackages © 2026

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