- Matrix:
@wolverine:chat.wolvnet.de
- Mastodon:
@[email protected]
- Codeberg:
https://codeberg.org/usox
I'm currently working on
PSR7-like http request/response management
License: MIT License
@wolverine:chat.wolvnet.de
@[email protected]
https://codeberg.org/usox
I'm currently working on
You probably want use type Facebook\HackTest\DataProvider
If request_output is directly passed, then writing to the stream will take effect immediately.
Nothing should be written to real output until it's actually dealt finished
For example:
await $r->withHeader('foo', vec['bar'])->getBody()->writeAsync("Herp derp");
... the header will not be set as the response body will have been sent before anything else can be done with the request
<<__EntryPoint>>
async function site_main_async(): Awaitable<noreturn> {
$request = Usox\HackTTP\createServerRequestFromGlobals();
\var_dump($request->getUri()->getHost());
exit(0);
}
$ curl -H "Host: docs.hhvm.com" http://localhost:8080
string(0) ""
$ curl http://localhost:8080
string(0) ""
e.g. an equivalent to (new Zend\Diactaros\Response\SapiEmitter())->emit($response);
We need to check whether the current header handling complies with the rules provided by the interfaces (normalization and such)
ServerRequest is currently untested due to some open issues on the interface side. Those issues are withdrawn (for now), so we can finalize ServerRequest
AIUI once that's done, this is ready to use for the brave :)
This has an \HH\Asio\join()
, which is unsafe; https://github.com/hhvm/hsl-experimental/pull/127/files#diff-580930ba292ece1b544999243167b56dR213 is an example of how this can stall forever (as well as being bad for performance)
It's nice to have unittests, but we really need some integration-tests, too... But wait until #6 is finished
I've already added some code regarding a potential UriInterface change in hhvm/hack-http-request-response-interfaces#12. Not sure if this will be accepted, so I guess there will be more work todo...
a5ba0a2 is needed; HHVM 4.109 includes has the HSL built-in, including the change that led to that commit.
Currently, there is only UploadedStream
. So we need at least an UploadedFile
version to deal with files which have been uploaded
- maybe more to come...
I expected to be passing in a handle
this issue is encountered with $_FILES
and $_COOKIE
reproduce :
$_FILES
:
$_FILES = [
'slide-shows' => [
'tmp_name' => [
// Note: Nesting *under* tmp_name/etc
0 => ['slides' => [0 => __FILE__, 1 => __FILE__]],
],
'error' => [0 => ['slides' => [0 => 0, 1 => 0]]],
'name' => [0 => ['slides' => [0 => 'foo.txt', 1 => 'bar.txt']]],
'size' => [0 => ['slides' => [0 => 123, 1 => 200]]],
'type' => [0 => ['slides' => [0 => 'text/plain', 1 => 'text/plain']]],
],
];
$_COOKIE
:
$_COOKIE = [
'foo' => ['bar', 'bar' => 'baz', 'qux' => 'dux'],
'bar' => ['bar' => ['baz' => ['qux' => 'dux']]]
];
Waiting for hhvm/hack-http-request-response-interfaces#13 to be resolved...
Currently, the -dev dependencies are effectively non-dev dependencies in the typechecker.
Can be worked around with ignored_paths, but should ideally be ignored.
$ hh_client
vendor/usox/hackttp/tests/RequestFactoryTest.hh:15:12,15: Unbound name (typing): Usox\HackMock\mock (Typing[4107])
vendor/usox/hackttp/tests/RequestFactoryTest.hh:15:12,15: Unbound name: Usox\HackMock\mock (a global constant) (Naming[2049])
vendor/usox/hackttp/tests/RequestFactoryTest.hh:15:12,15: Unbound name: Usox\HackMock\mock (a global function) (Naming[2049])
vendor/usox/hackttp/tests/RequestFactoryTest.hh:17:5,12: Unbound name (typing): Usox\HackMock\prospect (Typing[4107])
vendor/usox/hackttp/tests/RequestFactoryTest.hh:17:5,12: Unbound name: Usox\HackMock\prospect (a global constant) (Naming[2049])
vendor/usox/hackttp/tests/RequestFactoryTest.hh:17:5,12: Unbound name: Usox\HackMock\prospect (a global function) (Naming[2049])
For example, https://github.com/hhvm/hsl/blob/master/.gitattributes
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.