{"id":12381,"date":"2011-03-02T15:36:49","date_gmt":"2011-03-02T15:36:49","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wordpress-database-abstraction\/"},"modified":"2012-01-31T18:09:44","modified_gmt":"2012-01-31T18:09:44","slug":"wordpress-database-abstraction","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/wordpress-database-abstraction\/","author":7653503,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.1.4","stable_tag":"1.1.4","tested":"3.3.2","requires":"3.0","requires_php":"","requires_plugins":"","header_name":"WP Db Abstraction","header_author":"Anthony Gentile and Elizabeth M Smith","header_description":"","assets_banners_color":"","last_updated":"2012-01-31 18:09:44","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/wordpress.org\/extend\/plugins\/wordpress-database-abstraction\/","header_author_uri":"http:\/\/wordpress.visitmix.com\/","rating":5,"author_block_rating":0,"active_installs":0,"downloads":22568,"num_ratings":0,"support_threads":1,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"1"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.1","1.1.0","1.1.1","1.1.2","1.1.3","1.1.4"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[66914,28197,48507,66915,66916],"plugin_category":[59],"plugin_contributors":[129732],"plugin_business_model":[],"class_list":["post-12381","plugin","type-plugin","status-closed","hentry","plugin_tags-database-abstraction","plugin_tags-mssql","plugin_tags-pdo","plugin_tags-sql-server","plugin_tags-sqlsrv","plugin_category-utilities-and-tools","plugin_contributors-omniti","plugin_committers-omniti"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wordpress-database-abstraction.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>WP Database Abstraction is a plugin to make it possible to run WP on top of MS\nSQL Server or Azure and provides two features, database access abstraction and SQL\ndialect abstraction. This plugin cannot be installed or used as a regular\nplugin, it must be in the \"mu-plugins\" directory (must use plugins) and in\naddition to the plugin it contains a \"drop-in\" to hook into WordPress Database\nfunctionality.<\/p>\n\n<p>Database Access Abstraction is the way you connect to the database through PHP.\nThis plugin allows mysql, mysqli, pdo, sqlsrv or mssql extensions to be used.  PDO has support\nfor mssql, dblib, sqlsrv and mysql drivers.  This allows\nyou to choose the way your WordPress installation connects to your database.  You\ncan use the plugin and still use a Mysql Database, which is perfect if your hosting\nprovider does not make the mysql extension available.  The flexible structure of the\nplugin means that dropping in additional drivers is easy.<\/p>\n\n<p>SQL dialect abstraction means translating from the dialect understood by Mysql\nto other dialects.  Currently only translation layers for T-SQL (used by Azure and SQL Server)\nare provided.  However this is an open source project and additional translation layers\ncould be added.<\/p>\n\n<p>For help and support please see the sourceforge project\nhttp:\/\/sourceforge.net\/projects\/wp-sqlsrv\/<\/p>\n\n<p>For information and tutorials please visit our blog\nhttp:\/\/wordpress.visitmix.com\/<\/p>\n\n<h3>Notes<\/h3>\n\n<h4>Known Limitations<\/h4>\n\n<ul>\n<li>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.<\/li>\n<li>Auto-update does not work for must-use plugins<\/li>\n<li>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.<\/li>\n<li>Some plugins and themes may use queries that need additional translations added.  Please report any you find in the sourceforge forums so the translation files can be updated. Please turn on query logging in wp-config.php and include your logs with the translation fix request.<\/li>\n<li>Other plugins may also use a db.php drop-in.  You can use both plugins, but it will requiring renaming files and adding lines\nto db.php from the plugin.  See the Installation section for more details.<\/li>\n<li>Other plugins that use db.php and extend the db class with custom behavior will break.<\/li>\n<\/ul>\n\n<h4>To Do<\/h4>\n\n<ul>\n<li>Add additional translations for PostgreSQL and Sqlite<\/li>\n<li>Add additional drivers - pdo_sqlite, sqlite, sqlite3, pgsql, pdo_pgsql, odbc, pdo_odbc<\/li>\n<li>Plugin specific autoupdater to mimic upgrade behavior of regular plugins<\/li>\n<li>Administration area with the ability to view, alter, edit configuration and help with debugging issues<\/li>\n<li>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\"<\/li>\n<li>Proper error handling (no more @symbols) in database driver classes<\/li>\n<\/ul>\n\n<!--section=installation-->\n<p>Before you begin you will need a properly configuration server and PHP installation.\nFor help with IIS you can visit http:\/\/php.iis.net\/ and ask questions in the forums.\nYou will also need a working database extension.  Check your phpinfo page to verify:<\/p>\n\n<p>To use mysql you will need one of the following php extensions enabled:<\/p>\n\n<ol>\n<li>mysql<\/li>\n<li>mysqli<\/li>\n<li>pdo and pdo_mysql driver<\/li>\n<\/ol>\n\n<p>To use sql server you will need one of the following php extensions enabled:<\/p>\n\n<ol>\n<li>sqlsrv<\/li>\n<li>pdo and pdo_sqlsrv driver<\/li>\n<li>mssql (non-windows environments with freetds)<\/li>\n<li>pdo and pdo_dblib (non-windows environments with freetds)<\/li>\n<\/ol>\n\n<p>You can get more information and support for sql server and the sqlsrv extension\nat http:\/\/social.technet.microsoft.com\/Forums\/en-US\/sqldriverforphp\/threads<\/p>\n\n<p>For a new WordPress install - you cannot install WordPress using SQL Server until\nthe plugin and dropin are in place.<\/p>\n\n<ol>\n<li>Download wordpress, unzip the package and put the file in place.<\/li>\n<li>Download the plugin package.<\/li>\n<li>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.<\/li>\n<li>Put the db.php file from inside the wp-db-abstraction.php directory to wp-content\/db.php<\/li>\n<li>Visit $your_wordpress_url\/wp-content\/mu-plugins\/wp-db-abstraction\/setup-config.php to generate your wp-config.php file<\/li>\n<li>Install WordPress normally<\/li>\n<\/ol>\n\n<p>For a Wordpress install already using the plugin:<\/p>\n\n<ol>\n<li>Download the plugin package.<\/li>\n<li>Upload wp-db-abstraction.php and the wp-db-abstraction directory to wp-content\/mu-plugins replacing the existing files<\/li>\n<li>Put the db.php file from inside the wp-db-abstraction directory to wp-content\/db.php<\/li>\n<\/ol>\n\n<p>If you are using or intend to use plugins that also use a db.php dropin.\nYou MUST make sure the only db.php file in your wp-content directory is the one used by wp database abstraction.\nRename the db.php files from other plugins.  For example, if you are using a plugin named foobar, rename the\ndb.php file from foobar to db-foobar.php and put it in the wp-content directory parallel to the db.php file for\nwp-db-abstraction.  DO NOT OVERWRITE the db.php file that is already present.  Then\nadd<\/p>\n\n<p>include 'db-foobar.php';<\/p>\n\n<p>to the bottom of the db.php file (there is an example in that file, uncomment it and change the name\nto the name your renamed the other db.php file to)<\/p>\n\n<p>For a Wordpress Install migrating from MySQL to SQL Server<\/p>\n\n<ol>\n<li>Log into your current site and export your data as an xml file<\/li>\n<li>Disable all your current plugins<\/li>\n<li>Back up your existing config.php file<\/li>\n<li>Download the plugin package.<\/li>\n<li>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.<\/li>\n<li>Put the db.php file from inside the wp-db-abstraction.php directory to wp-content\/db.php<\/li>\n<li>Visit $your_wordpress_url\/wp-content\/mu-plugins\/wp-db-abstraction\/setup-config.php to generate your wp-config.php file<\/li>\n<li>Install WordPress<\/li>\n<li>Log into the newly installed system and import your data<\/li>\n<li>Reinstall and test your plugins<\/li>\n<\/ol>\n\n<p>If you are using or intend to use plugins that also use a db.php dropin.\nYou MUST make sure the only db.php file in your wp-content directory is the one used by wp database abstraction.\nRename the db.php files from other plugins.  For example, if you are using a plugin named foobar, rename the\ndb.php file from foobar to db-foobar.php and put it in the wp-content directory parallel to the db.php file for\nwp-db-abstraction.  DO NOT OVERWRITE the db.php file that is already present.  Then\nadd<\/p>\n\n<p>include 'db-foobar.php';<\/p>\n\n<p>to the bottom of the db.php file (there is an example in that file, uncomment it and change the name\nto the name your renamed the other db.php file to)<\/p>\n\n<!--section=faq-->\n<dl>\n<dt>How do I create a wp-config.php file?<\/dt>\n<dd><p>For new installs - we package our own wp-config.php creator.  The creation url will be at\n$your_wordpress_url\/wp-content\/mu-plugins\/wp-db-abstraction\/setup-config.php  The original\nsetup-config.php WILL be redirected after the second step if db.php is in the right place<\/p><\/dd>\n<dt>My themes and images don't show up when using Multisite with IIS<\/dt>\n<dd><p>The rewrite rules supplied by wordpress for networking are incorrect for IIS7 and Url Rewrite<\/p>\n\n<p>change your web.config file and replace the rewrite rule for #5 with the one below\n    \n      \n      \n    <\/p><\/dd>\n<dt>Why is collation important when using SQL Server? How do I change the SQL Server Collation used?<\/dt>\n<dd><p>By default, the SQL Server collation used by this plugin is database_default.  This means\nthat the default collation defined by the SQL Server install will dictate the collation\nused when creating the sql server tables.<\/p>\n\n<p>If you need to use a different collation for your installation, you may define DB_COLLATE\nin your wp-config.php file.  For example, defining it to Cyrillic_General_BIN.  Note that this\nwill only affect new installations of the plugin.<\/p>\n\n<p>If you want to change the way an individual table is collated you may use the following example syntax:<\/p>\n\n<pre><code>ALTER TABLE wp_posts ALTER COLUMN post_content varchar(max)COLLATE Latin1_General_CI_AS\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.1.4<\/h4>\n\n<ul>\n<li>add all reserved words for sql server - plugins might use them<\/li>\n<li>fixed limit regex to catch queries with ; at the end<\/li>\n<li>fix for inserting NULL into identity columns<\/li>\n<\/ul>\n\n<h4>1.1.3<\/h4>\n\n<ul>\n<li>fixed ording for items in archives<\/li>\n<li>added extra space before N prefix in strings to fix bad concatenation issues<\/li>\n<\/ul>\n\n<h4>1.1.2<\/h4>\n\n<ul>\n<li>packaged correct example fields_map file updated to a base 3.2.1 install<\/li>\n<li>blocked install as anything but mu-plugin<\/li>\n<li>fixed error messages for attempted regular plugin install<\/li>\n<li>fixed html issues with error page<\/li>\n<li>field maps parsed_types information cache can have a location defined in wp-config.php<\/li>\n<li>on multisite installs, each site has it's own database metadata cache file<\/li>\n<li>added error if PHP database extension desired is not loaded to avoid confusing db can't connect errors<\/li>\n<\/ul>\n\n<h4>1.1.1<\/h4>\n\n<ul>\n<li>additional help for installation, upgrading, and migrating<\/li>\n<li>packaged example fields_map file updated to a base 3.2.1 install<\/li>\n<li>translation uses N prefix for unicode data<\/li>\n<li>DB_COLLATE obeyed properly for table creation<\/li>\n<li>better error handling and descriptions for plugin, installation and upgrade issues<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>New method of stripping out strings before translation<\/li>\n<li>drivers extend sql translation that extends wpdb<\/li>\n<li>mysqli driver added<\/li>\n<li>Drivers cleaned up and code simplified<\/li>\n<li>Issues with sqlsrv and datetime objects, and with integrated windows auth are now fixed<\/li>\n<li>Some translation fixes for various plugins<\/li>\n<li>API ping is now cached<\/li>\n<li>Error if fields_map file cannot be written to<\/li>\n<li>Packaged example fields_map file for installations that failed<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Fix for USING join for categories<\/li>\n<li>mysql driver now simply extends wpdb class<\/li>\n<li>pdo driver now provides connection exception information when WP_DEBUG is on<\/li>\n<li>Added warning for windows users with ntwdblib and mssql to config setup<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Changed from patch to plugin architecture.<\/li>\n<li>Incorporated several fixes from sourceforge forums in T-SQL dialect translations<\/li>\n<\/ul>","raw_excerpt":"This plugin provides db access abstraction and SQL dialect abstraction for SQL Server.\nIt is an mu (Must-Use) plugin AND also a db.php drop-in.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/12381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=12381"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/omniti"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=12381"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=12381"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=12381"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=12381"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=12381"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=12381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}