Download the PHP package elephox/miniphox-framework without Composer
On this page you can find all versions of the php package elephox/miniphox-framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elephox/miniphox-framework
More information about elephox/miniphox-framework
Files in elephox/miniphox-framework
Package miniphox-framework
Short Description A minimal API framework based on Elephox.
License MIT
Informations about the package miniphox-framework
Miniphox
TL;DR:
Then:
Done.
Miniphox explained as fast as possible
- React HTTP server backbone (multi-threaded PHP socket server)
- Elephox/DI dependency injection
- Approachable router using PHP Attributes
- Best for (small) API projects
- Fast to production with minimal effort
Show me some code already
hello-world.php
The example above is the simplest way to use Miniphox. Just some straightforward route handlers with little to no logic and one line to run everything.
A more sophisticated example might use dependency injection to inject a database connection or logger into the route handler:
counter.php
You can find both of these examples in the folder example
.
Along with them is a showcase.php
file, which contains some advanced examples.
The ugly part
This project is still in its infant state, and it might stay that way. There are some things left to do, namely improving the routers capabilities, and I don't know when or how much time I'm going to invest going forward. It is a toy project after all.
Some things left TODO include:
- [ ] check if multiple dynamic routes exist and determine best fit
- [ ] regex patterns in route parameters
- [ ] check how to improve performance even further (is it possible to leverage opcache?)
- [ ] write up some tutorials on how to set up Doctrine and other common software stacks (phpdotenv using Elephox/Configuration?)
- [x]
Improve the way server timings are logged (maybe also look into how to send headers while processing the request with ReactPHP) - [x]
Add file watching and auto-restarting server - [ ] MAYBE: refactor Miniphox to be server-agnostic (exchange ReactPHP with other servers like OpenSwoole, Amphp?)
All versions of miniphox-framework with dependencies
elephox/framework Version dev-develop
react/http Version ^1.8
ricardoboss/php-console-logger Version ^2.4
psr/http-server-handler Version ^1.0
fruitcake/php-cors Version dev-feature/psr-7-rewrite
psr/http-server-middleware Version ^1.0