mirror of
https://github.com/OPSnet/Logchecker.git
synced 2026-01-16 18:04:27 -05:00
Mark ext-iconv as required dependency
This commit is contained in:
@@ -17,10 +17,11 @@
|
||||
},
|
||||
"require": {
|
||||
"php": "^8.1",
|
||||
"ext-iconv": "*",
|
||||
"ext-mbstring": "*",
|
||||
"symfony/console": "^6.0|^7.0",
|
||||
"symfony/yaml": "^6.0|^7.0",
|
||||
"symfony/process": "^6.0|^7.0"
|
||||
"symfony/process": "^6.0|^7.0",
|
||||
"symfony/yaml": "^6.0|^7.0"
|
||||
},
|
||||
"bin": ["bin/logchecker"],
|
||||
"require-dev": {
|
||||
@@ -45,6 +46,7 @@
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "8.1"
|
||||
}
|
||||
},
|
||||
"sort-packages": true
|
||||
}
|
||||
}
|
||||
|
||||
3
composer.lock
generated
3
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "e4d60c26c156775fe28702c92cf76037",
|
||||
"content-hash": "7f154ad99b1d7d4d57ba32adf8ecaaa9",
|
||||
"packages": [
|
||||
{
|
||||
"name": "psr/container",
|
||||
@@ -2618,6 +2618,7 @@
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": "^8.1",
|
||||
"ext-iconv": "*",
|
||||
"ext-mbstring": "*"
|
||||
},
|
||||
"platform-dev": [],
|
||||
|
||||
@@ -39,6 +39,10 @@ class Util
|
||||
} elseif ($chardet !== null) {
|
||||
$results = $chardet->analyze($logPath);
|
||||
if ($results['charset'] !== 'utf-8' && $results['confidence'] > 0.7) {
|
||||
// ideally we'd be able to use mb_convert_encoding as it has more widespread
|
||||
// support vs iconv, but it does not support as many encodings as iconv, such
|
||||
// as Windows-1250 (along with others) which is a common encoding for range logs
|
||||
// coming from rutracker
|
||||
// $log = mb_convert_encoding($log, 'UTF-8', $results['charset']);
|
||||
$tmp = @iconv($results['charset'], 'UTF-8', $log);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user