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

Cannot use adapter as adapter in cache config #24

Closed
GinoPane opened this issue Nov 29, 2022 · 4 comments · May be fixed by #33
Closed

Cannot use adapter as adapter in cache config #24

GinoPane opened this issue Nov 29, 2022 · 4 comments · May be fixed by #33

Comments

@GinoPane
Copy link

Hi!
Could you please suggest how to use the services from this package in adapters config?
I have something like this:
image

Rikudou\\DynamoDbCacheBundle\\Cache\\DynamoDbCacheAdapter::__construct(): Argument #1 ($cache) must be of type Rikudou\\DynamoDbCache\\DynamoDbCache, string given, called in /application/var/cache/qa/Container2ANkKkQ/getDealerHierarchyServiceService.php on line 23

And whenever I try to do else the adapter is not injectable. I got either "service does not exist" or "cannot inject argument as service is not yet configured" etc

@GinoPane
Copy link
Author

If trying to use it as a service I get:
image

@RikudouSage
Copy link
Owner

I know about the problem of using it as an adapter directly, sadly never found a solution for that. Symfony for some reason injects a string as the first argument instead of the configured one.

Where are you trying to import the service directly? That should AFAIK work.

@GinoPane
Copy link
Author

Yes, I switched to using this cache as a standalone service.
Thanks

@RikudouSage
Copy link
Owner

You can also make the CacheItemPoolInterface (or AdapterInterface) an alias to the service by default if you want to avoid a vendor lock-in.

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 a pull request may close this issue.

2 participants