Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: A new DBAL-based bridge core, and supporting phpBB3 driver  (Read 6919 times)

0 Members and 1 Guest are viewing this topic.

Dion

  • Contributor
  • Coppermine newbie
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 11
    • Dion Designs
A new DBAL-based bridge core, and supporting phpBB3 driver
« on: February 21, 2014, 09:22:19 pm »

One issue I've had with Coppermine, for myself as well as with clients, is that it doesn't support bridging to applications that use non-MySQL databases. The issue is that the bridge core is hard-coded to MySQL.

So one day I sat down and modified the udb_base.inc.php bridge core to create a database abstraction layer (DBAL), and then completely rewrote the phpbb3.inc.php phpBB3 bridge driver to utilize the DBAL in the new bridge core. It works great, and I wanted to share it with the folks here. While I had no interest in writing additional bridge drivers, they should be easy to write.

Here is where you can find the new files: http://forum.dion-designs.com/t9012/improved-copperminephpbb3-bridge/

I thought about attaching the ZIP file here, but since the instructions in the above topic are also required, I felt it was better to link to the topic.

Please let me know what you think.
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: A new DBAL-based bridge core, and supporting phpBB3 driver
« Reply #1 on: February 21, 2014, 09:56:56 pm »

Dion,
Thank you for the documentation and sharing your code!

A Database Abstraction Layer has definitely been a topic of discussion - we certainly know we need to replace the direct mysql calls due to deprecation... The direction for the abstraction hasn't been determined yet as several options are being explored...

I've downloaded your code and will take a closer look at what you did. (haven't had a chance to do more than read the post and linked page...)

I've already documented several 'missing' functions for the dev teamincluding 'free result' to be covered as well as we go through the process as I found those in writing some plugin code.

Greg
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4860
    • Windsurf.me
Re: A new DBAL-based bridge core, and supporting phpBB3 driver
« Reply #2 on: February 21, 2014, 10:54:32 pm »

Dion,

Absolutely fantastic work. As Greg says, a DBAL is something that we have wanted to add to CPG for a very long time. Keep it coming, we would love to know your thoughts on adding an abstraction layer to the core for CPG1.6.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Dion

  • Contributor
  • Coppermine newbie
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 11
    • Dion Designs
Re: A new DBAL-based bridge core, and supporting phpBB3 driver
« Reply #3 on: February 22, 2014, 09:30:09 pm »

I didn't mention it in my original post, but if you want to use my revised bridge code in CPG, feel free to do so. You have my permission to remove my copyright blocks in the two files.

I think adding a DBAL would be a great idea. Creating it will be easy; a $CONFIG['dbal'] line in config.inc.php specifying a DBAL (mysqli/pgsql/mssql/etc) driver, and each driver having its own set of cpg_db_xxx() functions. Most of the required functions have already been written; I added the missing "simple" functions in my bridge DBAL, but a few more will be needed for manipulating tables (creating/truncating/dropping/altering).

The biggest issue will be replacing the large number of hard-coded mysql calls in the current code with DBAL-based calls.

I'm curious about something...what is this? http://sourceforge.net/p/coppermine/code/HEAD/tree/trunk/cpgdbal/include/cpgdb/
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: A new DBAL-based bridge core, and supporting phpBB3 driver
« Reply #4 on: March 14, 2014, 03:29:02 pm »

what is this? http://sourceforge.net/p/coppermine/code/HEAD/tree/trunk/cpgdbal/include/cpgdb/

That was an attempt (or proof of concept) of a DBAL for Coppermine. As far as I know Abbas created it and it also seemed to work as expected. I don't know why it was abandoned, that was before I joined the dev team.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.