21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 365 Views |
-
[SOLVED] Server Check if localhost

27 July 2011 at 1:09pm
I'm syncing across local computers over to my remote server. In light of Director::set_dev_servers, I would like to know if I can check if the status of where I am viewing the site.
If it is localhost, i'd like to run
require_once('conf/ConfigureFromEnv.php');
If it is on the server
$databaseConfig = array(...
-
Re: [SOLVED] Server Check if localhost

27 July 2011 at 1:24pm Last edited: 27 July 2011 1:26pm
define('current_domain', $_SERVER['HTTP_HOST']);
start of conditional statement
#### whatever port you are running your test serverif(current_domain == "localhost:####"):
then include the localhost environment...
this allows me to safely sync and overwrite the complete mysite folder
| 365 Views | ||
|
Page:
1
|
Go to Top |

