Merge pull request #937 from mailpoet/premium_updates_fix

Add updater to the Free [PREMIUM-22]
This commit is contained in:
mrcasual
2017-06-19 11:09:42 -04:00
committed by GitHub
4 changed files with 135 additions and 1 deletions

View File

@@ -85,6 +85,7 @@ class Initializer {
$this->maybeDbUpdate();
$this->setupRenderer();
$this->setupInstaller();
$this->setupUpdater();
$this->setupLocalizer();
$this->setupMenu();
$this->setupAnalytics();
@@ -153,6 +154,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();