Skip to content

Conversation

pifou25
Copy link
Contributor

@pifou25 pifou25 commented Jan 27, 2025

Description

add log in case of plugin error via the plugin autoloader, this is a great help for plugin developers :)

Suggested changelog entry

add log in case of plugin error via the plugin autoloader

Related issues/external references

Fixes #3017

Types of changes

  • Bug fix (non-breaking change which fixes)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    • This change is only breaking for integrators, not for external standards or end-users.
  • Documentation improvement

PR checklist

@Mips2648
Copy link
Collaborator

Why do you log exception in "core"? this is weird... who will ever thought about checking this log?

@pifou25
Copy link
Contributor Author

pifou25 commented Jan 30, 2025

Not sure where to put this log, and 'core' is the default for log path

public static function getPathToLog($_log = 'core') {

what else do you suggest ? 'plugin' could be better ?

if ($plugin_active == 1) {
try {
include_file('core', $classname, 'class', $classname);
} catch (Exception $e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comme on ne gère plus sous php7.4, je propose de remplacer ces double catch par des catch (Throwable $e).
Pas nécessaire de le faire partout, mais si ca peut se faire au fur et à mesure qu'on passe sur du code ca sera déjà pas mal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oui aucun intérêt de faire 2 catch si le traitement est identique.
(le rapport avec php7.4 ? c'est déjà possible je pense dès php7 d'après la doc)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'était juste pour préciser que c'était pleinement géré sur cette version, rien de plus.

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

Successfully merging this pull request may close these issues.

[BUG] PHP Parse error dans *pluginid*/plugin_info/install.php n'est pas envoyé vers http.error
9 participants