Register mappings and alias with the metadata drivers.
760292
public function process(ContainerBuilder $container)
    {
        if (!$this->enabled($container)) {
            return;
        }

        $mappingDriverDef = $this->getDriver($container);
        $chainDriverDefService = $this->getChainDriverServiceName($container);
        // Definition for a Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain
        $chainDriverDef = $container->getDefinition($chainDriverDefService);
        foreach ($this->namespaces as $namespace) {
            $chainDriverDef->addMethodCall('addDriver', [$mappingDriverDef, $namespace]);
        }

        if (!\count($this->aliasMap)) {
            return;
        }

        $configurationServiceName = $this->getConfigurationServiceName($container);
        // Definition of the Doctrine\...\Configuration class specific to the Doctrine flavour.
        $configurationServiceDefinition = $container->getDefinition($configurationServiceName);
        foreach ($this->aliasMap as $alias => $namespace) {
            $configurationServiceDefinition->addMethodCall($this->registerAliasMethodName, [$alias, $namespace]);
        }
    }
625854
protected function registerAliases()
    {
        foreach ($this->aliases as $abstract => $aliases) {
            foreach ((array) $aliases as $alias) {
                $this->app->alias($alias, $abstract);
            }
        }
    }
728380
def model_alias(vk, model):
    """"""
    model['alias'] = {}

    # types
    for s in vk['registry']['types']['type']:
        if s.get('@category', None) == 'handle' and s.get('@alias'):
            model['alias'][s['@alias']] = s['@name'] 
              
    # commands
    for c in vk['registry']['commands']['command']:
        if c.get('@alias'):
            model['alias'][c['@alias']] = c['@name']
330958
public function register()
    {
        $this->app->register('ProAI\Datamapper\Providers\MetadataServiceProvider');

        $this->registerEntityScanner();

        $this->registerSchemaBuilder();

        $this->registerModelGenerator();

        $this->registerCommands();
    }
151158
private void registerTypeMappings(
      TypeMapping registryTypeMapping, List<TypeMapping> typeMappings) {
    Preconditions.checkNotNull(registryTypeMapping, "Null registry type mapping");
    Preconditions.checkNotNull(typeMappings, "Null type mappings");
    Preconditions.checkArgument(!typeMappings.isEmpty(), "Empty type mappings");
    for (TypeMapping typeMapping : typeMappings) {
      for (Class<?> mappingClass : typeMapping.getAllClasses()) {
        QName classQName = typeMapping.getTypeQName(mappingClass);
        DeserializerFactory deserializer = typeMapping.getDeserializer(mappingClass, classQName);
        if (deserializer != null && !registryTypeMapping.isRegistered(mappingClass, classQName)) {
          registryTypeMapping.register(
              mappingClass, classQName, (SerializerFactory) null, deserializer);
        }
      }
    }
  }
400258
private static void _registerTypeMapping(WSServer server, Class clazz) {
	if (clazz == null) return;

	if (!isComplexType(clazz)) {
	    if (clazz.isArray()) {
		_registerTypeMapping(server, clazz.getComponentType());
	    }
	    return;
	}
	server.registerTypeMapping(clazz);
	registerTypeMapping(server, clazz);
    }
964203
public void registerAny(Metric2Set metrics) {
		for (Map.Entry<MetricName, Metric> entry : metrics.getMetrics().entrySet()) {
			registerNewMetrics(entry.getKey(), entry.getValue());
		}
	}
214606
protected function bootDevAliases()
    {
        //Get the instance of the alias loader
        $loader = AliasLoader::getInstance();

        // Get Dev class aliases config key.
        $devProviderKey = 'dev-booter.dev_aliases_config_keys.'.$this->app->environment();

        // Boot all classes Aliases.
        $this->collectDevAliases($devProviderKey)->each(function ($facade, $alias) use ($loader) {
            $loader->alias($alias, $facade);
        });
    }
1228841
protected function setupMetaData()
    {
        MetaDataManager::registerDrivers(
            $this->config['meta']['drivers'],
            $this->config['dev']
        );

        MetaDataManager::resolved(function (Configuration $configuration) {

            // Debugbar
            if ($this->config['debugbar'] === true) {
                $debugStack = new DebugStack();
                $configuration->setSQLLogger($debugStack);
                $this->app['debugbar']->addCollector(
                    new DoctrineCollector($debugStack)
                );
            }

            $configuration->getMetadataDriverImpl()->addPaths([
                __DIR__ . '/Migrations',
                __DIR__ . '/Auth/Passwords'
            ]);

            // Automatically make table, column names, etc. like Laravel
            $configuration->setNamingStrategy(
                $this->app->make(LaravelNamingStrategy::class)
            );

            // Custom functions
            $configuration->setCustomDatetimeFunctions($this->config['custom_datetime_functions']);
            $configuration->setCustomNumericFunctions($this->config['custom_numeric_functions']);
            $configuration->setCustomStringFunctions($this->config['custom_string_functions']);

            // Second level caching
            if ($this->config['cache']['second_level']) {
                $configuration->setSecondLevelCacheEnabled(true);

                $cacheConfig = $configuration->getSecondLevelCacheConfiguration();
                $cacheConfig->setCacheFactory(
                    new DefaultCacheFactory(
                        $cacheConfig->getRegionsConfiguration(),
                        CacheManager::resolve(
                            $this->config['cache']['default']
                        )
                    )
                );
            }
        });
    }
1347977
private function processMetadataDrivers()
	{
		$builder = $this->getContainerBuilder();

		// At the moment, only Docblock annotations are supported, XML and YAML are not.		
		$annotationReader = $builder->addDefinition($this->prefix('metadata.annotationReader'))
			->setClass(AnnotationReader::class);

		$cachedReader = $builder->addDefinition($this->prefix('metadata.cachedReader'))
			->setClass(CachedReader::class)
			->setFactory(CachedReader::class, [
				'@' . $this->prefix('metadata.annotationReader'),
				'@' . $this->prefix('cache.annotations'),
				$this->debugMode
			]);

		$driverChain = $builder->addDefinition($this->prefix('metadata.driver'))
			->setClass(MappingDriverChain::class);

		foreach ($this->config['metadata'] as $namespace => $directory) {
			$driver = $builder->addDefinition($this->prefix('driver.' . $this->createServiceName($namespace)))
				->setClass(MappingDriver::class)
				->setFactory(AnnotationDriver::class, [
					'@' . $this->prefix('metadata.cachedReader'),
					$directory
				]);
			$driverChain->addSetup('$service->addDriver(?, ?)', [
				'@' . $this->prefix('driver.' . $this->createServiceName($namespace)), $namespace
			]);
		}
	}
265069
function registerAlias(name, alias) {
  var map = name
  var key
  var list
  var length
  var index

  if (alias) {
    map = {}
    map[name] = alias
  }

  for (key in map) {
    list = map[key]
    list = typeof list === 'string' ? [list] : list
    length = list.length
    index = -1

    while (++index < length) {
      aliases[list[index]] = key
    }
  }
}
473439
private function registerAliases()
    {

        // register this container to facades
        Facade::setApplication($this);

        $aliases = [

            'app'        => ['Anonym\Application\Application', Container::class],
            'redirect'   => ['Anonym\Http\Redirect'],
            'validation' => ['Anonym\Support\Validation'],
            'route'      => ['Anonym\Route\RouteCollector'],
            'event'      => ['Anonym\Event\EventDispatcher'],
            'cookie'     => ['Anonym\Cookie\CookieInterface'],
            'session'    => ['Anonym\Session\StrogeInterface'],
            'config'     => ['Anonym\Config\Reposity'],
            'crypt'      => ['Anonym\Crypt\Crypter'],
            'view'       => ['Anonym\View\View']
        ];


        // register aliases
        foreach ($aliases as $key => $alias) {

            foreach ((array)$alias as $abstract) {
                $this->alias($abstract, $key);
            }
        }

        // register the alias loader
        $this->setAliasLoader(new AliasLoader(Arr::get($this->getGeneral(), 'alias')));
        $this->getAliasLoader()->register();
    }
127714
private function registerConfigurationMapper()
    {
        $this->app->bind(DriverMapper::class, function () {
            $mapper = new DriverMapper;
            $mapper->registerMapper(new SqlMapper);
            $mapper->registerMapper(new SqliteMapper);
            $mapper->registerMapper(new OCIMapper);
            return $mapper;
        });
    }
653510
private void registerActionRepositories(FeatureContext context, CrnkBoot boot) {
        ResourceRegistry resourceRegistry = boot.getResourceRegistry();
        Collection<RegistryEntry> registryEntries = resourceRegistry.getEntries();
        for (RegistryEntry registryEntry : registryEntries) {
            ResourceRepositoryInformation repositoryInformation = registryEntry.getRepositoryInformation();
            if (repositoryInformation != null && !repositoryInformation.getActions().isEmpty()) {
                ResourceRepositoryAdapter repositoryAdapter = registryEntry.getResourceRepository();
                Object resourceRepository = repositoryAdapter.getResourceRepository();
                context.register(resourceRepository);
            }
        }
    }
896995
public function registerMapperServices() {

		$factory = Yii::$app->factory->getContainer();

		$factory->set( 'cmsgears\cms\common\services\interfaces\mappers\IModelCategoryService', 'cmsgears\cms\common\services\mappers\ModelCategoryService' );
		$factory->set( 'cmsgears\cms\common\services\interfaces\mappers\IModelTagService', 'cmsgears\cms\common\services\mappers\ModelTagService' );

		$factory->set( 'cmsgears\cms\common\services\interfaces\mappers\IPageFollowerService', 'cmsgears\cms\common\services\mappers\PageFollowerService' );

		$factory->set( 'cmsgears\cms\common\services\interfaces\mappers\IModelElementService', 'cmsgears\cms\common\services\mappers\ModelElementService' );

		$factory->set( 'cmsgears\cms\common\services\interfaces\mappers\IModelElementService', 'cmsgears\cms\common\services\mappers\ModelElementService' );
		$factory->set( 'cmsgears\cms\common\services\interfaces\mappers\IModelBlockService', 'cmsgears\cms\common\services\mappers\ModelBlockService' );

		$factory->set( 'cmsgears\cms\common\services\interfaces\mappers\IModelLinkService', 'cmsgears\cms\common\services\mappers\ModelLinkService' );

		$factory->set( 'cmsgears\cms\common\services\interfaces\mappers\IModelWidgetService', 'cmsgears\cms\common\services\mappers\ModelWidgetService' );
	}
919782
public static void registerMappingsFromConfig(Registry registry, Config cfg) {
    registry.register(new JmxMeter(registry, JmxConfig.from(cfg)));
  }
136480
def _register_namespace_and_command(self, namespace):
        """"""
        self._add_namespace(namespace)
        # Add the namespace for commands on this database
        cmd_name = namespace.source_name.split(".", 1)[0] + ".$cmd"
        dest_cmd_name = namespace.dest_name.split(".", 1)[0] + ".$cmd"
        self._add_namespace(Namespace(dest_name=dest_cmd_name, source_name=cmd_name))