Skip to content

Commit 5eb206f

Browse files
committed
Merge branch '4.9' into 4.10
# Conflicts: # calendar-bundle/src/Resources/contao/languages/fr/tl_calendar_feed.xlf # composer.json # core-bundle/src/Command/InstallCommand.php # core-bundle/src/Command/SymlinksCommand.php # core-bundle/src/DependencyInjection/Compiler/RegisterFragmentsPass.php # core-bundle/src/Migration/Version408/Version480Update.php # core-bundle/src/Resources/contao/dca/tl_page.php # core-bundle/src/Resources/contao/library/Contao/Controller.php # core-bundle/src/Resources/contao/library/Contao/DcaExtractor.php # core-bundle/src/Resources/contao/library/Contao/InsertTags.php # core-bundle/src/Resources/contao/modules/Module.php # core-bundle/tests/Contao/Database/ResultTest.php # core-bundle/tests/Functional/RoutingTest.php # core-bundle/tests/Security/Authentication/RememberMe/ExpiringTokenBasedRememberMeServicesTest.php # installation-bundle/src/Database/Version330Update.php # manager-bundle/composer.json # manager-bundle/src/Resources/skeleton/config/config.yml # manager-bundle/tests/ContaoManager/PluginTest.php # monorepo.yml # news-bundle/src/Resources/contao/dca/tl_news.php # news-bundle/src/Resources/contao/languages/fr/tl_news_feed.xlf
2 parents 90caa2a + 918884c commit 5eb206f

File tree

109 files changed

+628
-540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+628
-540
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ jobs:
1919
- name: Setup PHP
2020
uses: shivammathur/setup-php@v2
2121
with:
22-
php-version: 7.3
22+
php-version: 7.4
2323
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo, zlib
24-
tools: prestissimo, flex
24+
tools: flex
2525
coverage: pcov
2626

2727
- name: Checkout
2828
uses: actions/checkout@v1
2929

3030
- name: Install the dependencies
31-
run: composer install --no-interaction --no-suggest
31+
run: composer install --no-interaction
3232

3333
- name: Generate the coverage report
3434
run: php -d pcov.enabled=1 vendor/bin/phpunit --testsuite=coverage --coverage-clover=clover.xml --colors=always
@@ -47,16 +47,16 @@ jobs:
4747
- name: Setup PHP
4848
uses: shivammathur/setup-php@v2
4949
with:
50-
php-version: 7.3
50+
php-version: 7.4
5151
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo, zlib
52-
tools: prestissimo, flex
52+
tools: flex
5353
coverage: none
5454

5555
- name: Checkout
5656
uses: actions/checkout@v1
5757

5858
- name: Install the dependencies
59-
run: composer install --no-interaction --no-suggest
59+
run: composer install --no-interaction
6060

6161
- name: Check the coding style
6262
run: |
@@ -89,7 +89,39 @@ jobs:
8989
with:
9090
php-version: ${{ matrix.php }}
9191
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo_mysql, zlib
92-
tools: prestissimo, flex
92+
tools: flex
93+
coverage: none
94+
95+
- name: Initialize the database
96+
run: |
97+
sudo /etc/init.d/mysql start
98+
mysql -uroot -proot -e "CREATE database contao_test"
99+
100+
- name: Checkout
101+
uses: actions/checkout@v1
102+
103+
- name: Install the dependencies
104+
run: composer install --no-interaction
105+
106+
- name: Run the unit tests
107+
run: vendor/bin/phpunit --colors=always
108+
109+
- name: Run the functional tests
110+
run: vendor/bin/phpunit --testsuite=functional --colors=always
111+
env:
112+
DATABASE_URL: mysql://root:root@127.0.0.1:3306/contao_test
113+
114+
php8:
115+
name: PHP 8.0
116+
runs-on: ubuntu-latest
117+
if: github.event_name != 'push'
118+
steps:
119+
- name: Setup PHP
120+
uses: shivammathur/setup-php@v2
121+
with:
122+
php-version: 8.0
123+
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo_mysql, zlib
124+
tools: flex
93125
coverage: none
94126

95127
- name: Initialize the database
@@ -101,15 +133,15 @@ jobs:
101133
uses: actions/checkout@v1
102134

103135
- name: Install the dependencies
104-
run: composer install --no-interaction --no-suggest
136+
run: composer install --ignore-platform-reqs --no-interaction
105137

106138
- name: Run the unit tests
107139
run: vendor/bin/phpunit --colors=always
108140

109141
- name: Run the functional tests
110142
run: vendor/bin/phpunit --testsuite=functional --colors=always
111143
env:
112-
DATABASE_URL: mysql://root:root@localhost:3306/contao_test
144+
DATABASE_URL: mysql://root:root@127.0.0.1:3306/contao_test
113145

114146
prefer-lowest:
115147
name: Prefer Lowest
@@ -121,7 +153,7 @@ jobs:
121153
with:
122154
php-version: 7.3
123155
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo_mysql, zlib
124-
tools: prestissimo, flex
156+
tools: flex
125157
coverage: none
126158

127159
- name: Initialize the database
@@ -133,15 +165,15 @@ jobs:
133165
uses: actions/checkout@v1
134166

135167
- name: Install the dependencies
136-
run: composer update --prefer-lowest --prefer-stable --no-interaction --no-suggest
168+
run: composer update --prefer-lowest --prefer-stable --no-interaction
137169

138170
- name: Run the unit tests
139171
run: vendor/bin/phpunit --colors=always
140172

141173
- name: Run the functional tests
142174
run: vendor/bin/phpunit --testsuite=functional --colors=always
143175
env:
144-
DATABASE_URL: mysql://root:root@localhost:3306/contao_test
176+
DATABASE_URL: mysql://root:root@127.0.0.1:3306/contao_test
145177

146178
bundles:
147179
name: Bundles
@@ -151,9 +183,9 @@ jobs:
151183
- name: Setup PHP
152184
uses: shivammathur/setup-php@v2
153185
with:
154-
php-version: 7.3
186+
php-version: 7.4
155187
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo, zlib
156-
tools: prestissimo, flex
188+
tools: flex
157189
coverage: none
158190

159191
- name: Checkout
@@ -176,7 +208,7 @@ jobs:
176208
}
177209
file_put_contents(__DIR__."/composer.json", json_encode($data, JSON_UNESCAPED_SLASHES));
178210
'
179-
COMPOSER_ROOT_VERSION=dev-${{ env.GITHUB_SHA }} composer install --no-interaction --no-suggest
211+
COMPOSER_ROOT_VERSION=dev-${{ env.GITHUB_SHA }} composer install --no-interaction
180212
vendor/bin/phpunit --colors=always
181213
cd ..
182214
done
@@ -189,10 +221,10 @@ jobs:
189221
- name: Setup PHP
190222
uses: shivammathur/setup-php@v2
191223
with:
192-
php-version: 7.3
224+
php-version: 7.4
193225
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, mysqli, pcre, pdo_mysql, zlib
194226
ini-values: memory_limit=1G
195-
tools: prestissimo, flex
227+
tools: flex
196228
coverage: none
197229

198230
- name: Adjust the Git autocrlf setting
@@ -202,7 +234,7 @@ jobs:
202234
uses: actions/checkout@v1
203235

204236
- name: Install the dependencies
205-
run: composer install --no-interaction --no-suggest --no-progress
237+
run: composer install --no-interaction --no-progress
206238

207239
- name: Run the unit tests
208240
run: vendor/bin/phpunit.bat --colors=always
@@ -215,9 +247,8 @@ jobs:
215247
- name: Setup PHP
216248
uses: shivammathur/setup-php@v2
217249
with:
218-
php-version: 7.3
250+
php-version: 7.4
219251
extensions: json, zlib
220-
tools: prestissimo
221252
coverage: none
222253

223254
- name: Checkout
@@ -226,7 +257,7 @@ jobs:
226257
- name: Install the dependencies
227258
run: |
228259
composer global require contao/monorepo-tools:dev-master
229-
composer install --no-interaction --no-suggest
260+
composer install --no-interaction
230261
231262
- name: Validate the composer.json files
232263
run: $HOME/.composer/vendor/bin/monorepo-tools composer-json --validate --ansi
@@ -239,9 +270,8 @@ jobs:
239270
- name: Setup PHP
240271
uses: shivammathur/setup-php@v2
241272
with:
242-
php-version: 7.3
273+
php-version: 7.4
243274
extensions: json, zlib
244-
tools: prestissimo
245275
coverage: none
246276

247277
- name: Checkout

calendar-bundle/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616
],
1717
"require": {
18-
"php": "^7.2",
18+
"php": "^7.2 || ^8.0",
1919
"contao/core-bundle": "self.version",
2020
"friendsofsymfony/http-cache": "^2.4",
2121
"patchwork/utf8": "^1.2",
@@ -33,7 +33,7 @@
3333
"require-dev": {
3434
"contao/manager-plugin": "^2.3.1",
3535
"contao/test-case": "^4.0",
36-
"phpunit/phpunit": "^8.4",
36+
"phpunit/phpunit": "^8.5",
3737
"symfony/http-client": "4.4.*",
3838
"symfony/phpunit-bridge": "4.4.*"
3939
},

calendar-bundle/src/DependencyInjection/ContaoCalendarExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
class ContaoCalendarExtension extends Extension
2121
{
22-
public function load(array $mergedConfig, ContainerBuilder $container): void
22+
public function load(array $configs, ContainerBuilder $container): void
2323
{
2424
$loader = new YamlFileLoader(
2525
$container,

calendar-bundle/src/Resources/contao/classes/Events.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
namespace Contao;
1212

13-
use FOS\HttpCache\ResponseTagger;
14-
1513
/**
1614
* Provide methods to get all events of a certain period from the database.
1715
*
@@ -284,13 +282,11 @@ protected function addEvent($objEvents, $intStart, $intEnd, $intBegin, $intLimit
284282
}
285283
}
286284

287-
// Tag the response
285+
// Tag the event (see #2137)
288286
if (System::getContainer()->has('fos_http_cache.http.symfony_response_tagger'))
289287
{
290-
/** @var ResponseTagger $responseTagger */
291288
$responseTagger = System::getContainer()->get('fos_http_cache.http.symfony_response_tagger');
292289
$responseTagger->addTags(array('contao.db.tl_calendar_events.' . $objEvents->id));
293-
$responseTagger->addTags(array('contao.db.tl_calendar.' . $objEvents->pid));
294290
}
295291

296292
// Store raw data

calendar-bundle/src/Resources/contao/modules/ModuleCalendar.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ public function generate()
8181
$this->strLink = $objTarget->getFrontendUrl();
8282
}
8383

84+
// Tag the calendars (see #2137)
85+
if (System::getContainer()->has('fos_http_cache.http.symfony_response_tagger'))
86+
{
87+
$responseTagger = System::getContainer()->get('fos_http_cache.http.symfony_response_tagger');
88+
$responseTagger->addTags(array_map(static function ($id) { return 'contao.db.tl_calendar.' . $id; }, $this->cal_calendar));
89+
}
90+
8491
return parent::generate();
8592
}
8693

calendar-bundle/src/Resources/contao/modules/ModuleEventReader.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Contao\CoreBundle\Exception\InternalServerErrorException;
1414
use Contao\CoreBundle\Exception\PageNotFoundException;
1515
use Contao\CoreBundle\Exception\RedirectResponseException;
16-
use FOS\HttpCache\ResponseTagger;
1716
use Patchwork\Utf8;
1817

1918
/**
@@ -243,15 +242,6 @@ protected function compile()
243242
$objTemplate->hasDetails = false;
244243
$objTemplate->hasTeaser = false;
245244

246-
// Tag the response
247-
if (System::getContainer()->has('fos_http_cache.http.symfony_response_tagger'))
248-
{
249-
/** @var ResponseTagger $responseTagger */
250-
$responseTagger = System::getContainer()->get('fos_http_cache.http.symfony_response_tagger');
251-
$responseTagger->addTags(array('contao.db.tl_calendar_events.' . $objEvent->id));
252-
$responseTagger->addTags(array('contao.db.tl_calendar.' . $objEvent->pid));
253-
}
254-
255245
// Clean the RTE output
256246
if ($objEvent->teaser)
257247
{
@@ -407,6 +397,13 @@ protected function compile()
407397

408398
$this->Template->event = $objTemplate->parse();
409399

400+
// Tag the event (see #2137)
401+
if (System::getContainer()->has('fos_http_cache.http.symfony_response_tagger'))
402+
{
403+
$responseTagger = System::getContainer()->get('fos_http_cache.http.symfony_response_tagger');
404+
$responseTagger->addTags(array('contao.db.tl_calendar_events.' . $objEvent->id));
405+
}
406+
410407
$bundles = System::getContainer()->getParameter('kernel.bundles');
411408

412409
// HOOK: comments extension required

calendar-bundle/src/Resources/contao/modules/ModuleEventlist.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ public function generate()
7878
return $this->getFrontendModule($this->cal_readerModule, $this->strColumn);
7979
}
8080

81+
// Tag the calendars (see #2137)
82+
if (System::getContainer()->has('fos_http_cache.http.symfony_response_tagger'))
83+
{
84+
$responseTagger = System::getContainer()->get('fos_http_cache.http.symfony_response_tagger');
85+
$responseTagger->addTags(array_map(static function ($id) { return 'contao.db.tl_calendar.' . $id; }, $this->cal_calendar));
86+
}
87+
8188
return parent::generate();
8289
}
8390

comments-bundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616
],
1717
"require": {
18-
"php": "^7.2",
18+
"php": "^7.2 || ^8.0",
1919
"contao/core-bundle": "self.version",
2020
"patchwork/utf8": "^1.2",
2121
"symfony/http-kernel": "4.4.*"

comments-bundle/src/Resources/contao/classes/Comments.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
use Contao\CoreBundle\Exception\PageNotFoundException;
1414
use Contao\CoreBundle\OptIn\OptIn;
15-
use FOS\HttpCache\ResponseTagger;
1615

1716
/**
1817
* Class Comments
@@ -43,10 +42,9 @@ public function addCommentsToTemplate(FrontendTemplate $objTemplate, \stdClass $
4342

4443
$objTemplate->comments = array(); // see #4064
4544

46-
// Tag the response
45+
// Tag the source record (see #2137)
4746
if (System::getContainer()->has('fos_http_cache.http.symfony_response_tagger'))
4847
{
49-
/** @var ResponseTagger $responseTagger */
5048
$responseTagger = System::getContainer()->get('fos_http_cache.http.symfony_response_tagger');
5149
$responseTagger->addTags(array(sprintf('contao.comments.%s.%s', $strSource, $intParent)));
5250
}
@@ -102,6 +100,7 @@ public function addCommentsToTemplate(FrontendTemplate $objTemplate, \stdClass $
102100
if ($objComments !== null && ($total = $objComments->count()) > 0)
103101
{
104102
$count = 0;
103+
$tags = array();
105104
$objPartial = new FrontendTemplate($objConfig->template ?: 'com_default');
106105

107106
while ($objComments->next())
@@ -134,8 +133,17 @@ public function addCommentsToTemplate(FrontendTemplate $objTemplate, \stdClass $
134133
}
135134

136135
$arrComments[] = $objPartial->parse();
136+
$tags[] = 'contao.db.tl_comments.' . $objComments->id;
137+
137138
++$count;
138139
}
140+
141+
// Tag the comments (see #2137)
142+
if (System::getContainer()->has('fos_http_cache.http.symfony_response_tagger'))
143+
{
144+
$responseTagger = System::getContainer()->get('fos_http_cache.http.symfony_response_tagger');
145+
$responseTagger->addTags($tags);
146+
}
139147
}
140148

141149
$objTemplate->comments = $arrComments;

0 commit comments

Comments
 (0)