Automattic\WooCommerce\Database\Migrations\CustomOrderTable
CLIRunner::status
Displays a summary of HPOS situation on this site.
Метод класса: CLIRunner{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$CLIRunner = new CLIRunner(); $CLIRunner->status( $args, $assoc_args );
- $args(массив)
- Positional arguments passed to the command.
По умолчанию:array() - $assoc_args(массив)
- Associative arguments (options) passed to the command.
По умолчанию:array()
Список изменений
| С версии 8.6.0 | Введена. |
Код CLIRunner::status() CLIRunner::status WC 10.4.3
public function status( array $args = array(), array $assoc_args = array() ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed -- for backwards compat.
$legacy_handler = wc_get_container()->get( LegacyDataHandler::class );
// translators: %s is either 'yes' or 'no'.
WP_CLI::log( sprintf( __( 'HPOS enabled?: %s', 'woocommerce' ), wc_bool_to_string( $this->controller->custom_orders_table_usage_is_enabled() ) ) );
// translators: %s is either 'yes' or 'no'.
WP_CLI::log( sprintf( __( 'Compatibility mode enabled?: %s', 'woocommerce' ), wc_bool_to_string( $this->synchronizer->data_sync_is_enabled() ) ) );
// translators: %d is an order count.
WP_CLI::log( sprintf( __( 'Unsynced orders: %d', 'woocommerce' ), $this->synchronizer->get_current_orders_pending_sync_count() ) );
WP_CLI::log(
sprintf(
/* translators: %d is an order count. */
__( 'Orders subject to cleanup: %d', 'woocommerce' ),
( $this->synchronizer->custom_orders_table_is_authoritative() && ! $this->synchronizer->data_sync_is_enabled() )
? $legacy_handler->count_orders_for_cleanup()
: 0
)
);
}