Studio-42 / elFinder

📁 Open-source file manager for web, written in JavaScript using jQuery and jQuery UI
https://studio-42.github.io/elFinder/
Other
4.64k stars 1.41k forks source link

[Plugin Normalizer] missing Normalizer #3057

Closed osworx closed 4 years ago

osworx commented 4 years ago

Using the plugin Normalizer is fairly straight forward. When (!) the intl class Normalizer is installed (compiled). If not, only the debug option (when enabled) will tell you what is wrong:

WARNING: include_once(I18N/UnicodeNormalizer.php): failed to open stream: No such file or directory in plugins\Normalizer\plugin.php line 172.

The standard explaination inside the plugin.php itself tells you only that the class should be installed:

This plugin require Class "Normalizer" (PHP 5 >= 5.3.0, PECL intl >= 1.0.0) or PEAR package "I18N_UnicodeNormalizer"

More infos are then here: https://stackoverflow.com/questions/18470821/normalizer-not-found-in-php-5-3-8-and-not-xampp

Just a small tipp: could it be checked - better - if the normalizer class exists. Currently: Line 165: if (class_exists('Normalizer', false)) { Further (if not existing) Line 171 ff: if (!class_exists('I18N_UnicodeNormalizer', false)) { include_once 'I18N/UnicodeNormalizer.php'; }

And this include_once .. (line 172) throws the error.

To be fair, including the normalizer class is done only if this options are set (which are by default) if ($opts['nfc'] || $opts['nfkc']) { and I have called the plugin without further settings (using only the default).

nao-pon commented 4 years ago

@osworx I'm thinking of adding an option to show a toast message with errors notified in the backend so that the administrator can notice misconfigurations.

osworx commented 4 years ago

You mean similiar to the current output when "debug" is enabled?

nao-pon commented 4 years ago

Yes, When debugging mode is enabled on the backend side, minor errors caused by the PHP connector can be toasted on the elFinder UI.

elfdebugging