Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/infrastructure/cluster/config/PhabricatorClusterMailersConfigType.php b/src/infrastructure/cluster/config/PhabricatorClusterMailersConfigType.php
index b3b110298f..60547eea44 100644
--- a/src/infrastructure/cluster/config/PhabricatorClusterMailersConfigType.php
+++ b/src/infrastructure/cluster/config/PhabricatorClusterMailersConfigType.php
@@ -1,100 +1,100 @@
<?php
final class PhabricatorClusterMailersConfigType
extends PhabricatorJSONConfigType {
const TYPEKEY = 'cluster.mailers';
public function validateStoredValue(
PhabricatorConfigOption $option,
$value) {
if ($value === null) {
return;
}
if (!is_array($value)) {
throw $this->newException(
pht(
'Mailer cluster configuration is not valid: it should be a list '.
'of mailer configurations.'));
}
foreach ($value as $index => $spec) {
if (!is_array($spec)) {
throw $this->newException(
pht(
'Mailer cluster configuration is not valid: each entry in the '.
'list must be a dictionary describing a mailer, but the value '.
'with index "%s" is not a dictionary.',
$index));
}
}
$adapters = PhabricatorMailImplementationAdapter::getAllAdapters();
$map = array();
foreach ($value as $index => $spec) {
try {
PhutilTypeSpec::checkMap(
$spec,
array(
'key' => 'string',
'type' => 'string',
'priority' => 'optional int',
'options' => 'optional wild',
));
} catch (Exception $ex) {
throw $this->newException(
pht(
'Mailer configuration has an invalid mailer specification '.
'(at index "%s"): %s.',
$index,
$ex->getMessage()));
}
$key = $spec['key'];
if (isset($map[$key])) {
throw $this->newException(
pht(
'Mailer configuration is invalid: multiple mailers have the same '.
'key ("%s"). Each mailer must have a unique key.',
$key));
}
$map[$key] = true;
$priority = idx($spec, 'priority');
if ($priority !== null && $priority <= 0) {
throw $this->newException(
pht(
'Mailer configuration ("%s") is invalid: priority must be '.
'greater than 0.',
$key));
}
$type = $spec['type'];
if (!isset($adapters[$type])) {
throw $this->newException(
pht(
'Mailer configuration ("%s") is invalid: mailer type ("%s") is '.
'unknown. Supported mailer types are: %s.',
$key,
$type,
implode(', ', array_keys($adapters))));
}
$options = idx($spec, 'options', array());
try {
- id(clone $adapters[$type])->validateOptions($options);
+ id(clone $adapters[$type])->setOptions($options);
} catch (Exception $ex) {
throw $this->newException(
pht(
'Mailer configuration ("%s") specifies invalid options for '.
'mailer: %s',
$key,
$ex->getMessage()));
}
}
}
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Apr 28, 11:10 AM (16 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
107939
Default Alt Text
(3 KB)

Event Timeline