Login | Register
My pages Projects Community openCollabNet

propel
Reply to message

* = Required fields
* Subject
* Body
Attachments
Send reply to
Topic
Author (directly in email)
Please type the letters in the image above.

Original message

Author hlellelid
Full name Hans Lellelid
Date 2006-11-17 09:59:59 PST
Message That would work ... Certainly it is a hack to wire this stuff into
getConnection(), though I think we could also expect these defaults to
be set at the PDO layer -- if they represent fixes to broken
functionality, especially.

So, we could add something to the DBAdapter, but I'm not sure how much
we need to "systematize" workarounds for buggy low-level database drivers.

Hans

David Zülke wrote:
> Mmmmh my bad I just looked at it again and realized what the adapters
> do. So do we need a similar concept for building connections? Or could
> we simply use the adapters for that? (i.e. MysqlAdapter has default
> options and we read them)
>
>
> David
>
>
> Am 17.11.2006 um 17:47 schrieb David Zülke:
>
>> That seems a tad too hacky for my taste. I understand that we aren't
>> using DBAdapters anymore at all, is that correct? Should we maybe
>> re-introduce some very basic level of abstraction to cater for these
>> specific situations? For instance, what about this SET NAMES utf8 thing?
>> Putting stuff like that into the Propel class makes it next to
>> impossible to customize behavior in userland without patching.
>>
>> I'll be happy to implement the necessary changes should we decide
>> it's necessary or even feasible.
>>
>> Let's hear your thoughts :)
>>
>>
>> David
>>
>>
>> Am 17.11.2006 um 17:31 schrieb Soenke Ruempler - NorthClick:
>>
>>> Soenke Ruempler - NorthClick <> wrote on Friday, November 17, 2006
>>> 5:22 PM:
>>>
>>>> Ron Rademaker <mailto:r.rademak​er@virtualbuilding.n​l> wrote on
>>>> Friday, November 17, 2006 5:15 PM:
>>>>
>>>>> I guess the options from the runtime conf will be set later? (Just
>>>>> in case anyone ever wants to override the default).
>>>>
>>>> Currently not, but it should, yes.
>>>>
>>>> I don't know if PDO makes a difference between
>>>> driver-specific options and
>>>> global attributes like "PDO::ATTR_EMULATE_PREPARES". Are the
>>>> constructor-options from $driver_options the same as those
>>>> are passed to
>>>> PDO::setAttribute()?
>>>
>>> Yes they are. Finally:
>>>
>>> Index: Propel.php
>>> ====================​====================​====================​=======
>>> --- Propel.php (revision 497)
>>> +++ Propel.php (working copy)
>>> @@ -429,8 +429,16 @@
>>> $user = isset($conparams['user']) ?
>>> $conparams['user'] : null;
>>> $password = isset($conparams['password']) ?
>>> $conparams['password'] : null;
>>>
>>> + $driver_options = array();
>>> +
>>> + // Toggle PS Emulation for MySQL driver as the
>>> native server-side
>>> + // implementation seems to be buggy and slow.
>>> + // This can be overridden in the connection
>>> parameters
>>> + if (strpos($conparams['dsn'], 'mysql') === 0) {
>>> +
>>> $driver_options[PDO​::ATTR_EMULATE_PREPA​RES]
>>> = true;
>>> + }
>>> +
>>> // load any driver options from the INI file
>>> - $driver_options = array();
>>> if ( isset($conparams['options']) &&
>>> is_array($conparams['options']) ) {
>>> try {
>>> self::processDriverOptions(
>>> $conparams['options'], $driver_options );
>>>
>>> -soenke
>>>
>>> --------------------​--------------------​--------------------​---------
>>> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
>>> For additional commands, e-mail: dev-help at propel dot tigris dot org
>>>
>>>
>>
>> --------------------​--------------------​--------------------​---------
>> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
>> For additional commands, e-mail: dev-help at propel dot tigris dot org
>>
>>
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>