binsky / yaep
yaep - Yet another Exim parser
dev-master
2024-08-19 16:22 UTC
Requires
- php: ^8.1
This package is auto-updated.
Last update: 2024-09-22 18:38:32 UTC
README
This is a PHP written Exim4 log parser.
Requirements
- ^php8.1
- exim4
Getting started
Installation
Installing this package is done easily with composer.
composer require binsky/yaep
Load the EximParser
use binsky\yaep\EximParser;
//Construct the EximParser
$eximParser = new EximParser();
Load data into the parser
There are 3 options to load data into the parser.
The $EximParser->autoInit();
method is recommended, but you can of course use one of the others.
Use autoload function
$eximParser->autoInit();
Use custom paths
$eximParser->eximStats->loadRawStats('eximstats -nvr -include_original_destination /var/log/exim4/mainlog.1');
$eximParser->mainlog->loadMainlogFile('/var/log/exim4/mainlog.1');
- Set custom data
$eximParser->eximStats->setRawStats($lines); //$lines: array with the lines of a 'eximstats' command output
$eximParser->mainlog->setRawMainlog($lines); //$lines: array with the lines of a exim mainlog file
Parse and process data
$eximParser->parse();