Repository navigation
Expand file tree
/
Copy pathTarStream.php
More file actions
95 lines (75 loc) · 1.7 KB
/
Copy pathTarStream.php
File metadata and controls
95 lines (75 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
declare(strict_types=1);
namespace Docker\Stream;
use Psr\Http\Message\StreamInterface;
/**
* This class avoid a bug in PHP where fstat return a size of 0 for process stream.
*/
class TarStream implements StreamInterface
{
protected $stream;
public function __construct(StreamInterface $stream)
{
$this->stream = $stream;
}
public function __toString()
{
return $this->stream->__toString();
}
public function close(): void
{
$this->stream->close();
}
public function detach()
{
return $this->stream->detach();
}
public function getSize(): ?int
{
return null;
}
public function tell(): int
{
return $this->stream->tell();
}
public function eof(): bool
{
return $this->stream->eof();
}
public function isSeekable(): bool
{
return $this->stream->isSeekable();
}
public function seek($offset, $whence = \SEEK_SET): void
{
$this->stream->seek($offset, $whence);
}
public function rewind(): void
{
$this->stream->rewind();
}
public function isWritable(): bool
{
return $this->stream->isWritable();
}
public function write($string): int
{
return $this->stream->write($string);
}
public function isReadable(): bool
{
return $this->stream->isReadable();
}
public function read($length): string
{
return $this->stream->read($length);
}
public function getContents(): string
{
return $this->stream->getContents();
}
public function getMetadata($key = null)
{
return $this->stream->getMetadata($key);
}
}