Skip to content

Instantly share code, notes, and snippets.

@bwsewell
Created December 12, 2012 15:05
Show Gist options
  • Save bwsewell/4268476 to your computer and use it in GitHub Desktop.
Save bwsewell/4268476 to your computer and use it in GitHub Desktop.
AppFog Codeigniter Database Configuration
<?php
$services_json = json_decode(getenv("VCAP_SERVICES"),true);
$mysql_config = $services_json["mysql-5.1"][0]["credentials"];
$db['default']['hostname'] = $mysql_config['hostname'];
$db['default']['username'] = $mysql_config['user'];
$db['default']['password'] = $mysql_config['password'];
$db['default']['database'] = $mysql_config['name'];
$db['default']['port'] = $mysql_config['port'];
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment