10up/wpsnapshots

Fails to push a snapshot of a codebase that contains the same AWS SDK

Opened this issue · 1 comments

Describe the bug

If you try to push a snapshot of a theme that uses the same AWS SDK library, you get an error about duplicate functions and are unable to push a snapshot.

Cannot redeclare Aws\constantly() (previously declared in /opt/wpsnapshots/vendor/aws/aws-sdk-php/src/functions.php:19) in /var/www/html/wp-content/themes/{theme_name}/inc/s3/Aws/functions.php on line 22

Steps to Reproduce

  1. Create a theme locally that loads and uses the same AWS SDK.
  2. Push a snapshot (either database only, code only or code and database) and see the error output in the cli.

Expected behavior

WPSnapshots should run independently of the codebase being pushed.

Environment information

  • Device: MacBook
  • OS: MacOS 10.14.6
  • Browser and version: Chrome Version 92.0.4515.159
  • WordPress version: 5.8

Additional context

Adding the following flags --skip-plugins or --skip-themes depending on where the AWS SDK is located may circumvent an AWS SDK conflict for anyone who runs into it.