English > General Questions
Compatibility with Fabrik
(1/1)
xgon:
Hello,
I have a site with Jdiction that now I need Fabrik too.
I've installed Fabrik and it seems that it needs a database driver also. Can we have both drivers running at the same time?
Thanks.
Harald Leithner:
You can change the core of jdiction to use the others database driver.but this will break on each jdiction upgrade
xgon:
where can I change this? Thanks.
Harald Leithner:
There are two ways:
1. change the extends of JdDatabaseAdapter from JDatabaseDriverMySQLi to JDatabaseDriverMySQLi_Fab in the file libraries/jdiction/database/driver/mysqli.php you maybe have to load the fab database driver file before with require_once(JPATH_SITE.'/components/com_fabrik/driver/mysqli_fab.php');
2. add the following code to the JdDatabaseAdapter class in libraries/jdiction/database/driver/mysqli.php
--- Code: --- public function replacePrefix($sql, $prefix = '#__')
{
$app = JFactory::getApplication();
$package = $app->getUserStateFromRequest('com_fabrik.package', 'package', 'fabrik', 'cmd');
if ($package == '')
{
$package = 'fabrik';
}
$sql = str_replace('{package}', $package, $sql);
return parent::replacePrefix($sql, $prefix);
}
--- End code ---
Navigation
[0] Message Index
Go to full version