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

Breadcrumb

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

function Installer::getLocationPattern

Get the second part of the regular expression to check for support of a package type

1 call to Installer::getLocationPattern()
Installer::supports in vendor/composer/installers/src/Composer/Installers/Installer.php

File

vendor/composer/installers/src/Composer/Installers/Installer.php, line 225

Class

Installer

Namespace

Composer\Installers

Code

protected function getLocationPattern(string $frameworkType) : string {
    $pattern = null;
    if (!empty($this->supportedTypes[$frameworkType])) {
        $frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
        
        /** @var BaseInstaller $framework */
        $framework = new $frameworkClass(new Package('dummy/pkg', '1.0.0.0', '1.0.0'), $this->composer, $this->getIO());
        $locations = array_keys($framework->getLocations($frameworkType));
        if ($locations) {
            $pattern = '(' . implode('|', $locations) . ')';
        }
    }
    return $pattern ?: '(\\w+)';
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal