swarrot / SwarrotBundle

A symfony bundle for swarrot integration
MIT License
89 stars 59 forks source link

add processor stack under consumers key #64

Closed metfan closed 8 years ago

metfan commented 9 years ago

This Pr add processors_stack definition for each consumer. I added exclusive_processor_stack key to choose if I merge specific stack with the global stask or not.

stof commented 9 years ago

Please revert the permission changes on these files as they have no reason to be executable

metfan commented 9 years ago

I made change in config about pluralize of processor_stack. I renamed it stacked_processor(s). All work good, but it's a BC breaks with existing configuration.

odolbeau commented 9 years ago

@stof We talked together regarding a solution to deprecate this option. Do you have an example of how to achieve this in this case? Thanks in advance. :)

stof commented 9 years ago

permission changes should be reverted. The Configuration.php file has no reason to be an executable file.

stof commented 9 years ago

@odolbeau We would need to use something like that (on the parent node, i.e. near the fixXmlConfig calls):

// BC layer for PHP and Yaml files
->beforeNormalization()
    ->ifTrue(function ($v) { return isset($v['processors']) && !isset($v['stacked_processors']); })
    ->then(function ($v) {
        $v['stacked_processors'] = $v['processors'];
        unset($v['processors']);

        return $v;
    })
->end()
// BC layer for Xml files (this runs before the XML normalization, so we still have the old singular at this point)
->beforeNormalization()
    ->ifTrue(function ($v) { return isset($v['processor']) && !isset($v['stacked_processor']); })
    ->then(function ($v) {
        $v['stacked_processor'] = $v['processor'];
        unset($v['processor']);

        return $v;
    })
->end()
odolbeau commented 8 years ago

@stof: I think we also need this block, am I wrong?

// BC layer for Xml files (this runs before the XML normalization, so we still have the old singular at this point)
->beforeNormalization()
    ->ifTrue(function ($v) { return isset($v['processors_stack']) && !isset($v['stacked_processor']); })
    ->then(function ($v) {
        $v['stacked_processor'] = $v['processors_stack'];
        unset($v['processors_stack']);

        return $v;
    })
->end()

Once those 3 blocks have been added we're ready to merge right?

odolbeau commented 8 years ago

Fixed by #86