Skip to content

Instantly share code, notes, and snippets.

@chrisvogt
Created April 17, 2013 03:36
Show Gist options
  • Select an option

  • Save chrisvogt/5401600 to your computer and use it in GitHub Desktop.

Select an option

Save chrisvogt/5401600 to your computer and use it in GitHub Desktop.
Sendy on AppFog default config.
<?php
//==================================================================================//
// Configuration
//==================================================================================//
//path to your Sendy installation (without the trailing slash)
define('APP_PATH', 'http://sendy.yourdomain.com');
## --- APPFOG --- ##
// Read in the VCAP_SERVICES environment variable, parse the json, and
// check to see if it exists. If it does, use the settings for our default
// database connection.
$vcap_services = json_decode(getenv("VCAP_SERVICES"), true);
if(!empty($vcap_services)) { // database connection credentials
$dbHost = $vcap_services['mysql-5.1'][0]['credentials']['host']; // mySQL Hostname
$dbUser = $vcap_services['mysql-5.1'][0]['credentials']['username']; // mySQL Username
$dbPass = $vcap_services['mysql-5.1'][0]['credentials']['password']; // mySQL Password
$dbName = $vcap_services['mysql-5.1'][0]['credentials']['name']; // mySQL Database Name
if ($vcap_services['mysql-5.1'][0]['credentials']['port']) {
$dbPort = $vcap_services['mysql-5.1'][0]['credentials']['port']; // mySQL port
}
} else {
$dbHost = 'localhost'; //mySQL Hostname
$dbUser = ''; // mySQL Username
$dbPass = ''; // mySQL Password
$dbName = ''; // mySQL Database Name
// $dbPort = 3306; //mySQL port (only if you need to change it)
}
## --- APPFOG --- ##
//domain of cookie (99.99% chance you don't need to edit this)
define('COOKIE_DOMAIN', '');
//==================================================================================//
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment