Register the package's language component namespaces.

@param  string  $package
@param  string  $namespace
@param  string  $path

@return void
186803
public function addLanguageComponent(string $package, string $namespace, string $path): void
    {
        $this->app->make('translator')->addNamespace($namespace, $path);
    }
906380
public function addRepository($path, $namespace = null)
    {
        $loader = $this->getTwig()->getLoader();

        if (false === ($loader instanceof \Twig_Loader_Filesystem)) {
            $this->throwException(500, 'Current twig loader does not support adding template repository');
        }

        /** @var \Twig_Loader_Filesystem $loader */
        $loader->addPath($path, true === isset($namespace) ? $namespace : \Twig_Loader_Filesystem::MAIN_NAMESPACE);

        return $this;
    }
225548
private static function _parseAdditions(array &$components, $namespace, $path)
    {
        if (!file_exists($path)) {
            return;
        }
        foreach (new \DirectoryIterator($path) as $object) {
            if ($object->isDot() || $object->isDir()) {
                continue;
            }
            $components[$namespace][lcfirst(substr($object->getFilename(), 0, -4))] = substr($object->getFilename(), -3) == 'php' ? 1 : $object->getPathname();
        }
    }
352343
public function package($package, $hint = null, $namespace = null)
    {
        $namespace = $this->getPackageNamespace($package, $namespace);
        $hint = $hint ? $hint : $package->getPackagePath() . '/' . DIRNAME_CONFIG;
        $this->packages[] = $namespace;
        $this->addNamespace($namespace, $hint);
    }
936070
def fixup_namespace_packages(path_item, parent=None):
    """"""
    _imp.acquire_lock()
    try:
        for package in _namespace_packages.get(parent, ()):
            subpath = _handle_ns(package, path_item)
            if subpath:
                fixup_namespace_packages(subpath, package)
    finally:
        _imp.release_lock()
1000441
public function registerNamespace($namespace, $paths)
    {
        if (false === isset($this->_namespaces[$namespace])) {
            $this->_namespaces[$namespace] = array();
        }

        $this->_namespaces[$namespace] = array_merge($this->_namespaces[$namespace], (array) $paths);

        return $this;
    }
994645
public function addPath($namespace, $path, $priority = 5)
    {
        if ($path != '') {
            $path = rtrim($path, '/') . '/';
        }
        $namespace = '/' . trim($namespace, '/');
        
        if (! isset($this->paths[$namespace])) {
            $this->paths[$namespace] = [];
        }
        $this->paths[$namespace][] = [
            'path' => $path,
            'priority' => $priority
        ];
        usort($this->paths[$namespace], ['Jivoo\Utilities', 'prioritySorter']);
    }
857157
protected function loadConstantsFrom($path, $namespace = null)
    {
        $constants = require $path;
        $prefix = $namespace ? "$namespace" : '';

        foreach ($constants as $constant => $value) {
            define(strtoupper("{$prefix}{$constant}"), $value);
        }
    }
611770
public static function registerNamespace($namespace, $path, $classname = null)
    {
        $namespace = trim($namespace, '\\');
        $path = rtrim($path, '/\\');

        $loader = function ($classname, $return_filename = false) use ($namespace, $path) {
            if (class_exists($classname, false) || interface_exists($classname, false)) {
                return true;
            }

            $classname = trim($classname, '\\');

            if ($namespace && stripos($classname, $namespace) !== 0) {
                return false;
            } else {
                $filename = trim(substr($classname, strlen($namespace)), '\\');
            }

            $filename = $path . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $filename) . '.php';

            if ($return_filename) {
                return $filename;
            } else {
                if (!file_exists($filename)) {
                    return false;
                }

                require $filename;

                return class_exists($classname, false) || interface_exists($classname, false);
            }
        };

        if ($classname === null) {
            spl_autoload_register($loader);
        } else {
            return $loader($classname, true);
        }
    }
78067
public function package(string $package, ?string $namespace = null) : void {
        if (is_null($namespace)) {
            list($vendor, $namespace) = explode('/', $package);
        }

        $this->finder->addNamespace($namespace, $package);
    }
565287
public function addConfigComponent($package, $namespace, $path)
    {
        if ($this->hasPackageRepository()) {
            $this->app->make('config')->package($package, $path, $namespace);
        }
    }
1310529
public function initialize($vendor, $package, $directory)
    {
        if (!$this->files->exists($directory) || !$this->files->isDirectory($directory)) {
            throw new InvalidPathException("{$directory} does not exist or is not a valid directory.");
        }

        $packageComposer = new Package;
        $packageComposer->setVendor($vendor);
        $packageComposer->setPackage($package);
        $packageComposer->setDescription('Give your package template a good description');
        $packageComposer->setLicense(user_config('configuration.license', ''));
        $packageComposer->setAuthors(user_config('configuration.authors', []));

        $writer = new ConfigurationWriter($packageComposer->toArray());
        $writer['config'] = (object)['vendor-dir' => '_newup_vendor'];

        $writer->save($directory.'/composer.json');
        $this->renderer->setData('package', $package);
        $this->renderer->setData('vendor', $vendor);

        $packageClass = $this->renderer->render('template');

        if (!$this->files->exists($directory.'/_newup/')) {
            $this->files->makeDirectory($directory.'/_newup/');
        }

        if ($this->shouldCreateTemplateDirectory && $this->files->exists($directory.'/_template') == false) {
            $this->files->makeDirectory($directory.'/_template');
        }

        $this->files->put($directory.'/_newup/Package.php', $packageClass);
    }
52464
public static function registerNamespace(string $namespace, string $path): void
    {
        if ($namespace === '') {
            throw new InvalidArgumentException('Cannot register the default namespace');
        }

        if (!Str::endsWith($path, '/')) {
            throw new InvalidArgumentException('Paths must end with a directory separator');
        }

        self::$namespaces[$namespace] = $path;
    }
333863
public static function set($namespace, $path)
    {
        $namespace = trim($namespace, '\\');
        $path = rtrim($path, '/');

        if (!isset(self::$_namespace_list[$namespace])) {
            self::$_namespace_list[$namespace] = [];
        }

        self::$_namespace_list[$namespace][] = $path;
    }
523046
public function addCmsAppPath($path, $namespace = self::MAIN_NAMESPACE)
    {
        // invalidate the cache
        $this->cache = $this->errorCache = array();

        if (!is_dir($path)) {
            throw new \Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path));
        }

        $path = rtrim($path, '/\\');

        if (!isset($this->paths[$namespace])) {
            $this->paths[$namespace][] = $path;
        } else {
            $existAppPathKey = false;

            foreach ($this->paths[$namespace] as $key => $path2) {
                if (strpos($path2, 'app/Resources/')) {
                    $existAppPathKey = $key;
                }
            }

            if ($existAppPathKey === false) {
                array_unshift($this->paths[$namespace], $path);
            } else {
                $newPaths = [];

                foreach ($this->paths[$namespace] as $key => $path2) {
                    $newPaths[] = $path2;

                    if ($key == $existAppPathKey) {
                        $newPaths[] = $path;
                    }
                }

                $this->paths[$namespace] = $newPaths;
            }
        }
    }
307645
protected function registerPackageAssets($package, $namespace, $path)
    {
        $assets = $path .DS .'Assets';

        if ($this->app['files']->isDirectory($assets)) {
            $namespace = 'modules/' .str_replace('_', '-', $namespace);

            $this->app['assets.dispatcher']->package($package, $assets, $namespace);
        }
    }
366750
public static function addPath ($path, $namespace = \Twig_Loader_Filesystem::MAIN_NAMESPACE)
    {
        $twigLoader = self::getTwigLoader();
        /* @var $twigLoader \Twig_Loader_Filesystem */
        $twigLoader->addPath($path, $namespace);
    }