2017 © Pedro PelĂĄez
 

library typo3-whoops

Whoops error/ exception handler for TYPO3 projects

image

portrino/typo3-whoops

Whoops error/ exception handler for TYPO3 projects

  • Friday, November 17, 2017
  • by portrino-dev
  • Repository
  • 8 Watchers
  • 6 Stars
  • 473 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 46 % Grown

The README.md

TYPO3 Whoops

Build Status Latest Stable Version Total Downloads, (*1)

Use the whoops error/ exception handler instead of the default DebugExceptionHandler shipped within the TYPO3 core. This supports you with a nicer exception handling output in the frontend or on cli during extension development. Should only be used in a (local) development context!, (*2)

Getting started

Install using composer

$ composer require --dev portrino/typo3-whoops

Activation

via AdditionalConfiguration.php

Add the following lines into your typo3conf/AdditionalConfiguration.php:, (*3)

$GLOBALS['TYPO3_CONF_VARS']['SYS']['debugExceptionHandler'] = 
    \Portrino\Typo3Whoops\Error\WhoopsExceptionHandler::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['productionExceptionHandler'] = 
    \Portrino\Typo3Whoops\Error\WhoopsExceptionHandler::class;

We highly recommend to use a context related condition around it. For example:, (*4)

$applicationContext = \TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext()->__toString();
if (strpos($applicationContext, 'Development') !== false) {

    $GLOBALS['TYPO3_CONF_VARS']['SYS']['debugExceptionHandler'] = 
        \Portrino\Typo3Whoops\Error\WhoopsExceptionHandler::class;
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['productionExceptionHandler'] = 
        \Portrino\Typo3Whoops\Error\WhoopsExceptionHandler::class;

}
Compatibility for PHP versions < 7

Because the ExceptionHandlerInterface under php5.5 and 5.6 differs from the one from php > 7 we provide you a compatible version of the WhoopsExceptionHandler., (*5)

$GLOBALS['TYPO3_CONF_VARS']['SYS']['debugExceptionHandler'] = 
    \Portrino\Typo3Whoops\Compatibility\Error\WhoopsExceptionHandler::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['productionExceptionHandler'] = 
    \Portrino\Typo3Whoops\Compatibility\Error\WhoopsExceptionHandler::class;

via TYPO3 Console

typo3cms configuration:set --path SYS/debugExceptionHandler --value "Portrino\\Typo3Whoops\\Error\\WhoopsExceptionHandler"
typo3cms configuration:set --path SYS/productionExceptionHandler --value "Portrino\\Typo3Whoops\\Error\\WhoopsExceptionHandler"

Usage

Now trigger an exception somewhere in your extension code and you should see php errors for cool kids., (*6)

Whoops!, (*7)

Authors

, (*8)

  • Axel Böswetter - Initial work - EvilBMP
  • AndrĂ© Wuttig - Bugfixes, Unit Tests, Acceptance Tests, Travis CI Integration - aWuttig

See also the list of contributors who participated in this project., (*9)

The Versions

17/11 2017

dev-master

9999999-dev

Whoops error/ exception handler for TYPO3 projects

  Sources   Download

MIT

The Requires

 

The Development Requires

typo3 error handling whoops

13/11 2017

0.1.0

0.1.0.0

Whoops error/ exception handler for TYPO3 projects

  Sources   Download

MIT

The Requires

 

The Development Requires

typo3 error handling whoops