RE: [PEAR-DEV] MDB_Extended
| From: | Lukas Smith | Date: | Sat, 29 Nov 2003 11:35:59 +0000 |
| Subject: | RE: [PEAR-DEV] MDB_Extended | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-23965@lists.php.net to get a copy of this message | ||
> From: Matthias Nothhaft [mailto:php@mahono.de]
> Sent: Saturday, November 29, 2003 12:08 AM
> do you think, there is a common problem with the "module architecture"
> or is it just the Extended module that makes you worry?
>
> Doesn't return loadModule() always a reference to the loaded module?
> Did you try using this in methods?
>
> $ext = $mdb->loadModule("Extended");
> $ext->queryOne(...);
>
> Wouldn't this reduce code?
Well if I include the code all over the place in all modules then the
benefit is mostly lost. The point is to make the module truly optional.
> Maybe a abstract kind of iterator should be integrated to work with
> both, unbuffered and buffered lists in the same way?
Well if you use unbuffered queries you will just do query() and then
fetchRow() in a loop and then free the result set once you are done. You can
do this with buffered queries as well. But you might as well just have a
method query, fetch all data you want and free the result set, which is what
the query* methods do.
Another thing:
> Is there a Common.php in MDB/Modules/Native?
> It doesn't exist in the CVS.
>
> Remember MDB/Common.php line 1574:
> Instead of "return $value;" it should return an error,
> something like "declaration not found"
> or what else is $value?
The point of the native class is that it doesnt do any abstraction. Any
similarities are "accidental". There is no emulation. If you use this class
you better know that you are only working with the correct backend.
> And finally:
> A "little" feature request for LOBs: Maybe it would be usefull
> to have a factory for reading and writing LOBs for example
> to/from files, FTP, Streams, and other stuff!?
Well there is such a factory!
It's the "createLob" method. However in MDB 2.x you don't need to touch it
if you don't want to. You just have to pass an array to the setParam method
before the insert and it creates the LOB object for you. When you fetch a
LOB you just need to tell MDB which column contain LOBs and it will create
the necessary instance for you. Right now you can read/write from and to
variables and files. If you want more you can add new classes to the LOB.php
module.
Regards,
Lukas