First commit, version 0.1 beta base nibiru framework
This commit is contained in:
52
core/c/config.php
Normal file
52
core/c/config.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
namespace Nibiru;
|
||||
|
||||
/**
|
||||
* User - stephan
|
||||
* Date - 24.01.17
|
||||
* Time - 19:24
|
||||
* @author - Stephan Kasdorf
|
||||
* @category - [PLEASE SPECIFIY]
|
||||
* @license - BSD License
|
||||
*/
|
||||
class Config extends Settings
|
||||
{
|
||||
const STAGING_SYSTEM = "staging";
|
||||
const PRODUCTION_SYSTEM = "production";
|
||||
const DEVELOPMENT_SYSTEM = "development";
|
||||
const CLI_SYSTEM = "cli";
|
||||
|
||||
private static $_env;
|
||||
|
||||
public static function getInstance()
|
||||
{
|
||||
self::setEnv();
|
||||
parent::setConfig(self::getEnv());
|
||||
return parent::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public static function getEnv()
|
||||
{
|
||||
return self::$_env;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $env
|
||||
*/
|
||||
private static function setEnv( )
|
||||
{
|
||||
if(getenv("APPLICATION_ENV"))
|
||||
{
|
||||
self::$_env = getenv("APPLICATION_ENV");
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$_env = self::CLI_SYSTEM;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user