开发者

Drupal get database configuration

Is there any function preserved to extract da开发者_Python百科tabase configuration inside of my code, something like $db_user = drupal_get_dbuser(); $db_pass = drupal_get_dbpass();

...

...


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜