Skip to content

Commit 8a2410b

Browse files
committed
drop Symfony 2.2 support
1 parent 12f7b1b commit 8a2410b

File tree

7 files changed

+12
-123
lines changed

7 files changed

+12
-123
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ php:
66
- 5.5
77

88
env:
9-
- SYMFONY_VERSION=2.2.*
109
- SYMFONY_VERSION=2.3.*
1110
- SYMFONY_VERSION=2.4.*
1211
- SYMFONY_VERSION=dev-master

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
1.1.0-RC2
5+
---------
6+
7+
* **2014-04-11**: drop Symfony 2.2 compatibility, also the "cmf_request_aware" tag
8+
has been deprecated. please add the ``setRequest()`` call manually now:
9+
``<call method="setRequest"><argument type="service" id="request" on-invalid="null" strict="false"/></call>``
10+
411
1.1.0-RC1
512
---------
613

DependencyInjection/Compiler/RequestAwarePass.php

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
2020

2121
/**
22-
* A compiler pass to find all cmf_request_aware services and add them to the
23-
* RequestAwareListener
22+
* BC: A compiler pass to find all cmf_request_aware services and adjust the
23+
* service definition.
2424
*
2525
* @author David Buchmann <[email protected]>
2626
*/
@@ -31,43 +31,12 @@ class RequestAwarePass implements CompilerPassInterface
3131
*/
3232
public function process(ContainerBuilder $container)
3333
{
34-
if (version_compare(Kernel::VERSION, '2.3', '<')) {
35-
$this->configureSynchronizer($container);
36-
} else {
37-
$this->makeSynchronized($container);
38-
}
39-
}
40-
41-
/**
42-
* Configure the request synchronizer for symfony 2.2
43-
*
44-
* @param ContainerBuilder $container
45-
*/
46-
private function configureSynchronizer(ContainerBuilder $container)
47-
{
48-
if (!$container->hasDefinition('cmf_core.listener.request_aware')) {
49-
return;
50-
}
51-
52-
$listener = $container->getDefinition('cmf_core.listener.request_aware');
5334
$services = $container->findTaggedServiceIds('cmf_request_aware');
5435
foreach ($services as $id => $attributes) {
55-
$listener->addMethodCall('addService', array(new Reference($id)));
56-
}
57-
}
36+
trigger_error("Service $id is using the deprecated tag cmf_request_aware");
5837

59-
/**
60-
* Make the tagged services synchronized for symfony 2.3 and later.
61-
*
62-
* @param ContainerBuilder $container
63-
*/
64-
private function makeSynchronized(ContainerBuilder $container)
65-
{
66-
$services = $container->findTaggedServiceIds('cmf_request_aware');
67-
foreach ($services as $id => $attributes) {
6838
$definition = $container->getDefinition($id);
6939
$definition
70-
->setSynchronized(true)
7140
->addMethodCall('setRequest', array(
7241
new Reference('request', ContainerInterface::NULL_ON_INVALID_REFERENCE, false)
7342
))

EventListener/RequestAwareListener.php

Lines changed: 0 additions & 81 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ translated content.
1515

1616
## Requirements
1717

18-
* Symfony 2.2.x
18+
* Symfony 2.3+
1919

2020

2121
## Documentation

Resources/config/services.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<parameter key="cmf_core.persistence.phpcr.manager_name">null</parameter>
99
<parameter key="cmf_core.twig_extension.class">Symfony\Cmf\Bundle\CoreBundle\Twig\Extension\CmfExtension</parameter>
1010
<parameter key="cmf_core.templating.helper.class">Symfony\Cmf\Bundle\CoreBundle\Templating\Helper\CmfHelper</parameter>
11-
<parameter key="cmf_core.listener.request_aware.class">Symfony\Cmf\Bundle\CoreBundle\EventListener\RequestAwareListener</parameter>
1211
</parameters>
1312

1413
<services>
@@ -24,9 +23,5 @@
2423
<argument>%cmf_core.persistence.phpcr.manager_name%</argument>
2524
</service>
2625

27-
<service id="cmf_core.listener.request_aware" class="%cmf_core.listener.request_aware.class%">
28-
<tag name="kernel.event_subscriber"/>
29-
</service>
30-
3126
</services>
3227
</container>

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"minimum-stability": "dev",
1515
"require": {
1616
"php": ">=5.3.3",
17-
"symfony/framework-bundle": "~2.2"
17+
"symfony/framework-bundle": "~2.3"
1818
},
1919
"require-dev": {
2020
"symfony-cmf/routing-bundle": "1.2.*",

0 commit comments

Comments
 (0)