Create Initializer using DI
[MAIPOET-1823]
This commit is contained in:
committed by
M. Shull
parent
b7bc54a07e
commit
d8503cf3c2
@@ -20,11 +20,16 @@ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
||||
class Initializer {
|
||||
private $access_control;
|
||||
private $renderer;
|
||||
|
||||
/** @var ContainerInterface */
|
||||
private $container;
|
||||
|
||||
const INITIALIZED = 'MAILPOET_INITIALIZED';
|
||||
|
||||
function __construct(ContainerWrapper $container) {
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
function init() {
|
||||
$requirements_check_results = $this->checkRequirements();
|
||||
|
||||
@@ -47,8 +52,6 @@ class Initializer {
|
||||
));
|
||||
}
|
||||
|
||||
$this->loadContainer();
|
||||
|
||||
// activation function
|
||||
register_activation_hook(
|
||||
Env::$file,
|
||||
@@ -89,10 +92,6 @@ class Initializer {
|
||||
));
|
||||
}
|
||||
|
||||
function loadContainer() {
|
||||
$this->container = ContainerWrapper::getInstance(WP_DEBUG);
|
||||
}
|
||||
|
||||
function checkRequirements() {
|
||||
$requirements = new RequirementsChecker();
|
||||
return $requirements->checkAllRequirements();
|
||||
|
Reference in New Issue
Block a user