- Committed Moshe's selective table rewriting patch. Makes it possible to
share some database tables but not others.4.3.x
parent
410d619287
commit
b77272279e
|
@ -4,7 +4,18 @@
|
|||
function db_prefix_tables($sql) {
|
||||
global $db_prefix;
|
||||
|
||||
return strtr($sql, array("{" => $db_prefix, "}" => ""));
|
||||
if (is_array($db_prefix)) {
|
||||
$prefix = $db_prefix["default"];
|
||||
foreach ($db_prefix as $key => $val) {
|
||||
if ($key !== "default") {
|
||||
$sql = strtr($sql, array("{". $key. "}" => $val. $key));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$prefix = $db_prefix;
|
||||
}
|
||||
return strtr($sql, array("{" => $prefix, "}" => ""));
|
||||
}
|
||||
|
||||
$db_type = substr($db_url, 0, strpos($db_url, "://"));
|
||||
|
|
Loading…
Reference in New Issue