Skip to content

Conversation

@shyim
Copy link
Contributor

@shyim shyim commented Nov 22, 2018

Why?

Other Plugins (in my case Shopware Plugin) can extend the parameters using the Extension Hookpoint.
The most code is copied from ServiceCollector extensionPoint

Example

image

public class DefaultServiceParameterCollector implements ServiceParameterCollector { @Override public void collectIds(@NotNull ServiceParameterCollectorParameter.Id parameter) { parameter.add(new ContainerParameter("kernel.foo", "YAY", true)); } }
@Haehnchen
Copy link
Owner

how do you want to fill the parameters inside the shopware plugin? do you have a static list?
its just because of the "high traffic" of this method.

@Haehnchen Haehnchen merged commit 05256a2 into Haehnchen:master Nov 22, 2018
@shyim
Copy link
Contributor Author

shyim commented Nov 22, 2018

My current idea is to build a index and them like here

for (Map.Entry<String, List<String>> entry : FileIndexCaches.getStringDataCache(project, SERVICE_PARAMETER_INDEX, SERVICE_PARAMETER_INDEX_NAMES, ContainerParameterStubIndex.KEY, ServiceIndexUtil.getRestrictedFileTypesScope(project)).entrySet()) {

So i have to look how to create a index 🙈

@shyim shyim deleted the service-parameter-collector-point branch November 22, 2018 20:55
@cedricziel
Copy link
Contributor

You dont need an index at all costs; I suggest you also look into cachedValues. :)

@shyim
Copy link
Contributor Author

shyim commented Nov 22, 2018

Hey @cedricziel,

have you a example for me how that would look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants