Skip to content

Conversation

@Sidsector9
Copy link
Member

--skip-config will avoid addition of multisite constants to wp-config.php file.

--skip-config will avoid addition of multisite constants to wp-config.php file.
@schlessera
Copy link
Member

Fixes #11

Copy link
Member

@schlessera schlessera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, but it needs a functional test.

$wp_config_path = Utils\locate_wp_config();
if ( is_writable( $wp_config_path ) && self::modify_wp_config( $ms_config ) ) {
if ( true === \WP_CLI\Utils\get_flag_value( $assoc_args, 'skip-config' ) ) {
WP_CLI::log( "Addition of multisite constants to 'wp-config.php' skipped. You need to add them manually:" . PHP_EOL );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: The message should end with a period (.), not a colon (:).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, we could include the constants similar to below You need to add them manually:" . PHP_EOL . $ms_config

Copy link
Member Author

@Sidsector9 Sidsector9 Jun 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielbachhuber I think it'll be a good idea to let the user have a copy of the multisite constants, this way they can use it later if they change their mind? What do you say?
CC: @schlessera

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'll be a good idea to let the user have a copy of the multisite constants, this was they can use it later if they change their mind?

I agree, let's continue to print the constants.

@schlessera
Copy link
Member

@Sidsector9 Thanks for the pull request!
Can you please add a functional test to assert that the flag works as intended?
Here's more information about writing tests: https://make.wordpress.org/cli/handbook/pull-requests/#running-and-writing-tests

@Sidsector9
Copy link
Member Author

@schlessera I'll be working on the functional tests soon.

@Sidsector9
Copy link
Member Author

@schlessera Functional test added.

Copy link
Member

@danielbachhuber danielbachhuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@danielbachhuber danielbachhuber merged commit e4fc71f into wp-cli:master Jul 3, 2017
@danielbachhuber danielbachhuber changed the title GH#11 --skip-config feature added Use --skip-config to avoid addition of multisite constants to wp-config.php file. Jul 3, 2017
@aldalipharmacy2022
Copy link

$ wp core multisite-install --title="Welcome to the WordPress" \

--admin_user="admin" --admin_password="password"
--admin_email="user@example.com"
Single site database tables already present.
Set up multisite database tables.
Added multisite constants to wp-config.php.
Success: Network installed. Don't forget to set up rewrite rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants