| @@ 94-99 (lines=6) @@ | ||
| 91 | throw new NotFoundException($this->l10n->t('The redis host is not specified in the correct format.')); |
|
| 92 | } |
|
| 93 | } |
|
| 94 | if ($key === OcrConstants::REDIS_CONFIG_KEY_PORT) { |
|
| 95 | $value = intval($value); |
|
| 96 | if (!($value > 0 && $value < 65535)) { |
|
| 97 | throw new NotFoundException( |
|
| 98 | $this->l10n->t('The redis port number is not specified in the correct format.')); |
|
| 99 | } |
|
| 100 | } |
|
| 101 | if ($key === OcrConstants::REDIS_CONFIG_KEY_DB) { |
|
| 102 | $value = intval($value); |
|
| @@ 101-106 (lines=6) @@ | ||
| 98 | $this->l10n->t('The redis port number is not specified in the correct format.')); |
|
| 99 | } |
|
| 100 | } |
|
| 101 | if ($key === OcrConstants::REDIS_CONFIG_KEY_DB) { |
|
| 102 | $value = intval($value); |
|
| 103 | if (!($value >= 0)) { |
|
| 104 | throw new NotFoundException($this->l10n->t('The redis db is not specified in the correct format.')); |
|
| 105 | } |
|
| 106 | } |
|
| 107 | return $this->config->setAppValue($this->appName, $key, $value); |
|
| 108 | } |
|
| 109 | } |
|