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

Breadcrumb

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

function Terminal::readFromProcess

2 calls to Terminal::readFromProcess()
Terminal::getConsoleMode in vendor/symfony/console/Terminal.php
Runs and parses mode CON if it's available, suppressing any error output.
Terminal::getSttyColumns in vendor/symfony/console/Terminal.php
Runs and parses stty -a if it's available, suppressing any error output.

File

vendor/symfony/console/Terminal.php, line 199

Class

Terminal

Namespace

Symfony\Component\Console

Code

private static function readFromProcess(string|array $command) : ?string {
    if (!\function_exists('proc_open')) {
        return null;
    }
    $descriptorspec = [
        1 => [
            'pipe',
            'w',
        ],
        2 => [
            'pipe',
            'w',
        ],
    ];
    $cp = \function_exists('sapi_windows_cp_set') ? sapi_windows_cp_get() : 0;
    if (!($process = @proc_open($command, $descriptorspec, $pipes, null, null, [
        'suppress_errors' => true,
    ]))) {
        return null;
    }
    $info = stream_get_contents($pipes[1]);
    fclose($pipes[1]);
    fclose($pipes[2]);
    proc_close($process);
    if ($cp) {
        sapi_windows_cp_set($cp);
    }
    return $info;
}

API Navigation

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