开发者

Drupal get database configuration

开发者 https://www.devze.com 2023-01-18 09:27 出处:网络
Is there any function preserved to extract da开发者_Python百科tabase configuration inside of my code, something like

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

精彩评论

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