Is there any function preserved to extract database configuration inside of my code, something like
$db_user = drupal_get_dbuser();
$db_pass = drupal_get_dbpass();
...
...
views:
16answers:
1
+2
A:
The code for this is:
<?php
global $db_url;
$creds = parse_url($db_url);
print $creds['user'];
print $creds['pass'];
var_dump($creds);
?>
More detailed info and edge-cases can be found by reading the code of http://api.drupal.org/api/function/db_connect/6
berkes
2010-09-28 11:58:36
Great thanks a lot @berkes! )
sultan
2010-09-28 12:00:12