Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit 3c65def

Browse files
fredemmottusox
authored andcommitted
Fix compatibility with 4.93 and HSL IO v0.3
1 parent a4bbea9 commit 3c65def

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

.hhconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ disable_halt_compiler = true
77
disable_instanceof_refinement = true
88
disable_legacy_soft_typehints = true
99
disable_lval_as_an_expression = true
10-
disable_partially_abstract_typeconsts = true
1110
disable_primitive_refinement = true
1211
disable_static_closures = true
1312
disable_static_local_variables = true
@@ -39,3 +38,4 @@ typecheck_xhp_cvars = true
3938
unsafe_rx = false
4039
allowed_decl_fixme_codes=2053,4047
4140
allowed_fixme_codes_strict=2011,2049,2050,2053,4026,4027,4047,4053,4104,4107,4108,4110,4128,4135,4188,4200,4240,4248,4323
41+
ignored_paths = [ "vendor/.+/tests/.+" ]

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
}
1414
],
1515
"require": {
16-
"hhvm": "^4.58",
16+
"hhvm": "^4.93",
1717
"facebook/hack-http-request-response-interfaces": "^0.3",
1818
"hhvm/hsl": "^4.25",
1919
"hhvm/hsl-experimental": "^4.58",
20-
"hhvm/hsl-io": "^0.2.1",
20+
"hhvm/hsl-io": "^0.3.0",
2121
"hhvm/type-assert": "^3.3|^4.0",
2222
"usox/hack-http-factory-interfaces": "^0.2"
2323
},

example/index.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async function main(): Awaitable<noreturn> {
99

1010
$response = $response->withAddedHeaderLine('X-ZOMG', 'aggi');
1111

12-
await $response->getBody()->writeAsync('foo');
12+
await $response->getBody()->writeAllAsync('foo');
1313

1414
$emitter = new \Usox\HackTTP\Response\TemporaryFileSapiEmitter();
1515
await $emitter->emitAsync($response);

src/UploadedFile.hack

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,13 @@ final class UploadedFile implements Message\UploadedFileInterface {
5757
// peak memory usage
5858
do {
5959
/* HHAST_IGNORE_ERROR[DontAwaitInALoop] */
60-
$chunk = await $this->stream->readAsync();
60+
$chunk = await $this->stream->readAllowPartialSuccessAsync();
6161
if ($chunk === '') {
6262
break;
6363
}
64+
// ... but we need to write everything we read, so writeAllAsync
6465
/* HHAST_IGNORE_ERROR[DontAwaitInALoop] */
65-
await $target->writeAsync($chunk);
66+
await $target->writeAllAsync($chunk);
6667
} while (true);
6768

6869
if ($this->stream is IO\CloseableHandle) {

0 commit comments

Comments
 (0)