浏览代码

Also use symfony/process for chardet

pull/10/head
datagutten 4 年前
父节点
当前提交
79f2498d1f
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      src/Chardet.php

+ 4
- 1
src/Chardet.php 查看文件

@@ -3,6 +3,7 @@
namespace OrpheusNET\Logchecker;

use OrpheusNET\Logchecker\Exception\{FileNotFoundException};
use Symfony\Component\Process\Process;

class Chardet {
private $executable = null;
@@ -29,8 +30,10 @@ class Chardet {
if (!file_exists($filename)) {
throw new FileNotFoundException($filename);
}
$process = new Process([$this->executable, $filename]);
$process->run();
$output = $process->getOutput();

$output = shell_exec($this->executable . " " . escapeshellarg($filename));
// Following regex:
// matches[1] - file path
// matches[2] - charset


正在加载...
取消
保存