Support » Requests and Feedback » Single DB Connection File for All Modules

  • Being a programmer, I would like to see a single connection class where I have to define my database and connection string only once. I find with all of the plugins that I have to keep redefining the connection string. All of the plugins etc would then call that single class.

    Of course this info already exists in the config file. Should there be a push from Core to say if you are going to connect to the database, pull the info from config?


Viewing 3 replies - 1 through 3 (of 3 total)
  • Mark (podz)


    Support Maven

    I don’t program at all, but I’ve used a lot of plugins – I don’t recall ever having to give my config information to plugin.

    Same here… I’ve written a couple of plugins that accessed the DB, and as long as I used the wp db class I haven’t had any problems.

    Now, if the plugin dev didn’t know how to do that, that’s a different issue & should be taken up with the author.


    That is why you shouldnt use your own db layer, but use the one used in wordpress (global $wpdb object).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Single DB Connection File for All Modules’ is closed to new replies.