Hello Devs,
could you please let me know why configurable table names have been removed from Roundcube 1.0? Currently it is only possible to prefix database tables. The old method was much more flexible. Is there a chance to get it back?
Regards, Rosali
Roundcube 0.9.x, rcube_db.php:
{{{
public function table_name($table)
{
$rcube = rcube::get_instance();
// return table name if configured
$config_key = 'db_table_'.$table;
if ($name = $rcube->config->get($config_key)) {
return $name;
}
return $table;
}
}}}
Roundcube 1.0, rcube_db.php:
{{{ public function table_name($table) { static $rcube;
if (!$rcube) {
$rcube = rcube::get_instance();
}
// add prefix to the table name if configured
if (($prefix = $rcube->config->get('db_prefix')) &&
strpos($table, $prefix) !== 0) { return $prefix . $table; }
return $table;
}
}}}