I would vote for XML or, slightly less so, YAML. Regarding documentation, YAML is certainly the most concise to present, and I think we should borrow a page from Doctrine's API docs, where many of the inline examples use YAML, but they have sections devoted to each configuration format (XML, PHP, etc.). I would suggest not using PHP for reasons similar to the other ongoing conversation over the templating engine. XML/YAML each serve a specific purpose of defining configurations (or fixture data), just as Twig does for templating. PHP's lack of a sandbox can be a double-edged sword and promote abuse. The default, in my opinion, should be all about best practices.
I personally prefer XML for form validation and dependency-injection/service definitions, and YAML for application configs. Unfortunately, I assume we need a unified standard for everything, right? :) I definitely see XML as having a larger barrier of entry (especially if we require XSD's for authors that want their bundles to be officially approved), but there are obvious benefits with there being no ambiguity with respect to syntax (and easy validation). It's also quite a bit more self-documenting than free-form YAML, even if it's verbosity requires more effort to write initially. On Fri, Sep 24, 2010 at 1:07 PM, Fabien Potencier < [email protected]> wrote: > Hi all, > > Symfony2 supports many different formats for its configuration files. By > default, we support XML, YAML, INI, PHP, and Annotations. That's great as it > demonstrates the flexibility of the framework, but we need to choose one > "default" format (the recommend one in the documentation and the one that > bundles should use). > > Right now, the recommended one is XML (but we show YAML by default in the > documentation because it is more concise). But I'm wondering if we should > switch to PHP instead. > > Here is my reasoning: > > * YAML: Even if this is the more readable and simple format, it cannot be > used for the default because it needs a YAML parser and also because it is > really difficult to debug problems in a YAML file (missing :, tabs, wrong > indentation, ...). > > * INI and Annotations: They cannot be used for the default as they are not > suitable for all configurations. > > * XML: Great because you have validation, auto-completion, and > documentation (with XSD) but many people don't like to use XML (verbose, > feels like Java, ...). > > * PHP: Great as there is nothing new to learn. The only drawback I see is > that PHP being dynamic by nature, people can do weird thing in the > configuration files (for instance, changing a configuration setting based on > the current time; and that won't work because the configuration is cached in > a static form). > > What do you think? > > Fabien > > -- > Fabien Potencier > Sensio CEO - symfony lead developer > sensiolabs.com | symfony-project.org | fabien.potencier.org > Tél: +33 1 40 99 80 80 > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<symfony-devs%[email protected]> > For more options, visit this group at > http://groups.google.com/group/symfony-devs?hl=en > -- jeremy mikola -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en
