Skip to content

Commit

Permalink
Release Candidate: version 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Fariz Luqman committed Jul 11, 2016
1 parent b52984f commit 9141eae
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions src/Alias.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php
/**
* Damn Stupid Simple - A PHP Framework For Lazy Developers
*
* Copyright (c) 2016 Studio Nexus
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* @package Damn Stupid Simple
* @author Studio Nexus <[email protected]>
* @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);
}

}
}

0 comments on commit 9141eae

Please sign in to comment.