Advertisement
wingman007

AppFog MySQL connection

Dec 3rd, 2013
1,989
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. <?php
  2. $services_json = json_decode(getenv("VCAP_SERVICES"),true);
  3. $mysql_config = $services_json["mysql-5.1"][0]["credentials"];
  4. return array(
  5.     'db' => array(
  6.     'dsn' => 'mysql:dbname='.$mysql_config["name"].';host='.$mysql_config["hostname"].';port='.$mysql_config["port"],
  7.         'username'       => $mysql_config["username"],
  8.         'password'       => $mysql_config["password"],  
  9.     )
  10. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement