BpConfig: Process node imports in hasNode() and getNode()

This commit is contained in:
Johannes Meyer 2019-02-21 11:36:30 +01:00
parent 42642c88d6
commit f0162278d6

View file

@ -454,6 +454,9 @@ class BpConfig
{ {
if (array_key_exists($name, $this->nodes)) { if (array_key_exists($name, $this->nodes)) {
return true; return true;
} elseif ($name[0] === '@') {
list($configName, $nodeName) = preg_split('~:\s*~', substr($name, 1), 2);
return $this->getImportedConfig($configName)->hasNode($nodeName);
} }
return false; return false;
@ -645,6 +648,11 @@ class BpConfig
return $this->nodes[$name]; return $this->nodes[$name];
} }
if ($name[0] === '@') {
list($configName, $nodeName) = preg_split('~:\s*~', substr($name, 1), 2);
return $this->getImportedConfig($configName)->getNode($nodeName);
}
// Fallback: if it is a service, create an empty one: // Fallback: if it is a service, create an empty one:
$this->warn(sprintf('The node "%s" doesn\'t exist', $name)); $this->warn(sprintf('The node "%s" doesn\'t exist', $name));
$pos = strpos($name, ';'); $pos = strpos($name, ';');