feature #16069 [WebProfilerBundle] Move AjaxCollector to HttpKernel for use with Silex (glaubinix, fabpot)
This PR was merged into the 2.8 branch. Discussion ---------- [WebProfilerBundle] Move AjaxCollector to HttpKernel for use with Silex | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This PR moves the AjaxDataCollector from the FrameworkBundle to the HttpKernel Component where most of the other DataCollectors are. This would allow applications which are not base on symfony/framework-bundle to use the collector. Like for instance applications based on silex or symfony components. Commits -------3841f46
added missing a deprecated noticec227806
Move AjaxCollector for use without framework bundle
This commit is contained in:
commit
584cfc24a1
@ -11,24 +11,17 @@
|
|||||||
|
|
||||||
namespace Symfony\Bundle\FrameworkBundle\DataCollector;
|
namespace Symfony\Bundle\FrameworkBundle\DataCollector;
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpKernel\DataCollector\AjaxDataCollector as BaseAjaxDataCollector;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
|
@trigger_error('The '.__NAMESPACE__.'\AjaxDataCollector class is deprecated since version 2.8 and will be removed in 3.0. Use Symfony\Component\HttpKernel\DataCollector\AjaxDataCollector instead.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AjaxDataCollector.
|
* AjaxDataCollector.
|
||||||
*
|
*
|
||||||
* @author Bart van den Burg <bart@burgov.nl>
|
* @author Bart van den Burg <bart@burgov.nl>
|
||||||
|
*
|
||||||
|
* @deprecated since version 2.8, to be removed in 3.0.
|
||||||
*/
|
*/
|
||||||
class AjaxDataCollector extends DataCollector
|
class AjaxDataCollector extends BaseAjaxDataCollector
|
||||||
{
|
{
|
||||||
public function collect(Request $request, Response $response, \Exception $exception = null)
|
|
||||||
{
|
|
||||||
// all collecting is done client side
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getName()
|
|
||||||
{
|
|
||||||
return 'ajax';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<tag name="data_collector" template="@WebProfiler/Collector/request.html.twig" id="request" priority="335" />
|
<tag name="data_collector" template="@WebProfiler/Collector/request.html.twig" id="request" priority="335" />
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service id="data_collector.ajax" class="Symfony\Bundle\FrameworkBundle\DataCollector\AjaxDataCollector" public="false">
|
<service id="data_collector.ajax" class="Symfony\Component\HttpKernel\DataCollector\AjaxDataCollector" public="false">
|
||||||
<tag name="data_collector" template="@WebProfiler/Collector/ajax.html.twig" id="ajax" priority="315" />
|
<tag name="data_collector" template="@WebProfiler/Collector/ajax.html.twig" id="ajax" priority="315" />
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
<?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\Component\HttpKernel\DataCollector;
|
||||||
|
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AjaxDataCollector.
|
||||||
|
*
|
||||||
|
* @author Bart van den Burg <bart@burgov.nl>
|
||||||
|
*/
|
||||||
|
class AjaxDataCollector extends DataCollector
|
||||||
|
{
|
||||||
|
public function collect(Request $request, Response $response, \Exception $exception = null)
|
||||||
|
{
|
||||||
|
// all collecting is done client side
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return 'ajax';
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user