symfony / swiftmailer-bundle

Symfony Swiftmailer Bundle
https://symfony.com/swiftmailer-bundle
MIT License
1.56k stars 151 forks source link

Fix compatibility with the inline_class_loader optimization of the DIC dumper #230

Closed stof closed 6 years ago

stof commented 6 years ago

The special autoloading necessary to initialize Swiftmailer internals is incompatible with "inline_class_loader" optimization of the DIC dumper, as it bypasses the autoloading at runtime (doing it at compile-time instead). Instead of forcing disabling the optimization when using SwiftmailerBundle, this adds a compiler pass ensuring that Swift classes are never marked as being hot path services (which are the one being optimized). This compiler pass runs after the Symfony pass determining the hot path, reverting the detection for impacted services.

stof commented 6 years ago

@nicolas-grekas I reworded the comments a bit