Get the deployment backend used for this environment.
Enforces compliance with the allowed_backends setting; if the DNEnvironment.BackendIdentifier value is
illegal then that value is ignored.

@return DeploymentBackend
160149
public function Backend() {
		$backends = array_keys($this->config()->get('allowed_backends', Config::FIRST_SET));
		switch(sizeof($backends)) {
		// Nothing allowed, use the default value "DeploymentBackend"
		case 0:
			$backend = "DeploymentBackend";
			break;

		// Only 1 thing allowed, use that
		case 1:
			$backend = $backends[0];
			break;

		// Multiple choices, use our choice if it's legal, otherwise default to the first item on the list
		default:
			$backend = $this->BackendIdentifier;
			if(!in_array($backend, $backends)) $backend = $backends[0];
		}

		return Injector::inst()->get($backend);
	}
1097763
public function getEnvironment()
    {
        $fileSystem = new Filesystem();
        $environment = '';
        $environmentPath = app()->getBasePath().'/.env';
        if ($fileSystem->isFile($environmentPath)) {
            $environment = trim($fileSystem->get($environmentPath));
            $envFile = app()->getBasePath().'/.'.$environment;

            if ($fileSystem->isFile($envFile.'.env')) {
                $dotEnv = new Dotenv(app()->getBasePath().'/', '.'.$environment.'.env');
                $dotEnv->load();
            }
        }

        return $environment;
    }
684700
public Environment getEnvironment()
    {
        Environment env = ((BaseApplication)this.getApplication()).getEnvironment();
        if (env == null)
            env = Environment.getEnvironment(null);   // Never
        return env;
    }
909724
public function getEnvFile()
    {
        $basePath = $this->getBasePath();
        $envFile = $this->get('envFile');
        $startsWith = substr($envFile, 0, 1);
        if (!$startsWith !== '/' && $startsWith !== '~' && $startsWith !== '\\') {
            $envFile = $basePath . DIRECTORY_SEPARATOR . $envFile;
        }

        return $envFile;
    }
853320
private function getDeploymentConfig()
    {
        if (!$this->deploymentConfig instanceof \Magento\Framework\App\DeploymentConfig) {
            $this->deploymentConfig = \Magento\Framework\App\ObjectManager::getInstance()
                ->get('Magento\Framework\App\DeploymentConfig');
        }
        return $this->deploymentConfig;
    }
569506
protected function getIdsOfServicesThatAreDefinedInApplication()
    {
        if ($this->serviceIdWhitelist === null) {
            $builder = $this->createContainerBuilder();
            $this->applyToExtensions(function (ExtensionInterface $extension) use ($builder) {
                $extension->load($builder->getExtensionConfig($extension->getAlias()), $builder);
            });
            $this->serviceIdWhitelist = $builder->getServiceIds();
        }
        return $this->serviceIdWhitelist;
    }
1252429
public static function GetClientIpEnvironnement() {
        $ipaddress = '';
        if (getenv('HTTP_CLIENT_IP'))
            $ipaddress = getenv('HTTP_CLIENT_IP');
        else if (getenv('HTTP_X_FORWARDED_FOR'))
            $ipaddress = getenv('HTTP_X_FORWARDED_FOR');
        else if (getenv('HTTP_X_FORWARDED'))
            $ipaddress = getenv('HTTP_X_FORWARDED');
        else if (getenv('HTTP_FORWARDED_FOR'))
            $ipaddress = getenv('HTTP_FORWARDED_FOR');
        else if (getenv('HTTP_FORWARDED'))
            $ipaddress = getenv('HTTP_FORWARDED');
        else if (getenv('REMOTE_ADDR'))
            $ipaddress = getenv('REMOTE_ADDR');
        else
            $ipaddress = 'UNKNOWN';

        return $ipaddress;
    }
569289
private function getServer()
    {
        if ($this->server) {
            return $this->server;
        }
        if (isset($this->options['serverId']) && !empty($this->options['serverId'])) {
            return $this->server = $this->getDbCluster()
                ->getServer($this->options['serverId']);
        }

        return $this->server = $this->getDbCluster()
            ->getMaster();
    }
1046655
protected function getEnvironment() {
		$projectName = $this->getRequest()->param('Project');
		$project = DNProject::get()->filter('Name', $projectName)->first();
		$environmentName = $this->getRequest()->param('Environment');
		return $project->Environments()->filter('Name', $environmentName)->first();
	}
1204181
protected function getCurrentPlatform()
    {
        $env = [];

        $container = new Container('melisinstaller');
        if (isset($container['environments']) && isset($container['environments']['default_environment'])) {
            $env = $container['environments']['default_environment'];
        }

        return $env;
    }
23561
public function getBackends()
    {
        $backends = array_map(
            function ($backend) {
                $new = (object)(array_merge(reset($backend), ['_id'=>array_keys($backend)[0]]));
                return $new;
            },
            $this['payment_backends']
        );
        // return backends (filtered if requested)
        return ($filters = func_get_args()) ? array_filter($backends, self::combineFilters(self::argsToVariadic($filters))) : $backends;
    }
1324549
public function getBackendOption($backendName, $option, $defaultOption = null)
    {
        $backendConfig = $this->getConfigArrayOption('backend', array());
        if (isset($backendConfig[$backendName][$option])) {
            return $backendConfig[$backendName][$option];
        }

        $optionConfig = $this->getConfigArrayOption('default_backend_option', array());

        if (isset($optionConfig[$option])) {
            return $optionConfig[$option];
        }

        return $defaultOption;
    }
1325307
public String getEnvironment(){
        String env = "development";

        if(!blank(System.getenv("ACTIVE_ENV"))){
            env = System.getenv("ACTIVE_ENV");
        }

        if(!blank(System.getProperty("active_env"))){
            env = System.getProperty("active_env");
        }
        return env;
    }
972467
public static function isAdminBackend()
    {
        /* @var $controller Controller */
        $controller = Controller::curr();
        if (
            $controller instanceof LeftAndMain ||
            $controller instanceof DevelopmentAdmin ||
            $controller instanceof DatabaseAdmin ||
            (class_exists('DevBuildController') && $controller instanceof DevBuildController)
        ) {
            return true;
        }

        return false;
    }
1371584
public function getCacheFrontendFactory() {
		if ($this->_cacheFrontendFactory === null) {
			if ($this instanceof LocatorAwareInterface && $this->hasLocator()) {
				$locator   = $this->getLocator();
				$serviceId = $this->getCacheFrontendFactoryServiceId();
				
				if ($locator->has($serviceId)) {
					$this->_cacheFrontendFactory = $locator->get($serviceId);
					return $this->_cacheFrontendFactory;
				}
			}
			
			throw new NoFrontend('Unable to provide the cache frontend\'s factory');
		}
		
		return $this->_cacheFrontendFactory;
	}
45215
protected function proxy() {
        if (!$this->context) {
            $this->context = new DeploymentContext(
                $this->version,
                $this->solution['fleetSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
498026
def get_backend(self):
        
        try:
            cache = caches[machina_settings.ATTACHMENT_CACHE_NAME]
        except InvalidCacheBackendError:
            raise ImproperlyConfigured(
                'The attachment cache backend ({}) is not configured'.format(
                    machina_settings.ATTACHMENT_CACHE_NAME,
                ),
            )
        return cache