2019-06-21 18:58:20 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2020-07-29 18:40:14 +00:00
|
|
|
* Deprecated notice: This class is deprecated as of version 4.5.0. WooCommerce API is now part of core and not packaged seperately.
|
|
|
|
*
|
2019-06-21 18:58:20 +00:00
|
|
|
* Returns information about the package and handles init.
|
|
|
|
*
|
2020-09-17 14:56:08 +00:00
|
|
|
* @package WooCommerce\RestApi
|
2019-06-21 18:58:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Automattic\WooCommerce\RestApi;
|
|
|
|
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Main package class.
|
2020-07-29 18:40:14 +00:00
|
|
|
*
|
|
|
|
* @deprecated Use \Automattic\WooCommerce\RestApi\Server directly.
|
2019-06-21 18:58:20 +00:00
|
|
|
*/
|
|
|
|
class Package {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Version.
|
|
|
|
*
|
2020-07-29 18:40:14 +00:00
|
|
|
* @deprecated since 4.5.0. This tracks WooCommerce version now.
|
2019-06-21 18:58:20 +00:00
|
|
|
* @var string
|
|
|
|
*/
|
2020-07-27 10:24:46 +00:00
|
|
|
const VERSION = WC_VERSION;
|
2019-06-21 18:58:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Init the package - load the REST API Server class.
|
2020-07-29 18:40:14 +00:00
|
|
|
*
|
|
|
|
* @deprecated since 4.5.0. Directly call Automattic\WooCommerce\RestApi\Server::instance()->init()
|
2019-06-21 18:58:20 +00:00
|
|
|
*/
|
|
|
|
public static function init() {
|
2020-07-29 18:40:14 +00:00
|
|
|
wc_deprecated_function( 'Automattic\WooCommerce\RestApi\Server::instance()->init()', '4.5.0' );
|
2019-06-21 18:58:20 +00:00
|
|
|
\Automattic\WooCommerce\RestApi\Server::instance()->init();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the version of the package.
|
|
|
|
*
|
2020-07-29 18:40:14 +00:00
|
|
|
* @deprecated since 4.5.0. This tracks WooCommerce version now.
|
2019-06-21 18:58:20 +00:00
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public static function get_version() {
|
2020-07-29 18:40:14 +00:00
|
|
|
wc_deprecated_function( 'WC()->version', '4.5.0' );
|
|
|
|
return WC()->version;
|
2019-06-21 18:58:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the path to the package.
|
|
|
|
*
|
2020-07-29 18:40:14 +00:00
|
|
|
* @deprecated since 4.5.0. Directly call Automattic\WooCommerce\RestApi\Server::get_path()
|
2019-06-21 18:58:20 +00:00
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public static function get_path() {
|
2020-07-29 18:40:14 +00:00
|
|
|
wc_deprecated_function( 'Automattic\WooCommerce\RestApi\Server::get_path()', '4.5.0' );
|
|
|
|
return \Automattic\WooCommerce\RestApi\Server::get_path();
|
2019-06-21 18:58:20 +00:00
|
|
|
}
|
|
|
|
}
|