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
Post a Comment