| 1 |
<?php |
| 2 |
namespace IfSo\Addons\Base; |
| 3 |
use YahnisElsts\PluginUpdateChecker\v5\PucFactory; |
| 4 |
|
| 5 |
class ExtensionInitializer{ |
| 6 |
protected $extension_instance; |
| 7 |
|
| 8 |
public function __construct($plugin_main,$update_settings){ |
| 9 |
$this->check_for_updates($update_settings); |
| 10 |
} |
| 11 |
|
| 12 |
private function check_for_updates($update_settings){ |
| 13 |
if(!empty($update_settings)){ |
| 14 |
require_once(__DIR__ . '/lib/plugin-update-checker/plugin-update-checker.php'); |
| 15 |
try{ |
| 16 |
$myUpdateChecker = PucFactory::buildUpdateChecker( //Check for updates |
| 17 |
$update_settings->url, |
| 18 |
$update_settings->main_file, |
| 19 |
$update_settings->slug |
| 20 |
); |
| 21 |
} |
| 22 |
catch(Exception $e){ |
| 23 |
} |
| 24 |
} |
| 25 |
} |
| 26 |
|
| 27 |
} |