Created
August 2, 2013 12:43
-
-
Save lknight/6139600 to your computer and use it in GitHub Desktop.
Plugin for wordpress to
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
Plugin Name: DW RDS_DB object | |
Description: provides special object $wp_rds_db access external database | |
Plugin URI: http://pvp.alvegia.ru | |
Author: Pavel G. Roytberg | |
Author URI: http://onga.ru | |
Version: 0.1 | |
USAGE: just declare $global $wp_rds_db and use it with all the wordpress class wpdb has to offer. | |
*/ | |
//IT RUNS EVERY LOADED PAGE. SO PROVIDE THIS INSTANCE OF WPDB CLASS TO THE WHOLE WORDPRESS. | |
define('DB_RDS_NAME','DB_NAME'); | |
define('DB_RDS_USER','USER'); | |
define('DB_RDS_PASSWORD','pass!word'); | |
define('DB_RDS_HOST','instancename.secret-salt.zone-name.rds.amazonaws.com'); | |
$wp_rds_db = new wpdb( DB_RDS_USER, DB_RDS_PASSWORD, DB_RDS_NAME, DB_RDS_HOST); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment