| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
namespace Jet_Form_Builder\Migrations\Profilers; |
| 5 |
|
| 6 |
use Jet_Form_Builder\Migrations\Versions\Base_Migration; |
| 7 |
|
| 8 |
// If this file is called directly, abort. |
| 9 |
if ( ! defined( 'WPINC' ) ) { |
| 10 |
die; |
| 11 |
} |
| 12 |
|
| 13 |
class Cli_Migration_Profiler extends Base_Migration_Profiler { |
| 14 |
|
| 15 |
public function on_up_end( Base_Migration $migration, string $timer_stop ) { |
| 16 |
$name = get_class( $migration ); |
| 17 |
|
| 18 |
\WP_CLI::line( |
| 19 |
\WP_CLI::colorize( "%G{$name}: %n{$timer_stop} (s)" ) |
| 20 |
); |
| 21 |
} |
| 22 |
|
| 23 |
public function on_down_end( Base_Migration $migration, string $timer_stop ) { |
| 24 |
$name = get_class( $migration ); |
| 25 |
|
| 26 |
\WP_CLI::line( |
| 27 |
\WP_CLI::colorize( "%m{$name}: %n{$timer_stop} (s)" ) |
| 28 |
); |
| 29 |
} |
| 30 |
|
| 31 |
} |
| 32 |
|