Skip to content

Instantly share code, notes, and snippets.

@jonathanstegall
Created March 7, 2022 16:06
Show Gist options
  • Save jonathanstegall/905df73aed3a7d1b9255167eb7979509 to your computer and use it in GitHub Desktop.
Save jonathanstegall/905df73aed3a7d1b9255167eb7979509 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Environment Files
* Description: Load environment-specific config files
*
*/
if ( 'local' !== VIP_GO_ENV ) {
if ( file_exists( WPCOM_VIP_PRIVATE_DIR . '/' . VIP_GO_ENV . '-config.php' ) ) {
require_once( WPCOM_VIP_PRIVATE_DIR . '/' . VIP_GO_ENV . '-config.php' );
}
} else {
if ( file_exists( __DIR__ . '/../private/local-config.php' ) ) {
require_once( __DIR__ . '/../private/local-config.php' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment