Skip to content

Commit

Permalink
feature #23148 [FrameworkBundle] drop hard dependency on the Stopwatc…
Browse files Browse the repository at this point in the history
…h component (xabbuh)

This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] drop hard dependency on the Stopwatch component

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | related to symfony/flex#14
| License       | MIT
| Doc PR        |

Commits
-------

8d70ca0 drop hard dependency on the Stopwatch component
  • Loading branch information
fabpot committed Jun 12, 2017
2 parents 18ecbd7 + 8d70ca0 commit cc2363f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
3 changes: 3 additions & 0 deletions UPGRADE-3.4.md
Expand Up @@ -21,6 +21,9 @@ FrameworkBundle

* The `validator.mapping.cache.doctrine.apc` service has been deprecated.

* The `symfony/stopwatch` dependency has been removed, require it via `composer
require symfony/stopwatch` in your `dev` environment.

* Using the `KERNEL_DIR` environment variable or the automatic guessing based
on the `phpunit.xml` / `phpunit.xml.dist` file location is deprecated since 3.4.
Set the `KERNEL_CLASS` environment variable to the fully-qualified class name
Expand Down
12 changes: 8 additions & 4 deletions src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Expand Up @@ -4,10 +4,14 @@ CHANGELOG
3.4.0
-----

* Removed `doctrine/cache` from the list of required dependencies in `composer.json`
* Deprecated `validator.mapping.cache.doctrine.apc` service
* Deprecated using the `KERNEL_DIR` environment variable with `KernelTestCase::getKernelClass()`.
* Deprecated the `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()` methods.
* Removed `doctrine/cache` from the list of required dependencies in `composer.json`
* Deprecated `validator.mapping.cache.doctrine.apc` service
* Deprecated using the `KERNEL_DIR` environment variable with `KernelTestCase::getKernelClass()`.
* Deprecated the `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()` methods.
* The `symfony/stopwatch` dependency has been removed, require it via `composer
require symfony/stopwatch` in your `dev` environment.
* Deprecated using the `KERNEL_DIR` environment variable with `KernelTestCase::getKernelClass()`.
* Deprecated the `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()` methods.

3.3.0
-----
Expand Down
Expand Up @@ -61,6 +61,7 @@
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\Validator\ConstraintValidatorInterface;
use Symfony\Component\Validator\ObjectInitializerInterface;
use Symfony\Component\WebLink\HttpHeaderSerializer;
Expand Down Expand Up @@ -639,9 +640,14 @@ private function registerDebugConfiguration(array $config, ContainerBuilder $con
{
$loader->load('debug_prod.xml');

if (class_exists(Stopwatch::class)) {
$container->register('debug.stopwatch', Stopwatch::class);
$container->setAlias(Stopwatch::class, 'debug.stopwatch');
}

$debug = $container->getParameter('kernel.debug');

if ($debug) {
if ($debug && class_exists(Stopwatch::class)) {
$loader->load('debug.xml');
}

Expand Down Expand Up @@ -881,7 +887,7 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder

$container->setParameter('templating.helper.form.resources', $config['form']['resources']);

if ($container->getParameter('kernel.debug')) {
if ($container->getParameter('kernel.debug') && class_exists(Stopwatch::class)) {
$loader->load('templating_debug.xml');

$container->setDefinition('templating.engine.php', $container->findDefinition('debug.templating.engine.php'));
Expand Down
Expand Up @@ -23,9 +23,6 @@
<argument>true</argument>
</service>

<service id="debug.stopwatch" class="Symfony\Component\Stopwatch\Stopwatch" public="true" />
<service id="Symfony\Component\Stopwatch\Stopwatch" alias="debug.stopwatch" />

<service id="debug.file_link_formatter" class="Symfony\Component\HttpKernel\Debug\FileLinkFormatter">
<argument>%debug.file_link_format%</argument>
</service>
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bundle/FrameworkBundle/composer.json
Expand Up @@ -28,8 +28,7 @@
"symfony/polyfill-mbstring": "~1.0",
"symfony/filesystem": "~2.8|~3.0|~4.0",
"symfony/finder": "~2.8|~3.0|~4.0",
"symfony/routing": "~3.4|~4.0",
"symfony/stopwatch": "~2.8|~3.0|~4.0"
"symfony/routing": "~3.4|~4.0"
},
"require-dev": {
"doctrine/cache": "~1.0",
Expand All @@ -47,6 +46,7 @@
"symfony/security-core": "~3.2|~4.0",
"symfony/security-csrf": "~2.8|~3.0|~4.0",
"symfony/serializer": "~3.3|~4.0",
"symfony/stopwatch": "~2.8|~3.0|~4.0",
"symfony/translation": "~3.2|~4.0",
"symfony/templating": "~2.8|~3.0|~4.0",
"symfony/validator": "~3.3|~4.0",
Expand Down

0 comments on commit cc2363f

Please sign in to comment.