On Fri, Apr 24, 2015 at 8:16 AM, Arvids Godjuks <arvids.godj...@gmail.com> wrote:
> 2015-04-24 4:42 GMT+03:00 Benjamin Eberlei <kont...@beberlei.de>: > >> On Thu, Apr 23, 2015 at 3:45 PM, Arvids Godjuks <arvids.godj...@gmail.com >> > >> wrote: >> >> > PDO is everywhere. Doctrine? Based on PDO. >> >> >> You can use mysqli, oci8 or sqlsrv for example without problems in >> Doctrine. >> >> Exposing some of the internal api of PDO as php functions (SQL Parser) I >> would bet it is possible to reimplement PDO in PHP code using mysqli etc.. >> as "drivers". >> >> I think we could discuss going that road as well and we could save >> ourselves maintaining some thousands of lines of C code. >> > > May I question the sanity of the words written in this email? :D (it's a > joke). > You may question my sanity, but I am totally serious. > > The whole point of mysqlnd drivers and other improvements was to cut down > on data copying, improving performance and doing a lot of other stuff. > Moving PDO to a PHP implementation will kill it all: preformance will > suffer, memory usage will skyrocket, dealing with charsets - I don't even > wana pretend I understand how to deal with that part in a proper fasion. > Doesn't it require access to internal PHP api's to do a lot of what PDO and > other native drivers do? > Well, the Zephyr could pitch in here, MAYBE, depending on how good it > actually is and what it can do, but still, it feels more like a cruch to me. > None of these will happen, because PDO doesnt add much value on top of what the libraries already provide. For example MySQLi, pgsql, oci8 allready handle charsets, we only need to delegate correctly. See this very hacky prototype for PDO::prepare/query/bindValue/execute using a to be exposed API for emulated prepares in PHP code (extracted from existing PDO code). https://gist.github.com/beberlei/3dfa960901533e859c02 This is a very thin layer of PHP and given PHP7 is already twice as fast as PHP5 i don't think anyone would suffer.