Skip to content

Instantly share code, notes, and snippets.

@hugodias
Last active August 29, 2015 14:01
Show Gist options
  • Save hugodias/21f2061cb9b8ee4210f8 to your computer and use it in GitHub Desktop.
Save hugodias/21f2061cb9b8ee4210f8 to your computer and use it in GitHub Desktop.
<?php
if (App::environment('production')) {
$url = parse_url(getenv("CLEARDB_DATABASE_URL"));
$_ENV['DATABASE_HOST'] = $url["host"];
$_ENV['DATABASE_USERNAME'] = $url["user"];
$_ENV['DATABASE_PASSWORD'] = $url["pass"];
$_ENV['DATABASE_DATABASE'] = substr($url["path"], 1);
}
return array(
'fetch' => PDO::FETCH_CLASS,
'default' => 'mysql',
'connections' => array(
'sqlite' => array(
'driver' => 'sqlite',
'database' => __DIR__ . '/../database/production.sqlite',
'prefix' => '',
),
'mysql' => array(
'driver' => 'mysql',
'host' => $_ENV['DATABASE_HOST'],
'database' => $_ENV['DATABASE_DATABASE'],
'username' => $_ENV['DATABASE_USERNAME'],
'password' => $_ENV['DATABASE_PASSWORD'],
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'prefix' => '',
),
),
'migrations' => 'migrations',
'redis' => array(
'cluster' => false,
'default' => array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment