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

Breadcrumb

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

function ProcessStream::initialize

Overrides AbstractStream::initialize

File

vendor/symfony/mailer/Transport/Smtp/Stream/ProcessStream.php, line 39

Class

ProcessStream
A stream supporting local processes.

Namespace

Symfony\Component\Mailer\Transport\Smtp\Stream

Code

public function initialize() : void {
    $descriptorSpec = [
        0 => [
            'pipe',
            'r',
        ],
        1 => [
            'pipe',
            'w',
        ],
        2 => [
            'pipe',
            '\\' === \DIRECTORY_SEPARATOR ? 'a' : 'w',
        ],
    ];
    $pipes = [];
    $this->stream = proc_open($this->command, $descriptorSpec, $pipes);
    stream_set_blocking($pipes[2], false);
    if ($err = stream_get_contents($pipes[2])) {
        throw new TransportException('Process could not be started: ' . $err);
    }
    $this->in =& $pipes[0];
    $this->out =& $pipes[1];
    $this->err =& $pipes[2];
}

API Navigation

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