Initialy, I have to say I preffer xml configuration over yaml, that is why 
I'm writing this post. IMHO current implementation has few flaws I want to 
share.

1. XSD Schema validation.
Despite that every XSD file is accesible locally, its filepath is computed 
only when external XSD is definied in xsi:schemaLocation. It means when no 
schemaLocation is definied for extension ns than no XSD validation against 
that namespace occures.
Also this whole filepath computation is kind of magic (especially when those 
files are right there.. just waiting), which Symfony tries to avoid, right? 
What if dev is using IDEs XML catalog, pointing at local files? 
xsi:schemaLocation is somehow redundant.

Why not create more explicit Extension::getXsdFilePath()? Extensions could 
even drop getNamespace() method and pull ns from XSD file.

2. Namespaces in ContainerBuilder.
It is possible now to get extension by its namespace, but... don't you think 
namespaces don't belong there as they're only used by XmlConfigLoader?
I think moving code responsible for extension lookup (by its namespace) to 
loader, would add more clarity (also introducing few loops, but since 
configuration files are compiled its not a big deal).

I wrote some code, which you can find 
here:https://github.com/alanbem/symfony/tree/xml-config-improvements

P.S. Do you know that yaml configuration below is perfectly valid?

# config.yml
'http://symfony.com/schema/dic/symfony':
    secret:        %secret%
    charset:       UTF-8
    csrf_protection:
        enabled: true
    router:        { resource: "%kernel.root_dir%/config/routing.yml" }
    validation:    { enabled: true, annotations: true }
    templating:    { engines: ['twig'] } #assets_version: SomeVersionScheme
    session:
        default_locale: %locale%
        lifetime:       3600
        auto_start:     true

-- 
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

Reply via email to