Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 8... Línea 8...
8
 
8
 
9
/**
9
/**
10
 * Lazily reads or writes to a file that is opened only after an IO operation
10
 * Lazily reads or writes to a file that is opened only after an IO operation
11
 * take place on the stream.
11
 * take place on the stream.
12
 */
-
 
13
#[\AllowDynamicProperties]
12
 */
14
final class LazyOpenStream implements StreamInterface
13
final class LazyOpenStream implements StreamInterface
15
{
14
{
Línea 16... Línea 15...
16
    use StreamDecoratorTrait;
15
    use StreamDecoratorTrait;
Línea 20... Línea 19...
20
 
19
 
21
    /** @var string */
20
    /** @var string */
Línea 22... Línea 21...
22
    private $mode;
21
    private $mode;
-
 
22
 
-
 
23
    /**
-
 
24
     * @var StreamInterface
-
 
25
     */
-
 
26
    private $stream;
23
 
27
 
24
    /**
28
    /**
25
     * @param string $filename File to lazily open
29
     * @param string $filename File to lazily open
26
     * @param string $mode     fopen mode to use when opening the stream
30
     * @param string $mode     fopen mode to use when opening the stream
27
     */
31
     */
28
    public function __construct(string $filename, string $mode)
32
    public function __construct(string $filename, string $mode)
29
    {
33
    {
-
 
34
        $this->filename = $filename;
-
 
35
        $this->mode = $mode;
-
 
36
 
-
 
37
        // unsetting the property forces the first access to go through
30
        $this->filename = $filename;
38
        // __get().
Línea 31... Línea 39...
31
        $this->mode = $mode;
39
        unset($this->stream);
32
    }
40
    }
33
 
41