Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/env/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,17 @@ You can tell `wp-env` to use a specific PHP version for compatibility and testin
}
```

### Specific if multisite is enabled
Comment thread
spacedmonkey marked this conversation as resolved.
Resolved

You can tell `wp-env` if the site should be multisite enabled. This can also be set via the environment variable `WP_ENV_MULTISITE`.

```json
{
"multsite": true,
Comment thread
spacedmonkey marked this conversation as resolved.
Resolved
"plugins": [ "." ]
}
```

### Node Lifecycle Script

This is useful for performing some actions after setting up the environment, such as bootstrapping an E2E test environment.
Expand Down
5 changes: 5 additions & 0 deletions packages/env/lib/config/get-config-from-environment-vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const { checkPort, checkVersion, checkString } = require( './validate-config' );
* @property {?number} phpmyadminPort An override for the development environment's phpMyAdmin port.
* @property {?WPSource} coreSource An override for all environment's coreSource.
* @property {?string} phpVersion An override for all environment's PHP version.
* @property {?bool} multisite An override for if environmen should be multisite.
Comment thread
spacedmonkey marked this conversation as resolved.
Resolved
* @property {?Object.<string, string>} lifecycleScripts An override for various lifecycle scripts.
*/

Expand Down Expand Up @@ -68,6 +69,10 @@ module.exports = function getConfigFromEnvironmentVars( cacheDirectoryPath ) {
environmentConfig.phpVersion = process.env.WP_ENV_PHP_VERSION;
}

if ( process.env.WP_ENV_MULTISITE ) {
environmentConfig.multisite = !!process.env.WP_ENV_MULTISITE;
}

return environmentConfig;
};

Expand Down