protected function buildEnvironment($config) {
		$environmentId = $config['env.id'];
		
		if (!EnvironmentProvider::hasEnvironment($environmentId))
			EnvironmentProvider::buildEnvironment($environmentId, $config['env.class']);
		
		//setup environment
		$env = EnvironmentProvider::getEnvironment($environmentId);
		$env->setConfig($config);
		return $env;
	}