Skip to content

Commit 9c7beb6

Browse files
authored
Merge pull request #339 from FriendsOfSymfony/2.0
updated to v2.0 removed Symfony 2.8 support (sadly) so that Symfony4 support can be added
2 parents 0ec4b69 + a867a07 commit 9c7beb6

File tree

7 files changed

+64
-28
lines changed

7 files changed

+64
-28
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ vendor
66
.php_cs
77
Tests/Functional/cache
88
Tests/Functional/logs
9+
var

Controller/MessageController.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
namespace FOS\MessageBundle\Controller;
44

55
use FOS\MessageBundle\Provider\ProviderInterface;
6-
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7-
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
8-
use Symfony\Component\DependencyInjection\ContainerInterface;
6+
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
97
use Symfony\Component\HttpFoundation\RedirectResponse;
108
use Symfony\Component\HttpFoundation\Response;
9+
use Symfony\Component\DependencyInjection\ContainerInterface;
1110

12-
class MessageController extends Controller implements ContainerAwareInterface
11+
class MessageController extends AbstractController
1312
{
13+
public function __construct(ContainerInterface $container)
14+
{
15+
$this->setContainer($container);
16+
}
17+
1418
/**
1519
* @var ContainerInterface
1620
*/
@@ -162,12 +166,4 @@ protected function getProvider()
162166
{
163167
return $this->container->get('fos_message.provider');
164168
}
165-
166-
/**
167-
* {@inheritdoc}
168-
*/
169-
public function setContainer(ContainerInterface $container = null)
170-
{
171-
$this->container = $container;
172-
}
173169
}

DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Configuration implements ConfigurationInterface
1717
*/
1818
public function getConfigTreeBuilder()
1919
{
20-
$treeBuilder = new TreeBuilder();
20+
$treeBuilder = new TreeBuilder('fos_message');
2121
$rootNode = $treeBuilder->root('fos_message');
2222

2323
$rootNode

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,24 @@ Documentation
1616

1717
Documentation for this bundle is stored under `Resources/doc` in this repository.
1818

19-
[Read the documentation for the last stable (1.3)][]
19+
[Read the documentation for the last stable (2.0)][]
20+
21+
Legacy (Symfony 2, or <=3.3)
22+
------
23+
24+
Due to difficulties in CI testing, deprecation of the `Controller` class and the [deprecation coming November of this year (2019)][] support for anything older than Symfony3.4 (LTS) has been dropped in this bundle.
25+
26+
For more info, see the pull request that ultimately made the decision for us - https://github.com/FriendsOfSymfony/FOSMessageBundle/pull/340
27+
28+
If using versions older than Symfony3.4 (LTS), make sure to use version 1.3 of this bundle.
29+
30+
https://github.com/FriendsOfSymfony/FOSMessageBundle/tree/v1.3.0
31+
32+
When using composer, tag it as such but otherwise install as per the 1.3 docs:
33+
34+
```bash
35+
composer require friendsofsymfony/message-bundle:1.3.0
36+
```
2037

2138
License
2239
-------
@@ -27,4 +44,6 @@ This bundle is under the MIT license. See the complete license in the bundle:
2744
Resources/meta/LICENSE
2845
```
2946

30-
[Read the documentation for the last stable (1.3)]: https://github.com/FriendsOfSymfony/FOSMessageBundle/blob/master/Resources/doc/00-index.md
47+
[Read the documentation for the last stable (2.0)]: https://github.com/FriendsOfSymfony/FOSMessageBundle/blob/master/Resources/doc/00-index.md
48+
49+
[deprecation coming November of this year (2019)]: https://symfony.com/roadmap/2.8

Resources/config/config.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

77
<services>
88

9+
<service id="FOS\MessageBundle\Controller\MessageController" public="true">
10+
<bind key="$container"
11+
type="service"
12+
id="service_container"
13+
/>
14+
</service>
15+
916
<service id="fos_message.sender.default" class="FOS\MessageBundle\Sender\Sender" public="false">
1017
<argument type="service" id="fos_message.message_manager" />
1118
<argument type="service" id="fos_message.thread_manager" />

Resources/doc/01-installation.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ We provide examples for both Mongo DB and ORM.
5050

5151
### Step 4 - Enable the bundle in your kernel
5252

53-
The bundle must be added to your `AppKernel`
53+
The bundle must be added to your `AppKernel`.
54+
55+
**Step usually not necescary in Symfony 4**.
5456

5557
```php
5658
// app/AppKernel.php
@@ -77,6 +79,17 @@ fos_message:
7779
prefix: /optional_routing_prefix
7880
```
7981
82+
### Step 6 - Check templating
83+
84+
Make sure to add this to `framwork.yaml` (and check twig is installed) if you run into the non-existant service `templating` issue:
85+
86+
```yaml
87+
templating:
88+
engines:
89+
twig
90+
```
91+
92+
8093
## Installation Finished
8194

8295
At this point, the bundle has been installed and configured and should be ready for use.

composer.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
"require": {
2020
"php": ">=5.5.9",
2121
"doctrine/collections": "^1.3",
22-
"symfony/form": "^2.8.45|^3.0|^4.0",
23-
"symfony/framework-bundle": "^2.8.45|^3.0|^4.0",
24-
"symfony/security": "^2.8.45|^3.0|^4.0",
25-
"symfony/twig-bundle": "^2.8.45|^3.0|^4.0"
22+
"symfony/form": "^3.4|^4.0",
23+
"symfony/framework-bundle": "^3.4|^4.0",
24+
"symfony/security": "^3.4|^4.0",
25+
"symfony/twig-bundle": "^3.4|^4.0"
2626
},
2727
"require-dev": {
28-
"symfony/validator": "^2.8.45|^3.0|^4.0",
29-
"symfony/translation": "^2.8.45|^3.0|^4.0",
30-
"symfony/yaml": "^2.8.45|^3.0|^4.0",
31-
"symfony/security-bundle": "^2.8.45|^3.0|^4.0",
32-
"symfony/templating": "^2.8.45|^3.0|^4.0",
33-
"symfony/browser-kit": "^2.8.45|^3.0|^4.0",
34-
"symfony/phpunit-bridge": "^4.0",
28+
"symfony/validator": "^3.4|^4.0",
29+
"symfony/translation": "^3.4|^4.0",
30+
"symfony/yaml": "^3.4|^4.0",
31+
"symfony/security-bundle": "^3.4|^4.0",
32+
"symfony/templating": "^3.4|^4.0",
33+
"symfony/browser-kit": "^3.4|^4.0",
34+
"symfony/phpunit-bridge": "^4.2.8",
3535
"doctrine/orm": "^2.0"
3636
},
3737
"suggest": {
@@ -45,7 +45,7 @@
4545
},
4646
"extra": {
4747
"branch-alias": {
48-
"dev-master": "1.3-dev"
48+
"dev-master": "2.0-dev"
4949
}
5050
}
5151
}

0 commit comments

Comments
 (0)