=== WordPress Database Abstraction === Contributors: omniti Tags: database abstraction, mssql, pdo, SQL Server, sqlsrv, pdo_mysql, pdo_sqlsrv, database Requires at least: 3.1 Tested up to: 3.1 Stable tag: 1.0.1 This plugin provides two features - database access abstraction and SQL dialect abstraction. It is an mu (Must-Use) plugin AND also a db.php drop-in. == Description == WP Database Abstraction provides two features, database access abstraction and SQL dialect abstraction. This plugin cannot be installed or used as a regular plugin, it must be in the "mu-plugins" directory (must use plugins) and in addition to the plugin it contains a "drop-in" to hook into Wordpress Database functionality. Database Access Abstraction is the way you connect to the database through PHP. This plugin allows mysql, pdo, sqlsrv or mssql extensions to be used. PDO has support for mssql, dblib, sqlsrv and mysql drivers. This allows you to choose the way your WordPress installation connects to your database. You can use the plugin and still use a Mysql Database, which is perfect if your hosting provider only has PDO with the mysql driver available. The flexible structure of the plugin means that dropping in additional drivers is easy. SQL dialect abstraction means translating from the dialect understood by Mysql to other dialects. Currently only translation layers for T-SQL (used by Azure and SQL Server) are provided. However this is an open source project and additional translation layers could be added. For help and support please see the sourceforge project http://sourceforge.net/projects/wp-sqlsrv/ For information and tutorials please visit our blog http://wordpress.visitmix.com/ == Installation == NOTE: this plugin MUST be installed in the mu-plugins directory. db.php MUST be copied to your wp-content directory For a new WordPress install - first you cannot install WordPress until the plugin and dropin are in place. 1. Download the plugin package. 1. Upload wp-db-abstraction.php and the wp-db-abstraction directory to wp-content/mu-plugins. This should be parallel to your regular plugins directory. If the mu-plugins directory does not exist, you must create it. 1. Put the db.php file from inside the wp-db-abstraction directory to wp-content/db.php 1. Visit $your_wordpress_url/wp-content/mu-plugins/wp-db-abstraction/setup-config.php to generate your wp-config.php file 1. Install WordPress normally For a Wordpress install already using the plugin: 1. Download the plugin package. 1. Upload wp-db-abstraction.php and the wp-db-abstraction directory to wp-content/mu-plugins replacing the existing files 1. Put the db.php file from inside the wp-db-abstraction directory to wp-content/db.php If you are using or intend to use plugins that also use a db.php dropin. You MUST make sure the only db.php file in your wp-content directory is the one used by wp database abstraction. Rename the db.php files from other plugins. For example, if you are using a plugin named foobar, rename the db.php file from foobar to db-foobar.php and put it in the wp-content directory parallel to the db.php file for wp-db-abstraction. DO NOT OVERWRITE the db.php file that is already present. Then add include 'db-foobar.php'; to the bottom of the db.php file (there is an example in that file, uncomment it and change the name to the name your renamed the other db.php file to) == Frequently Asked Questions == = How do I create a wp-config.php file? = For new installs - we package our own wp-config.php creator. The creation url will be at $your_wordpress_url/wp-content/mu-plugins/wp-db-abstraction/setup-config.php The original setup-config.php WILL be redirected after the second step if db.php is in the right place == Changelog == = 1.0.1 = * Fix for USING join for categories * mysql driver now simply extends wpdb class * pdo driver now provides connection exception information when WP_DEBUG is on * Added warning for windows users with ntwdblib and mssql to config setup = 1.0.0 = * Changed from patch to plugin architecture. * Incorporated several fixes from sourceforge forums in T-SQL dialect translations == Notes == = Known Limitations = * This plugin must be in the "mu-plugins" directory. The db.php file "drop-in" must be in the wp-content directory. Normal plugin installation will not work. * Auto-update does not work for must-use plugins * It should be noted that we still hook into the WordPress upgrade logic and provide downstream upgrades through our own API call. This is done so that we can verify that new WordPress versions are compatible with our must-use database abstraction plugin. As a reminder to current users and as an explanation to new ones, our plugin is an essential part of your blog installation and we want to make sure that when you upgrade WordPress your blog doesn't break. * Some plugins and themes that do not use the WP abstraction layer will break. This is contrary to WordPress API guidelines, contact the theme or plugin author. * Some plugins and themes may use queries that need additional translations added. Please report any you find in the forums so the translation files can be updated. * Other plugins may also use a db.php drop-in. You can use both plugins, but it will requiring renaming files and adding lines to db.php from the plugin. See the Installation section for more details. * Other plugins that use db.php and extend the db class with custom behavior will break. = To Do = * Add additional translations for PostgreSQL and Sqlite * Add additional drivers - pdo_sqlite, sqlite, sqlite3, pgsql, pdo_pgsql, mysqli, odbc, pdo_odbc * Plugin specific autoupdater * Backup and import/export functionality in the plugin * Make db.php smart enough to pick up any files prefixed with db- in the wp-content directory to help with other plugins with "drop-ins" * Fix translation driven replacements inside quoted strings in queries.