Drupal - Settings.php that adapts to live & dev servers

PHP programming language and everything associated with it.

Drupal - Settings.php that adapts to live & dev servers

Postby Waylon » Thu Nov 01, 2012 3:41 am

Drupal - Settings.php that adapts to live & dev servers

Code: Select all
    if (stripos($_SERVER['SERVER_ADDR'],'192.168.1.5') === 0 ) {
    $db_url = 'mysqli://user:pass@localhost/dbname_dev';
    } else {
    $db_url = 'mysqli://user:pass@localhost/dbname_live';
    }
Waylon
Posting Frequency
Posting Frequency
 
Posts: 1007
Joined: Wed Oct 31, 2012 3:35 am

Drupal - Settings.php that adapts to live & dev servers

Return to PHP


Link to: Drupal - Settings.php that adapts to live & dev servers
URL:
BBCODE:
HTML:

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

 ® PcLayer.com 2009-2012 ©   All Rights Reserved