Introduce ContainerWrapper

Container wrapper wraps both premium and free containers and adds ability for free plugin to use premium plugin services directly.
[PREMIUM-99]
This commit is contained in:
Rostislav Wolny
2018-12-04 14:46:14 +01:00
parent 884cabb51f
commit 26472d8b9a
5 changed files with 154 additions and 14 deletions

View File

@ -2,9 +2,9 @@
namespace MailPoet\API;
use MailPoet\DI\ContainerWrapper;
use MailPoetVendor\Psr\Container\ContainerInterface;
use MailPoetVendor\Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
use MailPoet\DI\ContainerFactory;
if(!defined('ABSPATH')) exit;
@ -37,8 +37,7 @@ class API {
*/
private static function ensureContainerIsLoaded() {
if(!self::$container) {
$factory = new ContainerFactory();
self::$container = $factory->getContainer();
self::$container = ContainerWrapper::getInstance();
}
}
}