Add "symlink" option for "bin-compat" config (#9959)
parent
7157097ea0
commit
a9031e40eb
|
@ -253,11 +253,12 @@ Defaults to `false`. Whether to use the Composer cache in read-only mode.
|
||||||
## bin-compat
|
## bin-compat
|
||||||
|
|
||||||
Defaults to `auto`. Determines the compatibility of the binaries to be installed.
|
Defaults to `auto`. Determines the compatibility of the binaries to be installed.
|
||||||
If it is `auto` then Composer only installs .bat proxy files when on Windows. If
|
If it is `auto` then Composer only installs .bat proxy files when on Windows or WSL. If
|
||||||
set to `full` then both .bat files for Windows and scripts for Unix-based
|
set to `full` then both .bat files for Windows and scripts for Unix-based
|
||||||
operating systems will be installed for each binary. This is mainly useful if you
|
operating systems will be installed for each binary. This is mainly useful if you
|
||||||
run Composer inside a linux VM but still want the .bat proxies available for use
|
run Composer inside a linux VM but still want the `.bat` proxies available for use
|
||||||
in the Windows host OS.
|
in the Windows host OS. If set to `symlink` Composer will always symlink even on
|
||||||
|
Windows/WSL.
|
||||||
|
|
||||||
## prepend-autoloader
|
## prepend-autoloader
|
||||||
|
|
||||||
|
|
|
@ -251,8 +251,8 @@
|
||||||
"description": "Whether to use the Composer cache in read-only mode."
|
"description": "Whether to use the Composer cache in read-only mode."
|
||||||
},
|
},
|
||||||
"bin-compat": {
|
"bin-compat": {
|
||||||
"enum": ["auto", "full"],
|
"enum": ["auto", "full", "symlink"],
|
||||||
"description": "The compatibility of the binaries, defaults to \"auto\" (automatically guessed) and can be \"full\" (compatible with both Windows and Unix-based systems)."
|
"description": "The compatibility of the binaries, defaults to \"auto\" (automatically guessed), can be \"full\" (compatible with both Windows and Unix-based systems) and \"symlink\" (symlink also for WSL)."
|
||||||
},
|
},
|
||||||
"discard-changes": {
|
"discard-changes": {
|
||||||
"type": ["string", "boolean"],
|
"type": ["string", "boolean"],
|
||||||
|
|
|
@ -390,7 +390,7 @@ EOT
|
||||||
),
|
),
|
||||||
'bin-compat' => array(
|
'bin-compat' => array(
|
||||||
function ($val) {
|
function ($val) {
|
||||||
return in_array($val, array('auto', 'full'));
|
return in_array($val, array('auto', 'full', 'symlink'));
|
||||||
},
|
},
|
||||||
function ($val) {
|
function ($val) {
|
||||||
return $val;
|
return $val;
|
||||||
|
|
|
@ -92,6 +92,8 @@ class BinaryInstaller
|
||||||
}
|
}
|
||||||
} elseif ($this->binCompat === "full") {
|
} elseif ($this->binCompat === "full") {
|
||||||
$this->installFullBinaries($binPath, $link, $bin, $package);
|
$this->installFullBinaries($binPath, $link, $bin, $package);
|
||||||
|
} elseif ($this->binCompat === "symlink") {
|
||||||
|
$this->installSymlinkBinaries($binPath, $link);
|
||||||
}
|
}
|
||||||
Silencer::call('chmod', $link, 0777 & ~umask());
|
Silencer::call('chmod', $link, 0777 & ~umask());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue