Package.php
61 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Deprecated notice: This class is deprecated as of version 4.5.0. WooCommerce API is now part of core and not packaged separately. |
| 4 | * |
| 5 | * Returns information about the package and handles init. |
| 6 | * |
| 7 | * @package WooCommerce\RestApi |
| 8 | */ |
| 9 | |
| 10 | namespace Automattic\WooCommerce\RestApi; |
| 11 | |
| 12 | defined( 'ABSPATH' ) || exit; |
| 13 | |
| 14 | /** |
| 15 | * Main package class. |
| 16 | * |
| 17 | * @deprecated Use \Automattic\WooCommerce\RestApi\Server directly. |
| 18 | */ |
| 19 | class Package { |
| 20 | |
| 21 | /** |
| 22 | * Version. |
| 23 | * |
| 24 | * @deprecated since 4.5.0. This tracks WooCommerce version now. |
| 25 | * @var string |
| 26 | */ |
| 27 | const VERSION = WC_VERSION; |
| 28 | |
| 29 | /** |
| 30 | * Init the package - load the REST API Server class. |
| 31 | * |
| 32 | * @deprecated since 4.5.0. Directly call Automattic\WooCommerce\RestApi\Server::instance()->init() |
| 33 | */ |
| 34 | public static function init() { |
| 35 | wc_deprecated_function( 'Automattic\WooCommerce\RestApi\Server::instance()->init()', '4.5.0' ); |
| 36 | \Automattic\WooCommerce\RestApi\Server::instance()->init(); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Return the version of the package. |
| 41 | * |
| 42 | * @deprecated since 4.5.0. This tracks WooCommerce version now. |
| 43 | * @return string |
| 44 | */ |
| 45 | public static function get_version() { |
| 46 | wc_deprecated_function( 'WC()->version', '4.5.0' ); |
| 47 | return WC()->version; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Return the path to the package. |
| 52 | * |
| 53 | * @deprecated since 4.5.0. Directly call Automattic\WooCommerce\RestApi\Server::get_path() |
| 54 | * @return string |
| 55 | */ |
| 56 | public static function get_path() { |
| 57 | wc_deprecated_function( 'Automattic\WooCommerce\RestApi\Server::get_path()', '4.5.0' ); |
| 58 | return \Automattic\WooCommerce\RestApi\Server::get_path(); |
| 59 | } |
| 60 | } |
| 61 |