public static function choose($environment = null) {
		if (!isset($environment)) {
			if(isset($_ENV["APP_ENV"])) {
				switch($_ENV["APP_ENV"]) {
					case "dev": case "development": default:
						$environment = Environment::DEVELOPMENT; break;
					case "stage":
						$environment = Environment::STAGE; break;
					case "prod": case "production":
						$environment = Environment::PRODUCTION; break;
				}
			} else {
				switch($_SERVER["SERVER_NAME"]) {
					case "localhost":
						$environment = Environment::DEVELOPMENT; break;
					default:
						$environment = Environment::PRODUCTION; break;
				}
			}
		} else {
			$environment = Environment::DEVELOPMENT;
		}
		
		return $environment;
	}
public static function choose($environment = null) {
		if (!isset($environment)) {
			if(isset($_ENV["APP_ENV"])) {
				switch($_ENV["APP_ENV"]) {
					case "dev": case "development": default:
						$environment = Environment::DEVELOPMENT; break;
					case "stage":
						$environment = Environment::STAGE; break;
					case "prod": case "production":
						$environment = Environment::PRODUCTION; break;
				}
			} else {
				switch($_SERVER["SERVER_NAME"]) {
					case "localhost":
						$environment = Environment::DEVELOPMENT; break;
					default:
						$environment = Environment::PRODUCTION; break;
				}
			}
		} else {
			$environment = Environment::DEVELOPMENT;
		}
		
		return $environment;
	}
public static function choose ( $ environment = null ) { if ( ! isset ( $ environment ) ) { if ( isset ( $ _ENV [ "APP_ENV" ] ) ) { switch ( $ _ENV [ "APP_ENV" ] ) { case "dev" : case "development" : default : $ environment = Environment :: DEVELOPMENT ; break ; case "stage" : $ environment = Environment :: STAGE ; break ; case "prod" : case "production" : $ environment = Environment :: PRODUCTION ; break ; } } else { switch ( $ _SERVER [ "SERVER_NAME" ] ) { case "localhost" : $ environment = Environment :: DEVELOPMENT ; break ; default : $ environment = Environment :: PRODUCTION ; break ; } } } else { $ environment = Environment :: DEVELOPMENT ; } return $ environment ; }
Chooses environment.
@param null|string $environment
@return string
Chooses environment .