SMF
SMF copied to clipboard
ReCaptcha Lib needs updated for 3.0
Just opening this as a reminder for us.
It appears our version is at 1.2.4 (according to the last commit message regarding it) and the libs current version is 1.3 which adds php 8 support (I only had a minute or two to look over it).
Maybe it's easier to use composer.json to conveniently update the libraries with each release?
{
"require": {
"google/recaptcha": "^1.3",
"matthiasmullie/minify": "^1.3"
},
"config": {
"vendor-dir": "Libs",
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
}
}
Well, I agree it would be a much better solution. However, as you know, currently both of those "libs" reside in /Sources which means we can't manage them with composer.
There is nothing stopping from changing the location and specifying other paths in the source code, as in the case of moving the Languages folder. For example, let it be Sources/Libs, then the code in Autoloader.php will look something like this:
spl_autoload_register(function ($class) {
static $hook_value = '';
static $class_map = [
// Some special cases.
//'ReCaptcha\\' => 'ReCaptcha/',
//'MatthiasMullie\\Minify\\' => 'minify/src/',
//'MatthiasMullie\\PathConverter\\' => 'minify/path-converter/src/',
// In general, the SMF namespace maps to $sourcedir.
'SMF\\' => '',
];
require_once __DIR__ . '/Libs/autoload.php';
... and a small change of composer.json:
"vendor-dir": "Sources/Libs",
Also, nothing stopping from placing the Libs folder in the root of the forum.
I just checked both options.