[TYPO3-mvc] Dependency injection on object unserialization
Helmut Hummel
helmut.hummel at typo3.org
Fri Jul 24 23:45:38 CEST 2015
Hi!
Jan Kornblum wrote:
> Am i right with my assumption, that all kinds of dependency injection
> (@inject annotation, injectAnyhing() method, constuctor injection)
> don't work when an object gets unserialized?
This is correct.
> And, if so, are there plans to change this behaviour in future extbase
> version?
Why change a correct behavior?
To unserilaize an object, it must have been serialized before, right?
Before it was serialized it was created with the object manager and the
dependencies got injected. So (in theory) the serialized state should
have the dependencies injected already.
If you remove the dependencies during serialisation, you must take care
adding them again when unserlializing.
What Objects do you want to (un-)serilialize anyway?
Kind regards,
Helmut
--
Helmut Hummel
Release Manager TYPO3 6.0
TYPO3 CMS Active Contributor, TYPO3 Security Team Member
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-project-typo3v4mvc
mailing list