AppserverIo\Appserver\Core\Api\DeploymentService::loadContextInstancesByContainer PHP Method

loadContextInstancesByContainer() public method

Initializes the available application contexts and returns them.
public loadContextInstancesByContainer ( AppserverIo\Appserver\Core\Interfaces\ContainerInterface $container ) : ContextNode[]
$container AppserverIo\Appserver\Core\Interfaces\ContainerInterface The container we want to add the applications to
return AppserverIo\Appserver\Core\Api\Node\ContextNode[] The array with the application contexts
    public function loadContextInstancesByContainer(ContainerInterface $container)
    {
        // initialize the array for the context instances
        $contextInstances = array();
        // iterate over all applications and create the context configuration
        foreach (glob($container->getAppBase() . '/*', GLOB_ONLYDIR) as $webappPath) {
            $context = $this->loadContextInstance($container->getContainerNode(), $webappPath);
            $contextInstances[$context->getName()] = $context;
        }
        // return the array with the context instances
        return $contextInstances;
    }