Development

#3424 ([PATCH] split parse method of SfPatternRouting)

You must first sign up to be able to contribute.

Ticket #3424 (closed enhancement: fixed)

Opened 7 months ago

Last modified 7 months ago

[PATCH] split parse method of SfPatternRouting

Reported by: FabianLange Assigned to: FabianLange
Priority: minor Milestone: 1.1.0 RC1
Component: routing Version: 1.1.0 BETA4
Keywords: Cc:
Qualification: Design decision

Description

The current parse method of SfPatternRouting? has side effects on the internal state of routing. It is currently impossible to just get information about a possible match. Use case: I have a intelligent linker that makes http://localhost/module/action to "Click here for Action in Module"

Attached patch introduces a "findRoute" method that does this. it returns all needed information in an array. Additionally it fixes the bug mentioned in #3423

Attachments

sfPatternRouting.class.patch (2.6 kB) - added by FabianLange on 04/28/08 11:09:34.
introduces findRoute method. Existing unit tests pass. Updated with fixing #3423

Change History

04/28/08 11:09:34 changed by FabianLange

  • attachment sfPatternRouting.class.patch added.

introduces findRoute method. Existing unit tests pass. Updated with fixing #3423

05/05/08 10:01:57 changed by fabien

  • milestone set to 1.1.0 RC1.

05/06/08 14:53:33 changed by FabianLange

  • owner changed from fabien to FabianLange.
  • status changed from new to assigned.

05/06/08 15:52:58 changed by FabianLange

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [8806]) split sfPatternRouting::parse into two methods to allow side-effect free retrieval of route that might match a url. Useful for link rewriting that might want to check if a link will match an internal route, without actually "switching" there. Added PHPdoc for the new sfPatternRouting::findRoute(). Updated PHPdoc on sfRouting::parse, mentioning that this does modify internal state. Added unit tests to show issue of #3423. no separate tests for findRoute() needed as its implicitly tested by parse() tests. Added test to ensure that it is side effect free. Closes #3423, #3424