Commit 51622a78 authored by Fabien Potencier's avatar Fabien Potencier

merged branch luisgonzalez/1.0 (PR #707)

This PR was merged into the 1.0 branch.

Discussion
----------

add '_route' key to RedirectableUrlMatcher::redirect

When there is a logger, the Symfony\Compoment\HttpKernel\EventListener\RouterListener::onKernelRequest method expects the '_route' key to exist in order to log the matched route and issues a PHP Notice

    <?php
    date_default_timezone_set('America/Los_Angeles');

    require_once __DIR__ . '/../vendor/autoload.php';
    Symfony\Component\HttpKernel\Debug\ErrorHandler::register();
    $app = new Silex\Application();
    $app['debug'] = true;
    $app['monolog.logfile'] = 'C:/TEMP/log.log';
    $app->register(new \Silex\Provider\MonologServiceProvider());
    $app->get('/a/', function() {
        return 'done';
    });

    $app->run();

*[url]/a* issues the notice before redirecting to */a/*

Commits
-------

3d1a868c add '_route' key to RedirectableUrlMatcher::redirect
parents a7a7ef41 3d1a868c
......@@ -54,6 +54,7 @@ class RedirectableUrlMatcher extends BaseRedirectableUrlMatcher
return array(
'_controller' => function ($url) { return new RedirectResponse($url, 301); },
'_route' => null,
'url' => $url,
);
}
......
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