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

Breadcrumb

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

function BinaryInstaller::generateWindowsProxyCode

1 call to BinaryInstaller::generateWindowsProxyCode()
BinaryInstaller::installFullBinaries in vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php

File

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

Class

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

Namespace

Composer\Installer

Code

protected function generateWindowsProxyCode(string $bin, string $link) : string {
    $binPath = $this->filesystem
        ->findShortestPath($link, $bin);
    $caller = self::determineBinaryCaller($bin);
    // if the target is a php file, we run the unixy proxy file
    // to ensure that _composer_autoload_path gets defined, instead
    // of running the binary directly
    if ($caller === 'php') {
        return "@ECHO OFF\r\n" . "setlocal DISABLEDELAYEDEXPANSION\r\n" . "SET BIN_TARGET=%~dp0/" . trim(ProcessExecutor::escape(basename($link, '.bat')), '"\'') . "\r\n" . "SET COMPOSER_RUNTIME_BIN_DIR=%~dp0\r\n" . "{$caller} \"%BIN_TARGET%\" %*\r\n";
    }
    return "@ECHO OFF\r\n" . "setlocal DISABLEDELAYEDEXPANSION\r\n" . "SET BIN_TARGET=%~dp0/" . trim(ProcessExecutor::escape($binPath), '"\'') . "\r\n" . "SET COMPOSER_RUNTIME_BIN_DIR=%~dp0\r\n" . "{$caller} \"%BIN_TARGET%\" %*\r\n";
}

API Navigation

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