Skip to content

Commit

Permalink
Added autoconfig for Stackato
Browse files Browse the repository at this point in the history
  • Loading branch information
shsu committed Aug 29, 2012
1 parent 12b5f24 commit 3bd8794
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions config/autoconfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
$appinfo = getenv("VCAP_APPLICATION");
$appinfo_json = json_decode($appinfo,true);
if (array_key_exists("users", $appinfo_json))
$admin = $appinfo_json["users"][0];
else
$admin = $appinfo_json["group"];

$url_parts = parse_url($_SERVER['DATABASE_URL']);
$db_name = substr( $url_parts{'path'}, 1 );

$AUTOCONFIG = array(
"installed" => false,
"adminlogin" => $admin,
"adminpass" => "changeme",
"directory" => "/app/app/data",
"dbtype" => "mysql",
"dbname" => $db_name,
"dbuser" => $url_parts{'user'},
"dbpass" => $url_parts{'pass'},
"dbhost" => $url_parts{'host'},
"dbtableprefix" => "oc_"
);
?>

0 comments on commit 3bd8794

Please sign in to comment.