[Ivan Diaz] -Add default values if environment variables are not defined

This commit is contained in:
Ivan Diaz 2016-05-14 15:32:44 -03:00
parent a6b7ec145e
commit e83c0328a2
1 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,10 @@
<?php <?php
$mysql_host = 'localhost'; $env['MYSQL_SERVER'] = getenv('MYSQL_SERVER');
$mysql_user = $_ENV['MYSQL_USER']; $env['MYSQL_USER'] = getenv('MYSQL_USER');
$mysql_password = $_ENV['MYSQL_PASSWORD']; $env['MYSQL_PASSWORD'] = getenv('MYSQL_PASSWORD');
$mysql_database = 'development'; $env['MYSQL_DATABASE'] = getenv('MYSQL_DATABASE');
$mysql_host = ($env['MYSQL_SERVER']) ? $env['MYSQL_SERVER'] : 'localhost';
$mysql_user = ($env['MYSQL_USER']) ? $env['MYSQL_USER'] : 'root';
$mysql_password = ($env['MYSQL_PASSWORD']) ? $env['MYSQL_PASSWORD'] : '';
$mysql_database = ($env['MYSQL_DATABASE']) ? $env['MYSQL_DATABASE'] : 'development';