mirror of
https://github.com/OPSnet/Logchecker.git
synced 2026-11-09 17:39:19 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f81c3a91d | ||
|
|
04d6d9cbef | ||
|
|
752ec6af0a | ||
|
|
594add313f | ||
|
|
fb05ef7b26 | ||
|
|
e462fdef45 | ||
|
|
b38c25a13d |
No files matched your search
+11
-2
@@ -1,9 +1,10 @@
|
||||
language: php
|
||||
sudo: true
|
||||
dist: trusty
|
||||
dist: xenial
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.cache/pip
|
||||
- $HOME/.composer/cache
|
||||
|
||||
php:
|
||||
@@ -19,11 +20,19 @@ matrix:
|
||||
- php: nightly
|
||||
|
||||
before_install:
|
||||
- composer install --ansi --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress
|
||||
- sudo apt-get install python3
|
||||
- wget https://bootstrap.pypa.io/get-pip.py
|
||||
- sudo python3 get-pip.py
|
||||
|
||||
install:
|
||||
- composer install --ansi --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress
|
||||
- pip3 install --user xld_logchecker eac_logchecker
|
||||
|
||||
script:
|
||||
- bin/logchecker --version
|
||||
- bin/logchecker --help
|
||||
- bin/logchecker tests/logs/wgdbcm.log
|
||||
- bin/logchecker tests/logs/xld_perfect.log
|
||||
|
||||
before_deploy:
|
||||
- php -d phar.readonly=0 bin/compile
|
||||
|
||||
@@ -33,7 +33,7 @@ file. Download this file, and then it can executed via CLI by running `php logch
|
||||
Alternatively, if you `chmod +x logchecker.phar`, it can be executed directly by doing `./logchecker.phar`.
|
||||
|
||||
To install it globally, run:
|
||||
```
|
||||
```bash
|
||||
mv logchecker.phar /usr/local/bin/logchecker
|
||||
chmod +x /usr/local/bin/logchecker
|
||||
```
|
||||
@@ -75,7 +75,7 @@ Details :
|
||||
```
|
||||
|
||||
### Code
|
||||
```
|
||||
```php
|
||||
<?php
|
||||
|
||||
$logchecker = new OrpheusNET\Logchecker\Logchecker();
|
||||
@@ -90,8 +90,12 @@ $ composer require orpheusnet/logchecker
|
||||
```
|
||||
|
||||
### Usage
|
||||
```
|
||||
use OrpheusNET\Logchecker\Logchecker();
|
||||
```php
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
use OrpheusNET\Logchecker\Logchecker;
|
||||
|
||||
$logchecker = new Logchecker();
|
||||
$logchecker->new_file('/path/to/log/file');
|
||||
@@ -109,9 +113,9 @@ print("\nLog Text:\n{$log_text}");
|
||||
|
||||
To build your own phar, you can checkout this repository, and then
|
||||
run the `bin/compile` script. To do this, run the following commands:
|
||||
```
|
||||
```bash
|
||||
git clone https://github.com/OPSnet/Logchecker
|
||||
cd Logchecker
|
||||
composer install
|
||||
php -d phar.readonly=0 /bin/compile
|
||||
php -d phar.readonly=0 bin/compile
|
||||
```
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "orpheusnet/logchecker",
|
||||
"description": "Logchecker for validating logs generated from supported ripping programs (like EAC and XLD)",
|
||||
"version": "0.8.1",
|
||||
"version": "0.8.2",
|
||||
"license": "Unlicense",
|
||||
"type": "library",
|
||||
"authors": [
|
||||
|
||||
@@ -44,4 +44,4 @@ for ($i = 1; $i < $rows->length; $i++) {
|
||||
|
||||
file_put_contents(__DIR__.'/../src/offsets.txt', implode("\n", $offsets));
|
||||
|
||||
print("Updating ".count($offsets)." drives\n");
|
||||
print("Updating ".count($offsets)." drives\n");
|
||||
+9
-5
@@ -439,10 +439,14 @@ class Logchecker {
|
||||
$GoodString = 'OK';
|
||||
}
|
||||
|
||||
$CommandExists = Util::commandExists($Command);
|
||||
$Out = shell_exec("{$Command} {$this->LogPath}");
|
||||
if (Util::strposArray($Out, $BadStrings) !== false || strpos($Out, $GoodString) === false) {
|
||||
$this->Checksum = false;
|
||||
if (Util::commandExists($Command)) {
|
||||
$Out = shell_exec("{$Command} ".escapeshellarg($this->LogPath));
|
||||
if ($Out == null || Util::strposArray($Out, $BadStrings) !== false || strpos($Out, $GoodString) === false) {
|
||||
$this->Checksum = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->account("Could not find {$Command}, checksum not validated.", false, false, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1020,7 +1024,7 @@ class Logchecker {
|
||||
$MatchedDrives[$i] = ['drives' => [], 'offsets' => []];
|
||||
}
|
||||
|
||||
foreach ($this->AllDrives as [$Drive, $Offset]) {
|
||||
foreach ($this->AllDrives as list($Drive, $Offset)) {
|
||||
$Distance = levenshtein($Drive, $DriveName);
|
||||
if ($Distance < 5) {
|
||||
$MatchedDrives[$Distance]['drives'][] = $Drive;
|
||||
|
||||
Reference in new issue
Block a user