Get connection state.

@return string
161369
public function getConnectionState()
    {
        $directory = Google::make('directory');

        try {
            $r = $directory->users->get($email = config('users.google_apps_user_email_to_check_connection'));
            if($r) {
                $state = 'connected';
            } else {
                echo 'User does not exists: $email<br/>';
            }
        } catch (\Exception $e) {
            $state = 'error';
            $message = json_decode($e->getMessage());
        }

        $result = [
            'state' => $state
        ];

        if ($state != 'connected') $result['message'] = $message;

        return $result;
    }
690480
public function getState() {
        if (!isset($this->state)) {
            $state = $this->getData(OntologyDeliveryExecution::PROPERTY_STATUS);
            if (!$state instanceof core_kernel_classes_Resource) {
                $state = $this->getResource((string)$state);
            }
            $this->state = $state;
        }
        return $this->state;
    }
419801
public function getConnection()
    {
        if ($this->connection === null) {
            $this->connection = new PDO(
                'mysql:dbname=' . $this->database . ';host=' . $this->host,
                $this->username,
                $this->password,
                array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
        }

        return $this->connection;
    }
808286
public function getStatus() {
		if (isset($_SESSION) && isset($_SESSION[self::SESSION_FIELD_STATUS])) {
			return $_SESSION[self::SESSION_FIELD_STATUS];
		}
		else {
			return null;
		}
	}
90060
public function getConnectionString()
    {

        $dsn = 'mysql:';

        // get the connection settings local so there is less function call overhead
        $connectionSettings = $this->getConnectionSettings();
        if ($this->isSocket()) {
            $dsn .= (string)'unix_socket=' . $connectionSettings->getHost() . ';';
        } else {
            $dsn .= (string)'host=' . $connectionSettings->getHost() . ';';
            if ($connectionSettings->getPort()) {
                $dsn .= 'port=' . $connectionSettings->getPort() . ';';
            }
        }

        if ($connectionSettings->getDatabase()) {
            $dsn .= "dbname=" . $connectionSettings->getDatabase() . ';';
        }

        if ($connectionSettings->getCharset()) {
            $dsn .= "charset=" . $connectionSettings->getCharset() . ';';
        }

        return $dsn;
    }
15847
public function getStatus(){
        $rest = $this->getService( self::API_VPN_CLIENT_STATUS);
        $rest->GET();

        return $rest->getResult( models\VPN\Client\Status::class);
    }
327842
public function getIsSecureConnection()
    {
        $https = $this->getServerParam('HTTPS');
        if ($https !== null && (strcasecmp($https, 'on') === 0 || $https == 1)) {
            return true;
        }
        foreach ($this->secureProtocolHeaders as $header => $values) {
            if ($this->hasHeader($header)) {
                foreach ($values as $value) {
                    if (strcasecmp($this->getHeaderLine($header), $value) === 0) {
                        return true;
                    }
                }
            }
        }

        return false;
    }
804573
public function getStatus(){
        $rest = $this->getService( self::API_CONNECTION_XDSL);
        $rest->GET();

        return $rest->getResult( models\Connection\Xdsl\XdslInfos::class);
    }
245310
public function getPortStatus()
    {
        $status = $this->portConfig;
        foreach ($status as &$value) {
            $value['fdcount'] = 0;
        }
        foreach (get_instance()->server->connections as $fd) {
            $port = get_instance()->getServerPort($fd);
            if (array_key_exists($port, $status)) {
                $status[$port]['fdcount']++;
            }
        }
        return $status;
    }
1178011
public function getState()
    {
        if (empty($this->sortedQueue)) {
            return;
        }
        $current = current($this->sortedQueue)
                 ? current($this->sortedQueue)
                 : end($this->sortedQueue);

        return $current->getState();
    }
782685
public function getCurrentConnectionKey()
    {
        $current = $this->getCurrentConnection();

        return $current ? $current->getConnectionKey() : $this->credentials->createConnectionKey();
    }
973414
protected function getCurrentState()
    {
        return [
            'application_name' => $this->config->get('application_name'),
            'application' => realpath($this->paths->getBasePath()),
            'configuration' => realpath($this->paths->getConfigurationPath()),
            'logs' => $this->paths->getLogsPath(),
        ];
    }
998579
public function getConnection() {
        if (null === $this->connection) {
            $this->connection = $this->connect();
        }
        return $this->connection;
    }
1315706
public function getNodeStatus()
    {
        $port = get_instance()->getPort($this->websocket_port);
        if (count($port->connections) == 0) return;
        if (Start::isLeader() && $this->enable) {
            $status["isCluster"] = get_instance()->isCluster();
            if (get_instance()->isCluster()) {
                ProcessManager::getInstance()->getRpcCall(ClusterProcess::class, true)->my_status();
                $nodes = ProcessManager::getInstance()->getRpcCall(ClusterProcess::class)->getNodes();
                sort($nodes);
                $status["nodes"] = $nodes;
            } else {
                $status["nodes"] = [getNodeName()];
                get_instance()->getStatus();
            }
            get_instance()->pub('$SYS/status', $status);
        }
    }
1322373
public function getStatus ()
		{
			if (!$this->_status)
			{
				$this->_status = self::S_UNKNOWN;

				$headers = array_reverse($this->_headers);
				foreach ($headers as $header)
				{
					preg_match("/HTTP\/1.1 (\d{3})/", $header, $match);
					if (isset($match[ 1 ]))
					{
						$this->_status = (int) $match[ 1 ];
						break;
					}
				}
			}

			return $this->_status;
		}
1191645
public function getConnection()
    {
        if ($chosenConn = $this->connections->pop()) {
            $this->connections->push($chosenConn);

            return $chosenConn;
        }
    }
1310692
public function getState()
    {
        if (empty($this->state)) {
            $this->setState(
                rtrim(
                    base64_encode(uniqid('', true)),
                    '='
                )
            );
        }
        return $this->state;
    }