PHPackages                             fuelphp/alias - 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. fuelphp/alias

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

fuelphp/alias
=============

Class alias resolving.

2.0.0(11y ago)2037.6k↓72.1%3[2 issues](https://github.com/fuelphp/alias/issues)2MITPHPPHP &gt;=5.4

Since Dec 19Pushed 11y ago1 watchersCompare

[ Source](https://github.com/fuelphp/alias)[ Packagist](https://packagist.org/packages/fuelphp/alias)[ Docs](https://github.com/fuelphp/alias)[ RSS](/packages/fuelphp-alias/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (6)Used By (2)

Fuel Alias
==========

[](#fuel-alias)

[![Build Status](https://camo.githubusercontent.com/db7d378273ebd7e8a6194680683502f6cb1ba225d24047865e748477f8a5f713/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6675656c7068702f616c6961732e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/fuelphp/alias)[![Code Coverage](https://camo.githubusercontent.com/5572aad41f734e93916e967d0ee4993148c1ca03f185473fca4310f9d76fff63/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6675656c7068702f616c6961732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/fuelphp/alias)[![Quality Score](https://camo.githubusercontent.com/ab9729268466cfe7da23e2f2c28ac935ca87922da3a9147ca7143c0f5732a5e5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6675656c7068702f616c6961732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/fuelphp/alias)[![HHVM Status](https://camo.githubusercontent.com/350d3e6dd57099930e0d9a4c83cb99ddadb8ba7083588e70349a9c010a3a033b/68747470733a2f2f696d672e736869656c64732e696f2f6868766d2f6675656c7068702f616c6961732e7376673f7374796c653d666c61742d737175617265)](http://hhvm.h4cc.de/package/fuelphp/alias)

**Library for lazy class aliasing.**

Install
-------

[](#install)

Via Composer

```
$ composer require fuelphp/alias
```

Usage
-----

[](#usage)

Within FuelPHP class aliases are used to provide easy access to namespaced classes and facilitate class inheritance injection.

The package exposes an alias manager which lets you create 3 types of aliases:

- **Literal**
    A one-to-one translation. Class "Namespaced\\Classname" translates to "Another\\Classname".
- **Namespace**
    Namespace aliases allow you to alias an entire namespace with one call.
- **Replacement**
    A pattern is matched an through replacements a new class is generated. "Namespace\\\*" maps to "Alias\\$1".

When registering the alias manager append or prepends itself to the autoload stack to act as a pre-processor or fallback. Depending on the amount of aliases and it could be beneficial to alternate between pre- or appending.

By default the manager will prepend itself to the autoloader stack.

### Basic Usage

[](#basic-usage)

```
// Create a new alias manager
$manager = new Fuel\Alias\Manager;

// Register the manager
$manager->register();

// Alias one class
$manager->alias('Alias\Me', 'To\This');

// Or alias many
$manager->alias([
	'Alias\This' => 'To\Me',
	'AndAlias\This' => 'To\SomethingElse',
]);

//
```

### Namespace usage

[](#namespace-usage)

```
// alias to a less deep namespace
$manager->aliasNamespace('Less\Deep', 'Some\Super\Deep\Name\Space');

// alias a namespace to global
$manager->aliasNamespace('Some\Space', '');
```

### Pattern Usage

[](#pattern-usage)

```
$manager = new Fuel\Alias\Manager;

// Alias with wildcards
$manager->aliasPattern('Namespaced\*', 'Other\\$1');

$otherThing = new Namespaced\Thing;
```

This can result into class resolving that doesn't exists. Luckily the package is smart enough the check wether the class exists and will continue to look for the correct class if the resolved class does not exist. This is also taken into account when it comes to caching. Only resolved classes that exist will be cached.

Contributing
------------

[](#contributing)

Thank you for considering contribution to FuelPHP framework. Please see [CONTRIBUTING](https://github.com/fuelphp/fuelphp/blob/master/CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 51.3% 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

Every ~185 days

Total

5

Last Release

4201d ago

Major Versions

0.2.0 → 2.0.02015-01-01

PHP version history (2 changes)0.1.0PHP &gt;=5.3.3

0.2.0PHP &gt;=5.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/456954?v=4)[Harro Verton](/maintainers/WanWizard)[@WanWizard](https://github.com/WanWizard)

![](https://avatars.githubusercontent.com/u/2370734?v=4)[Emlyn West](/maintainers/emlynwest)[@emlynwest](https://github.com/emlynwest)

---

Top Contributors

[![WanWizard](https://avatars.githubusercontent.com/u/456954?v=4)](https://github.com/WanWizard "WanWizard (20 commits)")[![frankdejonge](https://avatars.githubusercontent.com/u/534693?v=4)](https://github.com/frankdejonge "frankdejonge (13 commits)")[![sagikazarmark](https://avatars.githubusercontent.com/u/1226384?v=4)](https://github.com/sagikazarmark "sagikazarmark (6 commits)")

---

Tags

aliasAliassing

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/fuelphp-alias/health.svg)

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

###  Alternatives

[typo3/class-alias-loader

Amends the composer class loader to support class aliases to provide backwards compatibility for packages

4414.6M28](/packages/typo3-class-alias-loader)[chasegiunta/scss

Compiler for SCSS

148.6k1](/packages/chasegiunta-scss)

PHPackages © 2026

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