Create Initializer using DI

[MAIPOET-1823]
This commit is contained in:
Rostislav Wolny
2019-02-20 12:25:13 +01:00
committed by M. Shull
parent b7bc54a07e
commit d8503cf3c2
3 changed files with 8 additions and 8 deletions

View File

@@ -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();