feature #13046 [3.0] [Bridge] [Swiftmailer] removed Swiftmailer bridge namespace. (hhamon)

This PR was merged into the 3.0-dev branch.

Discussion
----------

[3.0] [Bridge] [Swiftmailer] removed Swiftmailer bridge namespace.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Commits
-------

c70a616 [Bridge] [Swiftmailer] removes Swiftmailer bridge namespace.
This commit is contained in:
Fabien Potencier 2014-12-21 11:24:01 +01:00
commit 4c1ab52161
7 changed files with 3 additions and 155 deletions

View File

@ -1006,3 +1006,6 @@ UPGRADE FROM 2.x to 3.0
* `Symfony\Bridge\Monolog\Logger::err()` was removed. Use `error()` which is PSR-3 compatible.
* `Symfony\Bridge\Monolog\Logger::warn()` was removed. Use `warning()` which is PSR-3 compatible.
### Swiftmailer Bridge
* `Symfony\Bridge\Swiftmailer\DataCollector\MessageDataCollector` was removed. Use the `Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector` class instead.

View File

@ -57,7 +57,6 @@
"symfony/security-bundle": "self.version",
"symfony/serializer": "self.version",
"symfony/stopwatch": "self.version",
"symfony/swiftmailer-bridge": "self.version",
"symfony/templating": "self.version",
"symfony/translation": "self.version",
"symfony/twig-bridge": "self.version",

View File

@ -1,3 +0,0 @@
vendor/
composer.lock
phpunit.xml

View File

@ -1,7 +0,0 @@
CHANGELOG
=========
2.1.0
-----
* added a data collector

View File

@ -1,90 +0,0 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\Swiftmailer\DataCollector;
trigger_error(__CLASS__.' class is deprecated since version 2.4 and will be removed in 3.0. Use the Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector class from SwiftmailerBundle instead. Require symfony/swiftmailer-bundle package to download SwiftmailerBundle with Composer.', E_USER_DEPRECATED);
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* MessageDataCollector.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Clément JOBEILI <clement.jobeili@gmail.com>
*
* @deprecated Deprecated since version 2.4, to be removed in 3.0. Use
* MessageDataCollector of SwiftmailerBundle instead.
*/
class MessageDataCollector extends DataCollector
{
private $container;
private $isSpool;
/**
* Constructor.
*
* We don't inject the message logger and mailer here
* to avoid the creation of these objects when no emails are sent.
*
* @param ContainerInterface $container A ContainerInterface instance
* @param bool $isSpool
*/
public function __construct(ContainerInterface $container, $isSpool)
{
$this->container = $container;
$this->isSpool = $isSpool;
}
/**
* {@inheritdoc}
*/
public function collect(Request $request, Response $response, \Exception $exception = null)
{
// only collect when Swiftmailer has already been initialized
if (class_exists('Swift_Mailer', false)) {
$logger = $this->container->get('swiftmailer.plugin.messagelogger');
$this->data['messages'] = $logger->getMessages();
$this->data['messageCount'] = $logger->countMessages();
} else {
$this->data['messages'] = array();
$this->data['messageCount'] = 0;
}
$this->data['isSpool'] = $this->isSpool;
}
public function getMessageCount()
{
return $this->data['messageCount'];
}
public function getMessages()
{
return $this->data['messages'];
}
public function isSpool()
{
return $this->data['isSpool'];
}
/**
* {@inheritdoc}
*/
public function getName()
{
return 'swiftmailer';
}
}

View File

@ -1,19 +0,0 @@
Copyright (c) 2004-2014 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -1,35 +0,0 @@
{
"name": "symfony/swiftmailer-bridge",
"type": "symfony-bridge",
"description": "Symfony Swiftmailer Bridge",
"keywords": [],
"homepage": "http://symfony.com",
"license": "MIT",
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"require": {
"php": ">=5.3.3",
"swiftmailer/swiftmailer": ">=4.2.0,<6.0-dev"
},
"suggest": {
"symfony/http-kernel": ""
},
"autoload": {
"psr-0": { "Symfony\\Bridge\\Swiftmailer\\": "" }
},
"target-dir": "Symfony/Bridge/Swiftmailer",
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
}
}