Get the current environment

@return string
436529
public static function get()
    {
        if (empty(static::$sEnvironment)) {

            if (!empty($_ENV['ENVIRONMENT'])) {
                static::set($_ENV['ENVIRONMENT']);
            } else {
                static::set(ENVIRONMENT);
            }

            try {

                $oInput = Factory::service('Input');
                if (static::not(static::ENV_PROD) && $oInput->header(Testing::TEST_HEADER_NAME) === Testing::TEST_HEADER_VALUE) {
                    static::set(static::ENV_HTTP_TEST);
                    //  @todo (Pablo - 2018-11-21) - Consider halting execution if on prod and a test header is received
                }

            } catch (\Exception $e) {
                /**
                 * In the circumstance the environment is checked before the factory
                 * is loaded then this block will fail. Rather than consider this an
                 * error, simply swallow it quietly as it's probably intentional and
                 * can be considered a non-testing situation.
                 */
            }
        }

        return static::$sEnvironment;
    }
826235
public static function getEnv()
    {   
        if (null !== (getenv('P_DRIVER'))) {

            $dotEnv = new Dotenv($_SERVER['DOCUMENT_ROOT']);
            $dotEnv->load();
        }    
      
        self::$driver  = getenv('P_DRIVER');
        self::$host    = getenv('P_HOST');
        self::$dbname  = getenv('P_DBNAME');
        self::$user    = getenv('P_USER');
        self::$pass    = getenv('P_PASS');  
    }
900114
public function getCurrentDescription()
    {
        $files = $this->files;
        if(!($this->current === null)) {
            $files = $this->owner->$files;
            $file = $files[$this->current];
            return isset($file->vars->description) ? $file->vars->description : "";
        }
        return "";
    }
337537
protected function envPath()
    {
        if (method_exists($this->laravel, 'environmentFilePath')) {
            return $this->laravel->environmentFilePath();
        }

        // check if laravel version Less than 5.4.17
        if (version_compare($this->laravel->version(), '5.4.17', '<')) {
            return $this->laravel->basePath().DIRECTORY_SEPARATOR.'.env';
        }

        return $this->laravel->basePath('.env');
    }
358307
public static function getMetaEnvironments()
    {
        return array_merge([
            self::ENV_LOCAL,
            self::ENV_DEVELOPMENT,
            self::ENV_STAGING,
            self::ENV_PRODUCTION,
        ], config('nodes.meta.environments', []));
    }
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();
	}
302856
public static function environment()
	{
		$env = static::fw()->config->get( 'app.env', 'production' );

		if ( func_num_args() > 0 )
		{
			$patterns = is_array( func_get_arg( 0 ) ) ? func_get_arg( 0 ) : func_get_args();

			foreach ( $patterns as $pattern )
				if ( Str::is( $pattern, $env ) )
					return true;

			return false;
		}

		return $env;
	}
985276
public function current_settings() {
		$result = $this->executeCommand($this->_path_for_regex . '_current_settings', array('id' => $this->id));
		$json_str = $result->getBody(true);
		$json_obj = json_decode($json_str);
		return $json_obj;
	}
517483
def get_environment(self):
        '''
        
        '''
        env = {}
        if self.http:
            env['http_proxy'] = env['HTTP_PROXY'] = self.http
        if self.https:
            env['https_proxy'] = env['HTTPS_PROXY'] = self.https
        if self.ftp:
            env['ftp_proxy'] = env['FTP_PROXY'] = self.ftp
        if self.no_proxy:
            env['no_proxy'] = env['NO_PROXY'] = self.no_proxy
        return env
9775
private function getTwigEnvironment()
    {
        if (null == $this->twigEnvironment) {
            $this->twigEnvironment = $this->createTwigEnvironment();
        }
        return $this->twigEnvironment;
    }
1204006
def getCurrent(cls):
        
        if cls.__CURR is None:
            env = DEFAULT
            envs = cls.getRegisteredEnvs()
            if env not in envs:
                env = envs[0]
            logger.debug("Env not set, setting it to %s" % env)
            cls.setEnv(env)
        return cls.__CURR
411536
public function current()
    {
        $line = fgets($this->handle);
        $this->length = strlen($line);
        fseek($this->handle, $this->offset);

        return $line;
    }
834178
private function getEnv()
    {
        foreach (['CONVERT', 'PYTHON', 'AUDIO_BITRATE', 'STREAM'] as $var) {
            $env = getenv($var);
            if ($env) {
                $prop = lcfirst(str_replace('_', '', ucwords(strtolower($var), '_')));
                $this->$prop = $env;
            }
        }
    }
70219
def get_env():
    
    if not __ENV__:
        env = os.environ["env"] if "env" in os.environ else "Dev"
        set_env(env)
    return __ENV__
1213211
protected function getEnvironments() {
        if (!$this->_environments) {
            $this->_environments = new EnvironmentList($this->version, $this->solution['sid']);
        }

        return $this->_environments;
    }
1332193
protected function getEnvironmentVariables()
    {
        $env = array();

        foreach ($_SERVER as $name => $val) {
            if (is_array($val) || !in_array(strtolower($name), $this->getEnvironmentVariablesThatICareAbout())) {
                // In the future, this could be supported
                continue;
            }

            $env['env.'.$name] = $val;
        }

        return $env;
    }
1127795
def get_env():
    
    env = os.getenv('ENV', os.getenv('env', None))
    if env:
        env = env.lower()
    return env