[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Phpgroupware-developers] Handling different classes by the same nam
From: |
Oliver Günther |
Subject: |
Re: [Phpgroupware-developers] Handling different classes by the same name |
Date: |
Tue, 3 Sep 2002 09:21:17 -0000 |
Greetings.
> Seeking an experienced voice:
>
> I have a package that I wish to integrate within the phpGroupWare environment.
>
> Natively, it uses the PEAR database abstraction library.
>
> Are there any php OO gurus out there who can tell me if it is feasible to
> have both a phpGW
>
> class db
>
> as well as a PEAR
>
> class DB
>
> simultaneously?
>
If you watch the problem via OOP definitivly NOT (Just think about it, as you
have all code in one file,
so you would have two class definition with the same name, which is impossible)
If you look the problem from PHP, there might be a way.( don't know if you can
create an object, and then
tell php to redefine the class.)
But please ... DON'T EVEN THINK ABOUT THAT ANYMORE.
If you get it run, and another developer try's to understand what you have
done, he will simply die. :-)
The best way would be to create a new class, which inherids the db class of
phpgw an has some methods you
use in you app.
Or you the PEAR::DB class an extend it with the needed methods of phpgw.
that's it.
olli