diff --git a/src/Alias.php b/src/Alias.php new file mode 100644 index 0000000..eca12a6 --- /dev/null +++ b/src/Alias.php @@ -0,0 +1,63 @@ + + * @copyright 2016 Studio Nexus + * @license MIT + * @version Release: 0.2.0 + * @link https://www.studionexus.co/php/damnstupidsimple + */ +namespace Core; + +/** + * The Alias Manager + * ----------------------------------------------------------------------- + * + * Register the array of class aliases when this application + * is started. + * + */ +class Alias { + + static private $config = null; + + /** + * Reads the configuration file (config/aliases.php) and create the + * alias + * + * @static + * @since Method available since release 0.2.0 + */ + static function init(){ + if(self::$config === null){ + self::$config = Config::get('aliases'); + } + + foreach(self::$config as $class => $alias){ + class_alias($class, $alias); + } + + } +} \ No newline at end of file