Commit 8819e79
authored
Use temp stream instead of string to buffer content (#52)
* Use temp stream instead of string to buffer content
* Update MultipartStreamBuilder::build to buffer built content
in a php://temp stream resource instead of (string) $contents.
This way, the size of the stream built won't be limited by PHP
runtime limit.
* Detect available memory for maxmemory in buffer
* Detect available memory (in bytes). Then config the buffer
stream to stay in memory until reaching 1/4 of that.
* Added setBufferMaxMemory to manually override that limit.
* Fix code style
* Improve documentation to getAvailableMemory
* Improve documentation to MultipartStreamBuilder::getAvailableMemory
* Update CHANGELOG.md
* Remove the memory detection logic from build
* Remove the memory detection logic from MultipartStreamBuilder::build.
* Code style update
* Minor updates
* Improve readability of comment.
* Use the old __toString approach if the stream is not isReadable().
* Remove unnecessary comment1 parent 9addfcf commit 8819e79
2 files changed
+34
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | | - | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 78 | + | |
| 79 | + | |
82 | 80 | | |
83 | 81 | | |
84 | 82 | | |
| |||
133 | 131 | | |
134 | 132 | | |
135 | 133 | | |
136 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | | - | |
140 | | - | |
| 140 | + | |
| 141 | + | |
141 | 142 | | |
142 | | - | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
145 | 147 | | |
146 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
147 | 155 | | |
148 | | - | |
| 156 | + | |
149 | 157 | | |
150 | | - | |
151 | | - | |
| 158 | + | |
152 | 159 | | |
153 | 160 | | |
154 | 161 | | |
155 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
156 | 166 | | |
157 | | - | |
| 167 | + | |
158 | 168 | | |
159 | 169 | | |
160 | 170 | | |
| |||
0 commit comments