Skip to content

Commit

Permalink
[1.1] Load the vip-config.php file during initialization (#553)
Browse files Browse the repository at this point in the history
* Load the vip-config.php file during initialization

* CHANGELOG

* Changelog indent

* Mirror vip better
  • Loading branch information
srtfisher committed Jun 7, 2024
1 parent 9b90d4f commit 9859dfb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Ensure that unit tests fail when a project's installation script fails.
- Fix anonymous queue jobs from WP-CLI failing to run.

## Changed

- Load the `wp-content/vip-config/vip-config.php` file if it exists during
testing to integrate better with VIP Go projects.

## v1.0.7 - 2024-04-29

### Added
Expand Down
9 changes: 9 additions & 0 deletions src/mantle/testing/wordpress-bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@
Utils::info( 'No wp-tests-config.php file found, using default configuration.' );
}

// Attempt to load the vip-config.php file if it exists to play nicely with VIP Go.
if ( Utils::env_bool( 'MANTLE_LOAD_VIP_CONFIG', true ) ) {
if ( file_exists( ABSPATH . '/wp-content/vip-config/vip-config.php' ) ) {
require_once( ABSPATH . '/wp-content/vip-config/vip-config.php' );
} elseif ( file_exists( ABSPATH . '/vip-config/vip-config.php' ) ) {
require_once( ABSPATH . '/vip-config/vip-config.php' );
}
}

Utils::setup_configuration();
Utils::reset_server();

Expand Down

0 comments on commit 9859dfb

Please sign in to comment.