OPSnet / Logchecker

Logchecker for parsing and scoring logs coming from CD ripping programs
The Unlicense
57 stars 11 forks source link

Fatal Error When Analyzing EAC Log Files Pre-1.0 #16

Closed xekesz closed 8 months ago

xekesz commented 8 months ago

I am on 14.0 and when I analyze logs that I have made just a few days ago everything works perfectly but I recently found an old drive with tons of music and analyzing logs made from versions before 1.0 (0.99 prebeta 4 to be exact) I get this:

> logchecker analyze --no_text "a.log"
PHP Fatal error:  Uncaught Error: Call to undefined function OrpheusNET\Logchecker\iconv() in phar:///usr/local/bin/logchecker/src/Util.php:43
Stack trace:
#0 phar:///usr/local/bin/logchecker/src/Logchecker.php(112): OrpheusNET\Logchecker\Util::decodeEncoding()
#1 phar:///usr/local/bin/logchecker/src/Command/AnalyzeCommand.php(39): OrpheusNET\Logchecker\Logchecker->parse()
#2 phar:///usr/local/bin/logchecker/vendor/symfony/console/Command/Command.php(326): OrpheusNET\Logchecker\Command\AnalyzeCommand->execute()
#3 phar:///usr/local/bin/logchecker/vendor/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run()
#4 phar:///usr/local/bin/logchecker/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#5 phar:///usr/local/bin/logchecker/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#6 phar:///usr/local/bin/logchecker/bin/logchecker(6): Symfony\Component\Console\Application->run()
#7 /usr/local/bin/logchecker(14): require('...')
#8 {main}
  thrown in phar:///usr/local/bin/logchecker/src/Util.php on line 43
itismadness commented 8 months ago

Looks like your PHP installation is missing the iconv extension. Should probably add ext-iconv to composer.json to better indicate that it's required.

itismadness commented 8 months ago

Added ext-iconv as required in f02d02155a56725b9ef4e336baa6df40e41cbc68. Also added a comment on why we use iconv over mb_convert_encoding even though the latter is more broadly used/available.

If you hit the above error, iconv should come with your PHP installation and should just be a matter of making extension=iconv.so is in your php.ini file, which can be gotten by doing php -i | grep php.ini.

xekesz commented 8 months ago

I appreciate the help, I am very unfamiliar with PHP but all of my logs check out now!