2017 © Pedro Peláez
 

library fatalnotifyer

Coercive FatalNotifyer Utility

image

coercive/fatalnotifyer

Coercive FatalNotifyer Utility

  • Saturday, April 7, 2018
  • by Coercive
  • Repository
  • 1 Watchers
  • 1 Stars
  • 867 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 17 Versions
  • 19 % Grown

The README.md

Coercive FatalNotifyer Utility

This class allows you to manage your site's errors with an internal system of exception and notification by email., (*1)

Get

composer require coercive/fatalnotifyer

Usage


use Coercive\Utility\FatalNotifyer\FatalNotifyer; # Instanciate $oFatal = new FatalNotifyer; # Display errors or not $oFatal->displayError(true || false); # Set your own email subject, with your project name for example $oFatal->setMailSubject('Hello, an error occured on my website'); # Add your email(s) and error list to send $oFatal->mail('email_1@email.email'); $oFatal->mail(['email_2@email.email', 'email_3@email.email']); $oFatal->mail('email_4@email.email', E_COMPILE_ERROR); $oFatal->mail('email_5@email.email', E_NOTICE | E_USER_NOTICE); // ... # Or just notify (not the full backtrace but short message) $oFatal->notify('email_1@email.email'); $oFatal->notify(['email_2@email.email', 'email_3@email.email'], E_NOTICE | E_USER_NOTICE); # Register type error for internal class handle $oFatal->register(E_FATAL); // E_ERROR, E_WARNING, E_PARSE, E_NOTICE, E_CORE_ERROR, // E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, // E_USER_ERROR:, E_USER_WARNING, E_USER_NOTICE, E_STRICT, // E_RECOVERABLE_ERROR, E_DEPRECATED, E_USER_DEPRECATED # Save type error in personal file $oFatal->save('/my/personal/log/directory/fatal', E_FATAL); $oFatal->save('/my/personal/log/directory/notice', E_NOTICE); // See after for explore errors datas # You can try an autotest for 3 errors type FatalNotifyer::autoTest(); # And you have a reset function FatalNotifyer::reset();

Explore error log

use Coercive\Utility\FatalNotifyer\FatalLog;

# For example, you can imagine an ajax system that retrieve error list ...

# Load
$oLog = new FatalLog('/my/personal/log/directory/fatal');

# Retreive days list directories
# ['2017-07-22', '2017-07-21', '2017-07-20', ...]

$aDays = $oLog->getDayList();

# Retreive file list by directories
# ['2017-07-22' => ['15_14_57', '15_14_58', ...], ...]

$aLists = [];
foreach ($aDays as $sDay) {
    $aLists[$sDay] = $oLog->getFileList($sDay);
}

# Retrieve one (example)

$oLog->getOne("/my/personal/log/directory/fatal/2017-07-22/15_14_57");

# Loop retrieve (example)

$aErrors = [];
foreach ($aLists as $sDay => $aFiles) {
    foreach ($aFiles as $sFile) {
        $aErrors[$sDay . '@' . $sFile] = $oLog->getOne("/my/personal/log/directory/fatal/$sDay/$sFile");
    }
}

# See results

echo '

';
var_dump($aDays);
var_dump($aLists);
var_dump($aErrors);
echo '
';

The Versions

07/04 2018

dev-master

9999999-dev http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

MIT GNU

The Requires

  • php >=7.1

 

07/04 2018

0.0.16

0.0.16.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

MIT

The Requires

  • php >=7.1

 

06/04 2018

0.0.15

0.0.15.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

MIT

The Requires

  • php >=7.1

 

07/02 2018

0.0.14

0.0.14.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

MIT

The Requires

  • php >=7.1

 

26/07 2017

0.0.13

0.0.13.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

GNU

The Requires

  • php >=7.1

 

26/07 2017

0.0.12

0.0.12.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

GNU

The Requires

  • php >=7.1

 

23/07 2017

0.0.11

0.0.11.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

GNU

The Requires

  • php >=7.1

 

23/07 2017

0.0.10

0.0.10.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

GNU

The Requires

  • php >=7.1

 

23/07 2017

0.0.9

0.0.9.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

GNU

The Requires

  • php >=7.1

 

22/07 2017

0.0.8

0.0.8.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

GNU

The Requires

  • php >=7.1

 

21/07 2017

0.0.7

0.0.7.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

GNU

The Requires

  • php >=7.1

 

20/07 2017

0.0.6

0.0.6.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

GNU

The Requires

  • php >=7.1

 

20/07 2017

0.0.5

0.0.5.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

GNU

The Requires

  • php >=7.1

 

20/07 2017

0.0.4

0.0.4.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

GNU

The Requires

  • php >=7.1

 

20/07 2017

0.0.3

0.0.3.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

GNU

The Requires

  • php >=7.1

 

20/07 2017

0.0.2

0.0.2.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

GNU

The Requires

  • php >=7.1

 

18/07 2017

0.0.1

0.0.1.0 http://coercive.fr

Coercive FatalNotifyer Utility

  Sources   Download

GNU

The Requires

  • php >=7.1