Get SeasLog request variable

# SeasLog::getRequestVariable

(PECL seaslog >=1.9.0)

SeasLog::getRequestVariable — Get SeasLog request variable

### 説明

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

Get SeasLog request variable.

### パラメータ

`key`

  Constant int.

  - SEASLOG_REQUEST_VARIABLE_DOMAIN_PORT
  - SEASLOG_REQUEST_VARIABLE_REQUEST_URI
  - SEASLOG_REQUEST_VARIABLE_REQUEST_METHOD
  - SEASLOG_REQUEST_VARIABLE_CLIENT_IP

### 戻り値

Return request variable value on set success.

### 例

例1 SeasLog::getRequestVariable() example

    <?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));

    ?>

上の例の出力は、 たとえば以下のようになります。

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

### 参考

- SeasLog::setRequestVariable() - Manually set SeasLog request variable

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