Skip to content

Commit

Permalink
Fix minimum php version in composer, should be 8.0 due to uuid. Chang…
Browse files Browse the repository at this point in the history
…e command prefix to ubb
  • Loading branch information
goncaloasimoes committed Jan 12, 2023
1 parent f02d419 commit 5f07c20
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 50 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"homepage": "https://github.com/26B/unbabble",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.4",
"php": ">=8.0",
"ramsey/uuid": "^4.6"
},
"require-dev": {
Expand Down
103 changes: 57 additions & 46 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/Integrations/WPML/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Migrator {
*/
public function register() : void {
if ( class_exists( 'WP_CLI' ) ) {
WP_CLI::add_command( 'unbabble migrate-wpml', [ $this, 'run' ] );
WP_CLI::add_command( 'ubb migrate-wpml', [ $this, 'run' ] );
}
}

Expand Down Expand Up @@ -71,7 +71,7 @@ public function run( array $args, array $assoc_args ) : void {

$offset = $this->get_migration_offset();
if ( $offset ) {
WP_CLI::warning( 'Continuing previous migration. Use `wp unbabble migrate-wpml restart` to start a new one.' );
WP_CLI::warning( 'Continuing previous migration. Use `wp ubb migrate-wpml restart` to start a new one.' );
$options['trid_offset'] = $offset;
}

Expand All @@ -98,7 +98,7 @@ public function run( array $args, array $assoc_args ) : void {
private function get_migration_pid() : int {
// TODO: How to check if shell_exec is permitted.
// FIXME: Only works for *nix systems.
$grep = shell_exec( 'ps aux | grep "unbabble migrate-wpml run\|unbabble migrate-wpml restart" | grep -v grep | awk \'{print $2}\'' );
$grep = shell_exec( 'ps aux | grep "ubb migrate-wpml run\|ubb migrate-wpml restart" | grep -v grep | awk \'{print $2}\'' );
$rows = explode( "\n", $grep );
if ( count( $rows ) < 1 ) {
return 0;
Expand Down

0 comments on commit 5f07c20

Please sign in to comment.