Commit fb1e41e5 authored by Fabien Potencier's avatar Fabien Potencier

removed deprecated features, BC layers

parent 55bbb1ef
......@@ -26,22 +26,6 @@ please join us on the `mailing list
Any code you contribute must be licensed under the MIT
License.
Target branch
=============
Before you create a pull request for Silex, you need to determine which branch
to submit it to. Read this section carefully first.
Silex has two active branches: `1.0` and `master` (`1.1`).
* **1.0**: Bugfixes and documentation fixes go into the 1.0 branch. 1.0 is
periodically merged into master. The 1.0 branch targets versions 2.1, 2.2 and
2.3 of Symfony2.
* **1.1**: All new features go into the 1.1 branch. Changes cannot break
backward compatibility. The 1.1 branch targets the 2.3 version of Symfony2.
Writing Documentation
=====================
......
......@@ -215,8 +215,7 @@ methods on your application: ``get``, ``post``, ``put``, ``delete``::
<input type="hidden" id="_method" name="_method" value="PUT" />
</form>
If you are using Symfony Components 2.2+, you will need to explicitly
enable this method override::
You need to explicitly enable this method override::
use Symfony\Component\HttpFoundation\Request;
......@@ -685,19 +684,11 @@ To further customize the response before returning it, check the API doc for
->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, 'pic.jpg')
;
.. note::
HttpFoundation 2.2 or greater is required for this feature to be available.
Traits
------
Silex comes with PHP traits that define shortcut methods.
.. caution::
You need to use PHP 5.4 or later to benefit from this feature.
Almost all built-in service providers have some corresponding PHP traits. To
use them, define your own Application class and include the traits you want::
......
......@@ -120,13 +120,12 @@ point:
.. _FallbackResource directive: http://www.adayinthelifeof.nl/2012/01/21/apaches-fallbackresource-your-new-htaccess-command/
PHP 5.4
-------
PHP
---
PHP 5.4 ships with a built-in webserver for development. This server allows
you to run silex without any configuration. However, in order to serve static
files, you'll have to make sure your front controller returns false in that
case::
PHP ships with a built-in webserver for development. This server allows you to
run silex without any configuration. However, in order to serve static files,
you'll have to make sure your front controller returns false in that case::
// web/index.php
......
......@@ -32,20 +32,8 @@ class ExceptionHandler implements EventSubscriberInterface
$this->enabled = true;
}
/**
* @deprecated since 1.3, to be removed in 2.0
*/
public function disable()
{
$this->enabled = false;
}
public function onSilexError(GetResponseForExceptionEvent $event)
{
if (!$this->enabled) {
return;
}
$handler = new DebugExceptionHandler($this->debug);
$event->setResponse($handler->createResponse($event->getException()));
......
......@@ -30,7 +30,7 @@ class RememberMeServiceProvider implements ServiceProviderInterface, EventListen
public function register(Container $app)
{
$app['security.remember_me.response_listener'] = function ($app) {
if (!isset($app['security'])) {
if (!isset($app['security.token_storage'])) {
throw new \LogicException('You must register the SecurityServiceProvider to use the RememberMeServiceProvider');
}
......
......@@ -82,7 +82,6 @@ class SecurityServiceProvider implements ServiceProviderInterface, EventListener
$r = new \ReflectionMethod('Symfony\Component\Security\Http\Firewall\ContextListener', '__construct');
$params = $r->getParameters();
if ('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface' === $params[0]->getClass()->getName()) {
$app['security.authorization_checker'] = function ($app) {
return new AuthorizationChecker($app['security.token_storage'], $app['security.authentication_manager'], $app['security.access_manager']);
};
......@@ -91,21 +90,6 @@ class SecurityServiceProvider implements ServiceProviderInterface, EventListener
return new TokenStorage();
};
$app['security'] = function ($app) {
// Deprecated, to be removed in 2.0
return new SecurityContext($app['security.token_storage'], $app['security.authorization_checker']);
};
} else {
$app['security.token_storage'] = $app['security.authorization_checker'] = function ($app) {
return $app['security'];
};
$app['security'] = function ($app) {
// Deprecated, to be removed in 2.0
return new SecurityContext($app['security.authentication_manager'], $app['security.access_manager']);
};
}
$app['security.authentication_manager'] = function ($app) {
$manager = new AuthenticationProviderManager($app['security.authentication_providers']);
$manager->setEventDispatcher($app['dispatcher']);
......
......@@ -36,12 +36,6 @@ class TranslationServiceProvider implements ServiceProviderInterface, EventListe
}
$translator = new Translator($app['locale'], $app['translator.message_selector'], $app['translator.cache_dir'], $app['debug']);
// Handle deprecated 'locale_fallback'
if (isset($app['locale_fallback'])) {
$app['locale_fallbacks'] = (array) $app['locale_fallback'];
}
$translator->setFallbackLocales($app['locale_fallbacks']);
$translator->addLoader('array', new ArrayLoader());
$translator->addLoader('xliff', new XliffFileLoader());
......
......@@ -17,8 +17,6 @@ use Silex\Provider\FormServiceProvider;
* FormTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class FormTraitTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -19,8 +19,6 @@ use Monolog\Logger;
* MonologTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class MonologTraitTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -20,8 +20,6 @@ use Symfony\Component\HttpFoundation\Request;
* SecurityTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class SecurityTraitTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -17,8 +17,6 @@ use Silex\Provider\SwiftmailerServiceProvider;
* SwiftmailerTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class SwiftmailerTraitTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -17,8 +17,6 @@ use Silex\Provider\TranslationServiceProvider;
* TranslationTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class TranslationTraitTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -19,8 +19,6 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
* TwigTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class TwigTraitTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -19,8 +19,6 @@ use Silex\Provider\UrlGeneratorServiceProvider;
* UrlGeneratorTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @requires PHP 5.4
*/
class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase
{
......
......@@ -189,7 +189,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
public function testNoResponseExceptionHandler()
{
$app = new Application();
$app['exception_handler']->disable();
unset($app['exception_handler']);
$app->match('/foo', function () {
throw new \RuntimeException('foo exception');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment