nigelgreenway / reactive-slim Goto Github PK
View Code? Open in Web Editor NEWA bridge to use SlimPHP within ReactPHP
License: MIT License
A bridge to use SlimPHP within ReactPHP
License: MIT License
Why reason why you use with*
instead of set*
in Server
for the setters? with*
suggests immutability to me and returning a new object.
Notice: Undefined index: Accept in ./src/Server.php on line 121
Only happens when Chrome dev tools is open (something todo with .css.map
file)
It seems like this is the better solution as it is all native to SlimPHP, but is this the right right to go, as they both use the PSR interface it should be simple to swap out and remove the non-required dependancy of Zend\Diactoros
?
$slimRequest = new Request(
$request->getMethod(),
Uri::createFromString(
$request->getPath() . '?' . http_build_query($request->getQueryParams())
),
new Headers($request->getHeaders()),
SlimCookies::parseHeader($request->getHeader('Cookie')),
[],
$stream,
[]
);
Seems like it's using php://input
as request body instead of the request body stream provided by ReactPHP. php://input
is additionally a read-only stream.
Line 87 in 701667b
Allow a config setting for what file types are allowed and not allowed to be served as assets by the server.
This will allow a debug/profile bar to be added by default.
Possibly use just the STDOUT
stream to log out events/errors?
See here about supported PHP extension's to enhance performance of the event loop within ReactPHP.
In Server::155
, echo
is being used. This should possibly be switched out with the following:
$output = sprintf(
" >> Listening on http://%s:%d\n\nIn %s environment\n\n",
$this->host,
$this->port,
ServerEnvironment::getEnvironmentName($this->environment)
);
$terminal = fopen('php://stdout', 'w');
fwrite($terminal, $output);
fclose($terminal);
This would stop having to restart manually which can be tricky when running under Docker.
... turns out it's very annoying.
Would be better to just have captainhook to install after composer install
and configure start
and build
.
Allow an asset directory to be passed through to the server to enable certain file types to be rendered and returned as the response.
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.