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

Breadcrumb

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

function BinaryInstaller::determineBinaryCaller

2 calls to BinaryInstaller::determineBinaryCaller()
BinaryInstaller::generateWindowsProxyCode in vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php
EventDispatcher::doDispatch in vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php
Triggers the listeners of an event.

File

vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php, line 134

Class

BinaryInstaller
Utility to handle installation of package "bin"/binaries

Namespace

Composer\Installer

Code

public static function determineBinaryCaller(string $bin) : string {
    if ('.bat' === substr($bin, -4) || '.exe' === substr($bin, -4)) {
        return 'call';
    }
    $handle = fopen($bin, 'r');
    $line = fgets($handle);
    fclose($handle);
    if (Preg::isMatchStrictGroups('{^#!/(?:usr/bin/env )?(?:[^/]+/)*(.+)$}m', (string) $line, $match)) {
        return trim($match[1]);
    }
    return 'php';
}

API Navigation

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