Thanks for the feedback. And no, I'm not going to ignore you ;)
The reason I wrote this was because I needed the unix_socket option
for mysql. Which was included in the array and worked, but the schema
validation routines didn't approved it because it was missing from the
schema. So I found your issue on the bug tracker and decided to
include it.
With your feedback I decided to extended the unit test with additional
connections for sqlite and oracle. Unfortunately I found that multiple
connections won't work because the $config argument in
DoctrineExtension::dbalLoad looks like this:
array(1) {
["connections"]=>
array(1) {
["connection"]=>
array(7) {
["id"]=>
string(7) "default"
["dbname"]=>
string(10) "myWebapp"
["user"]=>
string(10) "myWebapp_user"
["password"]=>
string(16) "myWebapp_passwd"
["unix_socket"]=>
string(27) "/var/run/mysqld/mysqld.sock"
[0]=>
array(6) {
["id"]=>
string(6) "sqlite"
["driver"]=>
string(9) "PDOSqlite"
["dbname"]=>
string(8) "sqlit_db"
["user"]=>
string(11) "sqlite_user"
["password"]=>
string(13) "sqlite_s3cr3t"
["memory"]=>
bool(true)
}
[1]=>
array(6) {
["id"]=>
string(3) "oci"
["driver"]=>
string(4) "OCI8"
["dbname"]=>
string(9) "oracle_db"
["user"]=>
string(11) "oracle_user"
["password"]=>
string(13) "oracle_s3cr3t"
["charset"]=>
string(4) "utf8"
}
}
}
}
Which I guess is wrong (see the array structure). Apparently each
connection is put in the connections array which can only contain one
key with the name "connection". The supplied DI configuration in XML
looks like this and is valid according the schema:
<doctrine:dbal>
<doctrine:connections>
<doctrine:connection
id="default"
dbname="myWebapp"
user="myWebapp_user"
password="myWebapp_passwd"
unix_socket="/var/run/mysqld/mysqld.sock" />
<doctrine:connection
id="sqlite"
driver="PDOSqlite"
dbname="sqlit_db"
user="sqlite_user"
password="sqlite_s3cr3t"
memory="true" />
<doctrine:connection
id="oci"
driver="OCI8"
dbname="oracle_db"
user="oracle_user"
password="oracle_s3cr3t"
charset="utf8" />
</doctrine:connections>
</doctrine:dbal>
Am I missing something or is this a bug in the DI implementation?
Martijn
On 8 jul, 21:51, Brandon Turner <[email protected]> wrote:
> Martijn,
>
> I'm not a Symfony dev so feel free to ignore my comments. I think your
> unit test looks good, however it doesn't actually test the change made
> (added support for memory and charset options). Your unit test is still
> good and serves a purpose, but perhaps it should be moved to another
> patch/branch?
>
> Again, I'm not a Symfony dev so please ignore my two cents ;)
>
> Brandon (aka bltcoder)
>
> On 7/8/10 11:09 AM, Martijn wrote:
>
> > Ticket:http://trac.symfony-project.org/ticket/8824
> > Patch:http://github.com/martijn4evers/symfony/tree/ticket_8824
>
> > This was a great way to lean git so i hope everything went well.
>
> > I've used the patch provided by bltcoder for the DoctrineExtension and
> > added these options in the schema for XML DI configuration validation
> > ( Resource/config/schema/doctrine-1.0.xsd ). There is also an
> > additional unit test to verify these options are allowed in the XML DI
> > configuration using the schema. This was my first unit test so I hope
> > nothing is wrong, maybe someone can double check?
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en