Compute the repository credentials name

@return string
348635
protected function computeCredentialsName($prefix = null) {
		if (!$prefix) {
			$paths = $this->get('paths');
			if ($paths && isset($paths['default'])) {
				$prefix = $paths['default'];
			}
		}
		preg_match('/([http:\/\/|https:\/\/|ssh:\/\/])*(\w@)*([\w\.\-_]{1,}+)/', $prefix, $prefix);
		if (count($prefix)) return end($prefix);
		return basename($this->repository->getDir());
    }
674398
public function getKey()
    {
        $key = '';

        if ($this->clientCredentials instanceof ClientCredentials) {
            $key .= rawurlencode($this->clientCredentials->getSecret());
        }

        // Keep the ampersand even if both keys are empty.
        $key .= '&';

        if ($this->serverIssuedCredentials instanceof ServerIssuedCredentials) {
            $key .= rawurlencode($this->serverIssuedCredentials->getSecret());
        }

        return $key;
    }
1025970
public function getCredentials()
    {
        if ($this->login) return array( $this->login, $this->password);

        //Try to find the password inside symfony configuration
        if ($this->isSymfony() && $this->symfonyContainer->hasParameter('pb_private_key')) {
            return array('api', $this->symfonyContainer->getParameter('pb_private_key'));
        }

        //Using static PureBilling as fallback
        if (class_exists('\PureBilling') && \PureBilling::getPrivateKey()) {
            return array('api', \PureBilling::getPrivateKey());
        }
    }
1207983
private function getUiTIDSavedSearchRepository()
    {
        $metadata = $this->metadata->serialize();
        $tokenCredentials = $metadata['uitid_token_credentials'];

        $savedSearchesService = $this->savedSearchesServiceFactory->withTokenCredentials($tokenCredentials);

        $repository = new UiTIDSavedSearchRepository($savedSearchesService);

        if ($this->logger) {
            $repository->setLogger($this->logger);
        }

        return $repository;
    }
1211995
public function getVersionApproverUserName()
    {
        if ($this->cvApproverUID > 0) {
            $app = Facade::getFacadeApplication();
            $db = $app->make('database')->connection();

            return $db->fetchColumn('select uName from Users where uID = ?', array(
                $this->cvApproverUID,
            ));
        }
    }
36306
public function get_readable_fullname() {
        global $CFG;
        // retrieve the readable path with all parents (excluding the top most 'System')
        $fpath = array();
        for ($parent = $this; $parent && $parent->get_parent(); $parent = $parent->get_parent()) {
            array_unshift($fpath, $parent->get_visible_name());
        }

        if ($this->lf->get_component() == 'user' && $this->lf->get_filearea() == 'private') {
            // use the special syntax for user private files - 'USERNAME Private files: PATH'
            $username = array_shift($fpath);
            array_shift($fpath); // get rid of "Private Files/" in the beginning of the path
            return get_string('privatefilesof', 'repository', $username). ': '. join('/', $fpath);
        } else {
            // for all other files (except user private files) return 'Server files: PATH'

            // first, get and cache the name of the repository_local (will be used as prefix for file names):
            static $replocalname = null;
            if ($replocalname === null) {
                require_once($CFG->dirroot . "/repository/lib.php");
                $instances = repository::get_instances(array('type' => 'local'));
                if (count($instances)) {
                    $firstinstance = reset($instances);
                    $replocalname = $firstinstance->get_name();
                } else if (get_string_manager()->string_exists('pluginname', 'repository_local')) {
                    $replocalname = get_string('pluginname', 'repository_local');
                } else {
                    $replocalname = get_string('arearoot', 'repository');
                }
            }

            return $replocalname. ': '. join('/', $fpath);
        }
    }
357431
public function getEloquentRepository()
    {
        $repositoryGenerator = new RepositoryEloquentGenerator([
            'name' => $this->name,
        ]);

        $repository = $repositoryGenerator->getRootNamespace() . '\\' . $repositoryGenerator->getName();

        return str_replace([
            "\\",
            '/'
        ], '\\', $repository) . 'RepositoryEloquent';
    }
466803
public function getDbCredentials()
    {
        return array(
            'user' => ee()->db->username,
            'password' => ee()->db->password,
            'database' => ee()->db->database,
            'host' => ee()->db->hostname,
            'prefix' => ee()->db->dbprefix,
            'settings_table_name' => ee()->db->dbprefix . $this->getSettingsTable()
        );
    }
295350
public function getAuthorName()
    {
        if ($this->fvAuthorUID) {
            $app = Application::getFacadeApplication();
            $ui = $app->make(UserInfoRepository::class)->getByID($this->fvAuthorUID);
        } else {
            $ui = null;
        }

        return $ui === null ? t('(Unknown)') : $ui->getUserDisplayName();
    }
1250405
public function identity()
    {
        $databaseParts = explode('/', $this->name);
        $instanceParts = explode('/', $this->instance->name());

        return [
            'projectId' => $this->projectId,
            'database' => end($databaseParts),
            'instance' => end($instanceParts),
        ];
    }
657735
final public function getName(): string
    {
        try {
            $reflexionConstant = new ReflectionClassConstant($this, 'NAME');
            $this->name        = $reflexionConstant->getValue();
        }
        catch (Exception $e) {
        }

        return $this->name;
    }
88158
public function getGitHubUrlInfo()
    {
        $info = $this->getGithubInfo();

        if (isset($info['url'])) {
            $matches = [];
            $pattern = '/(?:https?:\/\/github.com\/|git\@.+\:)([\w\/\-\_]+)/';

            if (preg_match($pattern, $info['url'], $matches)) {
                list($account, $repo) = explode(
                    DIRECTORY_SEPARATOR,
                    $matches[1]
                );

                return [
                    'account' => $account,
                    'repository' => $repo,
                ];
            }
        }

        return [];
    }
713635
protected function getUsername()
    {

        // initialize the name
        $name = null;

        // query whether or not we've an principal
        if ($identity = $this->getIdentity()) {
            $name = $identity->getName();
        }

        // return the name
        return $name;
    }
143344
public function getGitUrl()
    {
        // The collection doesn't provide a Git URL, but it does provide the
        // right host, so the URL can be calculated.
        if (!$this->hasProperty('repository', false)) {
            $host = parse_url($this->getUri(), PHP_URL_HOST);

            return "{$this->id}@git.{$host}:{$this->id}.git";
        }
        $repository = $this->getProperty('repository');

        return $repository['url'];
    }
792118
private function resolveRepositoryName($repository)
    {
        if ($repository === null) {
            $aliases = array_keys($this->repositories);
            $repository = array_shift($aliases);
        }

        return $repository;
    }
512453
public function getRepository()
    {
        $repository = MigrationsRepository::getInstance()
            ->setCommand($this)
            ->setIo($this->io);

        $repository['path'] = $this->console->get('migration.dir') ?: $this->console->get('path.migrations');

        return $repository;
    }
160873
private function getPermissionRepository()
    {
        if (null === $this->permissionRepo) {
            /** @var EntityRepository $repo */
            $repo = RepositoryUtils::getRepository($this->doctrine, PermissionInterface::class);
            $this->permissionRepo = $repo;
        }

        return $this->permissionRepo;
    }