How to get PHP to recognize a new class extended from MDB2?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jonathanm
Forum Newbie
Posts: 2
Joined: Wed Apr 06, 2011 5:12 pm

How to get PHP to recognize a new class extended from MDB2?

Post by jonathanm »

Hi, all.

I'm a total noob at PHP and PEAR. I'm running PHP 5.3.6 on Windows XP Pro.

I've written a new class, MDB2_Driver_pfusionsql that extends MDB2_Driver_Common. I placed it in its own file, pfusionsql.php, under PEAR/MDB2/Driver.

On my web page code, I invoke it by setting the DSN with
$dsn['phptype'] = 'pfusionsql';
and with other appropriate names/values. Then I use the MDB2::connect($dsn) method. That returns an error object with the following messages:

MDB2 Error: not found
unable to find package 'MDB2_Driver_pfusionsql' file 'MDB2\Driver\pfusionsql.php'

I don't know anything about building packages or anything like that. I just figured if I put the code under the right directory it would be recognized.

Can anyone tell me how to make PHP recognize this new code?
jonathanm
Forum Newbie
Posts: 2
Joined: Wed Apr 06, 2011 5:12 pm

Re: How to get PHP to recognize a new class extended from MD

Post by jonathanm »

OK. Figured it out. What was happening was the file containing my new class was failing is_readable() due to permissions.
Post Reply