Serialization error when using a cache #82

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

Comments

Projects
None yet
1 participant
@mnapoli
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

This comment has been minimized.

Show comment
Hide comment
@mnapoli

mnapoli Jul 12, 2013

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@mnapoli

mnapoli Jul 12, 2013

Member

Fixed in 3.1.1

Member

mnapoli commented Jul 12, 2013

Fixed in 3.1.1

@mnapoli mnapoli closed this Jul 12, 2013

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