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

Symfony-Flex recipe #40

Open
ckrack opened this issue Sep 7, 2018 · 3 comments
Open

Symfony-Flex recipe #40

ckrack opened this issue Sep 7, 2018 · 3 comments

Comments

@ckrack
Copy link
Contributor

ckrack commented Sep 7, 2018

Hi!

I like to use Optimus as an easy way to obfuscate Ids.
I don't like to configure it every time.

It would be great to have a Symfony-Flex recipe that would provide an autowireable service with pre-configured random values. A ParamConverter could also be provided by the recipe.

@jenssegers
Copy link
Owner

Would be nice if someone could add some symfony documentation in the readme. I'm really familiar with flex recipes.

@ckrack
Copy link
Contributor Author

ckrack commented May 21, 2020

Hi Jens, I have this on my todo list.
Will add a flex recipe and update the docs with a link.

@ckrack
Copy link
Contributor Author

ckrack commented May 26, 2020

Hi @jenssegers, I've extracted my paramconverter and twig extension into ckrack/optimus-bundle.
A flex-recipe is underway as a PR to recipes-contrib.

There might be some changes to the recipe.
Actually, to enable the service for the main optimus class, we need to have working parameters for it in place. Otherwise the installation of the bundle will fail due to the exception thrown during Optimus instantiation.
I chose to use the lowest prime possible (3) and to describe the setup in readme and post-install.txt.
If you prefer, we could change this to use the values from the examples in the readme of this repo, but they actually mismatch (i tried using them in the tests).

There is no such thing as a post-install-hook for recipes in Symfony, so adding good spark numbers must be done by hand.
There's one way to accomplish something similar, but i'm not sure this should be used.
Flex recipes can add scripts to auto-scripts that are run after every composer update/install.
I could add a command that replaces the default values in the env or config by values generated by Energon. Replacing them means that this will only be applied once and will only replace the weak defaults. The script will always run, though.
This should probably be discussed in the PR of the recipe though.

For Symfony 5 compatibility, It'd be great if you can tag a new release containing the Command return fix.

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

No branches or pull requests

2 participants