-
Notifications
You must be signed in to change notification settings - Fork 333
Open
Description
The way ZfcUser 3 works with events is seriously broken:
- Not all objects register themselves correctly to the
SharedEventManager
. All services should implementEventManagerAwareInterface
in order forZend\Mvc
to inject it propertly (plus: there is a bug in theEventProvider
that comes bundled: Fix broken event system #677). - A lot of services attach and trigger events in their constructor. That has two problems:
- They are not usuable. See
RegisterFilter
. The only way to use it would normally be the shared manager. However that is in ZF3 only injected after construction using an initializer. - They are overwritten. There is some business logic dependent on it in
AdapterChainServiceFactory
. If we were to properly mark theAdapterClass
as aEventManagerAwareInterface
capable service, the event manager would be overwritten directly after construction (again via the bundled Initializer of ZF3 in Mvc). And thus the adapters will never receive theauthenticate
event.
- They are not usuable. See
- The way events are triggered in
AdapterChain
is super weird. And is different from how it worked under ZF2. The event is passed as the$target
parameter! What we need to do is use thetriggerEvent
method of theEventManager
.
I have a PR that fixes all of this. See #677
Metadata
Metadata
Assignees
Labels
No labels