php - Variable value changes depending on domain using Laravel 4 -


in laravel 4, how can have

$pathtofile = '/var/www/awesome' $mysqlserver = '111.111.111.0' 

when domain of site www.mysite.com, and

$pathtofile = '/var/www/hackish' $mysqlserver = '111.111.111.1' 

when domain of site dev.mysite.com?

create different environment each domain, under bootstrap/start.php, , add specific file it, under app/start folder. in example, have:

bootstrap/start.php

// ... $env = $app->detectenvironment(array(     'production'  => array('www.mysite.com'),     'development' => array('dev.mysite.com'), )); 

app/start/production.php

$pathtofile = '/var/www/awesome'; $mysqlserver= '111.111.111.0'; 

app/start/development.php

$pathtofile = '/var/www/hackish'; $mysqlserver= '111.111.111.1'; 

you should not though, if you're working default configuration files, same valid them. can read more on documentation.


Comments

Popular posts from this blog

Using 'OR' and 'AND' in SQL Server -

c++ - NetBeans Remote Development with additional configuration -

visual studio - TFS will not accept changes I've made to a Java project -