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

Migrate XML to PHP configuration #1941

Closed
core23 opened this issue Mar 19, 2021 · 3 comments
Closed

Migrate XML to PHP configuration #1941

core23 opened this issue Mar 19, 2021 · 3 comments
Labels
Milestone

Comments

@core23
Copy link
Member

core23 commented Mar 19, 2021

Feature Request

Migrate all configs under: https://github.com/sonata-project/SonataMediaBundle/tree/3.x/src/Resources/config

This tool can help: https://github.com/symplify/config-transformer

Ref: #1940 (comment)

@core23 core23 added the feature label Mar 19, 2021
@wbloszyk
Copy link
Member

I mean move sonata.media.resizer.crop.class parameter into sonata_media.resizer:

private function addResizerSection(ArrayNodeDefinition $node): void
{
$node
->children()
->arrayNode('resizer')
->addDefaultsIfNotSet()
->children()
->arrayNode('simple')
->addDefaultsIfNotSet()
->children()
->scalarNode('mode')->defaultValue('inset')->end()
->end()
->end()
->arrayNode('square')
->addDefaultsIfNotSet()
->children()
->scalarNode('mode')->defaultValue('inset')->end()
->end()
->end()
->end()
->end()
->arrayNode('resizers')
->addDefaultsIfNotSet()
->children()
->scalarNode('default')->defaultValue('sonata.media.resizer.simple')->end()
->end()
->end()
->end()
;
}

Or instead class we can use service like:

sonata_media:
    resizer:
        square:
            service: sonata.media.resizer.base_square # will be alias by sonata.media.resizer.square

Anyway move config from xml to php should be also done.

@core23
Copy link
Member Author

core23 commented Mar 19, 2021

I mean move sonata.media.resizer.crop.class parameter into sonata_media.resizer:

This config keys are just for customization, which is not supported by the crop resizer.

We should remove all XXX.class parameters. This is another problem across all bundles

@wbloszyk wbloszyk added this to the 4.0 milestone Mar 25, 2021
@VincentLanglet
Copy link
Member

Closed by #1968

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants