Forums / Developer / Connect extension to database on different server

Connect extension to database on different server

Author Message

Pasha Iakhontov

Wednesday 12 November 2008 6:05:55 pm

I have a custom extension that needs to connect to a database on a different server.

I can create a new database connection file based on ezdb.php and just modify it to grab the settings from the extensions site.ini, but the problem I have is that all my classes extend eZPersistentObject and my data type extends eZDataType. Obviously those classes just include the the standard call to eZDB::instance() as well as those classes include other classes.

I am stuck as I don't see a simple way of achieving what I am after.....any help/ideas appreciated!

Łukasz Serwatka

Thursday 13 November 2008 12:31:20 am

Hi,

As fare as I remember this is not possible with standard eZ Publish persistent object. Kristof made a patch while ago which allow connect to extrnal DB with eZ P persistent object.

See http://issues.ez.no/IssueView.php?Id=10667

Patch was made against 3.9 series, thus you will need to clean up it a bit in order to make with work with 4.x

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Piotrek Karaś

Tuesday 17 March 2009 1:36:54 pm

How come hasn't Kristof's patch made it to the regular code?
I guess using some independent connection and abstraction layer would be much safer in this case...

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu