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

Breadcrumb

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

function Process::replacePlaceholders

1 call to Process::replacePlaceholders()
Process::start in vendor/symfony/process/Process.php
Starts the process and returns after writing the input to STDIN.

File

vendor/symfony/process/Process.php, line 1656

Class

Process
Process is a thin wrapper around proc_* functions to easily start independent PHP processes.

Namespace

Symfony\Component\Process

Code

private function replacePlaceholders(string $commandline, array $env) : string {
    return preg_replace_callback('/"\\$\\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\\}"/', function ($matches) use ($commandline, $env) {
        if (!isset($env[$matches[1]]) || false === $env[$matches[1]]) {
            throw new InvalidArgumentException(\sprintf('Command line is missing a value for parameter "%s": ', $matches[1]) . $commandline);
        }
        return $this->escapeArgument($env[$matches[1]]);
    }, $commandline);
}
RSS feed
Powered by Drupal