terminal42 / contao-url-rewrite

Provides a back end module in Contao that allows you to specify url rewrites that are added to the Symfony Route collection
MIT License
15 stars 4 forks source link

[RTM] Config providers #3

Closed qzminski closed 6 years ago

qzminski commented 7 years ago
qzminski commented 7 years ago

Hey @Toflar you can check the concept already. I will add the unit tests after your confirmation.

One thing to discuss: should we disable the database config provider if backend_management is set to false? During my tests I have temporarily disabled the backend management but still had entries in the database and they were added to the routing configuration.

Toflar commented 7 years ago

One thing to discuss: should we disable the database config provider if backend_management is set to false?

I think the other way around. Only add it to the chain provider if it is enabled :) You can even optimize the compiler pass in such a way that it only uses the chain provider if there are more than one providers 😎

qzminski commented 7 years ago

I think the other way around. Only add it to the chain provider if it is enabled :)

But technically, how to do it? Should we introduce some isActive() method for the config providers or just hardcode that requirements in the compiler pass?

Toflar commented 7 years ago

Hardcode, that's what compiler passes are here for. If I want to add another conditional config provider I can only tag it in my extension if my own conditions are met :)

Toflar commented 6 years ago

Looks good to me now, excellent! Ready for unit tests and docs 👍

qzminski commented 6 years ago

@Toflar all done here. Shall I merge it as 1.1?

Toflar commented 6 years ago

Perfect, go ahead! Excellent work 👍