Skip to content
Advertisement

Symfony 1.4 connect to mysql via SSL

I need to change an old Symfony 1.4 application so that it’s able to connect to mysql via ssl-connection.

I found a lot about this for Symfony >= 2. But unfortunately not for this dusty one.

For validation purposes I already made it work by editing

./apps/frontend/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Connection.php

JavaScript

to

JavaScript

But I wonder if this ugly hack is actually the only solution?

Advertisement

Answer

It took me a while to see that this connection class is already overwritten (apps/frontend/lib…).

So I only had to make these variables configurable. There is an option in databases.yml configuration called attributes (doctrine::param::attributes). If you pass non-string keys you can get them with getAttribute.

So at least it works (it’s inside the try area of connect-method).

JavaScript

In databases.yml you will have to type the following (comments help to understand these numbers)

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement