Skip to content
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

[ResourceBundle] added the ability to configure services, forms, twig extensions, validations and mapping using yml or xml files (or both) #2092

Merged
merged 3 commits into from
Nov 8, 2014

Conversation

gperdomor
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? no
Fixed tickets #2091
License MIT
Doc PR #2091

I don't know why this bundle uses XML files for configuration and mapping, but personally i like more work with YAML files, is more simple for me.

With this changes, if someone want to configure the mapping of a bundle using YAML files, only have to change the mappingFormat variable value to 'yml' on the bundle class. To use YAML for the configuration files (services, form, twig, etc) only have to change the configFormat variable value to 'yml' on the bundle extension.

Also mixed scenarios are possible (mapping in XML and config/services files in YAML or viceversa).

@stloyd
Copy link
Contributor

stloyd commented Nov 1, 2014

@gperdomor In overall looks good, but there are issues in related bundles, i.e. in CoreBundle we have additional configs loaded in case of settings being enabled (emails) and there are typehits to the old xml loader, so you need to look at those cases too and adjust them to cover this replacement.

@gperdomor
Copy link
Contributor Author

@stloyd done. I checked the others bundles and only CoreBundle was affected.

@arnolanglade
Copy link
Contributor

It looks correct and I like it !

sprintf('%s.driver.%s', $this->getBundlePrefix(), $driver)
));
if ($this->mappingFormat === self::MAPPING_XML) {
if (class_exists($mappingsPassClassName)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would move this check as before instead of duplicating it:

if (class_exists($mappingsPassClassName)) {
    if (self::MAPPING_XML === $this->mappingFormat) {
    } else {
    }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stloyd you're right!

@stloyd
Copy link
Contributor

stloyd commented Nov 3, 2014

@pjedrzejewski any feedback?

@gperdomor
Copy link
Contributor Author

@stloyd you're right, i will wait the @pjedrzejewski feedback for make the adjustments and do only one commit

@stloyd
Copy link
Contributor

stloyd commented Nov 4, 2014

@pjedrzejewski 👍 for merge!

@gperdomor
Copy link
Contributor Author

@pjedrzejewski any feedback?

@liverbool
Copy link
Contributor

👍

pjedrzejewski pushed a commit that referenced this pull request Nov 8, 2014
[ResourceBundle]  added the ability to configure services, forms, twig extensions, validations and mapping using yml or xml files (or both)
@pjedrzejewski pjedrzejewski merged commit a162e8a into Sylius:master Nov 8, 2014
@pjedrzejewski
Copy link
Member

My feedback is merge! 👍

@pjedrzejewski
Copy link
Member

Thanks @gperdomor!

@gperdomor
Copy link
Contributor Author

Thanks to you @pjedrzejewski for this amazing project 👍

pamil pushed a commit to pamil/Sylius that referenced this pull request May 7, 2019
[ResourceBundle]  added the ability to configure services, forms, twig extensions, validations and mapping using yml or xml files (or both)
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.

None yet

5 participants