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

Breadcrumb

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

function AbstractStream::readLine

File

vendor/symfony/mailer/Transport/Smtp/Stream/AbstractStream.php, line 76

Class

AbstractStream
A stream supporting remote sockets and local processes.

Namespace

Symfony\Component\Mailer\Transport\Smtp\Stream

Code

public function readLine() : string {
    if (feof($this->out)) {
        return '';
    }
    $line = @fgets($this->out);
    if ('' === $line || false === $line) {
        $metas = stream_get_meta_data($this->out);
        if ($metas['timed_out']) {
            throw new TransportException(\sprintf('Connection to "%s" timed out.', $this->getReadConnectionDescription()));
        }
        if ($metas['eof']) {
            throw new TransportException(\sprintf('Connection to "%s" has been closed unexpectedly.', $this->getReadConnectionDescription()));
        }
        if (false === $line) {
            throw new TransportException(\sprintf('Unable to read from connection to "%s": ', $this->getReadConnectionDescription()) . error_get_last()['message']);
        }
    }
    $this->debug .= \sprintf('[%s] < %s', (new \DateTimeImmutable())->format('Y-m-d\\TH:i:s.up'), $line);
    return $line;
}

API Navigation

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