Last active
March 22, 2016 09:12
-
-
Save ArnaudLigny/6080029 to your computer and use it in GitHub Desktop.
Magento Whoops (https://github.com/filp/whoops) integration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
[...] | |
/** | |
* Redeclare custom error handler | |
* with Whoops support | |
* @see https://github.com/filp/whoops | |
* | |
* @param string $handler | |
* @return Mage_Core_Model_App | |
*/ | |
public function setErrorHandler($handler) | |
{ | |
if(Mage::getIsDeveloperMode()) { | |
$run = new Whoops\Run; | |
$handler = new Whoops\Handler\PrettyPageHandler; | |
$handler->addDataTable( | |
'Magento', array( | |
'Version' => Mage::getVersion() | |
) | |
); | |
$run->pushHandler($handler); | |
$run->register(); | |
} | |
else { | |
set_error_handler($handler); | |
} | |
return $this; | |
} | |
[...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment