Created
July 7, 2014 14:08
-
-
Save andrewhl/55b75bc1ccacf656e23e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
export APP_ENV=production | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php return array ( | |
'DB_HOST' => 'localhost', | |
'DB_NAME' => 'db_name', | |
'DB_USERNAME' => 'username', | |
'DB_PASSWORD' => 'password', | |
'APP_ENV' => 'local' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php return array ( | |
'DB_HOST' => 'localhost', | |
'DB_NAME' => 'production_db_name', | |
'DB_USERNAME' => 'production_username', | |
'DB_PASSWORD' => 'production_password', | |
'APP_ENV' => 'production' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/database.php | |
... | |
'connections' => array( | |
'sqlite' => array( | |
'driver' => 'sqlite', | |
'database' => __DIR__.'/../database/production.sqlite', | |
'prefix' => '', | |
), | |
'pgsql' => array( | |
'driver' => 'pgsql', | |
'host' => $_ENV['DB_HOST'], | |
'database' => $_ENV['DB_NAME'], | |
'username' => $_ENV['DB_USERNAME'], | |
'password' => $_ENV['DB_PASSWORD'], | |
'charset' => 'utf8', | |
'prefix' => '', | |
'schema' => 'public', | |
), | |
), | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# is actually: config/production/database.php | |
... | |
'connections' => array( | |
'sqlite' => array( | |
'driver' => 'sqlite', | |
'database' => __DIR__.'/../database/production.sqlite', | |
'prefix' => '', | |
), | |
'pgsql' => array( | |
'driver' => 'pgsql', | |
'host' => $_ENV['DB_HOST'], | |
'database' => $_ENV['DB_NAME'], | |
'username' => $_ENV['DB_USERNAME'], | |
'password' => $_ENV['DB_PASSWORD'], | |
'charset' => 'utf8', | |
'prefix' => '', | |
'schema' => 'public', | |
), | |
), | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ErrorException | |
Undefined index: DB_HOST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bootstrap/start.php | |
... | |
$env = $app->detectEnvironment(function() { | |
return getenv('APP_ENV') ?: 'local'; | |
}); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment