Keeping Issues Private

There are many times I see postings to add ‘display_errors’ = true and define(‘DEVELOPMENT’, true) suggested to be added to config.local.php.

Here is an alternate approach that I use that might keep you from publishing your issues to your clients but ensuring that you can see issues as they come up and also have access to the debugger all the time.

Create a local_conf.php file in the root of your store that contains:

<br />
if( !defined('BOOTSTRAP') ) die('Access denied');<br />
define('my_debug_enabled', true);  // change to false to disable<br />
function my_debug_ip() {<br />
    $debug_ips = array('[YOUR IP ADDRESS]', '[YOUR DEVELOPERS IP ADDRESS]', '[ETC']);<br />
    return in_array($_SERVER['REMOTE_ADDR'], $debug_ips);<br />
}<br />
if( defined('my_debug_enabled') && my_debug_enabled && my_debug_ip() ) {<br />
    define('DEVELOPMENT', true);<br />
    error_reporting(E_ALL);<br />
    ini_set('display_errors', true);<br />
    define('DEBUG_MODE', true);<br />
}<br />

```<br />
This will enable these things for your eyes only.  You can then also use the my_debug_ip() function in other areas of code to add diagnostic display of information when working on a live site.<br />
<br />
You can also further qualify this for AREA == 'C' if you want to restrict to customer view only, etc.<br />
<br />
Just a tid-bit to maybe make life easier and a bit more private.