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

Breadcrumb

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

function ExecCommand::getBinaries

Return value

list<string>

2 calls to ExecCommand::getBinaries()
ExecCommand::execute in vendor/composer/composer/src/Composer/Command/ExecCommand.php
Executes the current command.
ExecCommand::interact in vendor/composer/composer/src/Composer/Command/ExecCommand.php
Interacts with the user.

File

vendor/composer/composer/src/Composer/Command/ExecCommand.php, line 128

Class

ExecCommand
@author Davey Shafik <me@daveyshafik.com>

Namespace

Composer\Command

Code

private function getBinaries(bool $forDisplay) : array {
    $composer = $this->requireComposer();
    $binDir = $composer->getConfig()
        ->get('bin-dir');
    $bins = glob($binDir . '/*');
    $localBins = $composer->getPackage()
        ->getBinaries();
    if ($forDisplay) {
        $localBins = array_map(static function ($e) {
            return "{$e} (local)";
        }, $localBins);
    }
    $binaries = [];
    foreach (array_merge($bins, $localBins) as $bin) {
        // skip .bat copies
        if (isset($previousBin) && $bin === $previousBin . '.bat') {
            continue;
        }
        $previousBin = $bin;
        $binaries[] = basename($bin);
    }
    return $binaries;
}

API Navigation

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