Add updater to the Free [PREMIUM-22]

This commit is contained in:
stoletniy
2017-06-14 14:24:18 +03:00
parent cdd8e51ef9
commit fe9aa03de1
4 changed files with 135 additions and 1 deletions

View File

@ -76,6 +76,7 @@ class Initializer {
$this->maybeDbUpdate();
$this->setupRenderer();
$this->setupInstaller();
$this->setupUpdater();
$this->setupLocalizer();
$this->setupMenu();
$this->setupAnalytics();
@ -144,6 +145,20 @@ class Initializer {
$installer->init();
}
function setupUpdater() {
$slug = Installer::PREMIUM_PLUGIN_SLUG;
$plugin_file = Installer::getPluginFile($slug);
if(empty($plugin_file) || !defined('MAILPOET_PREMIUM_VERSION')) {
return false;
}
$updater = new Updater(
$plugin_file,
$slug,
MAILPOET_PREMIUM_VERSION
);
$updater->init();
}
function setupLocalizer() {
$localizer = new Localizer($this->renderer);
$localizer->init();