Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[WebProfilerBundle] injected Request object into the controller inste…
…ad of getting it from the container
  • Loading branch information
fabpot committed Jul 14, 2012
1 parent 5fb7214 commit 4b2230d
Showing 1 changed file with 20 additions and 17 deletions.
Expand Up @@ -41,8 +41,8 @@ public function panelAction(Request $request, $token)
$profiler = $this->container->get('profiler');
$profiler->disable();

$panel = $this->container->get('request')->query->get('panel', 'request');
$page = $this->container->get('request')->query->get('page', 'home');
$panel = $request->query->get('panel', 'request');
$page = $request->query->get('page', 'home');

if (!$profile = $profiler->loadProfile($token)) {
return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:info.html.twig', array('about' => 'no_token', 'token' => $token));
Expand Down Expand Up @@ -144,14 +144,14 @@ public function infoAction($about)
/**
* Renders the Web Debug Toolbar.
*
* @param string $token The profiler token
* @param string $position The toolbar position (top, bottom, normal, or null -- use the configuration)
* @param Request $request The current Request
* @param string $token The profiler token
* @param string $position The toolbar position (top, bottom, normal, or null -- use the configuration)
*
* @return Response A Response instance
*/
public function toolbarAction($token, $position = null)
public function toolbarAction(Request $request, $token, $position = null)
{
$request = $this->container->get('request');
$session = $request->getSession();

if (null !== $session && $session->getFlashBag() instanceof AutoExpireFlashBag) {
Expand Down Expand Up @@ -192,14 +192,16 @@ public function toolbarAction($token, $position = null)
/**
* Renders the profiler search bar.
*
* @param Request $request The current Request
*
* @return Response A Response instance
*/
public function searchBarAction()
public function searchBarAction(Request $request)
{
$profiler = $this->container->get('profiler');
$profiler->disable();

if (null === $session = $this->container->get('request')->getSession()) {
if (null === $session = $request->getSession()) {
$ip =
$method =
$url =
Expand All @@ -225,21 +227,22 @@ public function searchBarAction()
/**
* Search results.
*
* @param string $token The token
* @param Request $request The current Request
* @param string $token The token
*
* @return Response A Response instance
*/
public function searchResultsAction($token)
public function searchResultsAction(Request $request, $token)
{
$profiler = $this->container->get('profiler');
$profiler->disable();

$profile = $profiler->loadProfile($token);

$ip = $this->container->get('request')->query->get('ip');
$method = $this->container->get('request')->query->get('method');
$url = $this->container->get('request')->query->get('url');
$limit = $this->container->get('request')->query->get('limit');
$ip = $request->query->get('ip');
$method = $request->query->get('method');
$url = $request->query->get('url');
$limit = $request->query->get('limit');

return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:results.html.twig', array(
'token' => $token,
Expand All @@ -256,15 +259,15 @@ public function searchResultsAction($token)
/**
* Narrow the search bar.
*
* @param Request $request The current Request
*
* @return Response A Response instance
*/
public function searchAction()
public function searchAction(Request $request)
{
$profiler = $this->container->get('profiler');
$profiler->disable();

$request = $this->container->get('request');

$ip = preg_replace('/[^:\d\.]/', '', $request->query->get('ip'));
$method = $request->query->get('method');
$url = $request->query->get('url');
Expand Down

0 comments on commit 4b2230d

Please sign in to comment.