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

Serialization error when using a cache #82

Closed
mnapoli opened this issue Jul 12, 2013 · 2 comments
Closed

Serialization error when using a cache #82

mnapoli opened this issue Jul 12, 2013 · 2 comments
Assignees
Labels

Comments

@mnapoli
Copy link
Member

mnapoli commented Jul 12, 2013

When defining a ValueDefinition with

$container->set('foo', $var);

ValueDefinition::isCacheable() will return false if $var is an object.

However, if $var is an array containing unserializable objects, PHP-DI will try to serialize it (and thus an exception will be thrown).

@ghost ghost assigned mnapoli Jul 12, 2013
@mnapoli
Copy link
Member Author

mnapoli commented Jul 12, 2013

On a more general note, I think it's absurd to cache a ValueDefinition, their nature is dynamic (they can be depending on something, the user, the session, …).

So ValueDefinition shouldn't be cached anymore.

@mnapoli
Copy link
Member Author

mnapoli commented Jul 12, 2013

Fixed in 3.1.1

@mnapoli mnapoli closed this as completed Jul 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant