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

Allow other plugins to extend container parameters #1259

Merged
merged 1 commit into from
Nov 22, 2018
Merged

Allow other plugins to extend container parameters #1259

merged 1 commit into from
Nov 22, 2018

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?

@cedricziel
Copy link
Contributor

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

Successfully merging this pull request may close these issues.

3 participants