Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

portrino/typo3-whoops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TYPO3 Whoops

Build Status Latest Stable Version Total Downloads

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!

Getting started

Install using composer

$ composer require --dev portrino/typo3-whoops

Activation

via AdditionalConfiguration.php

Add the following lines into your typo3conf/AdditionalConfiguration.php:

$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:

$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.

$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.

Whoops!

Authors

  • 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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages