From dce23fa001e62fe7e779261ceeb718c24a37f127 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Mon, 19 Jan 2015 13:04:31 -0500 Subject: [PATCH] Moved defined parameters into separate file so uninstall can get to them. --- defines.php | 42 ++++++++++++++++++++++++++++++++++++++++++ index.php | 41 ++--------------------------------------- uninstall.php | 2 +- 3 files changed, 45 insertions(+), 40 deletions(-) create mode 100644 defines.php diff --git a/defines.php b/defines.php new file mode 100644 index 00000000..a92689b0 --- /dev/null +++ b/defines.php @@ -0,0 +1,42 @@ +prefix.'glm_members_'); + +?> \ No newline at end of file diff --git a/index.php b/index.php index c70a5ec1..1d05417e 100644 --- a/index.php +++ b/index.php @@ -39,45 +39,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - -/* - * - * Set standard parameters - * - */ - -// Determine current http/https protocol -$pageProtocol = 'http'; -if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443') { - $pageProtocol = 'https'; -} -define('GLM_MEMBERS_PLUGIN_HTTP_PROTOCOL', $pageProtocol); - -// Debug Options -define('GLM_MEMBERS_PLUGIN_ADMIN_DEBUG', true); -define('GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE', true); -define('GLM_MEMBERS_PLUGIN_FRONT_DEBUG', true); -define('GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE', true); - -// Plugin Versions -define('GLM_MEMBERS_PLUGIN_VERSION', 0.1); -define('GLM_MEMBERS_PLUGIN_DB_VERSION', 0.1); - -// URLs -define('GLM_MEMBERS_PLUGIN_URL', plugin_dir_url(__FILE__)); -$pageUri = explode('?', $_SERVER['REQUEST_URI']); // Bust this up to access URL path and script name only -define('GLM_MEMBERS_PLUGIN_CURRENT_BASE_URL', $pageProtocol.'://'.$_SERVER['SERVER_NAME'].$pageUri[0]); - -// Directories -define('GLM_MEMBERS_PLUGIN_NAME', 'Gaslight Media Members Database'); -define('GLM_MEMBERS_PLUGIN_DIR', dirname(__FILE__)); -define('GLM_MEMBERS_PLUGIN_DB_SCRIPTS', dirname(__FILE__).'/misc/databaseScripts'); -define('GLM_MEMBERS_PLUGIN_CLASS_DIR', GLM_MEMBERS_PLUGIN_DIR.'/classes'); -define('GLM_MEMBERS_PLUGIN_LIB_DIR', GLM_MEMBERS_PLUGIN_DIR.'/lib'); - -// Database table prefixes -global $wpdb; -define('GLM_MEMBERS_PLUGIN_DB_PREFIX', $wpdb->prefix.'glm_members_'); +// Get standard defined parameters +require_once('defines.php'); // Try to set the DB version option to false (new plugin) - If it's already set this won't do anything. add_option('glmMembersDatabaseDbVersion', false); diff --git a/uninstall.php b/uninstall.php index bdc5107b..059590bc 100644 --- a/uninstall.php +++ b/uninstall.php @@ -15,7 +15,7 @@ */ // Get setup and configuration -require_once('config.inc'); +require_once('defines.php'); //if uninstall not called from WordPress exit if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) -- 2.17.1