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

Breadcrumb

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

function AllowedPackages::recursiveGetAllowedPackages

Builds a name-to-package mapping from a list of package names.

Parameters

string[] $packages_to_allow: List of package names to allow.

array $allowed_packages: Mapping of package names to PackageInterface of packages already accumulated.

Return value

\Composer\Package\PackageInterface[] Mapping of package names to PackageInterface in priority order.

1 call to AllowedPackages::recursiveGetAllowedPackages()
AllowedPackages::getAllowedPackages in composer/Plugin/Scaffold/AllowedPackages.php
Gets a list of all packages that are allowed to copy scaffold files.

File

composer/Plugin/Scaffold/AllowedPackages.php, line 141

Class

AllowedPackages
Determine recursively which packages have been allowed to scaffold files.

Namespace

Drupal\Composer\Plugin\Scaffold

Code

protected function recursiveGetAllowedPackages(array $packages_to_allow, array $allowed_packages = []) {
    foreach ($packages_to_allow as $name) {
        $package = $this->getPackage($name);
        if ($package instanceof PackageInterface && !isset($allowed_packages[$name])) {
            $allowed_packages[$name] = $package;
            $package_options = $this->manageOptions
                ->packageOptions($package);
            $allowed_packages = $this->recursiveGetAllowedPackages($package_options->allowedPackages(), $allowed_packages);
        }
    }
    return $allowed_packages;
}

API Navigation

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