mirror of
https://github.com/flarum/framework.git
synced 2025-02-01 14:42:06 +08:00
9b2d7856d1
Historically, extensions using subscribers has caused problems because subscribers were constructed/applied at extension boot. This caused some classes (e.g. UrlGenerator) to be resolved early, breaking parts of Flarum. For this reason, subscriber support wasn't included in the initial version of the Event extender. However, updating extensions has shown that there is a legitimate use case for subscribers in organizing clean code; for instance, core's own `DiscussionMetadataUpdater`. This commit introduces support for subscribers, but only applies them after the app has booted, which avoids the early resolution issues. Since event listeners/subscribers are only intended to be used with domain events, which would never be dispatched during app boot, the late activation of subscribers should not cause issue. |
||
---|---|---|
.. | ||
fixtures | ||
integration | ||
unit | ||
phpunit.integration.xml | ||
phpunit.unit.xml |