Remove profiler storages
This commit is contained in:
parent
b630972379
commit
83b2d7c53b
107
UPGRADE-2.8.md
107
UPGRADE-2.8.md
@ -332,66 +332,81 @@ DependencyInjection
|
|||||||
WebProfiler
|
WebProfiler
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
The `profiler:import` and `profiler:export` commands have been deprecated and
|
* The `profiler:import` and `profiler:export` commands have been deprecated and
|
||||||
will be removed in 3.0.
|
will be removed in 3.0.
|
||||||
|
|
||||||
The web development toolbar has been completely redesigned. This update has
|
* The web development toolbar has been completely redesigned. This update has
|
||||||
introduced some changes in the HTML markup of the toolbar items.
|
introduced some changes in the HTML markup of the toolbar items.
|
||||||
|
|
||||||
Before:
|
Before:
|
||||||
|
|
||||||
Information was wrapped with simple `<span>` elements:
|
Information was wrapped with simple `<span>` elements:
|
||||||
|
|
||||||
```twig
|
```twig
|
||||||
{% block toolbar %}
|
{% block toolbar %}
|
||||||
{% set icon %}
|
{% set icon %}
|
||||||
<span>
|
<span>
|
||||||
<svg ...></svg>
|
<svg ...></svg>
|
||||||
<span>{{ '%.1f'|format(collector.memory / 1024 / 1024) }} MB</span>
|
<span>{{ '%.1f'|format(collector.memory / 1024 / 1024) }} MB</span>
|
||||||
</span>
|
</span>
|
||||||
{% endset %}
|
{% endset %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
```
|
```
|
||||||
|
|
||||||
After:
|
After:
|
||||||
|
|
||||||
Information is now semantically divided into values and labels according to
|
Information is now semantically divided into values and labels according to
|
||||||
the `class` attribute of each `<span>` element:
|
the `class` attribute of each `<span>` element:
|
||||||
|
|
||||||
```twig
|
```twig
|
||||||
{% block toolbar %}
|
{% block toolbar %}
|
||||||
{% set icon %}
|
{% set icon %}
|
||||||
<svg ...></svg>
|
<svg ...></svg>
|
||||||
<span class="sf-toolbar-value">
|
<span class="sf-toolbar-value">
|
||||||
{{ '%.1f'|format(collector.memory / 1024 / 1024) }}
|
{{ '%.1f'|format(collector.memory / 1024 / 1024) }}
|
||||||
</span>
|
</span>
|
||||||
<span class="sf-toolbar-label">MB</span>
|
<span class="sf-toolbar-label">MB</span>
|
||||||
{% endset %}
|
{% endset %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
```
|
```
|
||||||
|
|
||||||
Most of the blocks designed for the previous toolbar will still be displayed
|
Most of the blocks designed for the previous toolbar will still be displayed
|
||||||
correctly. However, if you want to support both the old and the new toolbar,
|
correctly. However, if you want to support both the old and the new toolbar,
|
||||||
it's better to make use of the new `profiler_markup_version` variable passed
|
it's better to make use of the new `profiler_markup_version` variable passed
|
||||||
to the toolbar templates:
|
to the toolbar templates:
|
||||||
|
|
||||||
```twig
|
```twig
|
||||||
{% block toolbar %}
|
{% block toolbar %}
|
||||||
{% set profiler_markup_version = profiler_markup_version|default(1) %}
|
{% set profiler_markup_version = profiler_markup_version|default(1) %}
|
||||||
|
|
||||||
{% set icon %}
|
{% set icon %}
|
||||||
{% if profiler_markup_version == 1 %}
|
{% if profiler_markup_version == 1 %}
|
||||||
|
|
||||||
{# code for the original toolbar #}
|
{# code for the original toolbar #}
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
{# code for the new toolbar (Symfony 2.8+) #}
|
{# code for the new toolbar (Symfony 2.8+) #}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endset %}
|
{% endset %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* All the profiler storages different than `FileProfilerStorage` have been
|
||||||
|
deprecated. The deprecated classes are:
|
||||||
|
|
||||||
|
- `Symfony\Component\HttpKernel\Profiler\BaseMemcacheProfilerStorage`
|
||||||
|
- `Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage`
|
||||||
|
- `Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage`
|
||||||
|
- `Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage`
|
||||||
|
- `Symfony\Component\HttpKernel\Profiler\MysqlProfilerStorage`
|
||||||
|
- `Symfony\Component\HttpKernel\Profiler\PdoProfilerStorage`
|
||||||
|
- `Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage`
|
||||||
|
- `Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage`
|
||||||
|
|
||||||
|
The alternative solution is to use the `FileProfilerStorage` or create your
|
||||||
|
own storage implementing the `ProfileStorageInterface`.
|
||||||
|
|
||||||
FrameworkBundle
|
FrameworkBundle
|
||||||
---------------
|
---------------
|
||||||
|
@ -272,9 +272,39 @@ class Configuration implements ConfigurationInterface
|
|||||||
->booleanNode('collect')->defaultTrue()->end()
|
->booleanNode('collect')->defaultTrue()->end()
|
||||||
->booleanNode('only_exceptions')->defaultFalse()->end()
|
->booleanNode('only_exceptions')->defaultFalse()->end()
|
||||||
->booleanNode('only_master_requests')->defaultFalse()->end()
|
->booleanNode('only_master_requests')->defaultFalse()->end()
|
||||||
->scalarNode('dsn')->defaultValue('file:%kernel.cache_dir%/profiler')->end()
|
->scalarNode('dsn')
|
||||||
->scalarNode('username')->defaultValue('')->end()
|
->defaultValue('file:%kernel.cache_dir%/profiler')
|
||||||
->scalarNode('password')->defaultValue('')->end()
|
->beforeNormalization()
|
||||||
|
->ifTrue(function ($v) { return 'file:' !== substr($v, 0, 5); })
|
||||||
|
->then(function ($v) {
|
||||||
|
@trigger_error('The profiler.dsn configuration key must start with "file:" because all the storages except the filesystem are deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
|
return $v;
|
||||||
|
})
|
||||||
|
->end()
|
||||||
|
->end()
|
||||||
|
->scalarNode('username')
|
||||||
|
->defaultValue('')
|
||||||
|
->beforeNormalization()
|
||||||
|
->always()
|
||||||
|
->then(function ($v) {
|
||||||
|
@trigger_error('The profiler.username configuration key is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
|
return $v;
|
||||||
|
})
|
||||||
|
->end()
|
||||||
|
->end()
|
||||||
|
->scalarNode('password')
|
||||||
|
->defaultValue('')
|
||||||
|
->beforeNormalization()
|
||||||
|
->always()
|
||||||
|
->then(function ($v) {
|
||||||
|
@trigger_error('The profiler.password configuration key is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
|
return $v;
|
||||||
|
})
|
||||||
|
->end()
|
||||||
|
->end()
|
||||||
->scalarNode('lifetime')->defaultValue(86400)->end()
|
->scalarNode('lifetime')->defaultValue(86400)->end()
|
||||||
->arrayNode('matcher')
|
->arrayNode('matcher')
|
||||||
->canBeUnset()
|
->canBeUnset()
|
||||||
|
@ -11,10 +11,15 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\HttpKernel\Profiler;
|
namespace Symfony\Component\HttpKernel\Profiler;
|
||||||
|
|
||||||
|
@trigger_error('The '.__NAMESPACE__.'\BaseMemcacheProfilerStorage class is deprecated since Symfony 2.8 and will be removed in 3.0. Use FileProfilerStorage instead.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base Memcache storage for profiling information in a Memcache.
|
* Base Memcache storage for profiling information in a Memcache.
|
||||||
*
|
*
|
||||||
* @author Andrej Hudec <pulzarraider@gmail.com>
|
* @author Andrej Hudec <pulzarraider@gmail.com>
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since Symfony 2.8, to be removed in Symfony 3.0.
|
||||||
|
* Use {@link FileProfilerStorage} instead.
|
||||||
*/
|
*/
|
||||||
abstract class BaseMemcacheProfilerStorage implements ProfilerStorageInterface
|
abstract class BaseMemcacheProfilerStorage implements ProfilerStorageInterface
|
||||||
{
|
{
|
||||||
|
@ -11,10 +11,15 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\HttpKernel\Profiler;
|
namespace Symfony\Component\HttpKernel\Profiler;
|
||||||
|
|
||||||
|
@trigger_error('The '.__NAMESPACE__.'\MemcacheProfilerStorage class is deprecated since Symfony 2.8 and will be removed in 3.0. Use FileProfilerStorage instead.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Memcache Profiler Storage.
|
* Memcache Profiler Storage.
|
||||||
*
|
*
|
||||||
* @author Andrej Hudec <pulzarraider@gmail.com>
|
* @author Andrej Hudec <pulzarraider@gmail.com>
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since Symfony 2.8, to be removed in Symfony 3.0.
|
||||||
|
* Use {@link FileProfilerStorage} instead.
|
||||||
*/
|
*/
|
||||||
class MemcacheProfilerStorage extends BaseMemcacheProfilerStorage
|
class MemcacheProfilerStorage extends BaseMemcacheProfilerStorage
|
||||||
{
|
{
|
||||||
|
@ -11,10 +11,15 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\HttpKernel\Profiler;
|
namespace Symfony\Component\HttpKernel\Profiler;
|
||||||
|
|
||||||
|
@trigger_error('The '.__NAMESPACE__.'\MemcachedProfilerStorage class is deprecated since Symfony 2.8 and will be removed in 3.0. Use FileProfilerStorage instead.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Memcached Profiler Storage.
|
* Memcached Profiler Storage.
|
||||||
*
|
*
|
||||||
* @author Andrej Hudec <pulzarraider@gmail.com>
|
* @author Andrej Hudec <pulzarraider@gmail.com>
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since Symfony 2.8, to be removed in Symfony 3.0.
|
||||||
|
* Use {@link FileProfilerStorage} instead.
|
||||||
*/
|
*/
|
||||||
class MemcachedProfilerStorage extends BaseMemcacheProfilerStorage
|
class MemcachedProfilerStorage extends BaseMemcacheProfilerStorage
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,12 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\HttpKernel\Profiler;
|
namespace Symfony\Component\HttpKernel\Profiler;
|
||||||
|
|
||||||
|
@trigger_error('The '.__NAMESPACE__.'\MongoDbProfilerStorage class is deprecated since Symfony 2.8 and will be removed in 3.0. Use FileProfilerStorage instead.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Deprecated since Symfony 2.8, to be removed in Symfony 3.0.
|
||||||
|
* Use {@link FileProfilerStorage} instead.
|
||||||
|
*/
|
||||||
class MongoDbProfilerStorage implements ProfilerStorageInterface
|
class MongoDbProfilerStorage implements ProfilerStorageInterface
|
||||||
{
|
{
|
||||||
protected $dsn;
|
protected $dsn;
|
||||||
|
@ -11,10 +11,15 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\HttpKernel\Profiler;
|
namespace Symfony\Component\HttpKernel\Profiler;
|
||||||
|
|
||||||
|
@trigger_error('The '.__NAMESPACE__.'\MysqlProfilerStorage class is deprecated since Symfony 2.8 and will be removed in 3.0. Use FileProfilerStorage instead.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A ProfilerStorage for Mysql.
|
* A ProfilerStorage for Mysql.
|
||||||
*
|
*
|
||||||
* @author Jan Schumann <js@schumann-it.com>
|
* @author Jan Schumann <js@schumann-it.com>
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since Symfony 2.8, to be removed in Symfony 3.0.
|
||||||
|
* Use {@link FileProfilerStorage} instead.
|
||||||
*/
|
*/
|
||||||
class MysqlProfilerStorage extends PdoProfilerStorage
|
class MysqlProfilerStorage extends PdoProfilerStorage
|
||||||
{
|
{
|
||||||
|
@ -11,11 +11,16 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\HttpKernel\Profiler;
|
namespace Symfony\Component\HttpKernel\Profiler;
|
||||||
|
|
||||||
|
@trigger_error('The '.__NAMESPACE__.'\PdoProfilerStorage class is deprecated since Symfony 2.8 and will be removed in 3.0. Use FileProfilerStorage instead.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base PDO storage for profiling information in a PDO database.
|
* Base PDO storage for profiling information in a PDO database.
|
||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
* @author Jan Schumann <js@schumann-it.com>
|
* @author Jan Schumann <js@schumann-it.com>
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since Symfony 2.8, to be removed in Symfony 3.0.
|
||||||
|
* Use {@link FileProfilerStorage} instead.
|
||||||
*/
|
*/
|
||||||
abstract class PdoProfilerStorage implements ProfilerStorageInterface
|
abstract class PdoProfilerStorage implements ProfilerStorageInterface
|
||||||
{
|
{
|
||||||
|
@ -11,11 +11,16 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\HttpKernel\Profiler;
|
namespace Symfony\Component\HttpKernel\Profiler;
|
||||||
|
|
||||||
|
@trigger_error('The '.__NAMESPACE__.'\RedisProfilerStorage class is deprecated since Symfony 2.8 and will be removed in 3.0. Use FileProfilerStorage instead.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RedisProfilerStorage stores profiling information in Redis.
|
* RedisProfilerStorage stores profiling information in Redis.
|
||||||
*
|
*
|
||||||
* @author Andrej Hudec <pulzarraider@gmail.com>
|
* @author Andrej Hudec <pulzarraider@gmail.com>
|
||||||
* @author Stephane PY <py.stephane1@gmail.com>
|
* @author Stephane PY <py.stephane1@gmail.com>
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since Symfony 2.8, to be removed in Symfony 3.0.
|
||||||
|
* Use {@link FileProfilerStorage} instead.
|
||||||
*/
|
*/
|
||||||
class RedisProfilerStorage implements ProfilerStorageInterface
|
class RedisProfilerStorage implements ProfilerStorageInterface
|
||||||
{
|
{
|
||||||
|
@ -11,10 +11,15 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\HttpKernel\Profiler;
|
namespace Symfony\Component\HttpKernel\Profiler;
|
||||||
|
|
||||||
|
@trigger_error('The '.__NAMESPACE__.'\SqliteProfilerStorage class is deprecated since Symfony 2.8 and will be removed in 3.0. Use FileProfilerStorage instead.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SqliteProfilerStorage stores profiling information in a SQLite database.
|
* SqliteProfilerStorage stores profiling information in a SQLite database.
|
||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated since Symfony 2.8, to be removed in Symfony 3.0.
|
||||||
|
* Use {@link FileProfilerStorage} instead.
|
||||||
*/
|
*/
|
||||||
class SqliteProfilerStorage extends PdoProfilerStorage
|
class SqliteProfilerStorage extends PdoProfilerStorage
|
||||||
{
|
{
|
||||||
|
@ -14,6 +14,9 @@ namespace Symfony\Component\HttpKernel\Tests\Profiler;
|
|||||||
use Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage;
|
use Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage;
|
||||||
use Symfony\Component\HttpKernel\Tests\Profiler\Mock\MemcacheMock;
|
use Symfony\Component\HttpKernel\Tests\Profiler\Mock\MemcacheMock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group legacy
|
||||||
|
*/
|
||||||
class MemcacheProfilerStorageTest extends AbstractProfilerStorageTest
|
class MemcacheProfilerStorageTest extends AbstractProfilerStorageTest
|
||||||
{
|
{
|
||||||
protected static $storage;
|
protected static $storage;
|
||||||
|
@ -14,6 +14,9 @@ namespace Symfony\Component\HttpKernel\Tests\Profiler;
|
|||||||
use Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage;
|
use Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage;
|
||||||
use Symfony\Component\HttpKernel\Tests\Profiler\Mock\MemcachedMock;
|
use Symfony\Component\HttpKernel\Tests\Profiler\Mock\MemcachedMock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group legacy
|
||||||
|
*/
|
||||||
class MemcachedProfilerStorageTest extends AbstractProfilerStorageTest
|
class MemcachedProfilerStorageTest extends AbstractProfilerStorageTest
|
||||||
{
|
{
|
||||||
protected static $storage;
|
protected static $storage;
|
||||||
|
@ -47,6 +47,9 @@ class MongoDbProfilerStorageTestDataCollector extends DataCollector
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group legacy
|
||||||
|
*/
|
||||||
class MongoDbProfilerStorageTest extends AbstractProfilerStorageTest
|
class MongoDbProfilerStorageTest extends AbstractProfilerStorageTest
|
||||||
{
|
{
|
||||||
protected static $storage;
|
protected static $storage;
|
||||||
|
@ -14,6 +14,9 @@ namespace Symfony\Component\HttpKernel\Tests\Profiler;
|
|||||||
use Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage;
|
use Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage;
|
||||||
use Symfony\Component\HttpKernel\Tests\Profiler\Mock\RedisMock;
|
use Symfony\Component\HttpKernel\Tests\Profiler\Mock\RedisMock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group legacy
|
||||||
|
*/
|
||||||
class RedisProfilerStorageTest extends AbstractProfilerStorageTest
|
class RedisProfilerStorageTest extends AbstractProfilerStorageTest
|
||||||
{
|
{
|
||||||
protected static $storage;
|
protected static $storage;
|
||||||
|
@ -13,6 +13,9 @@ namespace Symfony\Component\HttpKernel\Tests\Profiler;
|
|||||||
|
|
||||||
use Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage;
|
use Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group legacy
|
||||||
|
*/
|
||||||
class SqliteProfilerStorageTest extends AbstractProfilerStorageTest
|
class SqliteProfilerStorageTest extends AbstractProfilerStorageTest
|
||||||
{
|
{
|
||||||
protected static $dbFile;
|
protected static $dbFile;
|
||||||
|
Reference in New Issue
Block a user