Posted By

tylerhall on 07/17/06


Tagged

textmate server master settings conditional


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

postNuKe
nicolaspar
millisami


Conditional server settings


 / Published in: PHP
 

I use this code when I'm building a site that is tested both locally and remotely. If it finds ".com" in the doc root (on a remote server presumably) it loads one set of settings, otherwise it loads your local settings.

  1. if(strpos($_SERVER['DOCUMENT_ROOT'], ".com") === false)
  2. {
  3. $dbserver = "localhost";
  4. $dbname = "";
  5. $dbuser = "root";
  6. $dbpass = "";
  7. ini_set('display_errors', "1");
  8. ini_set('error_reporting', E_ALL ^ E_NOTICE);
  9. }
  10. else
  11. {
  12. $dbserver = "";
  13. $dbname = "";
  14. $dbuser = "";
  15. $dbpass = "";
  16. ini_set('display_errors', "0");
  17. }

Report this snippet  

You need to login to post a comment.