Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReCaptcha Lib needs updated for 3.0 #7977

Open
Tyrsson opened this issue Dec 28, 2023 · 3 comments · May be fixed by #8082
Open

ReCaptcha Lib needs updated for 3.0 #7977

Tyrsson opened this issue Dec 28, 2023 · 3 comments · May be fixed by #8082

Comments

@Tyrsson
Copy link
Collaborator

Tyrsson commented Dec 28, 2023

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).

@dragomano
Copy link
Contributor

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
  }
}

@Tyrsson
Copy link
Collaborator Author

Tyrsson commented Dec 29, 2023

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.

@dragomano
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants