-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symfony Flex Recipe #924
Comments
Great idea, and the recipe you've submitted looks like a good starting point too (We don't want to overcomplicate/prematurely overconfigure if this is a potential entrypoint for new users!). I've posted a comment about the issue raised by the PR checker. LGTM! |
@robfrawley why copy-paste and not just include bundle routing file inside |
@Koc The original intention of using YAML in the Flex recipe was to lower the entry barrier for someone looking to, perhaps, edit the route paths; XML is generally more difficult for newcomers to follow or edit. Do we want to prioritize ease of use in the recipe or duplication removal? I don't have a hard-fast answer to that question; let's solicit some input from everyone. |
How does everyone feel about converting our XML to YAML (as proposed by Koc) so it can be easily used by the recipe in a user-friendly format, as well as used in the Flex recipe through the This question only applies to the |
@Koc Perhaps we can combine a few of your ideas to resolve this? Let's change <!-- /Resources/config/routing.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing
http://symfony.com/schema/routing/routing-1.0.xsd">
<import resource="@LiipImagineBundle/Resources/config/routing.yaml" />
</routes> # /Resources/config/routing.yaml
liip_imagine_filter:
path: '/media/cache/resolve/{filter}/{path}'
defaults:
_controller: '%liip_imagine.controller.filter_action%'
methods:
- GET
requirements:
filter: '[A-z0-9_\-]*'
path: .+
liip_imagine_filter_runtime:
path: '/media/cache/resolve/{filter}/rc/{hash}/{path}'
defaults:
_controller: '%liip_imagine.controller.filter_runtime_action%'
methods:
- GET
requirements:
filter: '[A-z0-9_\-]*'
path: .+ This will allow us to immediately benefit from the change by using the {
"bundles": {
"Liip\\ImagineBundle\\LiipImagineBundle": ["all"]
},
"copy-from-recipe": {
"etc/": "%ETC_DIR%/"
},
"copy-from-package": {
"Resources/config/routing.yaml": "%ETC_DIR%/routing/"
}
} |
@robfrawley awesome idea - with BC, thank you |
In your case, I suggest you to move your The goal here is to allow users to customize both routes prefix instead of copy/pasting code. For example, in my OrbitaleCmsBundle recipe I just copy/paste the routing proposed by the doc, but actually, the page routing file for example is very light, and has no special routing prefixes in it so the user is free to have its own. This is the most flexible way of doing things, so maybe this is a solution for your What do you think? EDIT: Bonus, I suggest you to move the |
@Pierstoval The ordering was an error on my part in the YAML variant and was fixed already when I ran the test suite against #925 (the XML was always ordered that way, I accidently reversed it). It's actually not just a performance issue, as the router requirement for As for your other implementation description, I'm not sure I quite follow what you are trying to achieve or how it should be implemented. Can you further clarify? |
Clarify about what part exactly? |
Update: we're all good with a merge from fabpot! |
I've created an initial stab at a Symfony Flex contributor recipe, which I'll be submitting. Take a look at my fork of the contributor recipe repo and the added files to support this bundle, and let me know if we should add any additional items to it.
See symfony/recipes-contrib#14 for the pull request submitted against the contributed recipe repository.
The text was updated successfully, but these errors were encountered: