2013-05-03 17:02:53 +02:00
|
|
|
<?php
|
2013-05-16 03:16:56 +02:00
|
|
|
/**
|
2013-10-26 17:25:34 +02:00
|
|
|
* PHPCI - Continuous Integration for PHP
|
|
|
|
*
|
2014-05-12 18:26:17 +02:00
|
|
|
* @copyright Copyright 2014, Block 8 Limited.
|
2013-10-26 17:25:34 +02:00
|
|
|
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
2014-05-12 18:26:17 +02:00
|
|
|
* @link https://www.phptesting.org/
|
2013-10-26 17:25:34 +02:00
|
|
|
*/
|
2013-05-03 17:02:53 +02:00
|
|
|
|
|
|
|
namespace PHPCI;
|
2013-05-16 03:57:02 +02:00
|
|
|
|
2013-12-17 16:24:13 +01:00
|
|
|
use PHPCI\Helper\BuildInterpolator;
|
2014-12-04 16:48:52 +01:00
|
|
|
use PHPCI\Helper\Lang;
|
2013-11-17 22:26:38 +01:00
|
|
|
use PHPCI\Helper\MailerFactory;
|
2013-12-13 16:57:56 +01:00
|
|
|
use PHPCI\Logging\BuildLogger;
|
2013-05-03 17:02:53 +02:00
|
|
|
use PHPCI\Model\Build;
|
2013-07-30 03:55:29 +02:00
|
|
|
use b8\Config;
|
2014-02-25 17:59:28 +01:00
|
|
|
use b8\Store\Factory;
|
2013-10-26 17:15:29 +02:00
|
|
|
use Psr\Log\LoggerAwareInterface;
|
|
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
use Psr\Log\LogLevel;
|
2014-03-25 15:13:45 +01:00
|
|
|
use PHPCI\Plugin\Util\Factory as PluginFactory;
|
2013-05-03 17:02:53 +02:00
|
|
|
|
2013-05-16 03:16:56 +02:00
|
|
|
/**
|
2013-10-26 17:25:34 +02:00
|
|
|
* PHPCI Build Runner
|
|
|
|
* @author Dan Cryer <dan@block8.co.uk>
|
|
|
|
*/
|
2013-12-13 16:57:56 +01:00
|
|
|
class Builder implements LoggerAwareInterface
|
2013-05-03 17:02:53 +02:00
|
|
|
{
|
2013-05-16 03:57:02 +02:00
|
|
|
/**
|
2013-10-26 17:25:34 +02:00
|
|
|
* @var string
|
|
|
|
*/
|
2013-05-16 03:57:02 +02:00
|
|
|
public $buildPath;
|
|
|
|
|
|
|
|
/**
|
2013-10-26 17:25:34 +02:00
|
|
|
* @var string[]
|
|
|
|
*/
|
|
|
|
public $ignore = array();
|
2013-05-16 03:57:02 +02:00
|
|
|
|
|
|
|
/**
|
2013-10-26 17:25:34 +02:00
|
|
|
* @var string
|
|
|
|
*/
|
2013-05-16 03:57:02 +02:00
|
|
|
protected $directory;
|
|
|
|
|
|
|
|
/**
|
2013-10-26 17:25:34 +02:00
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
protected $verbose = true;
|
2013-05-16 03:57:02 +02:00
|
|
|
|
|
|
|
/**
|
2013-10-26 17:25:34 +02:00
|
|
|
* @var \PHPCI\Model\Build
|
|
|
|
*/
|
2013-05-16 03:57:02 +02:00
|
|
|
protected $build;
|
|
|
|
|
2013-10-26 17:25:34 +02:00
|
|
|
/**
|
|
|
|
* @var LoggerInterface
|
|
|
|
*/
|
|
|
|
protected $logger;
|
2013-05-16 03:57:02 +02:00
|
|
|
|
|
|
|
/**
|
2013-10-26 17:25:34 +02:00
|
|
|
* @var array
|
|
|
|
*/
|
2013-05-16 03:57:02 +02:00
|
|
|
protected $config;
|
2013-10-08 08:21:46 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $lastOutput;
|
|
|
|
|
2013-05-22 20:17:33 +02:00
|
|
|
/**
|
2013-12-17 16:24:13 +01:00
|
|
|
* @var BuildInterpolator
|
2013-05-22 20:17:33 +02:00
|
|
|
*/
|
2013-12-17 16:24:13 +01:00
|
|
|
protected $interpolator;
|
2013-05-16 03:57:02 +02:00
|
|
|
|
2013-10-08 08:21:46 +02:00
|
|
|
/**
|
|
|
|
* @var \PHPCI\Store\BuildStore
|
|
|
|
*/
|
|
|
|
protected $store;
|
|
|
|
|
2013-10-10 02:01:06 +02:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $quiet = false;
|
|
|
|
|
2013-11-17 23:31:51 +01:00
|
|
|
/**
|
2013-12-06 12:26:56 +01:00
|
|
|
* @var \PHPCI\Plugin\Util\Executor
|
2013-11-17 23:31:51 +01:00
|
|
|
*/
|
2013-12-06 12:26:56 +01:00
|
|
|
protected $pluginExecutor;
|
2013-11-17 18:24:47 +01:00
|
|
|
|
2013-12-12 15:15:44 +01:00
|
|
|
/**
|
|
|
|
* @var Helper\CommandExecutor
|
|
|
|
*/
|
|
|
|
protected $commandExecutor;
|
|
|
|
|
2013-12-13 16:57:56 +01:00
|
|
|
/**
|
|
|
|
* @var Logging\BuildLogger
|
|
|
|
*/
|
|
|
|
protected $buildLogger;
|
|
|
|
|
2013-05-16 03:57:02 +02:00
|
|
|
/**
|
2013-10-26 17:25:34 +02:00
|
|
|
* Set up the builder.
|
|
|
|
* @param \PHPCI\Model\Build $build
|
|
|
|
* @param LoggerInterface $logger
|
|
|
|
*/
|
2013-12-13 16:57:56 +01:00
|
|
|
public function __construct(Build $build, LoggerInterface $logger = null)
|
2013-05-16 03:57:02 +02:00
|
|
|
{
|
|
|
|
$this->build = $build;
|
2014-02-25 17:59:28 +01:00
|
|
|
$this->store = Factory::getStore('Build');
|
2013-12-13 16:57:56 +01:00
|
|
|
|
|
|
|
$this->buildLogger = new BuildLogger($logger, $build);
|
|
|
|
|
2014-03-02 21:00:43 +01:00
|
|
|
$pluginFactory = $this->buildPluginFactory($build);
|
|
|
|
$pluginFactory->addConfigFromFile(PHPCI_DIR . "/pluginconfig.php");
|
2014-03-26 08:22:27 +01:00
|
|
|
$this->pluginExecutor = new Plugin\Util\Executor($pluginFactory, $this->buildLogger);
|
2013-12-12 15:15:44 +01:00
|
|
|
|
2014-05-09 14:09:27 +02:00
|
|
|
$executorClass = 'PHPCI\Helper\UnixCommandExecutor';
|
2014-05-09 18:55:13 +02:00
|
|
|
if (IS_WIN) {
|
2014-05-09 14:09:27 +02:00
|
|
|
$executorClass = 'PHPCI\Helper\WindowsCommandExecutor';
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->commandExecutor = new $executorClass(
|
2013-12-13 16:57:56 +01:00
|
|
|
$this->buildLogger,
|
|
|
|
PHPCI_DIR,
|
|
|
|
$this->quiet,
|
|
|
|
$this->verbose
|
|
|
|
);
|
|
|
|
|
2013-12-17 16:24:13 +01:00
|
|
|
$this->interpolator = new BuildInterpolator();
|
2013-05-16 03:57:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-10-26 17:25:34 +02:00
|
|
|
* Set the config array, as read from phpci.yml
|
2014-04-16 10:05:48 +02:00
|
|
|
* @param array|null $config
|
|
|
|
* @throws \Exception
|
2013-10-26 17:25:34 +02:00
|
|
|
*/
|
2014-04-16 10:05:48 +02:00
|
|
|
public function setConfigArray($config)
|
2013-05-16 03:57:02 +02:00
|
|
|
{
|
2014-04-16 10:05:48 +02:00
|
|
|
if (is_null($config) || !is_array($config)) {
|
2014-12-04 16:48:52 +01:00
|
|
|
throw new \Exception(Lang::get('missing_phpci_yml'));
|
2014-04-16 10:05:48 +02:00
|
|
|
}
|
|
|
|
|
2013-05-16 03:57:02 +02:00
|
|
|
$this->config = $config;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-10-26 17:25:34 +02:00
|
|
|
* Access a variable from the phpci.yml file.
|
|
|
|
* @param string
|
2014-04-16 10:05:48 +02:00
|
|
|
* @return mixed
|
2013-10-26 17:25:34 +02:00
|
|
|
*/
|
2013-05-16 03:57:02 +02:00
|
|
|
public function getConfig($key)
|
|
|
|
{
|
2013-10-10 02:01:06 +02:00
|
|
|
$rtn = null;
|
|
|
|
|
|
|
|
if (isset($this->config[$key])) {
|
|
|
|
$rtn = $this->config[$key];
|
|
|
|
}
|
|
|
|
|
|
|
|
return $rtn;
|
2013-05-16 03:57:02 +02:00
|
|
|
}
|
|
|
|
|
2013-06-01 14:28:42 +02:00
|
|
|
/**
|
|
|
|
* Access a variable from the config.yml
|
|
|
|
* @param $key
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getSystemConfig($key)
|
|
|
|
{
|
2013-07-30 03:55:29 +02:00
|
|
|
return Config::getInstance()->get($key);
|
2013-06-01 14:28:42 +02:00
|
|
|
}
|
|
|
|
|
2013-06-04 22:47:45 +02:00
|
|
|
/**
|
|
|
|
* @return string The title of the project being built.
|
|
|
|
*/
|
2013-10-10 02:12:30 +02:00
|
|
|
public function getBuildProjectTitle()
|
|
|
|
{
|
2013-10-10 02:01:06 +02:00
|
|
|
return $this->build->getProject()->getTitle();
|
2013-06-01 14:56:09 +02:00
|
|
|
}
|
|
|
|
|
2013-05-16 03:57:02 +02:00
|
|
|
/**
|
2013-10-26 17:25:34 +02:00
|
|
|
* Run the active build.
|
|
|
|
*/
|
2013-05-16 03:57:02 +02:00
|
|
|
public function execute()
|
|
|
|
{
|
|
|
|
// Update the build in the database, ping any external services.
|
2013-12-07 15:29:25 +01:00
|
|
|
$this->build->setStatus(Build::STATUS_RUNNING);
|
2013-05-16 03:57:02 +02:00
|
|
|
$this->build->setStarted(new \DateTime());
|
|
|
|
$this->store->save($this->build);
|
|
|
|
$this->build->sendStatusPostback();
|
2014-05-02 16:58:21 +02:00
|
|
|
$success = true;
|
2013-05-16 03:57:02 +02:00
|
|
|
|
2015-10-13 17:22:39 +02:00
|
|
|
$previous_build = $this->build->getProject()->getPreviousBuild($this->build->getBranch());
|
|
|
|
|
|
|
|
$previous_state = Build::STATUS_NEW;
|
|
|
|
|
|
|
|
if ($previous_build) {
|
|
|
|
$previous_state = $previous_build->getStatus();
|
|
|
|
}
|
|
|
|
|
2014-04-16 10:05:46 +02:00
|
|
|
try {
|
|
|
|
// Set up the build:
|
|
|
|
$this->setupBuild();
|
|
|
|
|
|
|
|
// Run the core plugin stages:
|
|
|
|
foreach (array('setup', 'test') as $stage) {
|
2014-05-02 16:58:21 +02:00
|
|
|
$success &= $this->pluginExecutor->executePlugins($this->config, $stage);
|
2014-04-16 10:05:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Set the status so this can be used by complete, success and failure
|
|
|
|
// stages.
|
2014-05-02 16:58:21 +02:00
|
|
|
if ($success) {
|
2014-04-16 10:05:46 +02:00
|
|
|
$this->build->setStatus(Build::STATUS_SUCCESS);
|
|
|
|
} else {
|
|
|
|
$this->build->setStatus(Build::STATUS_FAILED);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-02 16:58:21 +02:00
|
|
|
if ($success) {
|
2014-04-16 10:05:46 +02:00
|
|
|
$this->pluginExecutor->executePlugins($this->config, 'success');
|
2015-10-13 17:22:39 +02:00
|
|
|
|
|
|
|
if ($previous_state == Build::STATUS_FAILED) {
|
|
|
|
$this->pluginExecutor->executePlugins($this->config, 'fixed');
|
|
|
|
}
|
|
|
|
|
2014-12-04 16:48:52 +01:00
|
|
|
$this->buildLogger->logSuccess(Lang::get('build_success'));
|
2014-04-16 10:05:46 +02:00
|
|
|
} else {
|
|
|
|
$this->pluginExecutor->executePlugins($this->config, 'failure');
|
2015-10-13 17:22:39 +02:00
|
|
|
|
|
|
|
if ($previous_state == Build::STATUS_SUCCESS || $previous_state == Build::STATUS_NEW) {
|
|
|
|
$this->pluginExecutor->executePlugins($this->config, 'broken');
|
|
|
|
}
|
|
|
|
|
2014-12-04 16:48:52 +01:00
|
|
|
$this->buildLogger->logFailure(Lang::get('build_failed'));
|
2014-04-16 10:05:46 +02:00
|
|
|
}
|
|
|
|
} catch (\Exception $ex) {
|
2013-12-07 15:29:25 +01:00
|
|
|
$this->build->setStatus(Build::STATUS_FAILED);
|
2014-12-04 16:48:52 +01:00
|
|
|
$this->buildLogger->logFailure(Lang::get('exception') . $ex->getMessage());
|
2016-04-27 17:59:29 +02:00
|
|
|
}finally{
|
|
|
|
// Complete stage plugins are always run
|
|
|
|
$this->pluginExecutor->executePlugins($this->config, 'complete');
|
2013-12-07 15:45:13 +01:00
|
|
|
}
|
|
|
|
|
2013-05-16 03:57:02 +02:00
|
|
|
|
|
|
|
// Update the build in the database, ping any external services, etc.
|
|
|
|
$this->build->sendStatusPostback();
|
|
|
|
$this->build->setFinished(new \DateTime());
|
2015-02-27 10:51:18 +01:00
|
|
|
|
|
|
|
// Clean up:
|
|
|
|
$this->buildLogger->log(Lang::get('removing_build'));
|
2016-02-21 18:22:36 +01:00
|
|
|
//$this->build->removeBuildDirectory();
|
2015-02-27 10:51:18 +01:00
|
|
|
|
2013-05-16 03:57:02 +02:00
|
|
|
$this->store->save($this->build);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-10-26 17:25:34 +02:00
|
|
|
* Used by this class, and plugins, to execute shell commands.
|
|
|
|
*/
|
2013-05-16 03:57:02 +02:00
|
|
|
public function executeCommand()
|
|
|
|
{
|
2014-05-09 09:25:24 +02:00
|
|
|
return $this->commandExecutor->executeCommand(func_get_args());
|
2013-05-16 03:57:02 +02:00
|
|
|
}
|
|
|
|
|
2013-10-08 08:21:46 +02:00
|
|
|
/**
|
|
|
|
* Returns the output from the last command run.
|
|
|
|
*/
|
|
|
|
public function getLastOutput()
|
|
|
|
{
|
2013-12-12 15:15:44 +01:00
|
|
|
return $this->commandExecutor->getLastOutput();
|
2013-10-08 08:21:46 +02:00
|
|
|
}
|
|
|
|
|
2014-12-08 12:25:33 +01:00
|
|
|
/**
|
|
|
|
* Specify whether exec output should be logged.
|
|
|
|
* @param bool $enableLog
|
|
|
|
*/
|
2014-04-25 13:28:27 +02:00
|
|
|
public function logExecOutput($enableLog = true)
|
|
|
|
{
|
|
|
|
$this->commandExecutor->logExecOutput = $enableLog;
|
|
|
|
}
|
|
|
|
|
2013-12-12 17:17:11 +01:00
|
|
|
/**
|
|
|
|
* Find a binary required by a plugin.
|
2015-04-14 12:17:52 +02:00
|
|
|
* @param string $binary
|
|
|
|
* @param bool $quiet
|
|
|
|
*
|
2013-12-12 17:17:11 +01:00
|
|
|
* @return null|string
|
|
|
|
*/
|
2015-04-14 12:17:52 +02:00
|
|
|
public function findBinary($binary, $quiet = false)
|
2013-12-12 17:17:11 +01:00
|
|
|
{
|
2015-04-14 12:17:52 +02:00
|
|
|
return $this->commandExecutor->findBinary($binary, $quiet = false);
|
2013-12-12 17:17:11 +01:00
|
|
|
}
|
|
|
|
|
2013-05-22 20:17:33 +02:00
|
|
|
/**
|
2013-12-17 16:24:13 +01:00
|
|
|
* Replace every occurrence of the interpolation vars in the given string
|
2013-05-22 20:17:33 +02:00
|
|
|
* Example: "This is build %PHPCI_BUILD%" => "This is build 182"
|
|
|
|
* @param string $input
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function interpolate($input)
|
|
|
|
{
|
2013-12-17 16:24:13 +01:00
|
|
|
return $this->interpolator->interpolate($input);
|
2013-05-22 20:17:33 +02:00
|
|
|
}
|
2013-10-26 17:25:34 +02:00
|
|
|
|
2013-05-16 03:57:02 +02:00
|
|
|
/**
|
2013-10-26 17:25:34 +02:00
|
|
|
* Set up a working copy of the project for building.
|
|
|
|
*/
|
2013-05-16 03:57:02 +02:00
|
|
|
protected function setupBuild()
|
|
|
|
{
|
2015-10-15 11:07:54 +02:00
|
|
|
$this->buildPath = $this->build->getBuildPath();
|
2013-10-26 17:25:34 +02:00
|
|
|
|
2013-12-17 16:24:13 +01:00
|
|
|
$this->interpolator->setupInterpolationVars(
|
|
|
|
$this->build,
|
|
|
|
$this->buildPath,
|
|
|
|
PHPCI_URL
|
|
|
|
);
|
2013-10-26 17:25:34 +02:00
|
|
|
|
2015-02-23 15:40:20 +01:00
|
|
|
$this->commandExecutor->setBuildPath($this->buildPath);
|
|
|
|
|
2013-05-16 03:57:02 +02:00
|
|
|
// Create a working copy of the project:
|
|
|
|
if (!$this->build->createWorkingCopy($this, $this->buildPath)) {
|
2014-12-04 16:48:52 +01:00
|
|
|
throw new \Exception(Lang::get('could_not_create_working'));
|
2013-05-16 03:57:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Does the project's phpci.yml request verbose mode?
|
|
|
|
if (!isset($this->config['build_settings']['verbose']) || !$this->config['build_settings']['verbose']) {
|
|
|
|
$this->verbose = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Does the project have any paths it wants plugins to ignore?
|
|
|
|
if (isset($this->config['build_settings']['ignore'])) {
|
|
|
|
$this->ignore = $this->config['build_settings']['ignore'];
|
|
|
|
}
|
|
|
|
|
2014-12-04 16:48:52 +01:00
|
|
|
$this->buildLogger->logSuccess(Lang::get('working_copy_created', $this->buildPath));
|
2013-05-16 03:57:02 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-10-26 17:25:34 +02:00
|
|
|
/**
|
|
|
|
* Sets a logger instance on the object
|
|
|
|
*
|
|
|
|
* @param LoggerInterface $logger
|
|
|
|
* @return null
|
|
|
|
*/
|
|
|
|
public function setLogger(LoggerInterface $logger)
|
|
|
|
{
|
2013-12-13 16:57:56 +01:00
|
|
|
$this->buildLogger->setLogger($logger);
|
|
|
|
}
|
|
|
|
|
2014-12-08 12:25:33 +01:00
|
|
|
/**
|
|
|
|
* Write to the build log.
|
|
|
|
* @param $message
|
|
|
|
* @param string $level
|
|
|
|
* @param array $context
|
|
|
|
*/
|
2013-12-13 16:57:56 +01:00
|
|
|
public function log($message, $level = LogLevel::INFO, $context = array())
|
|
|
|
{
|
|
|
|
$this->buildLogger->log($message, $level, $context);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a success-coloured message to the log.
|
|
|
|
* @param string
|
|
|
|
*/
|
|
|
|
public function logSuccess($message)
|
|
|
|
{
|
|
|
|
$this->buildLogger->logSuccess($message);
|
2013-10-26 17:25:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-12-13 16:57:56 +01:00
|
|
|
* Add a failure-coloured message to the log.
|
|
|
|
* @param string $message
|
|
|
|
* @param \Exception $exception The exception that caused the error.
|
2013-10-26 17:25:34 +02:00
|
|
|
*/
|
2013-12-13 16:57:56 +01:00
|
|
|
public function logFailure($message, \Exception $exception = null)
|
2013-10-26 17:25:34 +02:00
|
|
|
{
|
2013-12-13 16:57:56 +01:00
|
|
|
$this->buildLogger->logFailure($message, $exception);
|
2013-10-26 17:25:34 +02:00
|
|
|
}
|
2014-03-02 21:00:43 +01:00
|
|
|
/**
|
|
|
|
* Returns a configured instance of the plugin factory.
|
|
|
|
*
|
|
|
|
* @param Build $build
|
2014-03-25 15:13:45 +01:00
|
|
|
* @return PluginFactory
|
2014-03-02 21:00:43 +01:00
|
|
|
*/
|
2013-12-06 12:26:56 +01:00
|
|
|
private function buildPluginFactory(Build $build)
|
2013-11-17 18:24:47 +01:00
|
|
|
{
|
2014-03-25 15:13:45 +01:00
|
|
|
$pluginFactory = new PluginFactory();
|
2013-11-17 18:24:47 +01:00
|
|
|
|
|
|
|
$self = $this;
|
2013-12-06 12:26:56 +01:00
|
|
|
$pluginFactory->registerResource(
|
2014-03-10 13:28:42 +01:00
|
|
|
function () use ($self) {
|
2013-11-17 18:24:47 +01:00
|
|
|
return $self;
|
|
|
|
},
|
|
|
|
null,
|
2013-11-17 22:26:38 +01:00
|
|
|
'PHPCI\Builder'
|
2013-11-17 18:24:47 +01:00
|
|
|
);
|
|
|
|
|
2013-12-06 12:26:56 +01:00
|
|
|
$pluginFactory->registerResource(
|
2014-03-10 13:28:42 +01:00
|
|
|
function () use ($build) {
|
2013-11-17 18:24:47 +01:00
|
|
|
return $build;
|
|
|
|
},
|
|
|
|
null,
|
2013-11-17 22:26:38 +01:00
|
|
|
'PHPCI\Model\Build'
|
|
|
|
);
|
|
|
|
|
2014-03-10 13:27:17 +01:00
|
|
|
$logger = $this->logger;
|
|
|
|
$pluginFactory->registerResource(
|
|
|
|
function () use ($logger) {
|
|
|
|
return $logger;
|
|
|
|
},
|
|
|
|
null,
|
|
|
|
'Psr\Log\LoggerInterface'
|
|
|
|
);
|
|
|
|
|
2013-12-06 12:26:56 +01:00
|
|
|
$pluginFactory->registerResource(
|
2013-11-17 22:26:38 +01:00
|
|
|
function () use ($self) {
|
|
|
|
$factory = new MailerFactory($self->getSystemConfig('phpci'));
|
|
|
|
return $factory->getSwiftMailerFromConfig();
|
|
|
|
},
|
|
|
|
null,
|
2013-11-17 22:29:49 +01:00
|
|
|
'Swift_Mailer'
|
2013-11-17 18:24:47 +01:00
|
|
|
);
|
2013-12-06 12:26:56 +01:00
|
|
|
|
|
|
|
return $pluginFactory;
|
2013-11-17 18:24:47 +01:00
|
|
|
}
|
2015-10-13 17:31:17 +02:00
|
|
|
}
|