propelorm/Propel2 — pull request #39 by fzaninotto (2011-11-06 21:34:12+00:00)
Title: Connection refactoring

To accomodate the possibility to use non-PDO connections, I refactored the connections from classes extending PDO and PDOStatement to classes *wrapping around* the actual connection classes. After turning the problem in my head for quite some time, I came to the conclusion that wrapper classes - a concept already used by Doctrine2 for connections - is the best way to go.

I took the opportunity to tweak interfaces for Connection and Statement, and cleaned up the full query logging system. In theory, all the Propel code could work with only `ConnectionPdo` and `StatementPdo`, the wrapper classes providing only additional features:

- nested transactions
- statement cache
- logging

I made this PR so that the code to merge can be kept to a reasonable size. The refactoring isn't finished, so don't pay attention to the `ConnectionPdo` and `StatementPdo` class names for now. Also, I will add more tests as soon as the naming is final. For now, all the existing tests pass (at least the ones that pass in master).

The next step will be to move `ConnectionPdo` and `StatementPdo` under 'Runtime/Adapter/Pdo/`, as well as all the current Adapter classes (which are, in fact PDO adapter above all). That way, an oci8/db2 adapter can contain both an `Adapter` subclass, and a `Connection` and `Statement` subclass.