Skip to content

Instantly share code, notes, and snippets.

@davidneedham
Created November 20, 2013 22:38
Show Gist options
  • Save davidneedham/7572429 to your computer and use it in GitHub Desktop.
Save davidneedham/7572429 to your computer and use it in GitHub Desktop.
Put at your www root when syncing with a project that uses eosrei's Git-Dev-Workflow. This way you don't have to change database connection info when moving your code between the server and local.
<?php
/**
* A gdw.settings.php files for local D7 development. Store in /var/www.
*/
// Site is stored in '/var/www/example', so database name is 'example'
$database = basename(getcwd());
$databases = array (
'default' => array (
'default' => array (
'database' => $database,
'username' => 'root',
'password' => 'PASSWORD',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);
@Wylbur
Copy link

Wylbur commented Jun 12, 2014

Two updates, change password line:
'password' => 'PASSWORD',
Replace PASSWORD with your local account password.

Also, use this host file definition, because Drush likes to use 127.0.0.1 instead of localhost:
'host' => php_sapi_name() == 'cli' ? '127.0.0.1' : 'localhost',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment