Git Product home page Git Product logo

phreak's People

Contributors

dependabot[bot] avatar gitter-badger avatar webdevlabs avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

phreak's Issues

Stash is unable to serialize() Closure in route

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.

DI Container unable to use set() when caching

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.