Obtém a variável requisitada do SeasLog

# SeasLog::getRequestVariable

(PECL seaslog >=1.9.0)

SeasLog::getRequestVariable — Obtém a variável requisitada do SeasLog

### Descrição

public static function SeasLog::getRequestVariable(int `$key`): bool

Obtém a variável requisitada do SeasLog.

### Parâmetros

`key`

  Uma das constantes inteiras:

  - SEASLOG_REQUEST_VARIABLE_DOMAIN_PORT
  - SEASLOG_REQUEST_VARIABLE_REQUEST_URI
  - SEASLOG_REQUEST_VARIABLE_REQUEST_METHOD
  - SEASLOG_REQUEST_VARIABLE_CLIENT_IP

### Valor Retornado

Retorna o valor da variável requisitada em caso de sucesso.

### Exemplos

Exemplo #1 Exemplo de SeasLog::getRequestVariable()

    <?php

    $sDomainPort = 'domain:port';
    $sRequestUri = 'uri';
    $sRequestMethod = 'method';
    $sClientIp = 'client_ip';

    $iErrorKey = 1000;

    $oSeasLog = new SeasLog();

    var_dump($oSeasLog->setRequestVariable(SEASLOG_REQUEST_VARIABLE_DOMAIN_PORT, $sDomainPort));
    var_dump($oSeasLog->setRequestVariable(SEASLOG_REQUEST_VARIABLE_REQUEST_URI, $sRequestUri));
    var_dump($oSeasLog->setRequestVariable(SEASLOG_REQUEST_VARIABLE_REQUEST_METHOD, $sRequestMethod));
    var_dump($oSeasLog->setRequestVariable(SEASLOG_REQUEST_VARIABLE_CLIENT_IP, $sClientIp));

    var_dump($oSeasLog->setRequestVariable($iErrorKey,NULL));

    var_dump($oSeasLog->getRequestVariable(SEASLOG_REQUEST_VARIABLE_DOMAIN_PORT) == $sDomainPort);
    var_dump($oSeasLog->getRequestVariable(SEASLOG_REQUEST_VARIABLE_REQUEST_URI) == $sRequestUri);
    var_dump($oSeasLog->getRequestVariable(SEASLOG_REQUEST_VARIABLE_REQUEST_METHOD) == $sRequestMethod);
    var_dump($oSeasLog->getRequestVariable(SEASLOG_REQUEST_VARIABLE_CLIENT_IP) == $sClientIp);

    var_dump($oSeasLog->getRequestVariable($iErrorKey));

    ?>

O exemplo acima produzirá algo semelhante a:

    bool(true)
    bool(true)
    bool(true)
    bool(true)
    bool(false)
    bool(true)
    bool(true)
    bool(true)
    bool(true)
    bool(false)

### Veja Também

- SeasLog::setRequestVariable() - Define manualmente uma variável de requisição SeasLog

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open