Skip to content

Add some xml and php formats #2076

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

Merged
merged 1 commit into from
Feb 14, 2013
Merged

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Dec 30, 2012

This PR added XML formats in the reference/configuration section for the AsseticBundle, WebProfilerBundle and SwiftMailerBundle. It also adds the XML and PHP formats for the Min constraint.

It's my first time that I use xml or PHP for configuration, so I'm not sure about all of them. Please check the examples before merging.

I don't know the schema location and how this should be registered, this should be added before merging.

If this PR is correct and gets merged, I will create the other missing formats in the reference section too.

<!-- src/Acme/EventBundle/Resources/config/validation.yml -->
<class name="Acme\EventBundle\Entity\Participant">
<property name="age">
<constraint name="Max">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why Max ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woeps, I used the XML example in Max as an example, I will change it to Min.

@weaverryan
Copy link
Member

Hi @wouterj!

Personally - but I'd like to know what others think - I'm ok with only having YAML in the /reference/configuration sections. The YAML is generated automatically for us using the config:dump-reference command, then we tweak it from there. We really did YAML initially, just be cause it's so easy. What we really need in these sections is a description of the different configuration options, since right now we just have the big dump. If some sub-options are more complex, we could add the XML+PHP formats for those individual option descriptions.

I like the 3 formats everywhere else, but not in the framework, assetic, twig, etc keys in /reference/configuration.

Thanks!

@wouterj
Copy link
Member Author

wouterj commented Jan 3, 2013

@weaverryan, I don't understand why you don't want the XML and PHP formats here. We have talked about every part of these configuration files in the documentation. We have used the 3 formats there, why shouldn't we use them when we show the complete configuration?

@weaverryan
Copy link
Member

@wouterj I still feel mixed about the value of this - it would be great to have more formats, but since we're missing actual descriptions of the configuration options, it feels like we're not spending our time in the right place. I would much rather have reference configuration that describes these options and only shows one big YAML tree than no descriptions (as it is now), but with XML and PHP examples. The big YAML tree was almost more of a temporary fix until we actually found more time to document the individual options. In a perfect world, I think we might not have any big tree, but rather the keys themselves are all documented, and an example of how you configure that one option is provided in YAML, PHP and XML when describing that one option.

I think this could be a perfect thing for us to push on when we have the hack-day: so many options are very accessible. So my opinion is that we should push in that direction, and hopefully render the big tree either completely unnecessary (and remove it), or a no-longer-very-important extra reference down at the bottom of each page (in just YAML for now).

What do you (or anyone else) think?

@wouterj
Copy link
Member Author

wouterj commented Jan 27, 2013

Hi @weaverryan!

Well, I agree with you, but I think we should merge this and then split it into multiple configuration formats. In the ideally world, we would have each option described like the form reference, but before we get their we should make the quick fix ready for that great shift.
People who are documentating new features can use these references as an example for their configuration, that means we need less reviewing time for PRs.
And as far as I know, people aren't happy with the formats in the documentation. They think Xml is not very good documented.
And at last, I've already put some time (not much though) into converting these configuration. We can't get that time back. When we only have a Yaml configuration, we need to do this work again but then for each small part of the configuration. For me, that looks like doing something twice...

@wouterj
Copy link
Member Author

wouterj commented Feb 5, 2013

Update: I removed the constraint formats from this PR and added those to #2214

weaverryan added a commit that referenced this pull request Feb 14, 2013
@weaverryan weaverryan merged commit f7037b7 into symfony:2.0 Feb 14, 2013
@weaverryan
Copy link
Member

I've merged this in. I want to focus efforts on expanding the documentation in these areas over covering what the other formats look like, but we can also try keeping these other formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants