Register package's namespaces.
197682
protected function registerNamespaces()
    {
        $configPath = __DIR__ . '/../config/config.php';

        $this->mergeConfigFrom($configPath, 'modules');
        $this->publishes([
            $configPath => config_path('modules.php'),
        ], 'config');
    }
826365
def register_namespace(self, namespace, module):
        
        if namespace in self._namespaces:
            raise AlreadyRegisteredError("Namespace '{0}' is already registered on loader.".format(namespace))

        self._namespaces[namespace] = module
1321901
def register_namespace(self, namespace_handler):
        
        if not isinstance(namespace_handler, namespace.Namespace):
            raise ValueError('Not a namespace instance')
        if self.is_asyncio_based() != namespace_handler.is_asyncio_based():
            raise ValueError('Not a valid namespace class for this server')
        namespace_handler._set_server(self)
        self.namespace_handlers[namespace_handler.namespace] = \
            namespace_handler
1076196
def _add_namespace(self, namespace):
        """"""
        src_name = namespace.source_name
        if "*" in src_name:
            self._regex_map.append((namespace_to_regex(src_name), namespace))
        else:
            self._add_plain_namespace(namespace)
1290640
public function registerWorkerNamespace()
    {
        foreach ($this->customComponents as $ns => $componentDir) {
            if (is_int($ns)) {
                $ns = $componentDir;
                $componentDir = ComposerHelper::getDirByNamespace($ns);
                $ns = rtrim($ns, "\\");
                $componentDir = rtrim($componentDir, "/");
            }

            $this->componentNamespaces[] = $ns;
            $componentDir = alias($componentDir);

            if (!is_dir($componentDir)) {
                continue;
            }

            $scanDirs = scandir($componentDir, null);

            foreach ($scanDirs as $dir) {
                if ($dir == '.' || $dir == '..') {
                    continue;
                }
                if (\in_array($dir, $this->serverScan, true)) {
                    continue;
                }

                $scanDir = $componentDir . DS . $dir;

                if (!is_dir($scanDir)) {
                    $this->scanFiles[$ns][] = $scanDir;
                    continue;
                }
                $scanNs = $ns . '\\' . $dir;

                $this->scanNamespaces[$scanNs] = $scanDir;
            }
        }
    }
1042867
def register(cls, package_type):
    """"""
    if not issubclass(package_type, cls):
      raise TypeError('package_type must be a subclass of Package.')
    cls._REGISTRY.add(package_type)
369452
def add_namespace(self, module):
        
        uri = module.search_one("namespace").arg
        prefix = module.search_one("prefix").arg
        if uri in self.namespaces: return self.namespaces[uri]
        end = 1
        new = prefix
        while new in list(self.namespaces.values()):
            new = "%s%x" % (prefix,end)
            end += 1
        self.namespaces[uri] = new
        self.module_prefixes[module.arg] = new
        for inc in module.search("include"):
            self.module_prefixes[inc.arg] = new
        return new
117120
public void registerMapping(String prefix, String namespaceURI)
   {
      prefix2Ns.put(prefix, namespaceURI);
      ns2Prefix.put(namespaceURI, prefix);
   }
855049
def __add_namespaceinfo(self, ni):
        """"""
        self.__ns_uri_map[ni.uri] = ni
        for prefix in ni.prefixes:
            self.__prefix_map[prefix] = ni
379482
private void registerPackageInTypeInterestFactory(String pkg)
    {
        TypeInterestFactory.registerInterest(pkg + "_pkg", pkg.replace(".", "\\."), pkg, TypeReferenceLocation.IMPORT);
        // TODO: Finish the implementation
    }
366564
protected function registerBaseBindings()
    {
        static::setInstance($this);

        $this->instance('app', $this);

        $this->instance(Container::class, $this);

        $this->instance(PackageManifest::class, new PackageManifest(
            new Filesystem, $this->basePath(), $this->getCachedPackagesPath()
        ));
    }
115380
private synchronized void registerNamespace(String prefix, String uri, boolean persist) throws NamespaceException, RepositoryException
   {
      if (namespaces.containsKey(prefix))
      {
         unregisterNamespace(prefix);
      }
      else if (prefixes.containsKey(uri))
      {
         unregisterNamespace(prefixes.get(uri));
      }
      if (persister != null && persist)
      {
         persister.addNamespace(prefix, uri);
      }
      final String newPrefix = new String(prefix);
      final String newUri = new String(uri);

      namespaces.put(newPrefix, newUri);
      prefixes.put(newUri, newPrefix);
   }
1030938
protected function registerConfig()
    {
        // Merge project config and default package config
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/auth.php'), 'nodes.api.auth');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/errors.php'), 'nodes.api.errors');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/middleware.php'), 'nodes.api.middleware');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/response.php'), 'nodes.api.response');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/settings.php'), 'nodes.api.settings');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/throttling.php'), 'nodes.api.throttling');
        $this->mergeConfigFrom(realpath(__DIR__.'/../../../config/transformer.php'), 'nodes.api.transformer');

        if (! $this->app->runningInConsole() && empty(config('nodes.api.settings.prefix')) && empty(config('nodes.api.settings.domain'))) {
            throw new RuntimeException(sprintf('Unable to boot [%s], configure an API domain or prefix.', 'Nodes\Api\ServiceProvider'));
        }
    }
614106
protected function registerPackageAssets($package, $namespace, $path)
    {
        $assets = dirname($path) .DS .'assets';

        if ($this->app['files']->isDirectory($assets)) {
            list ($vendor) = explode('/', $package);

            $namespace = Str::snake($vendor, '-') .'/' .str_replace('_', '-', $namespace);

            $this->app['assets.dispatcher']->package($package, $assets, $namespace);
        }
    }
1117297
def _add_namespaces(self):
        
        self.doc.add_namespace(NIDM)
        self.doc.add_namespace(NIIRI)
        self.doc.add_namespace(CRYPTO)
        self.doc.add_namespace(DCT)
        self.doc.add_namespace(DC)
        self.doc.add_namespace(NFO)
        self.doc.add_namespace(OBO)
        self.doc.add_namespace(SCR)
        self.doc.add_namespace(NIF)
2986
public void registerUnregisteredNamespaces()
  {
    for (int i = 0; i < m_unregisteredExtensions.size(); i++)
    {
      String ns = (String)m_unregisteredExtensions.get(i);
      ExtensionNamespaceSupport extNsSpt = defineJavaNamespace(ns);
      if (extNsSpt != null)
        m_extensions.add(extNsSpt);
    }    
  }
863054
public void register(String... packageNames) {
        Collection<Class<? extends Controller>> classes = getControllerClasses(packageNames);
        if (classes.isEmpty()) {
            log.warn("No annotated controllers found in package(s) '{}'", Arrays.toString(packageNames));
            return;
        }

        log.debug("Found {} controller classes in {} package(s)", classes.size(), packageNames.length);

        for (Class<? extends Controller> controllerClass : classes) {
            register(controllerClass);
        }
    }