Skip to content

[FrameworkBundle] Added configuration for additionnal request formats #8944

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

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[FrameworkBundle] Added request tag inside FrameworkBundle xsd
  • Loading branch information
gquemener committed Sep 6, 2013
commit f92b1885f6a8839b9bad69788d64b743ad16ad46
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ private function addRequestSection(ArrayNodeDefinition $rootNode)
->arrayNode('request')
->info('request configuration')
->canBeUnset()
->fixXmlConfig('additionnal_format')
->fixXmlConfig('additional-format')
Copy link
Member

Choose a reason for hiding this comment

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

I think this should use an underscore as the transformation of dashes to underscores is handled by the Config component, and IIRC it happens before processing this

->children()
Copy link
Member

Choose a reason for hiding this comment

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

You are missing the ->fixXmlConfig('additional_format') call to make the prototyped node work properly for XML configs

->arrayNode('additional_formats')
->prototype('array')
Copy link
Member

Choose a reason for hiding this comment

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

you are missing useAttributeAsKey to make it an associative array

Copy link
Member

Choose a reason for hiding this comment

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

you are still missing the call to useAttributeAsKey. Please add a test using this feature in different formats to see that it is broken currently

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok thanks, will do soon

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<xsd:element name="fragments" type="fragments" minOccurs="0" maxOccurs="1" />
<xsd:element name="profiler" type="profiler" minOccurs="0" maxOccurs="1" />
<xsd:element name="router" type="router" minOccurs="0" maxOccurs="1" />
<xsd:element name="request" type="request" minOccurs="0" maxOccurs="1" />
<xsd:element name="session" type="session" minOccurs="0" maxOccurs="1" />
<xsd:element name="templating" type="templating" minOccurs="0" maxOccurs="1" />
<xsd:element name="translator" type="translator" minOccurs="0" maxOccurs="1" />
Expand Down Expand Up @@ -93,6 +94,19 @@
<xsd:attribute name="save-path" type="xsd:string" />
</xsd:complexType>

<xsd:complexType name="request">
<xsd:sequence>
<xsd:element name="additional-format" type="additional-format" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="additional-format">
<xsd:all>
<xsd:element name="mime-type" type="xsd:string" minOccurs="1" maxOccurs="unbounded" />
</xsd:all>
<xsd:attribute name="name" type="xsd:string" />
Copy link
Member

Choose a reason for hiding this comment

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

you should mark this attribute as required as we use it as key

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok thanks I'll fix it.

I'm still having issue finding the correct way to support https://github.com/symfony/symfony/pull/8944/files#L11R131 using xml.

@docteurklein rose up the fact that it might not be possible (gquemener@b41388e#commitcomment-4065417), but the FrameworkExtensionTest architecture suggest that all configuration format should behave identically. Is it okay if it's not the case?

I mean, is it ok if it's not possible to define multiple mime-types for a given format when using xml?

</xsd:complexType>

<xsd:complexType name="templating">
<xsd:sequence>
<xsd:element name="loader" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy