Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. <?php
  2. /**
  3. * There are many possible ways to set this, but it can only be defined once.
  4. *
  5. * Using an environment variable by the same name
  6. * define( 'WP_ENV', getenv( 'WP_ENV' ) );
  7. *
  8. * Matching the hostname
  9. * define( 'WP_ENV', 'example.com' == $_SERVER['SERVER_NAME'] ? 'production' : 'staging' );
  10. */
  11.  
  12. // These settings will take effect if the current environment is not production.
  13. if ( defined( 'WP_ENV' ) && WP_ENV != 'production' ) {
  14. /**
  15. * ALTERNATE/NON-EXISTENT CREDENTIALS
  16. *
  17. * Use alternate IAM credentials for limited permissions or use a placeholder to prevent Offload S3 from being able to upload new objects, remove existing objects, or read private objects.
  18. */
  19. define( 'DBI_AWS_ACCESS_KEY_ID', 'ASDFASDFASDFASDFASDF' );
  20. define( 'DBI_AWS_SECRET_ACCESS_KEY', 'ZXCVZXCVZXCVZXCVZXCVZXCVZXCVZXCVZXCVZXCV' );
  21.  
  22. /**
  23. * ALTERNATE BUCKET
  24. * Simply use a different bucket than is used in production.
  25. */
  26. define( 'AS3CF_BUCKET', 'dev.media.example.com' );
  27.  
  28. /**
  29. * Override any of the Offload S3 settings.
  30. */
  31. define( 'WPOS3_SETTINGS', serialize( array(
  32. // ONLY WRITE FROM PRODUCTION
  33. // Prevent new objects from being automatically uploaded to S3.
  34. 'copy-to-s3' => false,
  35. // ALTERNATE PATH
  36. // Prefix the path in S3 with the current environment.
  37. 'object-prefix' => WP_ENV . '/wp-content/uploads/',
  38. ) ) );
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement