Created
April 13, 2016 12:31
-
-
Save bkozora/f70cfe4b91d9ce909c6952ddf4bee7d7 to your computer and use it in GitHub Desktop.
Magento - Retrieve DB Info from local.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Bootstrap Magento | |
require_once("../www/app/Mage.php"); | |
$app = Mage::app('default'); | |
// Grab our database config info | |
$config = Mage::getConfig()->getResourceConnectionConfig("default_setup"); | |
// Connect to our RDS MySQL instance | |
$mysqli = new mysqli($config->host, $config->username, $config->password, $config->dbname); | |
// check RDS MySQL connection | |
if ($mysqli->connect_errno) { | |
printf("Connect failed: %s\n", $mysqli->connect_error); | |
exit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment