public function loadContainerInstances()
{
// load the system configuration
/** @var \AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface $systemConfiguration */
$systemConfiguration = $this->getSystemConfiguration();
// if applications are NOT allowed to override the system configuration
if ($systemConfiguration->getAllowApplicationConfiguration() === false) {
return $systemConfiguration;
}
/** @var \AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNodeInstance */
foreach ($systemConfiguration->getContainers() as $containerNode) {
// load the containers application base directory
$containerAppBase = $this->getBaseDirectory($containerNode->getHost()->getAppBase());
// iterate over all applications and create the server configuration
foreach (glob($containerAppBase . '/*', GLOB_ONLYDIR) as $webappPath) {
$this->loadContainerInstance($containerNode, $systemConfiguration, $webappPath);
}
}
// returns the merged system configuration
return $systemConfiguration;
}