-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[WIP] Add missing formats #2248
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
Conversation
@wouterj the difference is the way XML namespace are used. For the Note that a third way could be used: changing the main XML namespace for some elements: <container xmlns="http://symfony.com/schema/dic/services">
<parameters></parameters>
<config xmlns="http://symfony.com/schema/dic/framework">
<router resource="%kernel.root_dir%/config/routing.xml" />
</config>
</container> |
.. code-block:: php | ||
|
||
// app/config/config.php | ||
$loader->import('parameters.xml'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should also add the XML version: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We did not add XML version because previous paragraph states: "If you're not using XML".
@stof thanks for your great explaination and check! @ricardclau before I start with fixing the issues, are you already started with it? |
I was waiting for @stof to end his review, actually :) Do you need help on fixing the issues, or do you prefer to fix them all at once? |
I think it is better to fix them all in one commit. I will ping you if I need your help, thanks! |
@ricardclau I have fixed most issues, but I don't know how to solve the current open issues. |
Only thing missing is about adding namespaces on all examples or not, right? Ping @weaverryan |
Yes, there were some others when I said that, but I already managed to fix those. |
Sorry, I was having dinner, you know spanish times :) |
don't worry, you have done a lot of work already on creating code examples and pushing me to create the other ones :) |
Hi guys! Let me know when this is all ready and I'll merge it in as soon as I can to get all the nasty conflicts out of the way. I'm most definitely not an XML expert, and we obviously can't try all of these to make sure they work. But as we've neglected the XML format, I imagine that we already have many who are right in "spirit" but not actually functional The point is, do your best to review all of this and get it perfect, then let me know and I'll take a look and merge it in. Thanks! |
Basically, XML formats are ok (let's hope so :)) but some of them rely on the namespace being defined on top of the xml file, as @stof perfectly explained in his comments. So, should we add something like a proper XML root tag with all necessary namespaces in all XML examples? And also a full review should be done in all the documentation, @wouterj made a compillation of what was missing, but I don't think all XML examples have the namespaces defined. @weaverryan and other core members... what are your thoughts on this subject? |
@ricardclau be aware that I rebased the main branch ( I have done a first sketch of the doctrine format, which you can see here: wouterj#11 I will merge that soon.
Checking all XML code examples for missing namespaces and adding them isn't a big problem, but I'm in doubt if this is really usefull. People who uses XML in their configuration are mostly people who do know how to work with XML. That is, I think, a big difference with Yaml or Annotation syntaxes, which is just used by everyone because it is the default one. I think you lost to much time fixing every XML example with namespaces for the value it has to it's readers. But one thing I often hear is that XML is to less documented in Symfony2. To solve this, I think we need to write an article about the XML format, for instance in |
|
||
// app/config/config.php | ||
$container->loadFromExtension('twig', array( | ||
..., |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be // ...
@wouterj Sorry for not replying before, should I fix your 2 latest comments by a PR in your branch? |
@ricardclau well, that's just a very minor issue. I think I will rebase that fix into wouterj/symfony-docs@f51d33c |
@wouterj Did you manage to find time to do the final tweaks? I can't wait to see this merged ;) |
Fixed issues by @stof Fixed typo
@weaverryan it's ready for merging!! /cc @ricardclau |
Go go go! :) |
Merged! Thanks @wouterj, @ricardclau and @stof (for the all-important review) for your work on this issue, it was a big one! I've merged it in and made the Thanks! |
Thanks to the great work of @ricardclau, we have almost documented each format where we can in the documentation.
We just need to do the
cookbook/doctrine
chapters and we are ready for merging.Questions
While working on this, we had a discussion about the security configuration in xml. In
book/security
, we use this:But in the reference, we use this:
I think we use
config
because we put this inconfig.xml
and we usesecurity:config
because we use it in theconfig.xml
file? Can some developer explain the difference between these?Todo
cookbook/doctrine
book/doctrine
Merge instructions
You should pay attention to the routing example (in
cookbook/configuration/apache_router.rst
). Thepattern
option should be changed topath
while mering into2.2
/master
.