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

Breadcrumb

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

function SolverProblemsException::createExtensionHint

Parameters

string[] $missingExtensions:

1 call to SolverProblemsException::createExtensionHint()
SolverProblemsException::getPrettyString in vendor/composer/composer/src/Composer/DependencyResolver/SolverProblemsException.php

File

vendor/composer/composer/src/Composer/DependencyResolver/SolverProblemsException.php, line 106

Class

SolverProblemsException
@author Nils Adermann <naderman@naderman.de>

Namespace

Composer\DependencyResolver

Code

private function createExtensionHint(array $missingExtensions) : string {
    $paths = IniHelper::getAll();
    if ('' === $paths[0]) {
        if (count($paths) === 1) {
            return '';
        }
        array_shift($paths);
    }
    $ignoreExtensionsArguments = implode(" ", array_map(static function ($extension) {
        return "--ignore-platform-req={$extension}";
    }, array_unique($missingExtensions)));
    $text = "To enable extensions, verify that they are enabled in your .ini files:\n    - ";
    $text .= implode("\n    - ", $paths);
    $text .= "\nYou can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.";
    $text .= "\nAlternatively, you can run Composer with `{$ignoreExtensionsArguments}` to temporarily ignore these required extensions.";
    return $text;
}

API Navigation

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