Removes AccessControl from Migrator and Changelog
This commit is contained in:
@ -1,15 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Config;
|
namespace MailPoet\Config;
|
||||||
|
|
||||||
use MailPoet\Models\Setting;
|
use MailPoet\Models\Setting;
|
||||||
use MailPoet\Util\Url;
|
use MailPoet\Util\Url;
|
||||||
|
|
||||||
class Changelog {
|
class Changelog {
|
||||||
private $access_control;
|
|
||||||
|
|
||||||
function __construct(AccessControl $access_control) {
|
|
||||||
$this->access_control = $access_control;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
$doing_ajax = (bool)(defined('DOING_AJAX') && DOING_AJAX);
|
$doing_ajax = (bool)(defined('DOING_AJAX') && DOING_AJAX);
|
||||||
|
|
||||||
@ -37,7 +33,7 @@ class Changelog {
|
|||||||
$version = Setting::getValue('version', null);
|
$version = Setting::getValue('version', null);
|
||||||
$redirect_url = null;
|
$redirect_url = null;
|
||||||
|
|
||||||
$mp2_migrator = new MP2Migrator($this->access_control);
|
$mp2_migrator = new MP2Migrator();
|
||||||
if(!in_array($_GET['page'], array('mailpoet-migration', 'mailpoet-settings')) && $mp2_migrator->isMigrationStartedAndNotCompleted()) {
|
if(!in_array($_GET['page'], array('mailpoet-migration', 'mailpoet-settings')) && $mp2_migrator->isMigrationStartedAndNotCompleted()) {
|
||||||
// Force the redirection if the migration has started but is not completed
|
// Force the redirection if the migration has started but is not completed
|
||||||
$redirect_url = admin_url('admin.php?page=mailpoet-migration');
|
$redirect_url = admin_url('admin.php?page=mailpoet-migration');
|
||||||
|
@ -195,7 +195,7 @@ class Initializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setupChangelog() {
|
function setupChangelog() {
|
||||||
$changelog = new Changelog($this->access_control);
|
$changelog = new Changelog();
|
||||||
$changelog->init();
|
$changelog->init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,19 +19,17 @@ class MP2Migrator {
|
|||||||
const CHUNK_SIZE = 10; // To import the data by batch
|
const CHUNK_SIZE = 10; // To import the data by batch
|
||||||
|
|
||||||
private $log_file;
|
private $log_file;
|
||||||
private $access_control;
|
|
||||||
public $log_file_url;
|
public $log_file_url;
|
||||||
public $progressbar;
|
public $progressbar;
|
||||||
private $segments_mapping = array(); // Mapping between old and new segment IDs
|
private $segments_mapping = array(); // Mapping between old and new segment IDs
|
||||||
private $wp_users_segment;
|
private $wp_users_segment;
|
||||||
|
|
||||||
public function __construct(AccessControl $access_control) {
|
public function __construct() {
|
||||||
$this->defineMP2Tables();
|
$this->defineMP2Tables();
|
||||||
$log_filename = 'mp2migration.log';
|
$log_filename = 'mp2migration.log';
|
||||||
$this->log_file = Env::$temp_path . '/' . $log_filename;
|
$this->log_file = Env::$temp_path . '/' . $log_filename;
|
||||||
$this->log_file_url = Env::$temp_url . '/' . $log_filename;
|
$this->log_file_url = Env::$temp_url . '/' . $log_filename;
|
||||||
$this->progressbar = new ProgressBar('mp2migration');
|
$this->progressbar = new ProgressBar('mp2migration');
|
||||||
$this->access_control = $access_control;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function defineMP2Tables() {
|
private function defineMP2Tables() {
|
||||||
@ -189,7 +187,7 @@ class MP2Migrator {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private function eraseMP3Data() {
|
private function eraseMP3Data() {
|
||||||
$activator = new Activator($this->access_control);
|
$activator = new Activator();
|
||||||
$activator->deactivate();
|
$activator->deactivate();
|
||||||
$activator->activate();
|
$activator->activate();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user