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