function connect() { $currentEnv = getenv('SERVER_ENVIRONMENT'); $type = "Database"; $name = ""; $properties = getConfigByName($currentEnv, $type, $name); if ($properties != "") { $DB_USER = $properties[0]->username; $DB_PASSWORD = $properties[0]->password; $DB_HOST = $properties[0]->host; $DB_NAME = $properties[0]->dbname; $DB_TYPE = $properties[0]->type; $dbc = mysql_connect($DB_HOST, $DB_USER, $DB_PASSWORD) or $error = mysql_error(); mysql_select_db($DB_NAME) or $error = mysql_error(); return $dbc; } }
function connect() { $currentEnv = getenv('SERVER_ENVIRONMENT'); $type = "Database"; $name = ""; $properties = getConfigByName($currentEnv, $type, $name); if ($properties != "") { $DB_USER = $properties[0]->username; $DB_PASSWORD = $properties[0]->password; $DB_HOST = $properties[0]->host; $DB_NAME = $properties[0]->dbname; $DB_TYPE = $properties[0]->type; $conn = db2_connect($DB_NAME, $DB_USER, $DB_PASSWORD); return $conn; } else { $conn = ""; return $conn; } }
function connectDatabase() { $currentEnv = getenv('SERVER_ENVIRONMENT'); $type = ""; $name = ""; $properties = getConfigByName($currentEnv, $type, $name); //$properties = parse_ini_file('config.ini', true); $DB_USER = $properties[0]->username; $DB_PASSWORD = $properties[0]->password; $DB_HOST = $properties[0]->host; $DB_NAME = $properties[0]->name; $dbc = @mysql_connect($DB_HOST, $DB_USER, $DB_PASSWORD) or $error = mysql_error(); @mysql_select_db($DB_NAME) or $error = mysql_error(); if (strlen($error) > 10) { echo "<!--{$error}.-->"; exit; die; } return $dbc; }
* 'sessions' => 'shared_', * 'role' => 'shared_', * 'authmap' => 'shared_', * ); * * Database URL format: * $db_url = 'mysql://*****:*****@localhost/databasename'; * $db_url = 'mysqli://*****:*****@localhost/databasename'; * $db_url = 'pgsql://*****:*****@localhost/databasename'; */ //$db_url = 'mysqli://root@localhost/drupal-6.19'; //$properties = parse_ini_file('config.ini', true); $currentEnv = getenv('SERVER_ENVIRONMENT'); $type = "Database"; $name = ""; $properties = getConfigByName($currentEnv, $type, $name); //echo $properties[0]->tableprefix; //$properties = parse_ini_file('config.ini', true); $db_url = $properties[0]->type . '://' . $properties[0]->username . ':' . $properties[0]->password . '@' . $properties[0]->host . '/' . $properties[0]->dbname; $db_prefix = ''; /** * Access control for update.php script * * If you are updating your Drupal installation using the update.php script * being not logged in as administrator, you will need to modify the access * check statement below. Change the FALSE to a TRUE to disable the access * check. After finishing the upgrade, be sure to open this file again * and change the TRUE back to a FALSE! */ $update_free_access = FALSE; /**