webdevlabs / phreak Goto Github PK
View Code? Open in Web Editor NEWPhreak! ultra-light fast php framework for lamez :)
License: MIT License
Phreak! ultra-light fast php framework for lamez :)
License: MIT License
I've noticed this issue when passing cached objects to anonymous functions for routing like
$router->get('/some', function () use ($someting) {});
the Stash caching library is unable to serialize() complicated Closure's in routes.
The problem is visible when we use ($something)
and if $something is a cached object inside DI Container.
Normaly we don't need to do this. We can just pass a Controller class instead of objects inside anonymous functions. This is the correct usage: $router->get('/some', ['App\Class','myMethod']);
The solution is to avoid using Closures for Routes.
This issue is described at http://php-di.org/doc/php-definitions.html as
Be also aware that it isn't possible to add definitions to a container on the fly when using a cache
Phreak! uses caching for the Router inside a Dependency Injection Container, so all routes are resolved inside the cached container.
Thats why Phreak! stands above the other frameworks in the SPEED competition.
This voids to the described issue. However it's only a problem if you want to use $container->set()
function inside your scripts.
SOLUTION: You can manualy modify and disable the Router resolver behaviour from system/RouterResolver.php
.
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.