You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was merged into the 4.1-dev branch.
Discussion
----------
Revert "feature #24763 [Process] Allow writing portable "prepared" command lines (Simperfit)"
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This reverts commit 1364089, reversing
changes made to e043478.
As discussed in #24763 and #26344
This doens't revert the possibility to use prepared command lines. They just won't be *portable* anymore, unless special care is taken by "userland".
Ie the placeholders need to be shell-dependent: use eg `echo "$FOO"` on *nix (the double quotes *are* important), and `echo !FOO!` on Windows (no double quotes there).
Commits
-------
6a98bfa Revert "feature #24763 [Process] Allow writing portable "prepared" command lines (Simperfit)"
returnpreg_replace_callback('/\{\{ ?([_a-zA-Z0-9]++) ?\}\}/', function ($m) use ($pattern, $commandline, $env) {
1560
-
if (!isset($env[$m[1]]) || false === $env[$m[1]]) {
1561
-
foreach ($envas$k => $v) {
1562
-
if (false === $v) {
1563
-
unset($env[$k]);
1564
-
}
1565
-
}
1566
-
if (!$env) {
1567
-
thrownewInvalidArgumentException(sprintf('Invalid command line "%s": no values provided for any placeholders.', $commandline));
1568
-
}
1569
-
$env = implode('", "', array_keys($env));
1570
-
1571
-
thrownewInvalidArgumentException(sprintf('Invalid command line "%s": no value provided for placeholder "%s", did you mean "%s"?', $commandline, $m[1], $env));
0 commit comments