Coder Social home page Coder Social logo

zaphyr-org / router Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 76 KB

Robust PSR-7 router supporting attribute-based routing, complete with PSR-15 middleware and PSR-11 container support, all built upon the foundation of FastRoute.

Home Page: https://zaphyr.org/docs/1.x/repositories/router

License: MIT License

PHP 100.00%
fast-route psr-11 psr-15 psr-7 router routing

router's People

Contributors

merloxx avatar

Watchers

 avatar

router's Issues

Move route condition handling

The route condition handling must be moved from the Zaphyr\Router\Router class to the Zaphyr\Router\Dispatcher class. Otherwise, all routes called after a failed route would result in a 404 error.

RouteCondition scheme and host does not match

The scheme and host paremeter in the Zaphyr\Router\Traits\RouteConditionTrait must return null by default. Otherwise, PSR7 libraries may not work correct with the router repository.

For example, a $request->getUri()->getScheme() method may not return an empty string by default, but fetch the scheme from the $_SERVER globals. In this case a Zaphyr\Router\Exceptions\NotFoundException would be thrown, because the Zaphyr\Router\Traits\RouteCondition::getScheme() method returns an empty string by default.

Therefore the scheme and host parameters in the Zaphyr\Router\Traits\RouteConditionTrait must be set to null by default and a query may only take place if these parameters are not null.

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.