API
4 weeks ago
BlockTemplates
2 years ago
Composer
2 years ago
DateTimeProvider
4 years ago
Features
4 weeks ago
Marketing
1 year ago
Notes
4 weeks ago
Overrides
2 months ago
PluginsInstallLoggers
1 year ago
PluginsProvider
4 years ago
RemoteInboxNotifications
4 weeks ago
RemoteSpecs
2 months ago
Schedulers
1 year ago
Settings
2 weeks ago
DataSourcePoller.php
2 years ago
DeprecatedClassFacade.php
1 year ago
FeaturePlugin.php
4 years ago
Loader.php
2 years ago
PageController.php
4 weeks ago
PluginsHelper.php
4 weeks ago
PluginsInstaller.php
4 years ago
ReportCSVEmail.php
1 year ago
ReportCSVExporter.php
1 year ago
ReportExporter.php
3 years ago
ReportsSync.php
4 months ago
WCAdminHelper.php
4 weeks ago
DataSourcePoller.php
84 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Automattic\WooCommerce\Admin; |
| 4 | |
| 5 | use Automattic\WooCommerce\Admin\RemoteSpecs\DataSourcePoller as RemoteSpecsDataSourcePoller; |
| 6 | |
| 7 | /** |
| 8 | * Specs data source poller class. |
| 9 | * This handles polling specs from JSON endpoints, and |
| 10 | * stores the specs in to the database as an option. |
| 11 | * |
| 12 | * @deprecated since 8.8.0 |
| 13 | */ |
| 14 | abstract class DataSourcePoller extends RemoteSpecsDataSourcePoller { |
| 15 | /** |
| 16 | * Log a deprecation to the error log. |
| 17 | */ |
| 18 | private static function log_deprecation() { |
| 19 | /** |
| 20 | * Note: Deprecation messages have been temporarily disabled due to upgrade issues. |
| 21 | * For more details, see the discussion in the WooCommerce GitHub repository: |
| 22 | * https://github.com/woocommerce/woocommerce/pull/45892. |
| 23 | */ |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Constructor. |
| 28 | * |
| 29 | * @param string $id id of DataSourcePoller. |
| 30 | * @param array $data_sources urls for data sources. |
| 31 | * @param array $args Options for DataSourcePoller. |
| 32 | */ |
| 33 | public function __construct( $id, $data_sources = array(), $args = array() ) { |
| 34 | self::log_deprecation(); |
| 35 | parent::__construct( $id, $data_sources, $args ); |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Reads the data sources for specs and persists those specs. |
| 40 | * |
| 41 | * @deprecated 8.8.0 |
| 42 | * @return array list of specs. |
| 43 | */ |
| 44 | public function get_specs_from_data_sources() { |
| 45 | self::log_deprecation(); |
| 46 | return parent::get_specs_from_data_sources(); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Reads the data sources for specs and persists those specs. |
| 51 | * |
| 52 | * @deprecated 8.8.0 |
| 53 | * @return bool Whether any specs were read. |
| 54 | */ |
| 55 | public function read_specs_from_data_sources() { |
| 56 | self::log_deprecation(); |
| 57 | return parent::read_specs_from_data_sources(); |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Delete the specs transient. |
| 62 | * |
| 63 | * @deprecated 8.8.0 |
| 64 | * @return bool success of failure of transient deletion. |
| 65 | */ |
| 66 | public function delete_specs_transient() { |
| 67 | self::log_deprecation(); |
| 68 | return parent::delete_specs_transient(); |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Set the specs transient. |
| 73 | * |
| 74 | * @param array $specs The specs to set in the transient. |
| 75 | * @param int $expiration The expiration time for the transient. |
| 76 | * |
| 77 | * @deprecated 8.8.0 |
| 78 | */ |
| 79 | public function set_specs_transient( $specs, $expiration = 0 ) { |
| 80 | self::log_deprecation(); |
| 81 | return parent::set_specs_transient( $specs, $expiration ); |
| 82 | } |
| 83 | } |
| 84 |