Adds multiple repositories

@param   array      $repositories    The repositories (key => repository)
@return  RepositoryRegistry
198747
public function addRepositories(array $repositories)
    {
        foreach ($repositories as $key => $repository) {
            $this->addRepository($key, $repository);
        }
        return $this;
    }
277032
public static function add_to_repo($repository_path, $files = null)
    {
        $repo = new pakeMercurial($repository_path);
        $repo->add($files);

        return $repo;
    }
898497
public function registerRepository(ManagedRepositoryInterface $repository) {
		$name = $repository->getName();
		if($this->hasRepository($name)) {
			throw new \LogicException(sprintf('Repository %s is already registered.', $name));
		}

		$event = new ManagedRepositoryEvent($repository);
		$this->eventDispatcher->dispatch(ManagedRepositoryEvent::REGISTER, $event);
		$repository = $event->getRepository();

		$this->repositories[$name] = $repository;
		$this->classMap[$repository->getClassName()] = $name;
		return $repository;
	}
1004929
protected function ensureRepository( $repository ) {
    if ( $repository === null ) {
      return new Repository();
    }

    if ( $repository instanceof RepostoryContract ) {
      return $repository;
    }

    if ( is_array( $repository ) ) {
      return new Repository( $repository );
    }

    throw new \LogicException( 'A repository should either be an array or a Flysystem\Repository object.' );
  }
56409
protected function createRepository(ObjectAccess $repository)
    {
        if ($repository->exists('packagist')) {
            return new PackagistRepository(
                $repository->get('packagist'),
                $repository->data()
            );
        }

        $type = $repository->get('type');

        if ('package' === $type) {
            $repository = new PackageRepository(
                $this->objectToArray($repository->get('package')),
                $this->objectToArray($repository->getDefault('options')),
                $repository->data()
            );
        } else {
            $repository = new Repository(
                $type,
                $repository->getDefault('url'),
                $this->objectToArray($repository->getDefault('options')),
                $repository->data()
            );
        }

        return $repository;
    }
1169174
public function applyRepositoryFilters(array $filters, Repository $repository)
	{
		$repository->setFilters(array_merge($repository->getFilters(), $filters));
	}
1335203
public void addRepositoryClass(I_CmsRepository repository) throws CmsConfigurationException {

        // check if new repositories can still be added
        if (m_frozen) {
            throw new CmsConfigurationException(Messages.get().container(Messages.ERR_NO_CONFIG_AFTER_STARTUP_0));
        }
        m_repositoryList.add(repository);
    }
953140
public function addFilesToRegistry($filePaths)
    {
        collect((array) $filePaths)->each(function ($filePath) {
            if (file_exists($filePath)) {
                AnnotationRegistry::registerFile($filePath);
            }
        });

        return $this;
    }
856381
protected function registerCommands(array $commands)
    {
        foreach ($commands as $command) {
            if ( ! $command instanceof SymfonyCommand) {
                $command = $this->container[$command];
            }

            $this->container['console']->add($command);
        }
    }
1139784
private function initializeRepositories(array $repositories): void
    {
        foreach ($repositories as $name => $data) {
            $this->repositories[$name] = new Repository($this, $name, $data);
        }
    }
302455
public static function addPsr4($paths)
    {
        $loader = new ClassLoader();

        foreach ($paths as $namespace => $path) {
            $loader->addPsr4($namespace, $path);
        }

        $loader->register();
    }
946707
public void setRepositories(java.util.Collection<RepositoryNameIdPair> repositories) {
        if (repositories == null) {
            this.repositories = null;
            return;
        }

        this.repositories = new java.util.ArrayList<RepositoryNameIdPair>(repositories);
    }
39751
public function expandReferences(array $references, PackageVersionEntity $packageVersion)
    {
        if (empty($references)) {
            return $references;
        }
        $gitRepositories = $this->app->make(GitRepositoryRepository::class)->findBy(['packageHandle' => $packageVersion->getPackage()->getHandle()]);
        $applicableRepository = null;
        $foundVersionData = null;
        foreach ($gitRepositories as $gitRepository) {
            $d = $gitRepository->getDetectedVersion($packageVersion->getVersion());
            if ($d !== null) {
                $applicableRepository = $gitRepository;
                $foundVersionData = $d;
                break;
            }
        }

        $pattern = null;
        $lineFormat = null;
        if ($applicableRepository !== null) {
            $matches = null;
            switch (true) {
                case 1 == preg_match('/^(?:\w+:\/\/|\w+@)github.com[:\/]([a-z0-9_.\-]+\/[a-z0-9_.\-]+)\.git$/i', $applicableRepository->getURL(), $matches):
                    switch ($foundVersionData['kind']) {
                        case 'tag':
                            $pattern = 'https://github.com/' . $matches[1] . '/blob/' . $foundVersionData['repoName'] . '/<<FILE>><<LINE>>';
                            $lineFormat = '#L%s';
                            break;
                        case 'branch':
                            $pattern = 'https://github.com/' . $matches[1] . '/blob/' . $foundVersionData['repoName'] . '/<<FILE>><<LINE>>';
                            $lineFormat = '#L%s';
                            break;
                    }
                    break;
            }
        }
        $result = $references;
        if ($pattern !== null) {
            $prefix = $applicableRepository->getDirectoryToParse();
            if ($prefix !== '') {
                $prefix .= '/';
            }
            $stripSuffix = $applicableRepository->getDirectoryForPlaces();
            if ($stripSuffix !== '') {
                $stripSuffix .= '/';
            }
            $m = null;
            foreach ($result as $index => $reference) {
                if (!preg_match('/^\w*:\/\//', $reference)) {
                    if (preg_match('/^(.+):(\d+)$/', $reference, $m)) {
                        $file = $m[1];
                        $line = $m[2];
                    } else {
                        $file = $reference;
                        $line = null;
                    }
                    $file = ltrim($file, '/');
                    $line = ($line === null || $lineFormat === null) ? '' : sprintf($lineFormat, $line);
                    if ($stripSuffix !== '' && strpos($file, $stripSuffix) === 0) {
                        $file = $prefix . substr($file, strlen($stripSuffix));
                    }
                    $result[$index] = [
                        str_replace(['<<FILE>>', '<<LINE>>'], [$file, $line], $pattern),
                        $reference,
                    ];
                }
            }
        }

        return $result;
    }
1156622
public function incrementRepositoryAccess($repository)
    {
        $this->redis->hincrby($this->concatenateKeys($this->keyHash, $repository), self::KEY_TOTAL, 1);

        $key = $this->createDailyKey(self::KEY_TOTAL);
        $this->redis->hincrby($this->concatenateKeys($this->keyHash, $repository), $key, 1);

        $key = $this->createMonthlyKey(self::KEY_TOTAL);
        $this->redis->hincrby($this->concatenateKeys($this->keyHash, $repository), $key, 1);

        $key = $this->createYearlyKey(self::KEY_TOTAL);
        $this->redis->hincrby($this->concatenateKeys($this->keyHash, $repository), $key, 1);

        return $this;
    }
189745
protected function registerRepository()
    {
        $this->app->singleton('neoeloquent.migration.repository', function($app)
        {
            $model = new MigrationModel;

            $label = $app['config']['database.migrations_node'];

            if (isset($label)) {
                $model->setLabel($label);
            }

            return new DatabaseMigrationRepository(
                $app['db'],
                $app['db']->connection('neo4j')->getSchemaBuilder(),
                $model
            );
        });
    }
64311
protected function registerRepositories(Repository $config)
    {
        $this->app->afterResolving('registry', function (ManagerRegistry $registry, Container $container) use ($config) {
            foreach ($config->get('doctrine_repositories.repositories', []) as $details) {
                if (!isset($details['repository']) && !isset($details['entity'])) {
                    throw new \InvalidArgumentException(
                        sprintf('Failed to process repository data: missing repository/entity from definition')
                    );
                }

                $this->app->singleton($details['repository'], function ($app) use ($details, $registry) {
                    $class = $details['repository'];
                    $em    = isset($details['em']) ? $registry->getManager($details['em']) : $registry->getManager();

                    return new $class($em, $em->getClassMetaData($details['entity']));
                });

                if (isset($details['alias'])) {
                    $this->app->alias($details['repository'], $details['alias']);
                }
                if (isset($details['tags'])) {
                    $this->app->tag($details['repository'], $details['tags']);
                }
            }
        });
    }
1259743
final protected function extendRepositoryMapping()
    {
        $app = $this->getContainer();

        $app['storage'] = $app->share(
            $app->extend(
                'storage',
                function ($entityManager) use ($app) {
                    foreach ($this->registerRepositoryMappings() as $alias => $map) {
                        if (Arr::isIndexed($map)) {
                            // Usually caused by [entity, repo] instead of [entity => repo]
                            throw new \RuntimeException(sprintf('Repository mapping for %s `%s` is not an associative array.', __CLASS__, $alias));
                        }
                        $app['storage.repositories'] += $map;
                        $app['storage.metadata']->setDefaultAlias($app['schema.prefix'] . $alias, key($map));
                        $entityManager->setRepository(key($map), current($map));
                        $entityManager->addEntityAlias($alias, key($map));
                    }

                    return $entityManager;
                }
            )
        );
    }