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

Handle community packs #54

Closed
SimonMellerin opened this issue Nov 21, 2023 · 1 comment · Fixed by #57
Closed

Handle community packs #54

SimonMellerin opened this issue Nov 21, 2023 · 1 comment · Fixed by #57
Labels

Comments

@SimonMellerin
Copy link
Member

SimonMellerin commented Nov 21, 2023

The idea is to let people create their own packs of anonymizers and to distribute them via composer/packagist.

First, we will assume that each one of these packs will be created from a given template (provided by us).

This template will bootstrap a compose.json that will define a specific type : db-tools-bundle-pack

Then, the DbToolsBundle should be able to find these packs and to configure himself to use them. This will be done with a command : db-tools:discover-pack.

This command will scan each package in the vendor directory to find those with type db-tools-bundle-pack. Then it will add paths to the src directory of these packs to the anonymizer_paths configuration.

In order to avoid to interfere with user defined configurations, configuration declared by this command will be add to a config/db_tools_pack.yaml file.

In a second time, the idea is to use a Symfony Recipe to add this command to be launched automatically by composer.

@SimonMellerin
Copy link
Member Author

Finally, for now, we will locate pack directly in src/Anonymization/Anonymizer/AnonymizerRegistry.php at runtine.

This will be much more simple, we won't need Symfony recipe or a specific command for that.

Ideally, this routine should be cached and initialize at warmup (see #26) and not at runetime. But, it's not such a big deal for now: this service AnonymizerRegistry will only be constructed while using one of the commands provided by this bundle.

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

Successfully merging a pull request may close this issue.

1 participant