swiftmailer/swiftmailer — Issue #119: Swift Mailer conflicts with other autoloaders
Author: marktyler
Created: 2011-10-10 08:50:57+00:00
State: open

If spl_autoload_register was called before including swift mailer, it tries to load Swift mailer classes. If this function does not call file_exists but explicity includes file with require, all application fails.
The solution is to pass third paramter to spl_autoload_register in Swift class:

Current:
spl_autoload_register(array('Swift', 'autoload'));

Fixed:
spl_autoload_register(array('Swift', 'autoload'), true, true);

Now it gets added to top of the autoload stack. I'm using the latest 4.1.2.