Merge pull request #1582 from mailpoet/symfony-di

Add symfony dependency injection container [MAILPOET-1605]
This commit is contained in:
M. Shull
2018-11-05 13:50:05 -05:00
committed by GitHub
26 changed files with 1118 additions and 374 deletions

View File

@ -282,6 +282,21 @@ class RoboFile extends \Robo\Tasks {
return $this->_exec('vendor/bin/codecept run integration -g failed');
}
function containerDump() {
$this->say('Deleting DI Container');
$this->_exec('rm -f ./lib/DI/CachedContainer.php');
$this->say('Generating DI container cache');
$this->loadEnv();
define('ABSPATH', getenv('WP_ROOT') . '/');
if (!file_exists(ABSPATH . 'wp-config.php')) {
$this->yell('WP_ROOT env variable does not contain valid path to wordpress root.', 40, 'red');
exit(1);
}
require_once __DIR__ . '/vendor/autoload.php';
$container_factory = new \MailPoet\DI\ContainerFactory();
$container_factory->dumpContainer();
}
function qa() {
$collection = $this->collectionBuilder();
$collection->addCode(array($this, 'qaLint'));