From 9141eae0db6a54d03daafe38eed534bcd3fe5992 Mon Sep 17 00:00:00 2001 From: Fariz Luqman Date: Tue, 12 Jul 2016 05:42:55 +0800 Subject: [PATCH] Release Candidate: version 0.2.0 --- src/Alias.php | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/Alias.php 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