Skip to content

Commit

Permalink
Merge pull request #263 from wp-cli/fix/138-composer
Browse files Browse the repository at this point in the history
Add `ext-mbstring` to list of suggested dependencies
  • Loading branch information
schlessera authored Jul 5, 2021
2 parents 7738b31 + f4d8392 commit dead2da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"wp-cli/scaffold-command": "^1.2 || ^2",
"wp-cli/wp-cli-tests": "^3.0.11"
},
"suggest": {
"ext-mbstring": "Used for calculating include/exclude matches in code extraction"
},
"config": {
"process-timeout": 7200,
"sort-packages": true
Expand Down
12 changes: 11 additions & 1 deletion i18n-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@
WP_CLI::add_command( 'i18n', '\WP_CLI\I18n\CommandNamespace' );
}

WP_CLI::add_command( 'i18n make-pot', '\WP_CLI\I18n\MakePotCommand' );
WP_CLI::add_command(
'i18n make-pot',
'\WP_CLI\I18n\MakePotCommand',
array(
'before_invoke' => static function() {
if ( ! function_exists( 'mb_ereg' ) ) {
WP_CLI::error( 'The mbstring extension is required for string extraction to work reliably.' );
}
},
)
);

WP_CLI::add_command( 'i18n make-json', '\WP_CLI\I18n\MakeJsonCommand' );

Expand Down

0 comments on commit dead2da

Please sign in to comment.