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\StreamCode
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];
}