> But why should there be a wrapper in the first place if we use
> straight PDO? The wrapper doesn't add anything besides the exception
> of a better escaping method. If the wrapper is for unit testing, then
> I still wonder why as its already well tested in php-src.

Like Christoph already mentioned about the PDO wrapper being written
prior to all these changes, two main reasons why more abstraction,
wrapping into its own classes, and more:
1 - Chaining methods was implemented (this is one very nice and major
addition actually). With using raw PDO class and object, this would
not be possible:
$dbh->prepare($query)->execute()->fetchAll()
All these statements can be really one liners actually. Even further
in majority of the SQL queries across the apps there is only a single
most important method to be used and can be wrapped into a "run()" or
similar which combines prepare() and execute() and query() when no
arguments are passed.

2 - And further option to extend this more and use an Adapter for
implementing configuration... But this needs to be rechecked a bit.

PDO wrapper is already smart enough and should stay, however it should
be slightly fixed...

Pull request to address this particular issue is in progress here:
https://github.com/php/web-bugs/pull/60

--
Peter Kokot

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to