Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * There are many possible ways to set this, but it can only be defined once.
- *
- * Using an environment variable by the same name
- * define( 'WP_ENV', getenv( 'WP_ENV' ) );
- *
- * Matching the hostname
- * define( 'WP_ENV', 'example.com' == $_SERVER['SERVER_NAME'] ? 'production' : 'staging' );
- */
- // These settings will take effect if the current environment is not production.
- if ( defined( 'WP_ENV' ) && WP_ENV != 'production' ) {
- /**
- * ALTERNATE/NON-EXISTENT CREDENTIALS
- *
- * 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.
- */
- define( 'DBI_AWS_ACCESS_KEY_ID', 'ASDFASDFASDFASDFASDF' );
- define( 'DBI_AWS_SECRET_ACCESS_KEY', 'ZXCVZXCVZXCVZXCVZXCVZXCVZXCVZXCVZXCVZXCV' );
- /**
- * ALTERNATE BUCKET
- * Simply use a different bucket than is used in production.
- */
- define( 'AS3CF_BUCKET', 'dev.media.example.com' );
- /**
- * Override any of the Offload S3 settings.
- */
- define( 'WPOS3_SETTINGS', serialize( array(
- // ONLY WRITE FROM PRODUCTION
- // Prevent new objects from being automatically uploaded to S3.
- 'copy-to-s3' => false,
- // ALTERNATE PATH
- // Prefix the path in S3 with the current environment.
- 'object-prefix' => WP_ENV . '/wp-content/uploads/',
- ) ) );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement