Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/cluster/PhabricatorDatabaseRefParser.php
Show First 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | foreach ($refs as $key => $ref) { | ||||
} | } | ||||
if (!isset($ref_map[$master_key])) { | if (!isset($ref_map[$master_key])) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Database "%s" is configured as a replica and specifies a '. | 'Database "%s" is configured as a replica and specifies a '. | ||||
'master ("%s"), but that master is not a valid master. Valid '. | 'master ("%s"), but that master is not a valid master. Valid '. | ||||
'masters are: %s.', | 'masters are: %s.', | ||||
$ref->getRefKey(), | |||||
$master_key, | |||||
implode(', ', $master_keys))); | implode(', ', $master_keys))); | ||||
} | } | ||||
$master_ref = $ref_map[$master_key]; | $master_ref = $ref_map[$master_key]; | ||||
$ref->setMasterRef($ref_map[$master_key]); | $ref->setMasterRef($ref_map[$master_key]); | ||||
$master_ref->addReplicaRef($ref); | $master_ref->addReplicaRef($ref); | ||||
} | } | ||||
return array_values($refs); | return array_values($refs); | ||||
} | } | ||||
} | } |