Skip to content

Commit

Permalink
Merge branch '4.9' into bugfix/dca-labels
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Dec 8, 2020
2 parents cb3740c + 946940d commit 64d2350
Show file tree
Hide file tree
Showing 96 changed files with 470 additions and 513 deletions.
76 changes: 53 additions & 23 deletions .github/workflows/ci.yml
Expand Up @@ -19,16 +19,16 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
php-version: 7.4
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo, zlib
tools: prestissimo, flex
tools: flex
coverage: pcov

- name: Checkout
uses: actions/checkout@v1

- name: Install the dependencies
run: composer install --no-interaction --no-suggest
run: composer install --no-interaction

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

- name: Checkout
uses: actions/checkout@v1

- name: Install the dependencies
run: composer install --no-interaction --no-suggest
run: composer install --no-interaction

- name: Check the coding style
run: |
Expand Down Expand Up @@ -87,7 +87,39 @@ jobs:
with:
php-version: ${{ matrix.php }}
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo_mysql, zlib
tools: prestissimo, flex
tools: flex
coverage: none

- name: Initialize the database
run: |
sudo /etc/init.d/mysql start
mysql -uroot -proot -e "CREATE database contao_test"
- name: Checkout
uses: actions/checkout@v1

- name: Install the dependencies
run: composer install --no-interaction

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

- name: Run the functional tests
run: vendor/bin/phpunit --testsuite=functional --colors=always
env:
DATABASE_URL: mysql://root:root@127.0.0.1:3306/contao_test

php8:
name: PHP 8.0
runs-on: ubuntu-latest
if: github.event_name != 'push'
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo_mysql, zlib
tools: flex
coverage: none

- name: Initialize the database
Expand All @@ -99,15 +131,15 @@ jobs:
uses: actions/checkout@v1

- name: Install the dependencies
run: composer install --no-interaction --no-suggest
run: composer install --ignore-platform-reqs --no-interaction

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

- name: Run the functional tests
run: vendor/bin/phpunit --testsuite=functional --colors=always
env:
DATABASE_URL: mysql://root:root@localhost:3306/contao_test
DATABASE_URL: mysql://root:root@127.0.0.1:3306/contao_test

prefer-lowest:
name: Prefer Lowest
Expand All @@ -119,7 +151,7 @@ jobs:
with:
php-version: 7.3
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo_mysql, zlib
tools: prestissimo, flex
tools: flex
coverage: none

- name: Initialize the database
Expand All @@ -131,15 +163,15 @@ jobs:
uses: actions/checkout@v1

- name: Install the dependencies
run: composer update --prefer-lowest --prefer-stable --no-interaction --no-suggest
run: composer update --prefer-lowest --prefer-stable --no-interaction

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

- name: Run the functional tests
run: vendor/bin/phpunit --testsuite=functional --colors=always
env:
DATABASE_URL: mysql://root:root@localhost:3306/contao_test
DATABASE_URL: mysql://root:root@127.0.0.1:3306/contao_test

bundles:
name: Bundles
Expand All @@ -149,9 +181,9 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
php-version: 7.4
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, pcre, pdo, zlib
tools: prestissimo, flex
tools: flex
coverage: none

- name: Checkout
Expand All @@ -174,7 +206,7 @@ jobs:
}
file_put_contents(__DIR__."/composer.json", json_encode($data, JSON_UNESCAPED_SLASHES));
'
COMPOSER_ROOT_VERSION=dev-${{ env.GITHUB_SHA }} composer install --no-interaction --no-suggest
COMPOSER_ROOT_VERSION=dev-${{ env.GITHUB_SHA }} composer install --no-interaction
vendor/bin/phpunit --colors=always
cd ..
done
Expand All @@ -187,10 +219,10 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
php-version: 7.4
extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, mysqli, pcre, pdo_mysql, zlib
ini-values: memory_limit=1G
tools: prestissimo, flex
tools: flex
coverage: none

- name: Adjust the Git autocrlf setting
Expand All @@ -200,7 +232,7 @@ jobs:
uses: actions/checkout@v1

- name: Install the dependencies
run: composer install --no-interaction --no-suggest --no-progress
run: composer install --no-interaction --no-progress

- name: Run the unit tests
run: vendor/bin/phpunit.bat --colors=always
Expand All @@ -213,9 +245,8 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
php-version: 7.4
extensions: json, zlib
tools: prestissimo
coverage: none

- name: Checkout
Expand All @@ -224,7 +255,7 @@ jobs:
- name: Install the dependencies
run: |
composer global require contao/monorepo-tools:dev-master
composer install --no-interaction --no-suggest
composer install --no-interaction
- name: Validate the composer.json files
run: $HOME/.composer/vendor/bin/monorepo-tools composer-json --validate --ansi
Expand All @@ -237,9 +268,8 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
php-version: 7.4
extensions: json, zlib
tools: prestissimo
coverage: none

- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions calendar-bundle/composer.json
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"php": "^7.2",
"php": "^7.2 || ^8.0",
"contao/core-bundle": "self.version",
"friendsofsymfony/http-cache": "^2.4",
"patchwork/utf8": "^1.2",
Expand All @@ -32,7 +32,7 @@
"require-dev": {
"contao/manager-plugin": "^2.3.1",
"contao/test-case": "^4.0",
"phpunit/phpunit": "^8.4",
"phpunit/phpunit": "^8.5",
"symfony/http-client": "4.4.*",
"symfony/phpunit-bridge": "4.4.*"
},
Expand Down
Expand Up @@ -19,7 +19,7 @@

class ContaoCalendarExtension extends Extension
{
public function load(array $mergedConfig, ContainerBuilder $container): void
public function load(array $configs, ContainerBuilder $container): void
{
$loader = new YamlFileLoader(
$container,
Expand Down
Expand Up @@ -109,7 +109,6 @@ protected function compile()
}

throw new InternalServerErrorException('Invalid "jumpTo" value or target page not public');
break;

case 'article':
if (($article = ArticleModel::findByPk($objEvent->articleId)) && ($page = PageModel::findPublishedById($article->pid)))
Expand All @@ -118,7 +117,6 @@ protected function compile()
}

throw new InternalServerErrorException('Invalid "articleId" value or target page not public');
break;

case 'external':
if ($objEvent->url)
Expand All @@ -127,7 +125,6 @@ protected function compile()
}

throw new InternalServerErrorException('Empty target URL');
break;
}

// Overwrite the page title (see #2853, #4955 and #87)
Expand Down
2 changes: 1 addition & 1 deletion comments-bundle/composer.json
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"php": "^7.2",
"php": "^7.2 || ^8.0",
"contao/core-bundle": "self.version",
"patchwork/utf8": "^1.2",
"symfony/http-kernel": "4.4.*"
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"php": "^7.2",
"php": "^7.2 || ^8.0",
"ext-dom": "*",
"ext-gd": "*",
"ext-hash": "*",
Expand Down Expand Up @@ -148,11 +148,12 @@
"contao/test-case": "^4.0",
"doctrine/event-manager": "^1.0",
"monolog/monolog": "^1.24",
"phpunit/phpunit": "^8.4",
"phpunit/phpunit": "^8.5",
"psr/event-dispatcher": "^1.0",
"slam/phpstan-extensions": "^5.0",
"symfony/browser-kit": "4.4.*",
"symfony/phpunit-bridge": "4.4.*"
"symfony/phpunit-bridge": "4.4.*",
"thecodingmachine/phpstan-strict-rules": "^0.12"
},
"extra": {
"contao-manager-plugin": {
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/README.md
Expand Up @@ -58,7 +58,7 @@ framework:
```

Add the Contao routes to your `config/routing.yaml` file, and be sure to load
the `ContaoCoreBundle` at the very end, so the catch all route does not catch
the `ContaoCoreBundle` at the very end, so the catch-all route does not catch
your application routes.

```yml
Expand Down
4 changes: 2 additions & 2 deletions core-bundle/composer.json
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"php": "^7.2",
"php": "^7.2 || ^8.0",
"ext-dom": "*",
"ext-gd": "*",
"ext-hash": "*",
Expand Down Expand Up @@ -120,7 +120,7 @@
"doctrine/event-manager": "^1.0",
"lexik/maintenance-bundle": "^2.1.5",
"monolog/monolog": "^1.24",
"phpunit/phpunit": "^8.4",
"phpunit/phpunit": "^8.5",
"psr/event-dispatcher": "^1.0",
"symfony/browser-kit": "4.4.*",
"symfony/http-client": "4.4.*",
Expand Down
11 changes: 3 additions & 8 deletions core-bundle/src/Command/InstallCommand.php
Expand Up @@ -33,11 +33,6 @@ class InstallCommand extends Command
*/
private $fs;

/**
* @var SymfonyStyle
*/
private $io;

/**
* @var array
*/
Expand Down Expand Up @@ -83,14 +78,14 @@ protected function configure(): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->fs = new Filesystem();
$this->io = new SymfonyStyle($input, $output);
$this->webDir = rtrim($input->getArgument('target'), '/');

$this->addEmptyDirs();

if (!empty($this->rows)) {
$this->io->newLine();
$this->io->listing($this->rows);
$io = new SymfonyStyle($input, $output);
$io->newLine();
$io->listing($this->rows);
}

return 0;
Expand Down
4 changes: 2 additions & 2 deletions core-bundle/src/Command/MigrateCommand.php
Expand Up @@ -288,8 +288,8 @@ private function getCommandHashes(array $commands, bool $withDrops): array
if (!$withDrops) {
foreach ($commands as $hash => $command) {
if (
(0 === strncmp($command, 'DROP ', 5) && 0 !== strncmp($command, 'DROP INDEX', 10))
|| preg_match('/^ALTER TABLE [^ ]+ DROP /', $command, $matches)
preg_match('/^ALTER TABLE [^ ]+ DROP /', $command, $matches)
|| (0 === strncmp($command, 'DROP ', 5) && 0 !== strncmp($command, 'DROP INDEX', 10))
) {
unset($commands[$hash]);
}
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/src/Command/ResizeImagesCommand.php
Expand Up @@ -191,7 +191,7 @@ private function resizeImage(string $path, bool $quiet = false): int
return 0;
}

private function resizeImages(float $timeLimit, float $concurrent, bool $noSubProcess)
private function resizeImages(float $timeLimit, float $concurrent, bool $noSubProcess): int
{
if (!$noSubProcess && $this->supportsSubProcesses()) {
return $this->executeConcurrent($timeLimit, $concurrent);
Expand Down
11 changes: 3 additions & 8 deletions core-bundle/src/Command/SymlinksCommand.php
Expand Up @@ -36,11 +36,6 @@ class SymlinksCommand extends Command
{
protected static $defaultName = 'contao:symlinks';

/**
* @var SymfonyStyle
*/
private $io;

/**
* @var array
*/
Expand Down Expand Up @@ -102,14 +97,14 @@ protected function configure(): void

protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->io = new SymfonyStyle($input, $output);
$this->webDir = rtrim($input->getArgument('target'), '/');

$this->generateSymlinks();

if (!empty($this->rows)) {
$this->io->newLine();
$this->io->table(['', 'Symlink', 'Target / Error'], $this->rows);
$io = new SymfonyStyle($input, $output);
$io->newLine();
$io->table(['', 'Symlink', 'Target / Error'], $this->rows);
}

return $this->statusCode;
Expand Down

0 comments on commit 64d2350

Please sign in to comment.