‪TYPO3CMS  9.5
SelfEmittableLazyOpenStream.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
4 namespace ‪TYPO3\CMS\Core\Http;
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
19 use GuzzleHttp\Psr7\LazyOpenStream;
20 
28 class ‪SelfEmittableLazyOpenStream extends LazyOpenStream implements ‪SelfEmittableStreamInterface
29 {
33  protected ‪$filename;
34 
40  public function ‪__construct(‪$filename)
41  {
42  parent::__construct(‪$filename, 'r');
43  $this->filename = ‪$filename;
44  }
45 
49  public function ‪emit()
50  {
51  readfile($this->filename, false);
52  }
53 
57  public function ‪isWritable(): bool
58  {
59  return false;
60  }
61 
66  public function ‪write($string)
67  {
68  throw new \RuntimeException('Cannot write to a ' . self::class, 1538331833);
69  }
70 }
‪TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream\write
‪write($string)
Definition: SelfEmittableLazyOpenStream.php:65
‪TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream\$filename
‪string $filename
Definition: SelfEmittableLazyOpenStream.php:32
‪TYPO3\CMS\Core\Http\SelfEmittableStreamInterface
Definition: SelfEmittableStreamInterface.php:27
‪TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream\emit
‪emit()
Definition: SelfEmittableLazyOpenStream.php:48
‪TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream
Definition: SelfEmittableLazyOpenStream.php:29
‪TYPO3\CMS\Core\Http
Definition: AbstractApplication.php:3
‪TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream\__construct
‪__construct($filename)
Definition: SelfEmittableLazyOpenStream.php:39
‪TYPO3\CMS\Core\Http\SelfEmittableLazyOpenStream\isWritable
‪bool isWritable()
Definition: SelfEmittableLazyOpenStream.php:56