Build the environment specific worker command.

@return string
436006
protected function buildWorkerCommand()
    {
        if (! app()->isRunningOnGae()) {
            return parent::buildWorkerCommand();
        }

        $binary = (new PhpExecutableFinder)->find(false);

        if (defined('HHVM_VERSION')) {
            $binary .= ' --php';
        }

        if (defined('ARTISAN_BINARY')) {
            $artisan = ARTISAN_BINARY;
        } else {
            $artisan = 'artisan';
        }

        $command = 'queue:work %s --queue=%s --delay=%s --memory=%s --sleep=%s --tries=%s';

        return "{$binary} {$artisan} {$command}";
    }
224069
public function buildCommand()
    {
        $command = $this->command . ' >> ' . $this->_output . ' 2>&1 &';

        return $this->_user ? 'sudo -u ' . $this->_user . ' ' . $command : $command;
    }
1209045
function build(): string
    {
        if ($this->host !== null && $this->preferredFormat === static::ABSOLUTE) {
            return $this->buildAbsolute();
        } else {
            return $this->buildRelative();
        }
    }
724652
protected function generateEnv()
    {
        $env = null;

        // Get the existing .env file contents to replace
        $envPath = $this->laravel->environmentFilePath();

        if (! file_exists($envPath)) {
            // Create the .env file from the example file
            copy($envPath.'.example', $envPath);
            $this->callSilent('key:generate', ['--force' => true]);
        }

        $env = file_get_contents($envPath);

        // Loop over all of the keys we can set and replace the values that are set
        foreach ($this->keys as $key => $var) {
            // Skip if it's not set
            if (! isset($this->$var)) {
                continue;
            }

            $env = preg_replace(
                $this->keyReplacementPattern($key),
                $key.'='.(is_string($this->$var) ? '"'.$this->$var.'"' : $this->$var),
                $env,
                1
            );
        }

        return $env;
    }
1162313
function createEnvironment()
    {
        $env = new Environment;

        $loadPaths = $this->loadPaths ?: array();

        foreach ($loadPaths as $path) {
            $env->appendPath(dirname($this->filename) . "/" . $path);
        }

        if (!$this->debug) {
            if ($jsCompressor = $this->jsCompressor) {
                $env->setJsCompressor($jsCompressor);
            }

            if ($cssCompressor = $this->cssCompressor) {
                $env->setCssCompressor($cssCompressor);
            }
        }

        return $env;
    }
1003736
public function envRebuild()
    {
        $this->executeCommandHook(__FUNCTION__, 'before');
        $this->engineInstance()->rebuild();
        $this->projectInstance()->rebuildSettings();
        $this->executeCommandHook(__FUNCTION__, 'after');

        return $this;
    }
1287366
public function getProcessEnv() {
		if (file_exists($this->getPrivateKeyPath())) {
			// Key-pair is available, use it.
			$processEnv = array(
				'IDENT_KEY' => $this->getPrivateKeyPath(),
				'GIT_SSH' => BASE_PATH . "/deploynaut/git-deploy.sh"
			);
		} else {
			$processEnv = array();
		}
		$this->extend('updateProcessEnv', $processEnv);
		return $processEnv;
	}
117943
public
    static function getEnvironment()
    {
        if (empty(self::$environment)) {
            self::$environment = getenv(self::ENV)
                ?: @$_SERVER[self::ENV]
                    ?: @$_ENV[self::ENV];

            // If the environment cannot be inferred, assume production.
            if (empty(self::$environment)) {
                self::$environment = self::ENV_PRODUCTION;
            }
        }

        return self::$environment;
    }
1109173
public static function build()
    {
        if ( !isset( self::$instance ) )
        {
            self::$instance = self::buildHandler(
                eZINI::instance( 'file.ini' )->variable( 'eZDFSClusteringSettings', 'DFSBackend' )
            );
        }

        return self::$instance;
    }
1349247
private function compile()
    {
        $shellOptions = [];
        /** @var ShellOption $shellOption */
        foreach ($this->shellOptions as $shellOption) {
            $shellOptions = array_merge($shellOptions, $shellOption->getArray());
        }

        $shellArguments = [];
        foreach ($this->shellArguments as $shellArgument) {
            $shellArguments[] = $shellArgument['value'];
        }

        $command = array_merge([$this->shellCommand], $shellOptions, $shellArguments);

        $builder = new Process($command);

        $builder->setTimeout($this->getCommandTimeout());

        $this->builder = $builder;

        return $this->builder;
    }
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;
	}
594176
protected function getServerCommandLine()
    {
        $this->checkJar(self::$ngJarFile);
        $this->checkJar(self::$jarFile);

        $classPath = array(
            self::$ngJarFile,
            self::$jarFile,
        );

        // The command for the server that should show up in the process list
        $server = array(
            self::$javaExecutable,
            '-server',
            '-cp', implode(':', $classPath),
            self::NG_SERVER,
        );

        return $server;
    }
923243
public function buildCommand()
	{
		$output = ProcessUtils::escapeArgument( $this->output );
		$redirect = $this->shouldAppendOutput ? ' >> ' : ' > ';
		if ( $this->withoutOverlapping )
		{
			if ( windows_os() )
			{
				$command = '(echo \'\' > "' . $this->mutexPath() . '" & ' . $this->command . ' & del "' . $this->mutexPath() . '")' . $redirect . $output . ' 2>&1 &';
			}
			else
			{
				$command = '(touch ' . $this->mutexPath() . '; ' . $this->command . '; rm ' . $this->mutexPath() . ')' . $redirect . $output . ' 2>&1 &';
			}
		}
		else
		{
			$command = $this->command . $redirect . $output . ' 2>&1 &';
		}

		return $this->user && !windows_os() ? 'sudo -u ' . $this->user . ' -- sh -c \'' . $command . '\'' : $command;
	}
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;
    }
775974
public static function getRemoteEnvironments()
    {
        $environments = [];

        foreach (self::getProjectConfig()->getRemote() as $remote) {
            foreach ($remote as $environment) {
                if (!isset($environment['realm'])) {
                    continue;
                }
                $realm = $environment['realm'];
                unset($environment['realm']);

                $environments[$realm][] = $environment;
            }
        }

        return $environments;
    }
89229
protected function buildCommand()
    {
        if ($this->error !== null) {
            $this->realCommand .= ' 2> ' . escapeshellarg($this->error->getPath());
            $this->log(
                'Writing error output to: ' . $this->error->getPath(),
                $this->logLevel
            );
        }

        if ($this->output !== null) {
            $this->realCommand .= ' 1> ' . escapeshellarg($this->output->getPath());
            $this->log(
                'Writing standard output to: ' . $this->output->getPath(),
                $this->logLevel
            );
        } elseif ($this->spawn) {
            $this->realCommand .= ' 1>/dev/null';
            $this->log('Sending output to /dev/null', $this->logLevel);
        }

        // If neither output nor error are being written to file
        // then we'll redirect error to stdout so that we can dump
        // it to screen below.

        if ($this->output === null && $this->error === null && $this->passthru === false) {
            $this->realCommand .= ' 2>&1';
        }

        // we ignore the spawn boolean for windows
        if ($this->spawn) {
            $this->realCommand .= ' &';
        }

        $this->realCommand = (string) $this->commandline . $this->realCommand;
    }
237801
public function getEnvironmentMessages()
    {
        $messages = array();
        foreach ($this->getEnvironments() as $environment) {
            $style = 'general';
            if (false == $this->vagrentExists($environment)) {
                $style = 'warning';
            }
            $messages[$environment] = $style;
        }
        return $messages;
    }