Map an http method and a URI expression to a callable:
Router::add(method, urix, callable)
Router::get(urix, callable)
Router::post(...)
// etc for http methods
And then match a URI to a registered route:
Router::match(uri) : Route
Middleware is a totally separate thing and I think it's weird to put it here. Especially since middleware can do routing for you, no need for a separate step.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAJp_myW7zjLEFRhaNg4Qtz9gLFf4JWpfXwZcK2wszLCuiKS3Rw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
I wasn't implying it should be static, just stating naming. I think I agree with you about the first two interfaces. What is the purpose of RouteMatcherInterface?
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/2d837646-e3bd-4735-b8ce-ac269bbca9a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscribe@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/f4d330d6-d864-44a7-8409-d0ae2739b3c4%40googlegroups.com.
On 18 Nov 2016, at 06:27, Hari K T <ktha...@gmail.com> wrote:I believe , we should allow Router to do one thing, finding / matching the route, generating the route.
--
You received this message because you are subscribed to a topic in the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/php-fig/Fj0QoGB1xLU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/A8BB6ABD-75E9-4678-9180-F6EE02FA2A4E%40gmail.com.
Hello everyone,
I have been waiting to announce this until after I finish with PSR16, but there's no time like the present.
I have been working on the routing PSR for some time now, given my passion and experience at integrating 5 different routers into PPI Framework Engine.
I have spoke with a few others about this over the past while i.e: MWOP and others.
I would be happy to push forward this PSR, by way of Editor, by partnering up with someone (MWOP?), since we both have the experience at building routing interop engines.
On the basis that someone is willing to sponsor me.
What do we say, is it time to release the cracken ?
Many thanks,
Paul
What do you think about an interface that will be used by RouterInterface for dispatch an event using a specific method?
In this way the dispatching implementation will be bounded inside a single RouterInterface (so we could imagine different RouterInterfaces and everyone will have a RouterDispatcherInterface implemented).
It's ok to put the dispatching is somewhere else on the implementation level, but i would like to put it inside to PSR.
On Fri, Nov 18, 2016 at 7:06 AM Benni Mack <benjam...@gmail.com> wrote:
Hey Hari,On 18 Nov 2016, at 06:27, Hari K T <ktha...@gmail.com> wrote:I believe , we should allow Router to do one thing, finding / matching the route, generating the route.--Well, I think it should exactly do one thing - namely finding/match the route. The generation is IMHO separate, and belongs to a route generator or even URI/URL generator.I agree, dispatching is somewhere else on the implementation level...Best,Benni.-- TYPO3 Core Team LeaderSupport the project: http://typo3.org/donate/
You received this message because you are subscribed to a topic in the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/php-fig/Fj0QoGB1xLU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to php-fig+unsubscribe@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/A8BB6ABD-75E9-4678-9180-F6EE02FA2A4E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscribe@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAOOfSh5-QJYg%3D77HVqDT5pHo5tuymc3vAsKrQm93SW%3DqKMMzYQ%40mail.gmail.com.
It seems like the people are ready for it.
To unsubscribe from this group and all its topics, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/A8BB6ABD-75E9-4678-9180-F6EE02FA2A4E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAOOfSh5-QJYg%3D77HVqDT5pHo5tuymc3vAsKrQm93SW%3DqKMMzYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAKxcST9KiOSi1auXTNgxxU5mP1-_X4Rr4xEfwQC4UgZcrnpaBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAKxcST9KiOSi1auXTNgxxU5mP1-_X4Rr4xEfwQC4UgZcrnpaBA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAGOJM6KzoEZtcCems%3Dh9GVFCRNQtFVc%2BiVW3Kk70ziEWkijOYw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscribe@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/94ac60a2-02ce-8332-5778-59f0011c8c20%40garfieldtech.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAGOJM6%2BXGKXqpzHy1Z%3D45QmyuhCbcHkt%3DFQ5HzCKy3Ui09ER7A%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/94ac60a2-02ce-8332-5778-59f0011c8c20%40garfieldtech.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/php-fig/Fj0QoGB1xLU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/0f2fb424-4d52-4e12-864f-fb039174a2e1%40googlegroups.com.
To unsubscribe from this group and all its topics, send an email to php-fig+unsubscribe@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/0f2fb424-4d52-4e12-864f-fb039174a2e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/php-fig/Fj0QoGB1xLU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to php-fig+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAOOfSh7saK3zmOF2ne1NOApnGD7sTC9puaO6WUHKhFqArPg7Ww%40mail.gmail.com.
> So, for you, any PSR is wrong?
I have been pretty heavily invested in the development of PSR-5 and PSR-15, and I rely on PSR-7 and others in my work every day.
So no.
If you're trying to dismiss my opinion without actually debating any of the points I made, that's not the way to go about it.
PSR standards, in my view, are about making things interoperable - not about reducing every domain entity to a lowest common denominator.
To give you a few practical examples, the cache PSRs do not specify how a cache is implemented or configured, only how it's consumed. The middleware PSR does not specify how middleware is implemented or how the components get created, only how they're dispatched. The logger PSR does not concern itself with how loggers are implemented, routed, configured, created, etc. - only how the logger works once it's created, configured and ready to use.
If a router PSR defines how routers are configured as well as how they're consumed, how is it you think any logger will be able to differ from another, in the way it's configured, the features it offers, or anything else that makes one logger conceptually or feature-wise different from any other logger?
If you standardize router configuration, you've standardized the actual feature-set. There will be no practical reason (beyond performance) to choose any one specific implementation over another - they will all do precisely the same thing.
The same is not true for things like logging frameworks, cache back-ends or middleware.
Reducing all practical use of all routers to a lowest common denominator is meaningless. If you do that, you only need one router, the fastest one - it doesn't matter if they have different routing-configuration features beyond the standardized feature-set, you won't be able to use them.
Being able to dispatch a router without knowing how it was configured or created is, yes, important - but the same is true for lots of other components which take a request and produce a response, and middleware already takes care of that.
So I genuinely don't understand what it is you're trying to accomplish.
In my honest opinion, it sounds like a solution looking for a problem.
Any news Paul?
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscribe@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/d90b3d4e-910f-4c3b-a051-ab423f00d400%40googlegroups.com.
$router->get('uri', callable)
$router->post(...)
$router->match($request)