Moved defined parameters into separate file so uninstall can get to them.
authorChuck Scott <cscott@gaslightmedia.com>
Mon, 19 Jan 2015 18:04:31 +0000 (13:04 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 19 Jan 2015 18:04:31 +0000 (13:04 -0500)
defines.php [new file with mode: 0644]
index.php
uninstall.php

diff --git a/defines.php b/defines.php
new file mode 100644 (file)
index 0000000..a92689b
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+/*
+ *
+ * Set standard defined 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_');
+
+?>
\ No newline at end of file
index c70a5ec..1d05417 100644 (file)
--- a/index.php
+++ b/index.php
  * 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);
index bdc5107..059590b 100644 (file)
@@ -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' ) )