Ping the /site/status url

@return string "OK".
@throws Exception
424436
public function getSiteStatus()
    {
        $result = $this->getSiteStatusInternal();
        $statusCode = (int)$result['statusCode'];

        if (($statusCode >= 200) && ($statusCode < 300)) {
            return 'OK';
        }

        $this->reportUnexpectedResponse($result, 1503511661);
    }
380293
def ping():
    '''
    
    '''
    try:
        response = salt.utils.http.query(
            "{0}/ping".format(CONFIG[CONFIG_BASE_URL]),
            decode_type='plain',
            decode=True,
        )
        log.debug(
            'marathon.info returned successfully: %s',
            response,
        )
        if 'text' in response and response['text'].strip() == 'pong':
            return True
    except Exception as ex:
        log.error(
            'error calling marathon.info with base_url %s: %s',
            CONFIG[CONFIG_BASE_URL],
            ex,
        )
    return False
790176
public function getStatus()
    {
        $request = $this->apiRequestFactory->createRequest('GET', $this->getBaseUri() . '/status/CLEAN');
        $response = $this->httpClient->sendRequest($request);

        return $response->getStatusCode() === 200;
    }
822475
public function checkAtLeastOneUrl($urls)
    {
        $urls = $this->cleanParameterUrls($urls);

        if (!is_array($urls)
            || count($urls) == 0
        ) {
            throw new Exception(Piwik::translate('SitesManager_ExceptionNoUrl'));
        }
    }
1304346
public function actionOffline()
    {
        Yii::$app->getResponse()->statusCode = 503;
        yii::$app->getResponse()->content = "sorry, the site is temporary unserviceable";
        yii::$app->getResponse()->send();
    }
841878
def ping(self, handler='admin/ping', **kwargs):
        
        params = kwargs
        params_encoded = safe_urlencode(params, True)

        if len(params_encoded) < 1024:
            # Typical case.
            path = '%s/?%s' % (handler, params_encoded)
            return self._send_request('get', path)
        else:
            # Handles very long queries by submitting as a POST.
            path = '%s/' % handler
            headers = {
                'Content-type': 'application/x-www-form-urlencoded; charset=utf-8',
            }
            return self._send_request('post', path, body=params_encoded, headers=headers)
168864
public function getHttpStatusCode()
    {
        // Legacy check
        if ($this->_status != null) {
            $this->setHttpStatus($this->_status);
        }

        if (isset($this->_headers['status'])) {
            return $this->_headers['status']['response_code'];
        }

        return self::HTTP_STATUS_OK;
    }
685478
public function exeEnvio() {
        if ($this->checkStatus()):

            $options = array(
                'http' => array(
                    'header' => "Content-type: application/x-www-form-urlencoded\r\n",
                    'method' => 'POST',
                    'content' => http_build_query($this->dados)
                )
            );

            $this->connectToTarget(stream_context_create($options));

        else:
            $this->result = "Status do site '{$this->status}'. Não foi possível se comunicar.";
        endif;
    }
275430
public function getStatus() : ?string 
    {
        if ( ! $this->hasStatus()) {
            $this->setStatus($this->getDefaultStatus());
        }
        return $this->status;
    }
325051
public function ping()
    {
        foreach (class_parents($this) as $parent) {
            if (method_exists($parent, 'ping')) {
                return parent::ping();
            }
        }

        $this->connect();

        try {
            $this->query($this->getDatabasePlatform()->getDummySelectSQL());
            return true;
        } catch (DBALException $e) {
            return false;
        }
    }
483380
public function Ping( )
		{
			if( !$this->Connected )
			{
				throw new SocketException( 'Not connected.', SocketException::NOT_CONNECTED );
			}
			
			$this->Socket->Write( self::A2S_PING );
			$Buffer = $this->Socket->Read( );
			
			return $Buffer->GetByte( ) === self::S2A_PING;
		}
481617
public function ping() {

		if ( curl_getinfo( $this->handle, CURLINFO_EFFECTIVE_URL ) === '' ) {
			return false;
		}

		// Copy the handle to avoid diluting the resource
		$handle = curl_copy_handle( $this->handle );

		curl_setopt_array( $handle, array(
			CURLOPT_HEADER => false,
			CURLOPT_RETURNTRANSFER, true,
			CURLOPT_CONNECTTIMEOUT => 5,
			CURLOPT_FRESH_CONNECT => false,
			CURLOPT_FAILONERROR => true
		) );

		curl_exec( $handle );

		return curl_errno( $handle ) == 0;
	}
25937
protected function echoExceptionWeb($exception)
    {
        $statusCode = ($exception instanceof WithHttpStatusInterface) ? $exception->getStatusCode() : 500;
        $statusMessage = ResponseInformationHelper::getStatusMessageByCode($statusCode);
        if (!headers_sent()) {
            header(sprintf('HTTP/1.1 %s %s', $statusCode, $statusMessage));
        }

        if (!isset($this->renderingOptions['templatePathAndFilename'])) {
            $this->renderStatically($statusCode, $exception);
            return;
        }

        try {
            echo $this->buildView($exception, $this->renderingOptions)->render();
        } catch (\Throwable $throwable) {
            $this->renderStatically($statusCode, $throwable);
        }
    }
599898
public static function GetRequestUrl () {
		$action_url = '/';
		if (Environment::IsCli()) {
			$argv = $_SERVER['argv'];
			array_shift($argv);
			if (!isset($argv[0])) {
				throw new \Exception('URLが設定されていません。');
			}
			$action_url = $argv[0];
		} else {
			$request_uri = Environment::IsCli() ? (Cli::GetRequestParameterList()[0] ?? '') : $_SERVER['REQUEST_URI'];
			$path_info = parse_url(sprintf('http://localhost%s', $request_uri), \PHP_URL_PATH);
			if (preg_match("@\?([^\?&=]+)(?:&|$)@", $path_info, $mat)) {
				$action_url = $mat[1];
			} else {
				$action_url = substr($path_info, strlen(dirname($_SERVER['SCRIPT_NAME'])));
				if (substr($action_url, 0, 1) !== '/') {
					$action_url = '/' . $action_url;
				}
			}
		}

		return $action_url;
	}
1303470
public function getStatus()
    {
        $status = self::HTTP_INTERNAL_SERVER_ERROR;

        if ($this->getCode() >= 400 && $this->getCode() < 600) {
            $status = $this->getCode();
        }

        return $status;
    }
95623
public function getStatusCode()
    {
        $headers = $this->getHeaders();
        if ($headers->has('http-code')) {
            // take into account possible 'follow location'
            $statusCodeHeaders = $headers->get('http-code', null, false);
            return empty($statusCodeHeaders) ? null : end($statusCodeHeaders);
        }
        throw new Exception('Unable to get status code: referred header information is missing.');
    }
1099291
protected function checkParam()
    {
        if (empty($this->getHost()) && empty($this->getUnixSocket())) {
            $sErrorMessage = 'Connexion to Mysql must have an host or an unix socket defined';
            throw new \Exception($sErrorMessage);
            return false;
        } else {
            return true;
        }
    }