Skip to content

Commit

Permalink
Allow installation with PHP 8 (#94)
Browse files Browse the repository at this point in the history
* Allow create project with PHP 8

* Apply suggestions from code review

Co-authored-by: nnatter <[email protected]>

* Update .github/workflows/test-application.yaml

Co-authored-by: nnatter <[email protected]>

Co-authored-by: nnatter <[email protected]>
  • Loading branch information
alexander-schranz and niklasnatter authored Mar 1, 2021
1 parent 8b729cf commit fb94c39
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
working-directory: 'create-project-test'
php-extensions: 'ctype, iconv, mysql, gd'
tools: 'composer:v1'
mysql-version: '5.7'
env: {}

- php-version: '7.4'
Expand All @@ -36,6 +37,23 @@ jobs:
working-directory: 'project'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
mysql-version: '8.0'
env:
APP_ENV: test
APP_SECRET: a448d1dfcaa563fce56c2fd9981f662b
MAILER_URL: null://localhost
SULU_ADMIN_EMAIL:
DATABASE_URL: "mysql://root:@127.0.0.1:3306/sulu_test?serverVersion=8.0"

- php-version: '8.0'
node-version: '14.x'
create-project: false
create-database: false
checkout-directory: 'project'
working-directory: 'project'
php-extensions: 'ctype, iconv, mysql, gd'
tools: 'composer:v2'
mysql-version: '5.7'
env:
APP_ENV: test
APP_SECRET: a448d1dfcaa563fce56c2fd9981f662b
Expand All @@ -45,7 +63,7 @@ jobs:

services:
mysql:
image: mysql:5.7
image: mysql:${{ matrix.mysql-version }}
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"docs": "http://docs.sulu.io/"
},
"require": {
"php": "^7.2",
"php": "^7.2 || ^8.0",
"ext-ctype": "*",
"ext-iconv": "*",
"dantleech/phpcr-migrations-bundle": "^1.2",
Expand Down Expand Up @@ -88,11 +88,11 @@
"@auto-scripts"
],
"post-root-package-install": [
"php -r \"file_put_contents('.env.local', 'APP_ENV=dev' . PHP_EOL);\"",
"php -r \"file_put_contents('.env', str_replace('APP_SECRET=', 'APP_SECRET=' . bin2hex(random_bytes(16)), file_get_contents('.env')));\""
"@php -r \"file_put_contents('.env.local', 'APP_ENV=dev' . PHP_EOL);\"",
"@php -r \"file_put_contents('.env', str_replace('APP_SECRET=', 'APP_SECRET=' . bin2hex(random_bytes(16)), file_get_contents('.env')));\""
],
"post-create-project-cmd": [
"php -r \"file_put_contents('.gitignore', str_replace(['composer.lock' . PHP_EOL, 'symfony.lock' . PHP_EOL, 'package-lock.json' . PHP_EOL], ['', '', ''], file_get_contents('.gitignore')));\""
"@php -r \"file_put_contents('.gitignore', str_replace(['composer.lock' . PHP_EOL, 'symfony.lock' . PHP_EOL, 'package-lock.json' . PHP_EOL], ['', '', ''], file_get_contents('.gitignore')));\""
]
},
"config": {
Expand Down

0 comments on commit fb94c39

Please sign in to comment.