PHPackages                             wallaceosmar/carion-framework - 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. wallaceosmar/carion-framework

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

wallaceosmar/carion-framework
=============================

A basic singleton registry manager.

v0.0.1(3y ago)05MITPHPPHP &gt;=5.5.0

Since Dec 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/wallaceosmar/Carion-Library)[ Packagist](https://packagist.org/packages/wallaceosmar/carion-framework)[ RSS](/packages/wallaceosmar-carion-framework/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Carion-Framework
================

[](#carion-framework)

Carion is a simple singleton manager framework.

Installing
==========

[](#installing)

```
composer require wallaceosmar/carion-framework
```

How Use
-------

[](#how-use)

The access of the values can be due to a object value or array access.

```
require_once './vendor/autoload.php';

$carion->example = 'example';

$carion['example2'] = 'example2';

echo $cation->example;
echo $carion['example2'];
```

Seting a singleton
------------------

[](#seting-a-singleton)

Singleton is used to call some functions or instantiate custom class.

### Setting a singleton to be used later

[](#setting-a-singleton-to-be-used-later)

```
$carion = new Carion\Carion();

$carion->singleton( 'example', function () {
    return 'example';
});

echo $carion->example;
```

#### Setting a singleton with parameter

[](#setting-a-singleton-with-parameter)

The function singleton map the names of the paramter to a singleton register in the class.

```
$carion = new Carion\Carion();

$carion->set('value', 'example');

$carion->singleton( 'example', function ( $value ) {
    return $value;
});

echo $carion->example;
```

If the does`t have a value to the paramter, will be seted null as the value.

```
$carion = new Carion\Carion();

$carion->singleton( 'example', function ( $value ) {
    if ( 'example' == $value ) {
        $value = md5( $value )';
    }
    return $value;
});

echo $carion->example;
```

Calling a function or class method
----------------------------------

[](#calling-a-function-or-class-method)

You can call a function or a class method using the function call.

The function call is reponsibly to map all the paramters.

```
echo $carion->call(function( $value1, $value2 ) {
    return $value1 + $value2;
}, array( 10, 20 ));
```

Parsing a array with key name overwrite the order of values.

```
echo $carion->call(function( $value1, $value2 ) {
    return $value1 + $value2;
}, array( 10, 20, 'value1' => 0 ));
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

1254d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d9e3b7a8bcff6ce27eeed8daba912b565eee78e50107d4daf0648d5fca7f0a6?d=identicon)[wallaceosmar](/maintainers/wallaceosmar)

---

Top Contributors

[![wallaceosmar](https://avatars.githubusercontent.com/u/7277078?v=4)](https://github.com/wallaceosmar "wallaceosmar (5 commits)")

---

Tags

managesingletonregistry

### Embed Badge

![Health badge](/badges/wallaceosmar-carion-framework/health.svg)

```
[![Health](https://phpackages.com/badges/wallaceosmar-carion-framework/health.svg)](https://phpackages.com/packages/wallaceosmar-carion-framework)
```

###  Alternatives

[sylius/registry

Services registry.

6211.0M40](/packages/sylius-registry)[florianwolters/component-util-singleton

The Singleton (and Registry of Singletons a.k.a. Multiton) design pattern as a PHP component.

13175.8k5](/packages/florianwolters-component-util-singleton)[bnomei/autoloader-for-kirby

Helper to automatically load various Kirby extensions in a plugin

185.7k2](/packages/bnomei-autoloader-for-kirby)

PHPackages © 2026

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