Tools\Mailer\Email::_readFile PHP Method

_readFile() protected method

Overwrite parent to avoid File class and file_exists to false negative existent remove images. Also fixes file_get_contents (used via File class) to close the connection again after getting remote files. So far it would have kept the connection open in HTTP/1.1.
protected _readFile ( string $path ) : string
$path string The absolute path to the file to read.
return string File contents in base64 encoding
    protected function _readFile($path)
    {
        $context = stream_context_create(['http' => ['header' => 'Connection: close']]);
        $content = file_get_contents($path, 0, $context);
        if (!$content) {
            trigger_error('No content found for ' . $path);
        }
        return chunk_split(base64_encode($content));
    }