Automattic\WooCommerce\Internal\CLI\Migrator\Core
MigratorTracker::on_session_started
Handle migration session start.
Method of the class: MigratorTracker{}
No Hooks.
Returns
null. Nothing (null).
Usage
$MigratorTracker = new MigratorTracker(); $MigratorTracker->on_session_started( $platform, $metadata ): void;
- $platform(string) (required)
- Platform identifier (e.g., 'shopify').
- $metadata(array) (required)
- Session metadata.
MigratorTracker::on_session_started() MigratorTracker::on session started code WC 10.7.0
public function on_session_started( string $platform, array $metadata ): void { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
$this->current_session = array(
'platform' => $platform,
'started_at' => time(),
'products_total' => 0,
'products_attempted' => 0,
'products_successful' => 0,
'products_failed' => 0,
'products_skipped' => 0,
'product_types' => array(),
'total_time' => 0,
'is_dry_run' => $metadata['is_dry_run'] ?? false,
);
}