-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
[icons] Dispatch an event during ux:icons:lock #2365
Comments
If you already have a way to list all of your icons, right now the best method would be to import them just before the lock with some PhpSubProccess? I've updated its code the other day and it now downloads up to 60 icons at once (if they have common iconset), this should be very quick. |
I'm not following. I have my icons sprinkled about, in twig, in yaml, in php, in attributes, and maybe someday in the database. They work in dev, but not in prod (because of the very slick fetching). I'm not familiar with PhpSubProccesses. Obviously, I could copy the lock command and tweak it for my purposes. But it seems ripe for extending, right now it's pretty much a regex in the twig file. Which pretty much finds anything with a colon in a string:
Can you point me to what you mean by a PhpSubProccess? |
Of course! Here is the documentation related to your need: Executing a PHP Child Process with the Same Configuration Let's say your icons are $childProcess = new PhpSubprocess(['bin/console', 'ux:icons:import', ['a:foo', 'b:bar', 'b:foobar']);
$childProcess->run(); This will run the import command in the same configuration / environment that your code is, and will allow you to use the UX Icons import command ! Finally, if you have a fixed list of icons, the best method is probably to commit them in the repository :) |
I'm using knp_dictionary to define icons by class:
These work as expected in dev, as the ux_icon renderer fetches the icon on demand. I'd like to import them to production during the lock
Of course, it doesn't now. My idea for implementation is dispatching an event that I could listen for and add the icons based on how I store them. For example, I recently discovered https://github.com/zenstruck/class-metadata and considered putting my icons there instead, e.g.
In one project I have the icons as twig globals in twig.yaml.
In short, I'd like a way to register variable icons to make the discoverable during the lock command.
The text was updated successfully, but these errors were encountered: