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

Breadcrumb

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

function Config::getAllCleanupPaths

Gets the configured list of directories to remove from the root package.

This is stored in composer.json extra:drupal-core-vendor-hardening.

Return value

array[] An array keyed by package name. Each array value is an array of paths, relative to the package.

1 call to Config::getAllCleanupPaths()
Config::getPathsForPackage in composer/Plugin/VendorHardening/Config.php
Get a list of paths to remove for the given package.

File

composer/Plugin/VendorHardening/Config.php, line 118

Class

Config
Determine configuration.

Namespace

Drupal\Composer\Plugin\VendorHardening

Code

public function getAllCleanupPaths() {
    if ($this->configData) {
        return $this->configData;
    }
    // Get the root package config.
    $package_config = $this->rootPackage
        ->getExtra();
    if (isset($package_config['drupal-core-vendor-hardening'])) {
        $this->configData = array_change_key_case($package_config['drupal-core-vendor-hardening'], CASE_LOWER);
    }
    // Ensure the values are arrays.
    $this->configData = array_map(function ($paths) {
        return (array) $paths;
    }, $this->configData);
    // Merge root config with defaults.
    foreach (array_change_key_case(static::$defaultConfig, CASE_LOWER) as $package => $paths) {
        $this->configData[$package] = array_merge($this->configData[$package] ?? [], $paths);
    }
    return $this->configData;
}
RSS feed
Powered by Drupal