Skip to content
Snippets Groups Projects
Commit 1eb58c14 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

use php 7.4 as minimum version and adjust system accordingly, fixes #3123

Closes #3123

Merge request studip/studip!2110
parent 4a297701
No related branches found
No related tags found
No related merge requests found
image: studip/studip:tests-php7.2 image: studip/studip:tests-php8.2
variables: variables:
FF_NETWORK_PER_BUILD: 1 FF_NETWORK_PER_BUILD: 1
...@@ -110,6 +110,36 @@ lint-php: ...@@ -110,6 +110,36 @@ lint-php:
reports: reports:
codequality: $PHPLINT_CODE_QUALITY_REPORT codequality: $PHPLINT_CODE_QUALITY_REPORT
lint-php-7.4:
image: studip/studip:tests-php8.2
stage: checks
needs: [build-composer]
variables:
CACHE_LOCATION: $CACHE_DIR/phplint-cache
PHPLINT_JSON_REPORT: $REPORT_DIR/phplint-report-7.4.json
PHPLINT_CODE_QUALITY_REPORT: $REPORT_DIR/phplint-codequality-7.4.json
interruptible: true
cache:
- *composer-cache
- key: "$CI_JOB_NAME_SLUG:$CI_COMMIT_REF_SLUG"
paths:
- $CACHE_LOCATION
before_script:
- *mkdir-caches
- *mkdir-reports
- *install-composer
script:
- COMPOSER_MEMORY_LIMIT=-1
composer exec phplint
--
--json $PHPLINT_JSON_REPORT
--cache=$CACHE_LOCATION
after_script:
- ./.gitlab/scripts/convert-phplint-report $PHPLINT_JSON_REPORT > $PHPLINT_CODE_QUALITY_REPORT
artifacts:
reports:
codequality: $PHPLINT_CODE_QUALITY_REPORT
lint-js: lint-js:
stage: checks stage: checks
needs: [] needs: []
...@@ -229,6 +259,7 @@ test-unit: ...@@ -229,6 +259,7 @@ test-unit:
test-jest: test-jest:
stage: test stage: test
needs: [lint-js] needs: [lint-js]
image: $NODE_IMAGE
variables: variables:
JS_TEST_REPORT: $REPORT_DIR/jest.xml JS_TEST_REPORT: $REPORT_DIR/jest.xml
cache: *npm-cache cache: *npm-cache
......
...@@ -2,7 +2,7 @@ Die Installation von Stud.IP ist halb so schlimm: ...@@ -2,7 +2,7 @@ Die Installation von Stud.IP ist halb so schlimm:
es müssen lediglich ein paar Dateien kopiert werden und ein paar es müssen lediglich ein paar Dateien kopiert werden und ein paar
Programme laufen ;-) Programme laufen ;-)
Vorausgesetzt wird ein Webserver wie Apache2 oder nginx mit PHP-7.2 Modulen und Vorausgesetzt wird ein Webserver wie Apache2 oder nginx mit PHP-7.4 Modulen und
eine MySQL 5.7.6 Datenbank. eine MySQL 5.7.6 Datenbank.
Was genau zu tun ist, steht in Was genau zu tun ist, steht in
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"config": { "config": {
"vendor-dir": "composer", "vendor-dir": "composer",
"platform": { "platform": {
"php": "7.2.5" "php": "7.4"
} }
}, },
"require-dev": { "require-dev": {
...@@ -55,8 +55,6 @@ ...@@ -55,8 +55,6 @@
"league/oauth2-server": "^8.3", "league/oauth2-server": "^8.3",
"willdurand/negotiation": "^3.1", "willdurand/negotiation": "^3.1",
"monolog/monolog": "^2.8", "monolog/monolog": "^2.8",
"symfony/polyfill-php73": "^1.27",
"symfony/polyfill-php74": "^1.27",
"symfony/polyfill-php80": "^1.27", "symfony/polyfill-php80": "^1.27",
"symfony/polyfill-php81": "^1.27", "symfony/polyfill-php81": "^1.27",
"phpowermove/docblock": "^2.0", "phpowermove/docblock": "^2.0",
...@@ -72,6 +70,8 @@ ...@@ -72,6 +70,8 @@
"symfony/polyfill-php70": "*", "symfony/polyfill-php70": "*",
"symfony/polyfill-php71": "*", "symfony/polyfill-php71": "*",
"symfony/polyfill-php72": "*", "symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"symfony/polyfill-mbstring": "*" "symfony/polyfill-mbstring": "*"
} }
} }
This diff is collapsed.
<?php <?php
return [ return [
'php' => [ 'php' => [
'version' => '7.2', 'version' => '7.4',
'modules' => [ 'modules' => [
'PDO' => true, 'PDO' => true,
'pdo_mysql' => true, 'pdo_mysql' => true,
......
...@@ -9,8 +9,8 @@ build_image () { ...@@ -9,8 +9,8 @@ build_image () {
fi fi
} }
build_image tests/php72 studip:tests-php7.2 & build_image tests/php82 studip:tests-php8.2 &
build_image tests/php74 studip:tests & build_image tests/php74 studip:tests-php7.4 &
build_image release-cli release-cli & build_image release-cli release-cli &
wait wait
......
# Setup php, apache and stud.ip # Setup php, apache and stud.ip
FROM php:7.2-cli FROM php:8.2-cli
# Install system requirements # Install system requirements
RUN apt update && apt install -y --no-install-recommends \ RUN apt update && apt install -y --no-install-recommends \
...@@ -10,9 +10,8 @@ RUN apt update && apt install -y --no-install-recommends \ ...@@ -10,9 +10,8 @@ RUN apt update && apt install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Install php extensions # Install php extensions
RUN docker-php-ext-configure gd --with-png-dir=/usr/include/ \ RUN docker-php-ext-configure gd --with-jpeg=/usr/include/
--with-jpeg-dir=/usr/include/ RUN docker-php-ext-install -j$(nproc) pdo gettext curl gd mbstring zip pdo pdo_mysql mysqli intl
RUN docker-php-ext-install pdo gettext curl gd mbstring zip pdo pdo_mysql mysqli intl json
# Install npm using nvm # Install npm using nvm
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
......
parameters: parameters:
level: 0 level: 0
phpVersion: 70200 # PHP 7.2 phpVersion: 70400 # PHP 7.4
paths: paths:
- app/controllers - app/controllers
- app/routes - app/routes
......
...@@ -11,10 +11,15 @@ class BlubberThreadsShowTest extends \Codeception\Test\Unit ...@@ -11,10 +11,15 @@ class BlubberThreadsShowTest extends \Codeception\Test\Unit
*/ */
protected $tester; protected $tester;
protected $csrf_storage = [];
protected function _before() protected function _before()
{ {
\DBManager::getInstance()->setConnection('studip', $this->getModule('\\Helper\\StudipDb')->dbh); \DBManager::getInstance()->setConnection('studip', $this->getModule('\\Helper\\StudipDb')->dbh);
CSRFProtection::setStorage($this->csrf_storage);
// Create global template factory if neccessary // Create global template factory if neccessary
$has_template_factory = isset($GLOBALS['template_factory']); $has_template_factory = isset($GLOBALS['template_factory']);
if (!$has_template_factory) { if (!$has_template_factory) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment