[TYPO3-mvc] How to use a foreign database in a new Extbase extension?

Chris Wolff - AERTiCKET AG cwolff at aer.de
Wed Mar 12 15:51:44 CET 2014


Hi Giovanni,
Ist a bit Complicated, 

Here is the naïve Aproace Example for LDAP auth:
http://xavier.perseguers.ch/tutoriels/typo3/articles/ldap-backend-for-extbase.html

but here comes the Catch! If you replace the
config.tx_extbase.objects.Tx_Extbase_Persistence_Storage_BackendInterface.className = Tx_YourBackendClass

every extbase extension is trying to use your  storage backend... that's propably not what you want.
Therefor you need to replace the BackendInterface with a Proxy Backend which is able to handle different backends depending on your configuration
Thanks the there is a possible solution for that problem written for the Ext Solr
http://forge.typo3.org/projects/extension-nxsolrbackend/repository/revisions/42099/entry/trunk/Classes/Persistence/Storage/ProxyBackend.php

okay then the StorageProxyBackend is detecting what table the Object Belongs to an sets the correct backend for hat table. Then you need to implement your own 
Storage Backend (replacing the typo3DbBackend) for your extension to handle the external database.

And then you need mapping configuration for every table as seen in the LDAP example above..

The whole process ist not a pice of cake. 
Regards chris.

-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Giovanni Romero P??rez
Gesendet: Mittwoch, 12. März 2014 15:10
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: [TYPO3-mvc] How to use a foreign database in a new Extbase extension?

Hi, everybody.

I have a MySQL database different to the TYPO3 one; that database doesn't follow any convention about the table or field names. I need to develop an Extbase extension in order to query, insert and update registers from that database. My question is: How can I do that?

I consulted on IRC and I suggested to using Tx_Extbase_Persistence_Storage_BackendInterface. I also read about Typo3DbBackend and DataMapper, but I don't know how to use them.

I'd appreciate your help. Thank you.
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list