Conflict with Amazon SES SDK
-
I have started using Amazon SES to send emails. I’ve used the Amazon SDK because manually signing messages using ‘Signature version 4’ is just too hard.
Unfortunately, my version of the SDK clashes with yours. I don’t use the ‘S3’ option in BackWPUp so I first tried using the backwpup_register_destination filter to remove the ‘S3’ destination but BackWPUp still loads its version of the SDK. It does this through Composer in backwpup.php regardless of whether S3 is used, or not.
I’ve managed to get around the issue – mostly – by using prepend=true in my version of spl_autoload_register so my version of the SDK classes get loaded first.
However, there’s a residual issue because you (via Composer) unconditionally load vendor/aws/aws-sdk-php/src/functions.php in vendor/autoload.php. Your version of functions.php is older than the one I use and doesn’t contain a function that is required by SES. I therefore have to use the one from my SDK which causes a clash with function constantly() – the first function defined by both versions.
I can force PHP to use the later version by putting the plugin containing my code into ‘must use’ plugins, but it still causes tons of errors in my error log. As a hack, I’ve replaced your version of functions.php with an empty file (I can’t delete it without bringing the entire web site down).
I see you are investigating using a scoping mechanism to eliminate conflicts of this nature – which would be great but it might not resolve the functions.php issue.
One solution might be to selectively load functions (and maybe class registrations) instead of doing it unconditionally. We could then use the backwpup_register_destination filter to exclude the vendor libraries/services we don’t need. That wouldn’t help people who want to use two versions of a library at the same time, but it would be a simple fix for people like me who don’t need your version.
Andy
- The topic ‘Conflict with Amazon SES SDK’ is closed to new replies.