MODx: Plugin to Display Errors in a Development Environment

// You need to set the Apache variable LIVE on your live server
$e = &$modx->Event;
switch ($e->name) {
   case "OnWebPageInit":
       if ( !isset($_SERVER['LIVE']) ) // development environment
       {
           error_reporting(E_ALL);
           ini_set("display_errors","1");
       }
       break;
   default:
       return; // stop here - this is very important.
       break;
}
This entry was posted in MODx and tagged . Bookmark the permalink.

Leave a Reply