Skip to content

Commit

Permalink
1.4.2: Chg: Minimal PHP version is 8.1 & Fix: Added PHP extensions re…
Browse files Browse the repository at this point in the history
…quirements: MBString, JSON and BCMath or GMP
  • Loading branch information
marc-farre committed Feb 19, 2024
1 parent 03dcbd5 commit 7a48f15
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
2 changes: 0 additions & 2 deletions authclient/Keycloak.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ protected function normalizeUserAttributes($attributes)
isset($attributes['username'], $attributes['email'])
&& $attributes['username'] === $attributes['email']
) {
/* @var $userModule \humhub\modules\user\Module */
$userModule = Yii::$app->getModule('user');
$attributes['username'] = BaseInflector::id2camel(
BaseInflector::slug(
$attributes['firstname'] . ' ' . $attributes['lastname']
Expand Down
4 changes: 3 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Changelog
=========

Unreleased
1.4.2 (Feb 19, 2024)
--------------------
- Enh: Added the new `requirements.php` file (https://github.com/humhub/humhub/issues/6831)
- Chg: Require PHP 8.1 or later
- Fix: Added PHP extensions requirements: `MBString`, `JSON` and `BCMath` or `GMP`

1.4.1 (Jan 18, 2024)
--------------------
Expand Down
4 changes: 3 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ A new button "Keycloak" (which can be renamed) will appear on the login page.

## Requirements

- PHP 8.0 or later
- PHP 8.1 or later
- [PHP `allow_url_fopen`](https://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen) must be enabled
- PHP extensions: `MBString`, `JSON` and `BCMath` or `GMP`
- Depending on the algorithms you're using, other PHP extensions may be required (e.g. OpenSSL, Sodium). Full details: https://web-token.spomky-labs.com/introduction/pre-requisite
- For users' groups and email synchronization: on Keycloak, users attributes must be writable (it can be tested by changing the email address of a user on Keycloak administration).

## Configuration
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"auth",
"keycloak"
],
"version": "1.4.1",
"version": "1.4.2",
"humhub": {
"minVersion": "1.15"
},
Expand Down
16 changes: 14 additions & 2 deletions requirements.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

if (PHP_VERSION_ID < 80000) {
return 'Please upgrade to PHP Version 8 or later!';
if (PHP_VERSION_ID < 80100) {
return 'Please upgrade to PHP Version 8.1 or later!';
}

if (PHP_VERSION_ID >= 90000) {
Expand All @@ -12,4 +12,16 @@
return 'You need to enable allow_url_fopen in your PHP configuration on the server.';
}

if (!extension_loaded('mbstring')) {
return 'You need to enable MBString extension in your PHP configuration on the server.';
}

if (!extension_loaded('json')) {
return 'You need to enable JSON extension in your PHP configuration on the server.';
}

if (!extension_loaded('gmp') && !extension_loaded('bcmath')) {
return 'You need to enable GMP or BCMath extension in your PHP configuration on the server.';
}

return null;

0 comments on commit 7a48f15

Please sign in to comment.