let's say I develop locally and debug small things on a real server.
Is it good to have something like this in my code?
$is_local = (strpos($_SERVER['HTTP_HOST'], 'localhost') !== false);
define ('DEBUG',$is_local);
And then use it through your code when setting up?
$mysql_settings = (DEBUG) ?
array() :
array();
Thus, I can use the same files live and on the local host, so I can synchronize without fear of error, for example. connection settings on a real server.
Is this a good or wrong idea?
source
share