Skip to content

Commit c703981

Browse files
authored
Merge pull request #206 from mrrobot47/add/env-support
Add support for WP_ENVIRONMENT_TYPE
2 parents 01a31dd + 4cc9bac commit c703981

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/WordPress.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,12 @@ private function install_wp() {
12101210
throw new \Exception( 'WordPress install failed. Please check logs.' );
12111211
}
12121212

1213+
$env_type = \EE::get_runner()->config['env'];
1214+
$env_type = in_array( $env_type, [ 'production', 'staging', 'development', 'local' ] ) ? $env_type : '';
1215+
if ( ! empty( $env_type ) ) {
1216+
EE::exec( 'docker-compose exec --user=\'www-data\' php wp config set --type=constant WP_ENVIRONMENT_TYPE \'' . $env_type . '\' ' );
1217+
}
1218+
12131219
\EE::success( $prefix . $this->site_data['site_url'] . ' has been created successfully!' );
12141220
}
12151221

0 commit comments

Comments
 (0)