AppserverIo\Appserver\DependencyInjectionContainer\Provider::injectNamingDirectoryAliases PHP Method

injectNamingDirectoryAliases() public method

Injects the naming directory aliases.
public injectNamingDirectoryAliases ( AppserverIo\Storage\GenericStackable $namingDirectoryAliases ) : void
$namingDirectoryAliases AppserverIo\Storage\GenericStackable The naming directory aliases
return void
    public function injectNamingDirectoryAliases($namingDirectoryAliases)
    {
        $this->namingDirectoryAliases = $namingDirectoryAliases;
    }

Usage Example

 /**
  * The main method that creates new instances in a separate context.
  *
  * @param \AppserverIo\Psr\Application\ApplicationInterface         $application          The application instance to register the class loader with
  * @param \AppserverIo\Appserver\Core\Api\Node\ManagerNodeInterface $managerConfiguration The manager configuration
  *
  * @return void
  */
 public static function visit(ApplicationInterface $application, ManagerNodeInterface $managerConfiguration)
 {
     // create the storage for the reflection classes and the application specific aliases
     $reflectionClasses = new GenericStackable();
     $namingDirectoryAliases = new GenericStackable();
     // create and initialize the DI provider instance
     $provider = new Provider();
     $provider->injectApplication($application);
     $provider->injectReflectionClasses($reflectionClasses);
     $provider->injectNamingDirectoryAliases($namingDirectoryAliases);
     // attach the instance
     $application->addManager($provider, $managerConfiguration);
 }