Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PathRepository.php

function PathRepository::getUrlMatches

Get a list of all (possibly relative) path names matching given url (supports globbing).

Return value

string[]

1 call to PathRepository::getUrlMatches()
PathRepository::initialize in vendor/composer/composer/src/Composer/Repository/PathRepository.php
Initializes path repository.

File

vendor/composer/composer/src/Composer/Repository/PathRepository.php, line 238

Class

PathRepository
This repository allows installing local packages that are not necessarily under their own VCS.

Namespace

Composer\Repository

Code

private function getUrlMatches() : array {
    $flags = GLOB_MARK | GLOB_ONLYDIR;
    if (defined('GLOB_BRACE')) {
        $flags |= GLOB_BRACE;
    }
    elseif (strpos($this->url, '{') !== false || strpos($this->url, '}') !== false) {
        throw new \RuntimeException('The operating system does not support GLOB_BRACE which is required for the url ' . $this->url);
    }
    // Ensure environment-specific path separators are normalized to URL separators
    return array_map(static function ($val) : string {
        return rtrim(str_replace(DIRECTORY_SEPARATOR, '/', $val), '/');
    }, glob($this->url, $flags));
}
RSS feed
Powered by Drupal