By spflanze on
I have a need to access the prefix data in the db_prefix array (or scaler) in the settings.php of each site in the sites directory. I cannot simply include these files to access db_prefix variable that including them would create. To do so would alter many other global variables that should not be changed in the instance of Drupal that is running. That is, if it even can be done without PHP run time errors.
Worst case I would have to write code to parse the statement that assigns db_prefix a value. But I am hoping there is some PHP magic that, after extracting that statement's text from the file, can allow me to execute only that statement. Is there?
Comments
I have found what I am
I have found what I am looking for:
http://php.net/manual/en/function.eval.php