Deal with the potential that SERVER_NAME may not be a part of the superglobal _SERVER.

This commit is contained in:
Andrew Tomaka 2011-10-28 21:57:02 -04:00
parent b1b54536eb
commit a6c7ecc721

View file

@ -10,7 +10,7 @@ register_shutdown_function('shutdown');
// make sure our file_exist returns fresh data. Likely not necessary. // make sure our file_exist returns fresh data. Likely not necessary.
clearstatcache(); clearstatcache();
if(in_array($_SERVER['SERVER_NAME'],array('localhost','a.io'))) { if(isset($_SERVER['SERVER_NAME']) && in_array($_SERVER['SERVER_NAME'],array('localhost','a.io'))) {
$conf = json_decode(file_get_contents(getcwd() . '/../conf/wia.conf')); $conf = json_decode(file_get_contents(getcwd() . '/../conf/wia.conf'));
} else { } else {
$conf = json_decode(file_get_contents('/home/atomaka/conf/wia.conf')); $conf = json_decode(file_get_contents('/home/atomaka/conf/wia.conf'));