1 | <?php namespace EmailLog\Addon\API; |
||
15 | class EDDUpdater extends \EDD_SL_Plugin_Updater { |
||
16 | |||
17 | /** |
||
18 | * Add-on slug. |
||
19 | * The base class already has a slug property but it is private. |
||
20 | * So we have to create a duplicate to handle that. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $addon_slug; |
||
25 | |||
26 | /** |
||
27 | * Extract add-on slug alone and then pass everything to parent. |
||
28 | * |
||
29 | * @param string $_api_url The URL pointing to the custom API endpoint. |
||
30 | * @param string $_plugin_file Path to the plugin file. |
||
31 | * @param array|null $_api_data Optional data to send with API calls. |
||
32 | */ |
||
33 | public function __construct( $_api_url, $_plugin_file, $_api_data = null ) { |
||
38 | |||
39 | /** |
||
40 | * Overridden to disable `check_update` on the add-ons that are not installed. |
||
41 | * |
||
42 | * @inheritdoc |
||
43 | * |
||
44 | * @since 2.2.0 |
||
45 | */ |
||
46 | public function init() { |
||
57 | |||
58 | /** |
||
59 | * Get add-on slug. |
||
60 | * |
||
61 | * @return string Add-on slug. |
||
62 | */ |
||
63 | public function get_slug() { |
||
66 | |||
67 | /** |
||
68 | * Get Download URL. |
||
69 | * We can't call `api_request` method directly since it is declared as private in parent class. |
||
70 | * So we call the `plugins_api_filter` method instead. |
||
71 | * |
||
72 | * @return string Download url. |
||
73 | */ |
||
74 | public function get_download_url() { |
||
86 | } |
||
87 |