Download the PHP package fuelphp/alias without Composer
On this page you can find all versions of the php package fuelphp/alias. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fuelphp/alias
More information about fuelphp/alias
Files in fuelphp/alias
Package alias
Short Description Class alias resolving.
License MIT
Homepage https://github.com/fuelphp/alias
Informations about the package alias
Fuel Alias
Library for lazy class aliasing.
Install
Via Composer
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
Namespace usage
Pattern Usage
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
Thank you for considering contribution to FuelPHP framework. Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.