Sets the default namespaces Strata knows about in the project's Composer's
ClassLoader.
971441
public function setDefaultNamespace()
    {
        $classLoader = $this->getConfig("runtime.classLoader");
        $classLoader->setPsr4(self::getDefaultNamespace() . "\\", self::getSRCPath());
        $classLoader->setPsr4(self::getDefaultTestNamespace() . "\\", self::getTestPath());
    }
689594
private function initLoaders()
    {
        $namespace = sprintf('%s\\ServiceLoader', __NAMESPACE__);
        $classes = ['MetadataCache', 'MetadataDrivers', 'MetadataFactory', 'Persisters', 'Rest', 'SearchClients'];

        foreach ($classes as $class) {
            $fqcn = sprintf('%s\\%s', $namespace, $class);
            $this->addLoader(new $fqcn);
        }
        return $this;
    }
863829
def set_default(cls, name):
        """"""
        if name not in cls._depots:
            raise RuntimeError('%s depot has not been configured' % (name,))
        cls._default_depot = name
538805
public function addNamespaces(array $namespaces): void
    {
        //loop for add single namespace
        foreach ($namespaces as $namespace) {

            // normalize namespace prefix
            $prefix = \trim($namespace[0], '\\');

            // normalize the base directory with a trailing separator
            $baseDir = \rtrim($namespace[1], DIRECTORY_SEPARATOR).'/';

            //add namespace
            $this->prefixes[$prefix] = $baseDir;
        }
    }
494583
protected void addNamespaceContext() {
        NamespaceMap prefixmap = new NamespaceMap();
        NamespacePrefixList npl = getXsd().getNamespaceContext();
        if (npl == null) {
            /* We get an NPE if we don't add this. */
            prefixmap.add("", XMLConstants.W3C_XML_SCHEMA_NS_URI);
        } else {
            for (int i = 0; i < npl.getDeclaredPrefixes().length; i++) {
                prefixmap.add(npl.getDeclaredPrefixes()[i],
                        npl.getNamespaceURI(npl.getDeclaredPrefixes()[i]));
            }
        }
        prefixmap.add(getCOXBNamespacePrefix(), getCOXBNamespace());
        getXsd().setNamespaceContext(prefixmap);

    }
583318
static public function initNamespace()
	{
	    if (!static::$namespaces) {
	        $rnss = [];
	        
	        $nss = Config::get('namespaces');
	        
	        if ($nss) foreach ($nss as $ns => $path) {
	            if (!is_numeric($ns)) {
	                $ns = static::formatNamespace($ns);
	                static::loader()->addPsr4($ns, $path);
	            } else {
	                $ns = static::formatNamespace($path);
	            }
	            $rnss[] = $ns;
	        }
	        
	        $rnss[] = static::formatNamespace(Config::getCommon('commonNamespace', '\\Common'));
	        if (static::app()) {
	            $rnss[] = static::formatNamespace(static::app()->getNamespace());
	        }
	        
	        static::$namespaces = array_unique($rnss);
	        
	        foreach (static::$namespaces as $ns) {
	            $boot = $ns . 'Bootstrap';
	            if (class_exists($boot)) {
	                $boot::init();
	            }
	        }
	    }
	}
294099
def _setns(self, value):
        
        if self.conn is not None:
            self.conn.default_namespace = value
        else:
            self.__default_namespace = value
1127521
protected function setConfigNamespaces()
    {
        $configPath = $this->addon->path($this->addon->config('paths.config', 'config'));

        if ($this->filesystem->isDirectory($configPath)) {
            $files = Finder::create()
                ->in($configPath)
                ->name('*.php');

            foreach ($files as $file) {
                $this->replaceConfigNamespaces($file->getRealPath());
            }
        }
    }
632655
protected function registerClassAliases()
    {
        $aliases = __config()->class_aliases;
        if (!empty($aliases)) {
            $aliasLoader = new AliasLoader($aliases);
            spl_autoload_register([$aliasLoader, 'load']);
        }
    }
820422
private function setComposerNamespace($oldNamespace, $newNamespace)
    {
        $files = $this->filesystem->files(base_path() . '/vendor/composer');

        foreach ($files as $file) {
            $content = $this->filesystem->get($file);
            $this->filesystem->create($file, preg_replace("/\\b" . $oldNamespace . "\\b/", $newNamespace, $content));
        }

        $file = base_path() . '/composer.json';
        $content = $this->filesystem->get($file);
        $this->filesystem->create($file, preg_replace("/\\b" . $oldNamespace . "\\b/", $newNamespace, $content));
    }
734932
protected function setDatabaseFactoryNamespaces()
    {
        $files = Finder::create()
                            ->in(database_path('factories'))
                            ->contains($this->currentRoot)
                            ->name('*.php');

        foreach ($files as $file) {
            $this->replaceIn(
                $file->getRealPath(),
                $this->currentRoot, $this->argument('name')
            );
        }
    }
1276634
protected function setBootstrapNamespaces()
    {
        $search = [
            $this->currentRoot.'\\Http',
            $this->currentRoot.'\\Console',
            $this->currentRoot.'\\Exceptions',
        ];

        $replace = [
            $this->argument('name').'\\Http',
            $this->argument('name').'\\Console',
            $this->argument('name').'\\Exceptions',
        ];

        $this->replaceIn($this->getBootstrapPath(), $search, $replace);
    }
1003096
@Nonnull
  public final XMLWriterSettings setNamespaceContext (@Nullable final INamespaceContext aNamespaceContext)
  {
    // A namespace context must always be present, to resolve default namespaces
    m_aNamespaceContext = aNamespaceContext != null ? aNamespaceContext : new MapBasedNamespaceContext ();
    return this;
  }
975946
protected function setClassesToRun()
    {
        foreach ($this->listOfFiles as $filename => $file) {
            // Exclude non-PHP files
            if (!Utils::isFilePhp($filename)) {
                continue;
            }

            // Exclude non-Controller classes
            if (!Utils::doesFileContain($filename, 'extends Controller')) {
                continue;
            }

            // Set the classes to run
            $this->classesToRun[] = $this->namespace . '\\' . pathinfo($filename, PATHINFO_FILENAME);
        }
    }
1005692
public void setNamespace(String prefix, String namespaceURI) {
    ensureNotNull("Prefix", prefix);
    ensureNotNull("Namespace URI", namespaceURI);

    namespaces.put(prefix, namespaceURI);
  }
276625
protected function setInferredClassName()
	{
		$singularize = ($this instanceOf HasMany ? true : false);
		$this->setClassName(\ChickenTools\Str::classify($this->attributeName, $singularize));
	}
375273
public function setNamespace($namespace)
    {
        $namespace = rtrim(trim($namespace), '\\');

        if ($namespace === $this->namespace) {
            return;
        }

        $this->namespace = $namespace;
        if ($namespace && (!$this->package || $this->packageOverridden) && $this->getBuildProperty('generator.namespaceAutoPackage')) {
            $this->package = str_replace('\\', '.', $namespace);
            $this->packageOverridden = true;
        }
    }