Get PHP/Server environment details
@return array
434805
public static function getServerEnv()
    {
        return array_merge([
            'version' => phpversion(),
            'server_software' => $_SERVER['SERVER_SOFTWARE'],
            'server_os' => php_uname(),
            'database_connection_name' => config('database.default'),
            'ssl_installed' => self::checkSslIsInstalled(),
            'cache_driver' => config('cache.default'),
            'session_driver' => config('session.driver'),
            'openssl' => extension_loaded('openssl'),
            'pdo' => extension_loaded('pdo'),
            'mbstring' => extension_loaded('mbstring'),
            'tokenizer' => extension_loaded('tokenizer'),
            'xml' => extension_loaded('xml')
        ], self::getServerExtras());
    }
1291632
protected function getServerInitConfig()
    {
        return [
            'host'      => isset($this->config['host']) ? $this->config['host'] : '0.0.0.0',
            'port'      => isset($this->config['port']) ? $this->config['port'] : 8080,
            'sockType'  => isset($this->config['sockType']) ? (SWOOLE_SOCK_UDP | $this->config['sockType']) : SWOOLE_SOCK_UDP,
            'mode'      => isset($this->config['mode']) ? $this->config['mode'] : SWOOLE_PROCESS,
        ];
    }
950260
public static function getEnvironmentVariables() {
    $dir = shell_exec('pwd');
    $dir_parts = explode(DIRECTORY_SEPARATOR, $dir);
    $project = trim(array_pop($dir_parts));
    $client = trim(array_pop($dir_parts));
    $dir = $dir . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'project' . DIRECTORY_SEPARATOR . $client . DIRECTORY_SEPARATOR . $project;
    $environment_file = file_get_contents($dir . DIRECTORY_SEPARATOR . 'environment.yml');
    if (!$environment_file) {
      throw new MissingEnvironmentConfigurationException("The environment configuration is missing, please contact your administrator.");
    }
    return new EnvironmentVariables(Yaml::parse($environment_file));
  }
661145
protected function getServerInfo($running = true)
    {
        if (!isset($this->serverInfo)) {
            $this->serverInfo = [];
            // @todo move this to State service (in a new major version)
            $filename = $this->config()->getWritableUserDir() . '/local-servers.json';
            if (file_exists($filename)) {
                $this->serverInfo = (array) json_decode(file_get_contents($filename), true);
            }
        }

        if ($running) {
            return array_filter($this->serverInfo, function ($server) {
                if ($this->isProcessDead($server['pid'])) {
                    $this->stopServer($server['address']);
                    return false;
                }

                return true;
            });
        }

        return $this->serverInfo;
    }
486273
public function getAll()
    {
        if ($_ENV) return $_ENV;
        $info = $this->getPhpInfo();
        $_ENV = $this->parser->parse($info);
        return $_ENV;
    }
118568
protected function serverInfoSoftware()
    {
        $linfo = $this->linfo->getParser();

        $os = $this->ifExists($linfo->getOS());
        $kernel = $this->ifExists($linfo->getKernel());
        $arc = $this->ifExists($linfo->getCPUArchitecture());
        $webserver = $this->ifExists($linfo->getWebService());
        $php = $this->ifExists($linfo->getPhpVersion());

        $distro = '';
        if (method_exists($linfo, 'getDistro')) {
            $distro = $this->getDistroString(
                $this->ifExists($linfo->getDistro())
            );
        }

        $this->results['server']['software'] = compact(
            'os', 'distro', 'kernel', 'arc', 'webserver', 'php'
        );

        return $this;
    }
1365965
public function getServerSignature()
    {

        // try to load the OS identifier
        list($os, ) = sscanf(strtolower(php_uname('s')), '%s %s');

        // check if we've a file with the actual version number
        if (file_exists($filename = $this->getConfDir('/.release-version'))) {
            $version = file_get_contents($filename);
        } else {
            $version = 'dev-' . gethostname();
        }

        // prepare and return the server signature
        return sprintf('appserver/%s (%s) PHP/%s', $version, $os, PHP_VERSION);
    }
1106635
private static function checkEnvironment()
    {
        if (version_compare(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION, '5.6.99', '<')) {
            echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION . PHP_RELEASE_VERSION;
            require __DIR__ . '/ClientException.php';
            throw new ClientException('Incompatible PHP environment. Expecting PHP 7.0 or higher');
        }
    }
797461
public function getServerCredentials()
    {
        if (is_null($this->server)) {
            return [];
        }

        return isset($this->servers[$this->server]) ? $this->servers[$this->server] : [];
    }
1037813
public function getInfo()
    {
        if (function_exists('apache_note')) {
            $serverDesc = 'Apache';
        } else {
            $serverDesc = Piwik::translate('UserCountry_HttpServerModule');
        }

        $title = sprintf(self::TITLE, $serverDesc);

        $desc = Piwik::translate('GeoIp2_LocationProviderDesc_ServerModule', array('<strong>', '</strong>'))
            . '<br/><br/>'
            . Piwik::translate('UserCountry_GeoIpLocationProviderDesc_ServerBasedAnonWarn')
            . '<br/><br/>'
            . Piwik::translate('GeoIp2_LocationProviderDesc_ServerModule2',
                array('<strong>', '</strong>', '<strong>', '</strong>'));

        $installDocs =
            '<a rel="noreferrer"  target="_blank" href="https://maxmind.github.io/mod_maxminddb/">'
            . Piwik::translate('UserCountry_HowToInstallApacheModule')
            . '</a><br/>'
            . '<a rel="noreferrer"  target="_blank" href="https://github.com/leev/ngx_http_geoip2_module/blob/master/README.md#installing">'
            . Piwik::translate('UserCountry_HowToInstallNginxModule')
            . '</a>';

        $geoipServerVars = array();
        foreach ($_SERVER as $key => $value) {
            if (in_array($key, self::getGeoIpServerVars())) {
                $geoipServerVars[] = $key;
            }
        }

        if (empty($geoipServerVars)) {
            $extraMessage = '<strong>' . Piwik::translate('UserCountry_GeoIPNoServerVars', '$_SERVER') . '</strong>';
        } else {
            $extraMessage = '<strong>' . Piwik::translate('UserCountry_GeoIPServerVarsFound', '$_SERVER')
                . ":</strong><br/><br/>\n<ul style=\"list-style:disc;margin-left:24px\">\n";
            foreach ($geoipServerVars as $key) {
                $extraMessage .= '<li>' . $key . "</li>\n";
            }
            $extraMessage .= '</ul>';
        }

        $configUrl = Url::getCurrentQueryStringWithParametersModified(array(
            'module' => 'CoreAdminHome', 'action' => 'generalSettings'
        ));
        $extraMessage .= '<br />'.Piwik::translate('GeoIp2_GeoIPVariablesConfigurationHere', ['<a href="'.$configUrl.'">', '</a>']);

        return array('id'            => self::ID,
            'title'         => $title,
            'description'   => $desc,
            'order'         => 3,
            'install_docs'  => $installDocs,
            'extra_message' => $extraMessage);
    }
683438
public function getEnvironmentVariablesAsArray()
    {
        // Iterate over the environmentVariable nodes and sort them into an array
        $environmentVariables = array();
        /** @var \AppserverIo\Appserver\Core\Api\Node\EnvironmentVariableNode $environmentVariableNode */
        foreach ($this->getEnvironmentVariables() as $environmentVariableNode) {
            // Restructure to an array
            $environmentVariables[] = array(
                'condition' => $environmentVariableNode->getCondition(),
                'definition' => $environmentVariableNode->getDefinition()
            );
        }

        // Return what we got
        return $environmentVariables;
    }
42969
public static function getInfos(){
                
                
		//subfolder shall be detected as /SUBFLODERS/tao/install/index.php so we remove the "/extension/module/action" part:
        $subfolder = $_SERVER['REQUEST_URI'];
        $subfolder = preg_replace('/\/(([^\/]*)\/){2}([^\/]*)$/', '', $subfolder);
        $subfolder = preg_replace('/^\//', '', $subfolder);
        
        return array(
			'folder'	=> $subfolder,
			'host'		=> $_SERVER['HTTP_HOST'],
			'https'		=> ($_SERVER['SERVER_PORT'] == 443) 
		);
	}
1268278
protected function getServerPhpConfig()
    {
        $phpConfig = [];

        // Ensure $_ENV is populated.
        $variables_order = ini_get('variables_order');
        if (strpos($variables_order, 'E') === false) {
            $phpConfig['variables_order'] = 'E' . $variables_order;
        }

        return $phpConfig;
    }
568281
public function getSockets() {
        $sockets = array();
        $servers = Mage::helper('turpentine/data')->cleanExplode(PHP_EOL,
            Mage::getStoreConfig('turpentine_varnish/servers/server_list'));
        $key = str_replace('\n', PHP_EOL,
            Mage::getStoreConfig('turpentine_varnish/servers/auth_key'));
        $version = Mage::getStoreConfig('turpentine_varnish/servers/version');
        if ($version == 'auto') {
            $version = null;
        }
        foreach ($servers as $server) {
            $parts = explode(':', $server);
            $sockets[] = $this->getSocket($parts[0], $parts[1], $key, $version);
        }
        return $sockets;
    }
250217
public function getStatus()
    {

        $info_array                 = array();
        $info_array ['status']      = parent::getStats();
        $info_array ['version']     = parent::getVersion();
        $info_array ['server_list'] = parent::getServerList();

        return $info_array;
    }
994824
protected function fetchData() {
        $environment = $this->app->environment;
        $user = false;
        $password = false;

        /* If using PHP in CGI mode. */
        if (isset($_SERVER[$this->options["environment"]])) {
            $matches = null;

            if (preg_match("/Basic\s+(.*)$/i", $_SERVER[$this->options["environment"]], $matches)) {
                list($user, $password) = explode(":", base64_decode($matches[1]));
            }
        } else {
            $user = $environment["PHP_AUTH_USER"];
            $password = $environment["PHP_AUTH_PW"];
        }

        if (empty($user) || empty($password)) {
            return false;
        }

        $params = array(parent::KEY_USERNAME => $user, parent::KEY_PASSWORD => $password);
        return $params;
    }
1213211
protected function getEnvironments() {
        if (!$this->_environments) {
            $this->_environments = new EnvironmentList($this->version, $this->solution['sid']);
        }

        return $this->_environments;
    }