000-CMS
avatar dodinz
dodinz
1 Oct 2014

Hello,

I tried to use the PDO driver for my 2nd database connection by setting this code to my model class:

$option['driver'] = 'pdo'; // Database driver name
$option['dsn'] = 'DSNname';
$option['host'] = 'xx.xx.xx.xx'; // Database host name
$option['port'] = '1433'; // Database host name
$option['user'] = 'sa'; // User for database authentication
$option['password'] = '$$$$$$$$$'; // Password for database authentication
$option['database'] = 'myDB'; // Database name
$option['prefix'] = ''; // Database prefix (may be empty)

$db = JDatabase::getInstance( $option );
parent::setDbo($db);

But prompted me an error : Fatal error: Cannot instantiate abstract class JDatabaseDriverPdo

Just wanted to ask if this driver is still on the development progress?

Thanks in advance! :)

avatar dodinz dodinz - open - 1 Oct 2014
avatar zero-24
zero-24 - comment - 1 Oct 2014

@dodinz are you sure by posting to Jissues repo? BTW The CMS support PDO only in 3.4 that is a develop Branche here: https://github.com/joomla/joomla-cms/tree/3.4-dev

See: joomla/joomla-cms@216b687

avatar mbabker
mbabker - comment - 1 Oct 2014

You can't directly use JDatabaseDriverPdo as it's an abstract class, rather you'd need to use a subclass of it (in CMS 3.3, the SQLite and Oracle drivers are subclasses of it). As noted, in 3.4, a PDO MySQL driver is added.

avatar mbabker mbabker - close - 1 Oct 2014
avatar mbabker mbabker - close - 1 Oct 2014
avatar elkuku elkuku - close - 1 Oct 2014
avatar mbabker mbabker - change - 1 Oct 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-10-01 11:09:44
avatar elkuku elkuku - change - 1 Oct 2014
Labels Added: 000-CMS
avatar b2z
b2z - comment - 11 Oct 2014

Joomla! Logo JTracker Status Comment


issues.joomla.org/tracker/jtracker/518

Easy: No
Successfull Tests: 0
Unsuccessfull Tests: 0


Last updated on 11 Oct 2014 20:01:25 GMT

Add a Comment

Login with GitHub to post a comment