Completed
Branch BUG-9050-duplicate-contacts (7cd9be)
by
unknown
91:23 queued 73:01
created
core/services/database/TableManager.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
             }
147 147
         }
148 148
         global $wpdb;
149
-        $wpdb->query('DROP TABLE ' . implode(', ', $tables_to_delete));
149
+        $wpdb->query('DROP TABLE '.implode(', ', $tables_to_delete));
150 150
         return $tables_to_delete;
151 151
     }
152 152
 
Please login to merge, or discard this patch.
Indentation   +206 added lines, -206 removed lines patch added patch discarded remove patch
@@ -17,211 +17,211 @@
 block discarded – undo
17 17
 class TableManager extends \EE_Base
18 18
 {
19 19
 
20
-    /**
21
-     * @var TableAnalysis $table_analysis
22
-     */
23
-    private $table_analysis;
24
-
25
-
26
-
27
-    /**
28
-     * TableManager constructor.
29
-     *
30
-     * @param TableAnalysis $TableAnalysis
31
-     */
32
-    public function __construct(TableAnalysis $TableAnalysis)
33
-    {
34
-        $this->table_analysis = $TableAnalysis;
35
-    }
36
-
37
-
38
-
39
-    /**
40
-     * Gets the injected table analyzer, or throws an exception
41
-     *
42
-     * @return TableAnalysis
43
-     * @throws \EE_Error
44
-     */
45
-    protected function getTableAnalysis()
46
-    {
47
-        if ($this->table_analysis instanceof TableAnalysis) {
48
-            return $this->table_analysis;
49
-        } else {
50
-            throw new \EE_Error(
51
-                sprintf(
52
-                    __('Table analysis class on class %1$s is not set properly.', 'event_espresso'),
53
-                    get_class($this)
54
-                )
55
-            );
56
-        }
57
-    }
58
-
59
-
60
-
61
-    /**
62
-     * @param string $table_name which can optionally start with $wpdb->prefix or not
63
-     * @param string $column_name
64
-     * @param string $column_info
65
-     * @return bool|false|int
66
-     */
67
-    public function addColumn($table_name, $column_name, $column_info = 'INT UNSIGNED NOT NULL')
68
-    {
69
-        if (apply_filters('FHEE__EEH_Activation__add_column_if_it_doesnt_exist__short_circuit', false)) {
70
-            return false;
71
-        }
72
-        global $wpdb;
73
-        $full_table_name = $this->getTableAnalysis()->ensureTableNameHasPrefix($table_name);
74
-        $columns = $this->getTableColumns($table_name);
75
-        if ( ! in_array($column_name, $columns)) {
76
-            $alter_query = "ALTER TABLE $full_table_name ADD $column_name $column_info";
77
-            return $wpdb->query($alter_query);
78
-        }
79
-        return true;
80
-    }
81
-
82
-
83
-
84
-    /**
85
-     * Gets the name of all columns on the  table. $table_name can
86
-     * optionally start with $wpdb->prefix or not
87
-     *
88
-     * @global \wpdb $wpdb
89
-     * @param string $table_name
90
-     * @return array
91
-     */
92
-    public function getTableColumns($table_name)
93
-    {
94
-        global $wpdb;
95
-        $table_name = $this->getTableAnalysis()->ensureTableNameHasPrefix($table_name);
96
-        $fieldArray = array();
97
-        if ( ! empty($table_name)) {
98
-            $columns = $wpdb->get_results("SHOW COLUMNS FROM $table_name ");
99
-            if ($columns !== false) {
100
-                foreach ($columns as $column) {
101
-                    $fieldArray[] = $column->Field;
102
-                }
103
-            }
104
-        }
105
-        return $fieldArray;
106
-    }
107
-
108
-
109
-
110
-    /**
111
-     * Drops the specified table from the database. $table_name can
112
-     * optionally start with $wpdb->prefix or not
113
-     *
114
-     * @global \wpdb $wpdb
115
-     * @param string $table_name
116
-     * @return int
117
-     */
118
-    public function dropTable($table_name)
119
-    {
120
-        global $wpdb;
121
-        if ($this->getTableAnalysis()->tableExists($table_name)) {
122
-            $table_name = $this->getTableAnalysis()->ensureTableNameHasPrefix($table_name);
123
-            return $wpdb->query("DROP TABLE IF EXISTS $table_name");
124
-        }
125
-        return 0;
126
-    }
127
-
128
-
129
-
130
-    /**
131
-     * Drops all the tables mentioned in a single MYSQL query. Double-checks
132
-     * each table name provided has a wpdb prefix attached, and that it exists.
133
-     * Returns the list actually deleted
134
-     *
135
-     * @global WPDB $wpdb
136
-     * @param array $table_names
137
-     * @return array of table names which we deleted
138
-     */
139
-    public function dropTables($table_names)
140
-    {
141
-        $tables_to_delete = array();
142
-        foreach ($table_names as $table_name) {
143
-            $table_name = $this->getTableAnalysis()->ensureTableNameHasPrefix($table_name);
144
-            if ($this->getTableAnalysis()->tableExists($table_name)) {
145
-                $tables_to_delete[] = $table_name;
146
-            }
147
-        }
148
-        global $wpdb;
149
-        $wpdb->query('DROP TABLE ' . implode(', ', $tables_to_delete));
150
-        return $tables_to_delete;
151
-    }
152
-
153
-
154
-
155
-    /**
156
-     * Drops the specified index from the specified table. $table_name can
157
-     * optionally start with $wpdb->prefix or not
158
-     *
159
-     * @global \wpdb $wpdb
160
-     * @param string $table_name
161
-     * @param string $indexName
162
-     * @return int
163
-     */
164
-    public function dropIndex($table_name, $indexName)
165
-    {
166
-        if (apply_filters('FHEE__EEH_Activation__drop_index__short_circuit', false)) {
167
-            return false;
168
-        }
169
-        global $wpdb;
170
-        $table_name = $this->getTableAnalysis()->ensureTableNameHasPrefix($table_name);
171
-        $index_exists_query = "SHOW INDEX FROM $table_name WHERE Key_name = '$indexName'";
172
-        if (
173
-            $this->getTableAnalysis()->tableExists($table_name)
174
-            && $wpdb->get_var($index_exists_query)
175
-               === $table_name //using get_var with the $index_exists_query returns the table's name
176
-        ) {
177
-            return $wpdb->query("ALTER TABLE $table_name DROP INDEX $indexName");
178
-        }
179
-        return 0;
180
-    }
181
-
182
-
183
-
184
-    /**
185
-     * Just creates the requested table. $table_name can
186
-     * optionally start with $wpdb->prefix or not
187
-     *
188
-     * @param string $table_name
189
-     * @param string $createSql defining the table's columns and indexes
190
-     * @param string $engine    (no need to specify "ENGINE=", that's implied)
191
-     * @return void
192
-     * @throws \EE_Error
193
-     */
194
-    public function createTable($table_name, $createSql, $engine = 'MyISAM')
195
-    {
196
-        // does $sql contain valid column information? ( LPT: https://regex101.com/ is great for working out regex patterns )
197
-        if (preg_match('((((.*?))(,\s))+)', $createSql, $valid_column_data)) {
198
-            $table_name = $this->getTableAnalysis()->ensureTableNameHasPrefix($table_name);
199
-            $SQL = "CREATE TABLE $table_name ( $createSql ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;";
200
-            /** @var \wpdb $wpdb */
201
-            global $wpdb;
202
-            //get $wpdb to echo errors, but buffer them. This way at least WE know an error
203
-            //happened. And then we can choose to tell the end user
204
-            $old_show_errors_policy = $wpdb->show_errors(true);
205
-            $old_error_suppression_policy = $wpdb->suppress_errors(false);
206
-            ob_start();
207
-            dbDelta($SQL);
208
-            $output = ob_get_contents();
209
-            ob_end_clean();
210
-            $wpdb->show_errors($old_show_errors_policy);
211
-            $wpdb->suppress_errors($old_error_suppression_policy);
212
-            if ( ! empty($output)) {
213
-                throw new \EE_Error($output);
214
-            }
215
-        } else {
216
-            throw new \EE_Error(
217
-                sprintf(
218
-                    __('The following table creation SQL does not contain valid information about the table columns: %1$s %2$s',
219
-                        'event_espresso'),
220
-                    '<br />',
221
-                    $createSql
222
-                )
223
-            );
224
-        }
225
-    }
20
+	/**
21
+	 * @var TableAnalysis $table_analysis
22
+	 */
23
+	private $table_analysis;
24
+
25
+
26
+
27
+	/**
28
+	 * TableManager constructor.
29
+	 *
30
+	 * @param TableAnalysis $TableAnalysis
31
+	 */
32
+	public function __construct(TableAnalysis $TableAnalysis)
33
+	{
34
+		$this->table_analysis = $TableAnalysis;
35
+	}
36
+
37
+
38
+
39
+	/**
40
+	 * Gets the injected table analyzer, or throws an exception
41
+	 *
42
+	 * @return TableAnalysis
43
+	 * @throws \EE_Error
44
+	 */
45
+	protected function getTableAnalysis()
46
+	{
47
+		if ($this->table_analysis instanceof TableAnalysis) {
48
+			return $this->table_analysis;
49
+		} else {
50
+			throw new \EE_Error(
51
+				sprintf(
52
+					__('Table analysis class on class %1$s is not set properly.', 'event_espresso'),
53
+					get_class($this)
54
+				)
55
+			);
56
+		}
57
+	}
58
+
59
+
60
+
61
+	/**
62
+	 * @param string $table_name which can optionally start with $wpdb->prefix or not
63
+	 * @param string $column_name
64
+	 * @param string $column_info
65
+	 * @return bool|false|int
66
+	 */
67
+	public function addColumn($table_name, $column_name, $column_info = 'INT UNSIGNED NOT NULL')
68
+	{
69
+		if (apply_filters('FHEE__EEH_Activation__add_column_if_it_doesnt_exist__short_circuit', false)) {
70
+			return false;
71
+		}
72
+		global $wpdb;
73
+		$full_table_name = $this->getTableAnalysis()->ensureTableNameHasPrefix($table_name);
74
+		$columns = $this->getTableColumns($table_name);
75
+		if ( ! in_array($column_name, $columns)) {
76
+			$alter_query = "ALTER TABLE $full_table_name ADD $column_name $column_info";
77
+			return $wpdb->query($alter_query);
78
+		}
79
+		return true;
80
+	}
81
+
82
+
83
+
84
+	/**
85
+	 * Gets the name of all columns on the  table. $table_name can
86
+	 * optionally start with $wpdb->prefix or not
87
+	 *
88
+	 * @global \wpdb $wpdb
89
+	 * @param string $table_name
90
+	 * @return array
91
+	 */
92
+	public function getTableColumns($table_name)
93
+	{
94
+		global $wpdb;
95
+		$table_name = $this->getTableAnalysis()->ensureTableNameHasPrefix($table_name);
96
+		$fieldArray = array();
97
+		if ( ! empty($table_name)) {
98
+			$columns = $wpdb->get_results("SHOW COLUMNS FROM $table_name ");
99
+			if ($columns !== false) {
100
+				foreach ($columns as $column) {
101
+					$fieldArray[] = $column->Field;
102
+				}
103
+			}
104
+		}
105
+		return $fieldArray;
106
+	}
107
+
108
+
109
+
110
+	/**
111
+	 * Drops the specified table from the database. $table_name can
112
+	 * optionally start with $wpdb->prefix or not
113
+	 *
114
+	 * @global \wpdb $wpdb
115
+	 * @param string $table_name
116
+	 * @return int
117
+	 */
118
+	public function dropTable($table_name)
119
+	{
120
+		global $wpdb;
121
+		if ($this->getTableAnalysis()->tableExists($table_name)) {
122
+			$table_name = $this->getTableAnalysis()->ensureTableNameHasPrefix($table_name);
123
+			return $wpdb->query("DROP TABLE IF EXISTS $table_name");
124
+		}
125
+		return 0;
126
+	}
127
+
128
+
129
+
130
+	/**
131
+	 * Drops all the tables mentioned in a single MYSQL query. Double-checks
132
+	 * each table name provided has a wpdb prefix attached, and that it exists.
133
+	 * Returns the list actually deleted
134
+	 *
135
+	 * @global WPDB $wpdb
136
+	 * @param array $table_names
137
+	 * @return array of table names which we deleted
138
+	 */
139
+	public function dropTables($table_names)
140
+	{
141
+		$tables_to_delete = array();
142
+		foreach ($table_names as $table_name) {
143
+			$table_name = $this->getTableAnalysis()->ensureTableNameHasPrefix($table_name);
144
+			if ($this->getTableAnalysis()->tableExists($table_name)) {
145
+				$tables_to_delete[] = $table_name;
146
+			}
147
+		}
148
+		global $wpdb;
149
+		$wpdb->query('DROP TABLE ' . implode(', ', $tables_to_delete));
150
+		return $tables_to_delete;
151
+	}
152
+
153
+
154
+
155
+	/**
156
+	 * Drops the specified index from the specified table. $table_name can
157
+	 * optionally start with $wpdb->prefix or not
158
+	 *
159
+	 * @global \wpdb $wpdb
160
+	 * @param string $table_name
161
+	 * @param string $indexName
162
+	 * @return int
163
+	 */
164
+	public function dropIndex($table_name, $indexName)
165
+	{
166
+		if (apply_filters('FHEE__EEH_Activation__drop_index__short_circuit', false)) {
167
+			return false;
168
+		}
169
+		global $wpdb;
170
+		$table_name = $this->getTableAnalysis()->ensureTableNameHasPrefix($table_name);
171
+		$index_exists_query = "SHOW INDEX FROM $table_name WHERE Key_name = '$indexName'";
172
+		if (
173
+			$this->getTableAnalysis()->tableExists($table_name)
174
+			&& $wpdb->get_var($index_exists_query)
175
+			   === $table_name //using get_var with the $index_exists_query returns the table's name
176
+		) {
177
+			return $wpdb->query("ALTER TABLE $table_name DROP INDEX $indexName");
178
+		}
179
+		return 0;
180
+	}
181
+
182
+
183
+
184
+	/**
185
+	 * Just creates the requested table. $table_name can
186
+	 * optionally start with $wpdb->prefix or not
187
+	 *
188
+	 * @param string $table_name
189
+	 * @param string $createSql defining the table's columns and indexes
190
+	 * @param string $engine    (no need to specify "ENGINE=", that's implied)
191
+	 * @return void
192
+	 * @throws \EE_Error
193
+	 */
194
+	public function createTable($table_name, $createSql, $engine = 'MyISAM')
195
+	{
196
+		// does $sql contain valid column information? ( LPT: https://regex101.com/ is great for working out regex patterns )
197
+		if (preg_match('((((.*?))(,\s))+)', $createSql, $valid_column_data)) {
198
+			$table_name = $this->getTableAnalysis()->ensureTableNameHasPrefix($table_name);
199
+			$SQL = "CREATE TABLE $table_name ( $createSql ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;";
200
+			/** @var \wpdb $wpdb */
201
+			global $wpdb;
202
+			//get $wpdb to echo errors, but buffer them. This way at least WE know an error
203
+			//happened. And then we can choose to tell the end user
204
+			$old_show_errors_policy = $wpdb->show_errors(true);
205
+			$old_error_suppression_policy = $wpdb->suppress_errors(false);
206
+			ob_start();
207
+			dbDelta($SQL);
208
+			$output = ob_get_contents();
209
+			ob_end_clean();
210
+			$wpdb->show_errors($old_show_errors_policy);
211
+			$wpdb->suppress_errors($old_error_suppression_policy);
212
+			if ( ! empty($output)) {
213
+				throw new \EE_Error($output);
214
+			}
215
+		} else {
216
+			throw new \EE_Error(
217
+				sprintf(
218
+					__('The following table creation SQL does not contain valid information about the table columns: %1$s %2$s',
219
+						'event_espresso'),
220
+					'<br />',
221
+					$createSql
222
+				)
223
+			);
224
+		}
225
+	}
226 226
 
227 227
 }
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_9_0.dms.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 //unfortunately, this needs to be done upon INCLUSION of this file,
10 10
 //instead of construction, because it only gets constructed on first page load
11 11
 //(all other times it gets resurrected from a wordpress option)
12
-$stages = glob(EE_CORE . 'data_migration_scripts/4_9_0_stages/*');
12
+$stages = glob(EE_CORE.'data_migration_scripts/4_9_0_stages/*');
13 13
 $class_to_filepath = array();
14 14
 foreach ($stages as $filepath) {
15 15
     $matches = array();
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         } elseif ( ! $version_string) {
68 68
 //			echo "no version string provided: $version_string";
69 69
             //no version string provided... this must be pre 4.3
70
-            return false;//changed mind. dont want people thinking they should migrate yet because they cant
70
+            return false; //changed mind. dont want people thinking they should migrate yet because they cant
71 71
         } else {
72 72
 //			echo "$version_string doesnt apply";
73 73
             return false;
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function schema_changes_before_migration()
93 93
     {
94
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
94
+        require_once(EE_HELPERS.'EEH_Activation.helper.php');
95 95
         $now_in_mysql = current_time('mysql', true);
96 96
         $table_name = 'esp_answer';
97 97
         $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
Please login to merge, or discard this patch.
Indentation   +190 added lines, -190 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 $stages = glob(EE_CORE . 'data_migration_scripts/4_9_0_stages/*');
13 13
 $class_to_filepath = array();
14 14
 foreach ($stages as $filepath) {
15
-    $matches = array();
16
-    preg_match('~4_9_0_stages/(.*).dmsstage.php~', $filepath, $matches);
17
-    $class_to_filepath[$matches[1]] = $filepath;
15
+	$matches = array();
16
+	preg_match('~4_9_0_stages/(.*).dmsstage.php~', $filepath, $matches);
17
+	$class_to_filepath[$matches[1]] = $filepath;
18 18
 }
19 19
 //give addons a chance to autoload their stages too
20 20
 $class_to_filepath = apply_filters('FHEE__EE_DMS_4_9_0__autoloaded_stages', $class_to_filepath);
@@ -33,77 +33,77 @@  discard block
 block discarded – undo
33 33
 class EE_DMS_Core_4_9_0 extends EE_Data_Migration_Script_Base
34 34
 {
35 35
 
36
-    /**
37
-     * return EE_DMS_Core_4_9_0
38
-     *
39
-     * @param TableManager  $table_manager
40
-     * @param TableAnalysis $table_analysis
41
-     */
42
-    public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null)
43
-    {
44
-        $this->_pretty_name = __("Data Migration to Event Espresso 4.9.0.P", "event_espresso");
45
-        $this->_priority = 10;
46
-        $this->_migration_stages = array(
47
-            new EE_DMS_4_9_0_Email_System_Question(),
48
-            new EE_DMS_4_9_0_Answers_With_No_Registration(),
49
-        );
50
-        parent::__construct($table_manager, $table_analysis);
51
-    }
36
+	/**
37
+	 * return EE_DMS_Core_4_9_0
38
+	 *
39
+	 * @param TableManager  $table_manager
40
+	 * @param TableAnalysis $table_analysis
41
+	 */
42
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null)
43
+	{
44
+		$this->_pretty_name = __("Data Migration to Event Espresso 4.9.0.P", "event_espresso");
45
+		$this->_priority = 10;
46
+		$this->_migration_stages = array(
47
+			new EE_DMS_4_9_0_Email_System_Question(),
48
+			new EE_DMS_4_9_0_Answers_With_No_Registration(),
49
+		);
50
+		parent::__construct($table_manager, $table_analysis);
51
+	}
52 52
 
53 53
 
54 54
 
55
-    /**
56
-     * Whether to migrate or not.
57
-     *
58
-     * @param array $version_array
59
-     * @return bool
60
-     */
61
-    public function can_migrate_from_version($version_array)
62
-    {
63
-        $version_string = $version_array['Core'];
64
-        if (version_compare($version_string, '4.9.0', '<=') && version_compare($version_string, '4.8.0', '>=')) {
55
+	/**
56
+	 * Whether to migrate or not.
57
+	 *
58
+	 * @param array $version_array
59
+	 * @return bool
60
+	 */
61
+	public function can_migrate_from_version($version_array)
62
+	{
63
+		$version_string = $version_array['Core'];
64
+		if (version_compare($version_string, '4.9.0', '<=') && version_compare($version_string, '4.8.0', '>=')) {
65 65
 //			echo "$version_string can be migrated from";
66
-            return true;
67
-        } elseif ( ! $version_string) {
66
+			return true;
67
+		} elseif ( ! $version_string) {
68 68
 //			echo "no version string provided: $version_string";
69
-            //no version string provided... this must be pre 4.3
70
-            return false;//changed mind. dont want people thinking they should migrate yet because they cant
71
-        } else {
69
+			//no version string provided... this must be pre 4.3
70
+			return false;//changed mind. dont want people thinking they should migrate yet because they cant
71
+		} else {
72 72
 //			echo "$version_string doesnt apply";
73
-            return false;
74
-        }
75
-    }
73
+			return false;
74
+		}
75
+	}
76 76
 
77 77
 
78 78
 
79
-    /**
80
-     * @return string|void
81
-     */
82
-    public function pretty_name()
83
-    {
84
-        return __("Core Data Migration to version 4.9.0", "event_espresso");
85
-    }
79
+	/**
80
+	 * @return string|void
81
+	 */
82
+	public function pretty_name()
83
+	{
84
+		return __("Core Data Migration to version 4.9.0", "event_espresso");
85
+	}
86 86
 
87 87
 
88 88
 
89
-    /**
90
-     * @return bool
91
-     */
92
-    public function schema_changes_before_migration()
93
-    {
94
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
95
-        $now_in_mysql = current_time('mysql', true);
96
-        $table_name = 'esp_answer';
97
-        $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
89
+	/**
90
+	 * @return bool
91
+	 */
92
+	public function schema_changes_before_migration()
93
+	{
94
+		require_once(EE_HELPERS . 'EEH_Activation.helper.php');
95
+		$now_in_mysql = current_time('mysql', true);
96
+		$table_name = 'esp_answer';
97
+		$sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
98 98
 					REG_ID int(10) unsigned NOT NULL,
99 99
 					QST_ID int(10) unsigned NOT NULL,
100 100
 					ANS_value text NOT NULL,
101 101
 					PRIMARY KEY  (ANS_ID),
102 102
 					KEY REG_ID (REG_ID),
103 103
 					KEY QST_ID (QST_ID)";
104
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
105
-        $table_name = 'esp_attendee_meta';
106
-        $sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
104
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
105
+		$table_name = 'esp_attendee_meta';
106
+		$sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
107 107
 				ATT_ID bigint(20) unsigned NOT NULL,
108 108
 				ATT_fname varchar(45) NOT NULL,
109 109
 				ATT_lname varchar(45) NOT	NULL,
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
 				KEY ATT_email (ATT_email),
121 121
 				KEY ATT_lname (ATT_lname),
122 122
 				KEY ATT_fname (ATT_fname)";
123
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
124
-        $table_name = 'esp_checkin';
125
-        $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
123
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
124
+		$table_name = 'esp_checkin';
125
+		$sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
126 126
 				REG_ID int(10) unsigned NOT NULL,
127 127
 				DTT_ID int(10) unsigned NOT NULL,
128 128
 				CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1,
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
 				PRIMARY KEY  (CHK_ID),
131 131
 				KEY REG_ID (REG_ID),
132 132
 				KEY DTT_ID (DTT_ID)";
133
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
134
-        $table_name = 'esp_country';
135
-        $sql = "CNT_ISO varchar(2) collate utf8_bin NOT NULL,
133
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
134
+		$table_name = 'esp_country';
135
+		$sql = "CNT_ISO varchar(2) collate utf8_bin NOT NULL,
136 136
 				CNT_ISO3 varchar(3) collate utf8_bin NOT NULL,
137 137
 				RGN_ID tinyint(3) unsigned DEFAULT NULL,
138 138
 				CNT_name varchar(45) collate utf8_bin NOT NULL,
@@ -148,25 +148,25 @@  discard block
 block discarded – undo
148 148
 				CNT_is_EU tinyint(1) DEFAULT '0',
149 149
 				CNT_active tinyint(1) DEFAULT '0',
150 150
 				PRIMARY KEY  (CNT_ISO)";
151
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
152
-        $table_name = 'esp_currency';
153
-        $sql = "CUR_code varchar(6) collate utf8_bin NOT NULL,
151
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
152
+		$table_name = 'esp_currency';
153
+		$sql = "CUR_code varchar(6) collate utf8_bin NOT NULL,
154 154
 				CUR_single varchar(45) collate utf8_bin DEFAULT 'dollar',
155 155
 				CUR_plural varchar(45) collate utf8_bin DEFAULT 'dollars',
156 156
 				CUR_sign varchar(45) collate utf8_bin DEFAULT '$',
157 157
 				CUR_dec_plc varchar(1) collate utf8_bin NOT NULL DEFAULT '2',
158 158
 				CUR_active tinyint(1) DEFAULT '0',
159 159
 				PRIMARY KEY  (CUR_code)";
160
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
161
-        $table_name = 'esp_currency_payment_method';
162
-        $sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT,
160
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
161
+		$table_name = 'esp_currency_payment_method';
162
+		$sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT,
163 163
 				CUR_code varchar(6) collate utf8_bin NOT NULL,
164 164
 				PMD_ID int(11) NOT NULL,
165 165
 				PRIMARY KEY  (CPM_ID),
166 166
 				KEY PMD_ID (PMD_ID)";
167
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
168
-        $table_name = 'esp_datetime';
169
-        $sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
167
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
168
+		$table_name = 'esp_datetime';
169
+		$sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
170 170
 				EVT_ID bigint(20) unsigned NOT NULL,
171 171
 				DTT_name varchar(255) NOT NULL DEFAULT '',
172 172
 				DTT_description text NOT NULL,
@@ -182,25 +182,25 @@  discard block
 block discarded – undo
182 182
 				KEY DTT_EVT_start (DTT_EVT_start),
183 183
 				KEY EVT_ID (EVT_ID),
184 184
 				KEY DTT_is_primary (DTT_is_primary)";
185
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
186
-        $table_name = "esp_datetime_ticket";
187
-        $sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
185
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
186
+		$table_name = "esp_datetime_ticket";
187
+		$sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
188 188
 				DTT_ID int(10) unsigned NOT NULL,
189 189
 				TKT_ID int(10) unsigned NOT NULL,
190 190
 				PRIMARY KEY  (DTK_ID),
191 191
 				KEY DTT_ID (DTT_ID),
192 192
 				KEY TKT_ID (TKT_ID)";
193
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
194
-        $table_name = 'esp_event_message_template';
195
-        $sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
193
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
194
+		$table_name = 'esp_event_message_template';
195
+		$sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
196 196
 				EVT_ID bigint(20) unsigned NOT NULL DEFAULT 0,
197 197
 				GRP_ID int(10) unsigned NOT NULL DEFAULT 0,
198 198
 				PRIMARY KEY  (EMT_ID),
199 199
 				KEY EVT_ID (EVT_ID),
200 200
 				KEY GRP_ID (GRP_ID)";
201
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
202
-        $table_name = 'esp_event_meta';
203
-        $sql = "EVTM_ID int(10) NOT NULL AUTO_INCREMENT,
201
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
202
+		$table_name = 'esp_event_meta';
203
+		$sql = "EVTM_ID int(10) NOT NULL AUTO_INCREMENT,
204 204
 				EVT_ID bigint(20) unsigned NOT NULL,
205 205
 				EVT_display_desc tinyint(1) unsigned NOT NULL DEFAULT 1,
206 206
 				EVT_display_ticket_selector tinyint(1) unsigned NOT NULL DEFAULT 1,
@@ -215,34 +215,34 @@  discard block
 block discarded – undo
215 215
 				EVT_donations tinyint(1) NULL,
216 216
 				PRIMARY KEY  (EVTM_ID),
217 217
 				KEY EVT_ID (EVT_ID)";
218
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
219
-        $table_name = 'esp_event_question_group';
220
-        $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
218
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
219
+		$table_name = 'esp_event_question_group';
220
+		$sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
221 221
 				EVT_ID bigint(20) unsigned NOT NULL,
222 222
 				QSG_ID int(10) unsigned NOT NULL,
223 223
 				EQG_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
224 224
 				PRIMARY KEY  (EQG_ID),
225 225
 				KEY EVT_ID (EVT_ID),
226 226
 				KEY QSG_ID (QSG_ID)";
227
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
228
-        $table_name = 'esp_event_venue';
229
-        $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
227
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
228
+		$table_name = 'esp_event_venue';
229
+		$sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
230 230
 				EVT_ID bigint(20) unsigned NOT NULL,
231 231
 				VNU_ID bigint(20) unsigned NOT NULL,
232 232
 				EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
233 233
 				PRIMARY KEY  (EVV_ID)";
234
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
235
-        $table_name = 'esp_extra_meta';
236
-        $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
234
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
235
+		$table_name = 'esp_extra_meta';
236
+		$sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
237 237
 				OBJ_ID int(11) DEFAULT NULL,
238 238
 				EXM_type varchar(45) DEFAULT NULL,
239 239
 				EXM_key varchar(45) DEFAULT NULL,
240 240
 				EXM_value text,
241 241
 				PRIMARY KEY  (EXM_ID),
242 242
 				KEY EXM_type (EXM_type,OBJ_ID,EXM_key)";
243
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
244
-        $table_name = 'esp_extra_join';
245
-        $sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT,
243
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
244
+		$table_name = 'esp_extra_join';
245
+		$sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT,
246 246
 				EXJ_first_model_id varchar(6) NOT NULL,
247 247
 				EXJ_first_model_name varchar(20) NOT NULL,
248 248
 				EXJ_second_model_id varchar(6) NOT NULL,
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
 				PRIMARY KEY  (EXJ_ID),
251 251
 				KEY first_model (EXJ_first_model_name,EXJ_first_model_id),
252 252
 				KEY second_model (EXJ_second_model_name,EXJ_second_model_id)";
253
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
254
-        $table_name = 'esp_line_item';
255
-        $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
253
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
254
+		$table_name = 'esp_line_item';
255
+		$sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
256 256
 				LIN_code varchar(245) NOT NULL DEFAULT '',
257 257
 				TXN_ID int(11) DEFAULT NULL,
258 258
 				LIN_name varchar(245) NOT NULL DEFAULT '',
@@ -271,9 +271,9 @@  discard block
 block discarded – undo
271 271
 				PRIMARY KEY  (LIN_ID),
272 272
 				KEY LIN_code (LIN_code(191)),
273 273
 				KEY TXN_ID (TXN_ID)";
274
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
275
-        $table_name = 'esp_log';
276
-        $sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT,
274
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
275
+		$table_name = 'esp_log';
276
+		$sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT,
277 277
 				LOG_time datetime DEFAULT NULL,
278 278
 				OBJ_ID varchar(45) DEFAULT NULL,
279 279
 				OBJ_type varchar(45) DEFAULT NULL,
@@ -284,9 +284,9 @@  discard block
 block discarded – undo
284 284
 				KEY LOG_time (LOG_time),
285 285
 				KEY OBJ (OBJ_type,OBJ_ID),
286 286
 				KEY LOG_type (LOG_type)";
287
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
288
-        $table_name = 'esp_message';
289
-        $sql = "MSG_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
287
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
288
+		$table_name = 'esp_message';
289
+		$sql = "MSG_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
290 290
 				GRP_ID int(10) unsigned NULL,
291 291
 				MSG_token varchar(255) NULL,
292 292
 				TXN_ID int(10) unsigned NULL,
@@ -318,18 +318,18 @@  discard block
 block discarded – undo
318 318
 				KEY STS_ID (STS_ID),
319 319
 				KEY MSG_created (MSG_created),
320 320
 				KEY MSG_modified (MSG_modified)";
321
-        $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
322
-        $table_name = 'esp_message_template';
323
-        $sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
321
+		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
322
+		$table_name = 'esp_message_template';
323
+		$sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
324 324
 				GRP_ID int(10) unsigned NOT NULL,
325 325
 				MTP_context varchar(50) NOT NULL,
326 326
 				MTP_template_field varchar(30) NOT NULL,
327 327
 				MTP_content text NOT NULL,
328 328
 				PRIMARY KEY  (MTP_ID),
329 329
 				KEY GRP_ID (GRP_ID)";
330
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
331
-        $table_name = 'esp_message_template_group';
332
-        $sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
330
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
331
+		$table_name = 'esp_message_template_group';
332
+		$sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
333 333
 				MTP_user_id int(10) NOT NULL DEFAULT '1',
334 334
 				MTP_name varchar(245) NOT NULL DEFAULT '',
335 335
 				MTP_description varchar(245) NOT NULL DEFAULT '',
@@ -341,9 +341,9 @@  discard block
 block discarded – undo
341 341
 				MTP_is_active tinyint(1) NOT NULL DEFAULT '1',
342 342
 				PRIMARY KEY  (GRP_ID),
343 343
 				KEY MTP_user_id (MTP_user_id)";
344
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
345
-        $table_name = 'esp_payment';
346
-        $sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
344
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
345
+		$table_name = 'esp_payment';
346
+		$sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
347 347
 				TXN_ID int(10) unsigned DEFAULT NULL,
348 348
 				STS_ID varchar(3) collate utf8_bin DEFAULT NULL,
349 349
 				PAY_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -360,9 +360,9 @@  discard block
 block discarded – undo
360 360
 				PRIMARY KEY  (PAY_ID),
361 361
 				KEY PAY_timestamp (PAY_timestamp),
362 362
 				KEY TXN_ID (TXN_ID)";
363
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
364
-        $table_name = 'esp_payment_method';
365
-        $sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT,
363
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
364
+		$table_name = 'esp_payment_method';
365
+		$sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT,
366 366
 				PMD_type varchar(124) DEFAULT NULL,
367 367
 				PMD_name varchar(255) DEFAULT NULL,
368 368
 				PMD_desc text,
@@ -378,24 +378,24 @@  discard block
 block discarded – undo
378 378
 				PRIMARY KEY  (PMD_ID),
379 379
 				UNIQUE KEY PMD_slug_UNIQUE (PMD_slug),
380 380
 				KEY PMD_type (PMD_type)";
381
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
382
-        $table_name = "esp_ticket_price";
383
-        $sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
381
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
382
+		$table_name = "esp_ticket_price";
383
+		$sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
384 384
 				TKT_ID int(10) unsigned NOT NULL,
385 385
 				PRC_ID int(10) unsigned NOT NULL,
386 386
 				PRIMARY KEY  (TKP_ID),
387 387
 				KEY TKT_ID (TKT_ID),
388 388
 				KEY PRC_ID (PRC_ID)";
389
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
390
-        $table_name = "esp_ticket_template";
391
-        $sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
389
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
390
+		$table_name = "esp_ticket_template";
391
+		$sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
392 392
 				TTM_name varchar(45) NOT NULL,
393 393
 				TTM_description text,
394 394
 				TTM_file varchar(45),
395 395
 				PRIMARY KEY  (TTM_ID)";
396
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
397
-        $table_name = 'esp_question';
398
-        $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
396
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
397
+		$table_name = 'esp_question';
398
+		$sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
399 399
 				QST_display_text text NOT NULL,
400 400
 				QST_admin_label varchar(255) NOT NULL,
401 401
 				QST_system varchar(25) DEFAULT NULL,
@@ -409,18 +409,18 @@  discard block
 block discarded – undo
409 409
 				QST_deleted tinyint(2) unsigned NOT NULL DEFAULT 0,
410 410
 				PRIMARY KEY  (QST_ID),
411 411
 				KEY QST_order (QST_order)';
412
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
413
-        $table_name = 'esp_question_group_question';
414
-        $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
412
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
413
+		$table_name = 'esp_question_group_question';
414
+		$sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
415 415
 				QSG_ID int(10) unsigned NOT NULL,
416 416
 				QST_ID int(10) unsigned NOT NULL,
417 417
 				QGQ_order int(10) unsigned NOT NULL DEFAULT 0,
418 418
 				PRIMARY KEY  (QGQ_ID),
419 419
 				KEY QST_ID (QST_ID),
420 420
 				KEY QSG_ID_order (QSG_ID,QGQ_order)";
421
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
422
-        $table_name = 'esp_question_option';
423
-        $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
421
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
422
+		$table_name = 'esp_question_option';
423
+		$sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
424 424
 				QSO_value varchar(255) NOT NULL,
425 425
 				QSO_desc text NOT NULL,
426 426
 				QST_ID int(10) unsigned NOT NULL,
@@ -430,9 +430,9 @@  discard block
 block discarded – undo
430 430
 				PRIMARY KEY  (QSO_ID),
431 431
 				KEY QST_ID (QST_ID),
432 432
 				KEY QSO_order (QSO_order)";
433
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
434
-        $table_name = 'esp_registration';
435
-        $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
433
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
434
+		$table_name = 'esp_registration';
435
+		$sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
436 436
 				EVT_ID bigint(20) unsigned NOT NULL,
437 437
 				ATT_ID bigint(20) unsigned NOT NULL,
438 438
 				TXN_ID int(10) unsigned NOT NULL,
@@ -456,18 +456,18 @@  discard block
 block discarded – undo
456 456
 				KEY TKT_ID (TKT_ID),
457 457
 				KEY EVT_ID (EVT_ID),
458 458
 				KEY STS_ID (STS_ID)";
459
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
460
-        $table_name = 'esp_registration_payment';
461
-        $sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
459
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
460
+		$table_name = 'esp_registration_payment';
461
+		$sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
462 462
 					  REG_ID int(10) unsigned NOT NULL,
463 463
 					  PAY_ID int(10) unsigned NULL,
464 464
 					  RPY_amount decimal(10,3) NOT NULL DEFAULT '0.00',
465 465
 					  PRIMARY KEY  (RPY_ID),
466 466
 					  KEY REG_ID (REG_ID),
467 467
 					  KEY PAY_ID (PAY_ID)";
468
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
469
-        $table_name = 'esp_state';
470
-        $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
468
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
469
+		$table_name = 'esp_state';
470
+		$sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
471 471
 				CNT_ISO varchar(2) collate utf8_bin NOT NULL,
472 472
 				STA_abbrev varchar(24) collate utf8_bin NOT NULL,
473 473
 				STA_name varchar(100) collate utf8_bin NOT NULL,
@@ -475,9 +475,9 @@  discard block
 block discarded – undo
475 475
 				PRIMARY KEY  (STA_ID),
476 476
 				KEY STA_abbrev (STA_abbrev),
477 477
 				KEY CNT_ISO (CNT_ISO)";
478
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
479
-        $table_name = 'esp_status';
480
-        $sql = "STS_ID varchar(3) NOT NULL,
478
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
479
+		$table_name = 'esp_status';
480
+		$sql = "STS_ID varchar(3) NOT NULL,
481 481
 				STS_code varchar(45) NOT NULL,
482 482
 				STS_type varchar(45) NOT NULL,
483 483
 				STS_can_edit tinyint(1) NOT NULL DEFAULT 0,
@@ -485,9 +485,9 @@  discard block
 block discarded – undo
485 485
 				STS_open tinyint(1) NOT NULL DEFAULT 1,
486 486
 				UNIQUE KEY STS_ID_UNIQUE (STS_ID),
487 487
 				KEY STS_type (STS_type)";
488
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
489
-        $table_name = 'esp_transaction';
490
-        $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
488
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
489
+		$table_name = 'esp_transaction';
490
+		$sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
491 491
 				TXN_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
492 492
 				TXN_total decimal(10,3) DEFAULT '0.00',
493 493
 				TXN_paid decimal(10,3) NOT NULL DEFAULT '0.00',
@@ -499,9 +499,9 @@  discard block
 block discarded – undo
499 499
 				PRIMARY KEY  (TXN_ID),
500 500
 				KEY TXN_timestamp (TXN_timestamp),
501 501
 				KEY STS_ID (STS_ID)";
502
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
503
-        $table_name = 'esp_venue_meta';
504
-        $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
502
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
503
+		$table_name = 'esp_venue_meta';
504
+		$sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
505 505
 			VNU_ID bigint(20) unsigned NOT NULL DEFAULT 0,
506 506
 			VNU_address varchar(255) DEFAULT NULL,
507 507
 			VNU_address2 varchar(255) DEFAULT NULL,
@@ -520,10 +520,10 @@  discard block
 block discarded – undo
520 520
 			KEY VNU_ID (VNU_ID),
521 521
 			KEY STA_ID (STA_ID),
522 522
 			KEY CNT_ISO (CNT_ISO)";
523
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
524
-        //modified tables
525
-        $table_name = "esp_price";
526
-        $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
523
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
524
+		//modified tables
525
+		$table_name = "esp_price";
526
+		$sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
527 527
 				PRT_ID tinyint(3) unsigned NOT NULL,
528 528
 				PRC_amount decimal(10,3) NOT NULL DEFAULT '0.00',
529 529
 				PRC_name varchar(245) NOT NULL,
@@ -536,9 +536,9 @@  discard block
 block discarded – undo
536 536
 				PRC_parent int(10) unsigned DEFAULT 0,
537 537
 				PRIMARY KEY  (PRC_ID),
538 538
 				KEY PRT_ID (PRT_ID)";
539
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
540
-        $table_name = "esp_price_type";
541
-        $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
539
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
540
+		$table_name = "esp_price_type";
541
+		$sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
542 542
 				PRT_name varchar(45) NOT NULL,
543 543
 				PBT_ID tinyint(3) unsigned NOT NULL DEFAULT '1',
544 544
 				PRT_is_percent tinyint(1) NOT NULL DEFAULT '0',
@@ -547,9 +547,9 @@  discard block
 block discarded – undo
547 547
 				PRT_deleted tinyint(1) NOT NULL DEFAULT '0',
548 548
 				UNIQUE KEY PRT_name_UNIQUE (PRT_name),
549 549
 				PRIMARY KEY  (PRT_ID)";
550
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
551
-        $table_name = "esp_ticket";
552
-        $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
550
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
551
+		$table_name = "esp_ticket";
552
+		$sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
553 553
 				TTM_ID int(10) unsigned NOT NULL,
554 554
 				TKT_name varchar(245) NOT NULL DEFAULT '',
555 555
 				TKT_description text NOT NULL,
@@ -571,9 +571,9 @@  discard block
 block discarded – undo
571 571
 				TKT_deleted tinyint(1) NOT NULL DEFAULT '0',
572 572
 				PRIMARY KEY  (TKT_ID),
573 573
 				KEY TKT_start_date (TKT_start_date)";
574
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
575
-        $table_name = 'esp_question_group';
576
-        $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
574
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
575
+		$table_name = 'esp_question_group';
576
+		$sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
577 577
 				QSG_name varchar(255) NOT NULL,
578 578
 				QSG_identifier varchar(100) NOT NULL,
579 579
 				QSG_desc text NULL,
@@ -586,41 +586,41 @@  discard block
 block discarded – undo
586 586
 				PRIMARY KEY  (QSG_ID),
587 587
 				UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier),
588 588
 				KEY QSG_order (QSG_order)';
589
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
590
-        /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */
591
-        $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
592
-        //(because many need to convert old string states to foreign keys into the states table)
593
-        $script_4_1_defaults->insert_default_states();
594
-        $script_4_1_defaults->insert_default_countries();
595
-        /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */
596
-        $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0');
597
-        $script_4_5_defaults->insert_default_price_types();
598
-        $script_4_5_defaults->insert_default_prices();
599
-        $script_4_5_defaults->insert_default_tickets();
600
-        /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */
601
-        $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0');
602
-        $script_4_6_defaults->add_default_admin_only_payments();
603
-        $script_4_6_defaults->insert_default_currencies();
604
-        /** @var EE_DMS_Core_4_8_0 $script_4_8_defaults */
605
-        $script_4_8_defaults = EE_Registry::instance()->load_dms('Core_4_8_0');
606
-        $script_4_8_defaults->verify_new_countries();
607
-        $script_4_8_defaults->verify_new_currencies();
608
-        return true;
609
-    }
589
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
590
+		/** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */
591
+		$script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
592
+		//(because many need to convert old string states to foreign keys into the states table)
593
+		$script_4_1_defaults->insert_default_states();
594
+		$script_4_1_defaults->insert_default_countries();
595
+		/** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */
596
+		$script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0');
597
+		$script_4_5_defaults->insert_default_price_types();
598
+		$script_4_5_defaults->insert_default_prices();
599
+		$script_4_5_defaults->insert_default_tickets();
600
+		/** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */
601
+		$script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0');
602
+		$script_4_6_defaults->add_default_admin_only_payments();
603
+		$script_4_6_defaults->insert_default_currencies();
604
+		/** @var EE_DMS_Core_4_8_0 $script_4_8_defaults */
605
+		$script_4_8_defaults = EE_Registry::instance()->load_dms('Core_4_8_0');
606
+		$script_4_8_defaults->verify_new_countries();
607
+		$script_4_8_defaults->verify_new_currencies();
608
+		return true;
609
+	}
610 610
 
611 611
 
612 612
 
613
-    /**
614
-     * @return boolean
615
-     */
616
-    public function schema_changes_after_migration()
617
-    {
618
-        return true;
619
-    }
613
+	/**
614
+	 * @return boolean
615
+	 */
616
+	public function schema_changes_after_migration()
617
+	{
618
+		return true;
619
+	}
620 620
 
621 621
 
622 622
 
623
-    public function migration_page_hooks()
624
-    {
625
-    }
623
+	public function migration_page_hooks()
624
+	{
625
+	}
626 626
 }
627 627
\ No newline at end of file
Please login to merge, or discard this patch.
espresso.php 1 patch
Spacing   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined( 'ABSPATH' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('ABSPATH')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /*
5 5
   Plugin Name:		Event Espresso
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
  * @link             {@link http://www.eventespresso.com}
40 40
  * @since            4.0
41 41
  */
42
-if ( function_exists( 'espresso_version' ) ) {
42
+if (function_exists('espresso_version')) {
43 43
 
44 44
 	/**
45 45
 	 *    espresso_duplicate_plugin_error
@@ -56,15 +56,15 @@  discard block
 block discarded – undo
56 56
 			</p>
57 57
 		</div>
58 58
 		<?php
59
-		espresso_deactivate_plugin( plugin_basename( __FILE__ ) );
59
+		espresso_deactivate_plugin(plugin_basename(__FILE__));
60 60
 	}
61
-	add_action( 'admin_notices', 'espresso_duplicate_plugin_error', 1 );
61
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
62 62
 
63 63
 } else {
64 64
 
65
-	define( 'EE_MIN_PHP_VER_REQUIRED', '5.3.0' );
65
+	define('EE_MIN_PHP_VER_REQUIRED', '5.3.0');
66 66
 
67
-	if ( ! version_compare( PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=' ) ) {
67
+	if ( ! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
68 68
 
69 69
 		/**
70 70
 		 * espresso_minimum_php_version_error
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
 				</p>
91 91
 			</div>
92 92
 			<?php
93
-			espresso_deactivate_plugin( plugin_basename( __FILE__ ) );
93
+			espresso_deactivate_plugin(plugin_basename(__FILE__));
94 94
 		}
95
-		add_action( 'admin_notices', 'espresso_minimum_php_version_error', 1 );
95
+		add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
96 96
 
97 97
 	} else {
98 98
 
@@ -103,99 +103,99 @@  discard block
 block discarded – undo
103 103
 		 * @return string
104 104
 		 */
105 105
 		function espresso_version() {
106
-			return apply_filters( 'FHEE__espresso__espresso_version', '4.9.18.rc.008' );
106
+			return apply_filters('FHEE__espresso__espresso_version', '4.9.18.rc.008');
107 107
 		}
108 108
 
109 109
 		// define versions
110
-		define( 'EVENT_ESPRESSO_VERSION', espresso_version() );
111
-		define( 'EE_MIN_WP_VER_REQUIRED', '4.1' );
112
-		define( 'EE_MIN_WP_VER_RECOMMENDED', '4.4.2' );
113
-		define( 'EE_MIN_PHP_VER_RECOMMENDED', '5.4.44' );
114
-		define( 'EVENT_ESPRESSO_MAIN_FILE', __FILE__ );
110
+		define('EVENT_ESPRESSO_VERSION', espresso_version());
111
+		define('EE_MIN_WP_VER_REQUIRED', '4.1');
112
+		define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2');
113
+		define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44');
114
+		define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
115 115
 
116 116
 		//used to be DIRECTORY_SEPARATOR, but that caused issues on windows
117
-		if ( ! defined( 'DS' ) ) {
118
-			define( 'DS', '/' );
117
+		if ( ! defined('DS')) {
118
+			define('DS', '/');
119 119
 		}
120
-		if ( ! defined( 'PS' ) ) {
121
-			define( 'PS', PATH_SEPARATOR );
120
+		if ( ! defined('PS')) {
121
+			define('PS', PATH_SEPARATOR);
122 122
 		}
123
-		if ( ! defined( 'SP' ) ) {
124
-			define( 'SP', ' ' );
123
+		if ( ! defined('SP')) {
124
+			define('SP', ' ');
125 125
 		}
126
-		if ( ! defined( 'EENL' ) ) {
127
-			define( 'EENL', "\n" );
126
+		if ( ! defined('EENL')) {
127
+			define('EENL', "\n");
128 128
 		}
129
-		define( 'EE_SUPPORT_EMAIL', '[email protected]' );
129
+		define('EE_SUPPORT_EMAIL', '[email protected]');
130 130
 		// define the plugin directory and URL
131
-		define( 'EE_PLUGIN_BASENAME', plugin_basename( EVENT_ESPRESSO_MAIN_FILE ) );
132
-		define( 'EE_PLUGIN_DIR_PATH', plugin_dir_path( EVENT_ESPRESSO_MAIN_FILE ) );
133
-		define( 'EE_PLUGIN_DIR_URL', plugin_dir_url( EVENT_ESPRESSO_MAIN_FILE ) );
131
+		define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE));
132
+		define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE));
133
+		define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE));
134 134
 		// main root folder paths
135
-		define( 'EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS );
136
-		define( 'EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS );
137
-		define( 'EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS );
138
-		define( 'EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS );
139
-		define( 'EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS );
140
-		define( 'EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS );
141
-		define( 'EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS );
142
-		define( 'EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS );
135
+		define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH.'admin_pages'.DS);
136
+		define('EE_CORE', EE_PLUGIN_DIR_PATH.'core'.DS);
137
+		define('EE_MODULES', EE_PLUGIN_DIR_PATH.'modules'.DS);
138
+		define('EE_PUBLIC', EE_PLUGIN_DIR_PATH.'public'.DS);
139
+		define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH.'shortcodes'.DS);
140
+		define('EE_WIDGETS', EE_PLUGIN_DIR_PATH.'widgets'.DS);
141
+		define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH.'payment_methods'.DS);
142
+		define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH.'caffeinated'.DS);
143 143
 		// core system paths
144
-		define( 'EE_ADMIN', EE_CORE . 'admin' . DS );
145
-		define( 'EE_CPTS', EE_CORE . 'CPTs' . DS );
146
-		define( 'EE_CLASSES', EE_CORE . 'db_classes' . DS );
147
-		define( 'EE_INTERFACES', EE_CORE . 'interfaces' . DS );
148
-		define( 'EE_BUSINESS', EE_CORE . 'business' . DS );
149
-		define( 'EE_MODELS', EE_CORE . 'db_models' . DS );
150
-		define( 'EE_HELPERS', EE_CORE . 'helpers' . DS );
151
-		define( 'EE_LIBRARIES', EE_CORE . 'libraries' . DS );
152
-		define( 'EE_TEMPLATES', EE_CORE . 'templates' . DS );
153
-		define( 'EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS );
154
-		define( 'EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS );
155
-		define( 'EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS );
144
+		define('EE_ADMIN', EE_CORE.'admin'.DS);
145
+		define('EE_CPTS', EE_CORE.'CPTs'.DS);
146
+		define('EE_CLASSES', EE_CORE.'db_classes'.DS);
147
+		define('EE_INTERFACES', EE_CORE.'interfaces'.DS);
148
+		define('EE_BUSINESS', EE_CORE.'business'.DS);
149
+		define('EE_MODELS', EE_CORE.'db_models'.DS);
150
+		define('EE_HELPERS', EE_CORE.'helpers'.DS);
151
+		define('EE_LIBRARIES', EE_CORE.'libraries'.DS);
152
+		define('EE_TEMPLATES', EE_CORE.'templates'.DS);
153
+		define('EE_THIRD_PARTY', EE_CORE.'third_party_libs'.DS);
154
+		define('EE_GLOBAL_ASSETS', EE_TEMPLATES.'global_assets'.DS);
155
+		define('EE_FORM_SECTIONS', EE_LIBRARIES.'form_sections'.DS);
156 156
 		// gateways
157
-		define( 'EE_GATEWAYS', EE_MODULES . 'gateways' . DS );
158
-		define( 'EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS );
157
+		define('EE_GATEWAYS', EE_MODULES.'gateways'.DS);
158
+		define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL.'modules'.DS.'gateways'.DS);
159 159
 		// asset URL paths
160
-		define( 'EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS );
161
-		define( 'EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS );
162
-		define( 'EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS );
163
-		define( 'EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS );
164
-		define( 'EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/' );
165
-		define( 'EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/' );
160
+		define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL.'core'.DS.'templates'.DS);
161
+		define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL.'global_assets'.DS);
162
+		define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL.'images'.DS);
163
+		define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL.'core'.DS.'third_party_libs'.DS);
164
+		define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL.'core/helpers/assets/');
165
+		define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL.'core/libraries/');
166 166
 		// define upload paths
167 167
 		$uploads = wp_upload_dir();
168 168
 		// define the uploads directory and URL
169
-		define( 'EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'] . DS . 'espresso' . DS );
170
-		define( 'EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'] . DS . 'espresso' . DS );
169
+		define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'].DS.'espresso'.DS);
170
+		define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'].DS.'espresso'.DS);
171 171
 		// define the templates directory and URL
172
-		define( 'EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'templates' . DS );
173
-		define( 'EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'templates' . DS );
172
+		define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'].DS.'espresso'.DS.'templates'.DS);
173
+		define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'].DS.'espresso'.DS.'templates'.DS);
174 174
 		// define the gateway directory and URL
175
-		define( 'EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'] . DS . 'espresso' . DS . 'gateways' . DS );
176
-		define( 'EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'] . DS . 'espresso' . DS . 'gateways' . DS );
175
+		define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'].DS.'espresso'.DS.'gateways'.DS);
176
+		define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'].DS.'espresso'.DS.'gateways'.DS);
177 177
 		// languages folder/path
178
-		define( 'EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS );
179
-		define( 'EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS );
178
+		define('EE_LANGUAGES_SAFE_LOC', '..'.DS.'uploads'.DS.'espresso'.DS.'languages'.DS);
179
+		define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'languages'.DS);
180 180
 		//check for dompdf fonts in uploads
181
-		if ( file_exists( EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ) ) {
182
-			define( 'DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS );
181
+		if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS)) {
182
+			define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS);
183 183
 		}
184 184
 		//ajax constants
185 185
 		define(
186 186
 			'EE_FRONT_AJAX',
187
-			isset( $_REQUEST['ee_front_ajax'] ) || isset( $_REQUEST['data']['ee_front_ajax'] ) ? true : false
187
+			isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false
188 188
 		);
189 189
 		define(
190 190
 			'EE_ADMIN_AJAX',
191
-			isset( $_REQUEST['ee_admin_ajax'] ) || isset( $_REQUEST['data']['ee_admin_ajax'] ) ? true : false
191
+			isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false
192 192
 		);
193 193
 		//just a handy constant occasionally needed for finding values representing infinity in the DB
194 194
 		//you're better to use this than its straight value (currently -1) in case you ever
195 195
 		//want to change its default value! or find when -1 means infinity
196
-		define( 'EE_INF_IN_DB', -1 );
197
-		define( 'EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX );
198
-		define( 'EE_DEBUG', false );
196
+		define('EE_INF_IN_DB', -1);
197
+		define('EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX);
198
+		define('EE_DEBUG', false);
199 199
 
200 200
 
201 201
 		/**
@@ -203,9 +203,9 @@  discard block
 block discarded – undo
203 203
 		 *    adds a wp-option to indicate that EE has been activated via the WP admin plugins page
204 204
 		 */
205 205
 		function espresso_plugin_activation() {
206
-			update_option( 'ee_espresso_activation', true );
206
+			update_option('ee_espresso_activation', true);
207 207
 		}
208
-		register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' );
208
+		register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
209 209
 
210 210
 
211 211
 
@@ -215,15 +215,15 @@  discard block
 block discarded – undo
215 215
 		 */
216 216
 		function espresso_load_error_handling() {
217 217
 			// load debugging tools
218
-			if ( WP_DEBUG === true && is_readable( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ) ) {
219
-				require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' );
218
+			if (WP_DEBUG === true && is_readable(EE_HELPERS.'EEH_Debug_Tools.helper.php')) {
219
+				require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php');
220 220
 				EEH_Debug_Tools::instance();
221 221
 			}
222 222
 			// load error handling
223
-			if ( is_readable( EE_CORE . 'EE_Error.core.php' ) ) {
224
-				require_once( EE_CORE . 'EE_Error.core.php' );
223
+			if (is_readable(EE_CORE.'EE_Error.core.php')) {
224
+				require_once(EE_CORE.'EE_Error.core.php');
225 225
 			} else {
226
-				wp_die( esc_html__( 'The EE_Error core class could not be loaded.', 'event_espresso' ) );
226
+				wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso'));
227 227
 			}
228 228
 		}
229 229
 
@@ -237,16 +237,16 @@  discard block
 block discarded – undo
237 237
 		 * @param    string $full_path_to_file
238 238
 		 * @throws    EE_Error
239 239
 		 */
240
-		function espresso_load_required( $classname, $full_path_to_file ) {
240
+		function espresso_load_required($classname, $full_path_to_file) {
241 241
 			static $error_handling_loaded = false;
242
-			if ( ! $error_handling_loaded ) {
242
+			if ( ! $error_handling_loaded) {
243 243
 				espresso_load_error_handling();
244 244
 				$error_handling_loaded = true;
245 245
 			}
246
-			if ( is_readable( $full_path_to_file ) ) {
247
-				require_once( $full_path_to_file );
246
+			if (is_readable($full_path_to_file)) {
247
+				require_once($full_path_to_file);
248 248
 			} else {
249
-				throw new EE_Error (
249
+				throw new EE_Error(
250 250
 					sprintf(
251 251
 						esc_html__(
252 252
 							'The %s class file could not be located or is not readable due to file permissions.',
@@ -258,15 +258,15 @@  discard block
 block discarded – undo
258 258
 			}
259 259
 		}
260 260
 
261
-		espresso_load_required( 'EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' );
262
-		espresso_load_required( 'EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' );
263
-		espresso_load_required( 'EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php' );
261
+		espresso_load_required('EEH_Base', EE_CORE.'helpers'.DS.'EEH_Base.helper.php');
262
+		espresso_load_required('EEH_File', EE_CORE.'helpers'.DS.'EEH_File.helper.php');
263
+		espresso_load_required('EE_Bootstrap', EE_CORE.'EE_Bootstrap.core.php');
264 264
 		new EE_Bootstrap();
265 265
 
266 266
 	}
267 267
 }
268 268
 
269
-if ( ! function_exists( 'espresso_deactivate_plugin' ) ) {
269
+if ( ! function_exists('espresso_deactivate_plugin')) {
270 270
 
271 271
 	/**
272 272
 	 *    deactivate_plugin
@@ -276,12 +276,12 @@  discard block
 block discarded – undo
276 276
 	 * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
277 277
 	 * @return    void
278 278
 	 */
279
-	function espresso_deactivate_plugin( $plugin_basename = '' ) {
280
-		if ( ! function_exists( 'deactivate_plugins' ) ) {
281
-			require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
279
+	function espresso_deactivate_plugin($plugin_basename = '') {
280
+		if ( ! function_exists('deactivate_plugins')) {
281
+			require_once(ABSPATH.'wp-admin/includes/plugin.php');
282 282
 		}
283
-		unset( $_GET['activate'], $_REQUEST['activate'] );
284
-		deactivate_plugins( $plugin_basename );
283
+		unset($_GET['activate'], $_REQUEST['activate']);
284
+		deactivate_plugins($plugin_basename);
285 285
 	}
286 286
 
287 287
 }
Please login to merge, or discard this patch.
caffeinated/admin/extend/events/Extend_Events_Admin_Page.core.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -272,12 +272,12 @@  discard block
 block discarded – undo
272 272
 			);
273 273
 			$title = esc_attr__( 'Duplicate Event', 'event_espresso' );
274 274
 			$return .= '<a href="'
275
-			           . $href
276
-			           . '" title="'
277
-			           . $title
278
-			           . '" id="ee-duplicate-event-button" class="button button-small"  value="duplicate_event">'
279
-			           . $title
280
-			           . '</button>';
275
+					   . $href
276
+					   . '" title="'
277
+					   . $title
278
+					   . '" id="ee-duplicate-event-button" class="button button-small"  value="duplicate_event">'
279
+					   . $title
280
+					   . '</button>';
281 281
 		}
282 282
 		return $return;
283 283
 	}
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 
310 310
 
311 311
 	public function load_scripts_styles_edit() {
312
-        // plz note, the following script contains some code that is not heartbeat related
312
+		// plz note, the following script contains some code that is not heartbeat related
313 313
 		wp_register_script(
314 314
 			'ee-event-editor-heartbeat',
315 315
 			EVENTS_CAF_ASSETS_URL . 'event-editor-heartbeat.js',
@@ -418,11 +418,11 @@  discard block
 block discarded – undo
418 418
 			);
419 419
 			$reports_link = EE_Admin_Page::add_query_args_and_nonce( $reports_query_args, REG_ADMIN_URL );
420 420
 			$action_links[] = '<a href="'
421
-			                  . $reports_link
422
-			                  . '" title="'
423
-			                  . esc_attr__( 'View Report', 'event_espresso' )
424
-			                  . '"><div class="dashicons dashicons-chart-bar"></div></a>'
425
-			                  . "\n\t";
421
+							  . $reports_link
422
+							  . '" title="'
423
+							  . esc_attr__( 'View Report', 'event_espresso' )
424
+							  . '"><div class="dashicons dashicons-chart-bar"></div></a>'
425
+							  . "\n\t";
426 426
 		}
427 427
 		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) {
428 428
 			EE_Registry::instance()->load_helper( 'MSG_Template' );
Please login to merge, or discard this patch.
registration_form/espresso_events_Registration_Form_Hooks_Extend.class.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -112,12 +112,12 @@
 block discarded – undo
112 112
 						<input value="' . $QSG->ID() . '" type="checkbox" name="add_attendee_question_groups[' . $QSG->ID() . ']"' . $checked . ' />
113 113
 						<a href="' . $edit_link . '" title="' . sprintf( esc_attr__( 'Edit %s Group', 'event_espresso' ),  $QSG->get('QSG_name') ) . '" target="_blank">' . $QSG->get('QSG_name') . '</a>
114 114
 					</p>';
115
-                    if ($QSG->ID() === 2) {
116
-                        $html .= '
115
+					if ($QSG->ID() === 2) {
116
+						$html .= '
117 117
 					<p id="question-group-requirements-notice-pg" class="important-notice small-text" style="display: none;">
118 118
 					    '. esc_html__('The Personal Information question group is required whenever the Address Information question group is activated.', 'event_espresso').'
119 119
 					</p>';
120
-                    }
120
+					}
121 121
 				}
122 122
 				$html .= count( $QSGs ) > 10 ? '</div>' : '';
123 123
 
Please login to merge, or discard this patch.