Skip to content

Commit ff346ab

Browse files
authored
Merge branch 'develop' into fix/postfix-configuration
2 parents a32730e + 0028a18 commit ff346ab

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/WordPress.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public function create( $args, $assoc_args ) {
262262
$this->logger->debug( 'args:', $args );
263263
$this->logger->debug( 'assoc_args:', empty( $assoc_args ) ? array( 'NULL' ) : $assoc_args );
264264
$this->site_data['site_url'] = strtolower( \EE\Utils\remove_trailing_slash( $args[0] ) );
265-
$this->site_data['subnet_ip'] = \EE\Site\Utils\get_subnet_ip();
265+
$this->site_data['subnet_ip'] = \EE\Site\Utils\get_available_subnet();
266266

267267
$mu = \EE\Utils\get_flag_value( $assoc_args, 'mu' );
268268
$this->site_data['app_sub_type'] = $mu ?? 'wp';
@@ -344,12 +344,7 @@ public function create( $args, $assoc_args ) {
344344
}
345345

346346
$this->site_data['site_container_fs_path'] = get_public_dir( $assoc_args );
347-
$this->site_data['site_ssl'] = get_value_if_flag_isset( $assoc_args, 'ssl', [
348-
'le',
349-
'self',
350-
'inherit',
351-
'custom'
352-
], 'le' );
347+
$this->site_data['site_ssl'] = get_value_if_flag_isset( $assoc_args, 'ssl', 'le' );
353348
if ( 'custom' === $this->site_data['site_ssl'] ) {
354349
try {
355350
$this->validate_site_custom_ssl( get_flag_value( $assoc_args, 'ssl-key' ), get_flag_value( $assoc_args, 'ssl-crt' ) );
@@ -1448,11 +1443,16 @@ protected function update_ssl( $assoc_args ) {
14481443

14491444
$extra_flags = '--precise';
14501445
$extra_flags .= ( 'wp' === $this->site_data['app_sub_type'] ) ? '' : ' --network';
1451-
EE::exec( sprintf( \EE_DOCKER::docker_compose_with_custom() . ' exec php wp search-replace http://%1$s https://%1$s %2$s', $this->site_data['site_url'], $extra_flags ), true, true );
1446+
1447+
$ssl = get_flag_value( $assoc_args, 'ssl' );
1448+
$from = $ssl === 'off' ? 'https' : 'http';
1449+
$to = $ssl === 'off' ? 'http' : 'https';
1450+
1451+
EE::exec( sprintf( \EE_DOCKER::docker_compose_with_custom() . ' exec php wp search-replace %2$s://%1$s %3$s://%1$s %4$s', $this->site_data['site_url'], $from, $to, $extra_flags ), true, true );
14521452
EE::success( 'Successfully completed search-replace.' );
14531453

14541454
if ( $backup_success ) {
1455-
EE::log( "In case something is not working as intended. You can restore your DB from backup file generated before search-replace located at:\n `$backup_location`\nand proceed with search-replace according to your needs." );
1455+
EE::log( "In case something is not working as intended, you can restore your DB from backup file generated before search-replace located at:\n `$backup_location`\nand proceed with search-replace according to your needs." );
14561456
}
14571457
}
14581458

0 commit comments

Comments
 (0)