diff --git a/src/Symfony/Bridge/Swiftmailer/DataCollector/MessageDataCollector.php b/src/Symfony/Bridge/Swiftmailer/DataCollector/MessageDataCollector.php new file mode 100644 index 0000000000..5b96618547 --- /dev/null +++ b/src/Symfony/Bridge/Swiftmailer/DataCollector/MessageDataCollector.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bridge\Swiftmailer\DataCollector; + +use Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector as BaseMessageDataCollector; + +/** + * MessageDataCollector. + * + * Added for forwards compatibility with Symfony2.1 + */ +class MessageDataCollector extends BaseMessageDataCollector +{ +} diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index 45e66bf2ed..88004b4fbf 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -845,6 +845,24 @@ class Request $this->format = $format; } + public function setLocale($locale) + { + if (!$this->hasSession()) { + throw new \LogicException('Forward compatibility for Request::setLocale() requires the session to be set.'); + } + + $this->session->setLocale($locale); + } + + public function getLocale() + { + if (!$this->hasSession()) { + throw new \LogicException('Forward compatibility for Request::getLocale() requires the session to be set.'); + } + + return $this->session->getLocale(); + } + /** * Checks whether the method is safe or not. *