Completed
Branch FET-9707-scroll-to-ticket-sele... (4ce04f)
by
unknown
117:04 queued 100:00
created
core/data_migration_scripts/EE_DMS_Core_4_5_0.dms.php 1 patch
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -15,16 +15,16 @@  discard block
 block discarded – undo
15 15
 //(all other times it gets resurrected from a wordpress option)
16 16
 $stages = glob(EE_CORE.'data_migration_scripts/4_5_0_stages/*');
17 17
 $class_to_filepath = array();
18
-foreach($stages as $filepath){
18
+foreach ($stages as $filepath) {
19 19
 	$matches = array();
20
-	preg_match('~4_5_0_stages/(.*).dmsstage.php~',$filepath,$matches);
20
+	preg_match('~4_5_0_stages/(.*).dmsstage.php~', $filepath, $matches);
21 21
 	$class_to_filepath[$matches[1]] = $filepath;
22 22
 }
23 23
 //give addons a chance to autoload their stages too
24
-$class_to_filepath = apply_filters('FHEE__EE_DMS_4_5_0__autoloaded_stages',$class_to_filepath);
24
+$class_to_filepath = apply_filters('FHEE__EE_DMS_4_5_0__autoloaded_stages', $class_to_filepath);
25 25
 EEH_Autoloader::register_autoloader($class_to_filepath);
26 26
 
27
-class EE_DMS_Core_4_5_0 extends EE_Data_Migration_Script_Base{
27
+class EE_DMS_Core_4_5_0 extends EE_Data_Migration_Script_Base {
28 28
 
29 29
 
30 30
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @param TableManager  $table_manager
35 35
 	 * @param TableAnalysis $table_analysis
36 36
 	 */
37
-	public function __construct( TableManager $table_manager = null, TableAnalysis $table_analysis = null ) {
37
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) {
38 38
 		$this->_pretty_name = __("Data Migration to Event Espresso 4.5.0.P", "event_espresso");
39 39
 		$this->_priority = 10;
40 40
 		$this->_migration_stages = array(
@@ -44,21 +44,21 @@  discard block
 block discarded – undo
44 44
 			new EE_DMS_4_5_0_update_wp_user_for_question_groups(),
45 45
 			new EE_DMS_4_5_0_invoice_settings(),
46 46
 			);
47
-		parent::__construct( $table_manager, $table_analysis );
47
+		parent::__construct($table_manager, $table_analysis);
48 48
 	}
49 49
 
50 50
 
51 51
 
52 52
 	public function can_migrate_from_version($version_array) {
53 53
 		$version_string = $version_array['Core'];
54
-		if($version_string <= '4.5.0' && $version_string >= '4.3.0' ){
54
+		if ($version_string <= '4.5.0' && $version_string >= '4.3.0') {
55 55
 //			echo "$version_string can be migrated from";
56 56
 			return true;
57
-		}elseif( ! $version_string ){
57
+		}elseif ( ! $version_string) {
58 58
 //			echo "no version string provided: $version_string";
59 59
 			//no version string provided... this must be pre 4.3
60
-			return false;//changed mind. dont want people thinking they should migrate yet because they cant
61
-		}else{
60
+			return false; //changed mind. dont want people thinking they should migrate yet because they cant
61
+		} else {
62 62
 //			echo "$version_string doesnt apply";
63 63
 			return false;
64 64
 		}
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
 	}
69 69
 	public function schema_changes_before_migration() {
70 70
 		//relies on 4.1's EEH_Activation::create_table
71
-		require_once( EE_HELPERS . 'EEH_Activation.helper.php' );
72
-		$table_name='esp_answer';
73
-		$sql=" ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
71
+		require_once(EE_HELPERS.'EEH_Activation.helper.php');
72
+		$table_name = 'esp_answer';
73
+		$sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
74 74
 					REG_ID INT UNSIGNED NOT NULL,
75 75
 					QST_ID INT UNSIGNED NOT NULL,
76 76
 					ANS_value TEXT NOT NULL,
77 77
 					PRIMARY KEY  (ANS_ID)";
78
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
78
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
79 79
 
80 80
 		$table_name = 'esp_attendee_meta';
81 81
 		$sql = "ATTM_ID INT(10) UNSIGNED NOT	NULL AUTO_INCREMENT,
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 					  CNT_is_EU TINYINT(1) DEFAULT '0',
115 115
 					  CNT_active TINYINT(1) DEFAULT '0',
116 116
 					  PRIMARY KEY  (CNT_ISO)";
117
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
117
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
118 118
 
119 119
 		$table_name = 'esp_datetime';
120 120
 		$sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
 
137 137
 
138
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
138
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
139 139
 		$table_name = 'esp_event_meta';
140 140
 		$sql = "
141 141
 			EVTM_ID INT NOT NULL AUTO_INCREMENT,
@@ -152,41 +152,41 @@  discard block
 block discarded – undo
152 152
 			EVT_external_URL VARCHAR(200) NULL,
153 153
 			EVT_donations TINYINT(1) NULL,
154 154
 			PRIMARY KEY  (EVTM_ID)";
155
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
155
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
156 156
 
157 157
 
158 158
 
159
-		$table_name='esp_event_question_group';
160
-		$sql="EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
159
+		$table_name = 'esp_event_question_group';
160
+		$sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
161 161
 					EVT_ID BIGINT(20) UNSIGNED NOT NULL,
162 162
 					QSG_ID INT UNSIGNED NOT NULL,
163 163
 					EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
164 164
 					PRIMARY KEY  (EQG_ID)";
165
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
165
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
166 166
 
167 167
 
168 168
 
169
-		$table_name='esp_event_venue';
170
-		$sql="EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
169
+		$table_name = 'esp_event_venue';
170
+		$sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
171 171
 				EVT_ID BIGINT(20) UNSIGNED NOT NULL,
172 172
 				VNU_ID BIGINT(20) UNSIGNED NOT NULL,
173 173
 				EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
174 174
 				PRIMARY KEY  (EVV_ID)";
175
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
175
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
176 176
 
177 177
 
178 178
 
179
-		$table_name='esp_extra_meta';
180
-		$sql="EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
179
+		$table_name = 'esp_extra_meta';
180
+		$sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
181 181
 				OBJ_ID INT(11) DEFAULT NULL,
182 182
 				EXM_type VARCHAR(45) DEFAULT NULL,
183 183
 				EXM_key VARCHAR(45) DEFAULT NULL,
184 184
 				EXM_value TEXT,
185 185
 				PRIMARY KEY  (EXM_ID)";
186
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
186
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
187 187
 
188
-		$table_name='esp_line_item';
189
-		$sql="LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
188
+		$table_name = 'esp_line_item';
189
+		$sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
190 190
 				LIN_code VARCHAR(245) NOT NULL DEFAULT '',
191 191
 				TXN_ID INT(11) DEFAULT NULL,
192 192
 				LIN_name VARCHAR(245) NOT NULL DEFAULT '',
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 				OBJ_ID INT(11) DEFAULT NULL,
203 203
 				OBJ_type VARCHAR(45)DEFAULT NULL,
204 204
 				PRIMARY KEY  (LIN_ID)";
205
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB' );
205
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
206 206
 
207 207
 		$table_name = 'esp_message_template';
208 208
 		$sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 					KEY GRP_ID (GRP_ID)";
215 215
 		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
216 216
 
217
-		$this->_get_table_manager()->dropIndex( 'esp_message_template_group', 'EVT_ID' );
217
+		$this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID');
218 218
 
219 219
 		$table_name = 'esp_message_template_group';
220 220
 		$sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 					MTP_is_active TINYINT(1) NOT NULL DEFAULT '1',
230 230
 					PRIMARY KEY  (GRP_ID),
231 231
 					KEY MTP_user_id (MTP_user_id)";
232
-		$this->_table_should_exist_previously( $table_name, $sql, 'ENGINE=InnoDB');
232
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
233 233
 
234 234
 		$table_name = 'esp_event_message_template';
235 235
 		$sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 					PRIMARY KEY  (EMT_ID),
239 239
 					KEY EVT_ID (EVT_ID),
240 240
 					KEY GRP_ID (GRP_ID)";
241
-		$this->_table_should_exist_previously( $table_name, $sql, 'ENGINE=InnoDB');
241
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
242 242
 
243 243
 
244 244
 		$table_name = 'esp_payment';
@@ -288,8 +288,8 @@  discard block
 block discarded – undo
288 288
 					  PRIMARY KEY  (TTM_ID)";
289 289
 		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
290 290
 
291
-		$table_name='esp_question';
292
-		$sql='QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
291
+		$table_name = 'esp_question';
292
+		$sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
293 293
 					QST_display_text TEXT NOT NULL,
294 294
 					QST_admin_label VARCHAR(255) NOT NULL,
295 295
 					QST_system VARCHAR(25) DEFAULT NULL,
@@ -301,27 +301,27 @@  discard block
 block discarded – undo
301 301
 					QST_wp_user BIGINT UNSIGNED NULL,
302 302
 					QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0,
303 303
 					PRIMARY KEY  (QST_ID)';
304
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
304
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
305 305
 
306
-		$table_name='esp_question_group_question';
307
-		$sql="QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
306
+		$table_name = 'esp_question_group_question';
307
+		$sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
308 308
 					QSG_ID INT UNSIGNED NOT NULL,
309 309
 					QST_ID INT UNSIGNED NOT NULL,
310 310
 					QGQ_order INT UNSIGNED NOT NULL DEFAULT 0,
311 311
 					PRIMARY KEY  (QGQ_ID) ";
312
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
312
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
313 313
 
314 314
 
315 315
 
316
-		$table_name='esp_question_option';
317
-		$sql="QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
316
+		$table_name = 'esp_question_option';
317
+		$sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
318 318
 					QSO_value VARCHAR(255) NOT NULL,
319 319
 					QSO_desc TEXT NOT NULL,
320 320
 					QST_ID INT UNSIGNED NOT NULL,
321 321
 					QSO_order INT UNSIGNED NOT NULL DEFAULT 0,
322 322
 					QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
323 323
 					PRIMARY KEY  (QSO_ID)";
324
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
324
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
325 325
 
326 326
 
327 327
 
@@ -354,8 +354,8 @@  discard block
 block discarded – undo
354 354
 
355 355
 
356 356
 
357
-		$table_name='esp_checkin';
358
-		$sql="CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
357
+		$table_name = 'esp_checkin';
358
+		$sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
359 359
 					REG_ID INT(10) UNSIGNED NOT NULL,
360 360
 					DTT_ID INT(10) UNSIGNED NOT NULL,
361 361
 					CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1,
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 					  PRC_wp_user BIGINT UNSIGNED NULL,
444 444
 					  PRC_parent INT(10) UNSIGNED DEFAULT 0,
445 445
 					  PRIMARY KEY  (PRC_ID)";
446
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
446
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
447 447
 
448 448
 		$table_name = "esp_price_type";
449 449
 		$sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -480,12 +480,12 @@  discard block
 block discarded – undo
480 480
 					  TKT_parent INT(10) UNSIGNED DEFAULT '0',
481 481
 					  TKT_deleted TINYINT(1) NOT NULL DEFAULT '0',
482 482
 					  PRIMARY KEY  (TKT_ID)";
483
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
483
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
484 484
 
485
-		$this->_get_table_manager()->dropIndex( 'esp_question_group', 'QSG_identifier_UNIQUE' );
485
+		$this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE');
486 486
 
487 487
 		$table_name = 'esp_question_group';
488
-		$sql='QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
488
+		$sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
489 489
 					QSG_name VARCHAR(255) NOT NULL,
490 490
 					QSG_identifier VARCHAR(100) NOT NULL,
491 491
 					QSG_desc TEXT NULL,
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 					QSG_wp_user BIGINT UNSIGNED NULL,
498 498
 					PRIMARY KEY  (QSG_ID),
499 499
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)';
500
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
500
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
501 501
 
502 502
 		$script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
503 503
 
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 		return true;
522 522
 	}
523 523
 
524
-	public function migration_page_hooks(){
524
+	public function migration_page_hooks() {
525 525
 
526 526
 	}
527 527
 
@@ -535,21 +535,21 @@  discard block
 block discarded – undo
535 535
 		global $wpdb;
536 536
 		$price_type_table = $wpdb->prefix."esp_price_type";
537 537
 
538
-		if ( $this->_get_table_analysis()->tableExists( $price_type_table ) ) {
538
+		if ($this->_get_table_analysis()->tableExists($price_type_table)) {
539 539
 
540
-			$SQL = 'SELECT COUNT(PRT_ID) FROM ' . $price_type_table;
541
-			$price_types_exist = $wpdb->get_var( $SQL );
540
+			$SQL = 'SELECT COUNT(PRT_ID) FROM '.$price_type_table;
541
+			$price_types_exist = $wpdb->get_var($SQL);
542 542
 
543
-			if ( ! $price_types_exist ) {
543
+			if ( ! $price_types_exist) {
544 544
 				$user_id = EEH_Activation::get_default_creator_id();
545 545
 				$SQL = "INSERT INTO $price_type_table ( PRT_ID, PRT_name, PBT_ID, PRT_is_percent, PRT_order, PRT_wp_user, PRT_deleted ) VALUES
546
-							(1, '" . __('Base Price', 'event_espresso') . "', 1,  0, 0, $user_id, 0),
547
-							(2, '" . __('Percent Discount', 'event_espresso') . "', 2,  1, 20, $user_id, 0),
548
-							(3, '" . __('Dollar Discount', 'event_espresso') . "', 2,  0, 30, $user_id, 0),
549
-							(4, '" . __('Percent Surcharge', 'event_espresso') . "', 3,  1, 40, $user_id,  0),
550
-							(5, '" . __('Dollar Surcharge', 'event_espresso') . "', 3,  0, 50, $user_id, 0);";
551
-				$SQL = apply_filters( 'FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL );
552
-				$wpdb->query( $SQL );
546
+							(1, '".__('Base Price', 'event_espresso')."', 1,  0, 0, $user_id, 0),
547
+							(2, '".__('Percent Discount', 'event_espresso')."', 2,  1, 20, $user_id, 0),
548
+							(3, '".__('Dollar Discount', 'event_espresso')."', 2,  0, 30, $user_id, 0),
549
+							(4, '".__('Percent Surcharge', 'event_espresso')."', 3,  1, 40, $user_id,  0),
550
+							(5, '".__('Dollar Surcharge', 'event_espresso')."', 3,  0, 50, $user_id, 0);";
551
+				$SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL);
552
+				$wpdb->query($SQL);
553 553
 			}
554 554
 		}
555 555
 	}
@@ -569,17 +569,17 @@  discard block
 block discarded – undo
569 569
 		global $wpdb;
570 570
 		$price_table = $wpdb->prefix."esp_price";
571 571
 
572
-		if ( $this->_get_table_analysis()->tableExists( $price_table ) ) {
572
+		if ($this->_get_table_analysis()->tableExists($price_table)) {
573 573
 
574
-			$SQL = 'SELECT COUNT(PRC_ID) FROM ' .$price_table;
575
-			$prices_exist = $wpdb->get_var( $SQL );
574
+			$SQL = 'SELECT COUNT(PRC_ID) FROM '.$price_table;
575
+			$prices_exist = $wpdb->get_var($SQL);
576 576
 
577
-			if ( ! $prices_exist ) {
577
+			if ( ! $prices_exist) {
578 578
 				$user_id = EEH_Activation::get_default_creator_id();
579 579
 				$SQL = "INSERT INTO $price_table
580 580
 							(PRC_ID, PRT_ID, PRC_amount, PRC_name, PRC_desc,  PRC_is_default, PRC_overrides, PRC_wp_user, PRC_order, PRC_deleted, PRC_parent ) VALUES
581 581
 							(1, 1, '0.00', 'Free Admission', '', 1, NULL, $user_id, 0, 0, 0);";
582
-				$SQL = apply_filters( 'FHEE__EE_DMS_4_5_0__insert_default_prices__SQL', $SQL );
582
+				$SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_prices__SQL', $SQL);
583 583
 				$wpdb->query($SQL);
584 584
 			}
585 585
 		}
@@ -597,35 +597,35 @@  discard block
 block discarded – undo
597 597
 
598 598
 		global $wpdb;
599 599
 		$ticket_table = $wpdb->prefix."esp_ticket";
600
-		if ( $this->_get_table_analysis()->tableExists( $ticket_table ) ) {
600
+		if ($this->_get_table_analysis()->tableExists($ticket_table)) {
601 601
 
602
-			$SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table;
602
+			$SQL = 'SELECT COUNT(TKT_ID) FROM '.$ticket_table;
603 603
 			$tickets_exist = $wpdb->get_var($SQL);
604 604
 
605
-			if ( ! $tickets_exist ) {
605
+			if ( ! $tickets_exist) {
606 606
 				$user_id = EEH_Activation::get_default_creator_id();
607 607
 				$SQL = "INSERT INTO $ticket_table
608 608
 					( TKT_ID, TTM_ID, TKT_name, TKT_description, TKT_qty, TKT_sold, TKT_uses, TKT_required, TKT_min, TKT_max, TKT_price, TKT_start_date, TKT_end_date, TKT_taxable, TKT_order, TKT_row, TKT_is_default, TKT_parent, TKT_wp_user, TKT_deleted ) VALUES
609
-					( 1, 0, '" . __("Free Ticket", "event_espresso") . "', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, $user_id, 0);";
610
-				$SQL = apply_filters( 'FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL', $SQL );
609
+					( 1, 0, '".__("Free Ticket", "event_espresso")."', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, $user_id, 0);";
610
+				$SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL', $SQL);
611 611
 				$wpdb->query($SQL);
612 612
 			}
613 613
 		}
614 614
 		$ticket_price_table = $wpdb->prefix."esp_ticket_price";
615 615
 
616
-		if ( $this->_get_table_analysis()->tableExists( $ticket_price_table ) ) {
616
+		if ($this->_get_table_analysis()->tableExists($ticket_price_table)) {
617 617
 
618
-			$SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table;
618
+			$SQL = 'SELECT COUNT(TKP_ID) FROM '.$ticket_price_table;
619 619
 			$ticket_prc_exist = $wpdb->get_var($SQL);
620 620
 
621
-			if ( ! $ticket_prc_exist ) {
621
+			if ( ! $ticket_prc_exist) {
622 622
 
623 623
 				$SQL = "INSERT INTO $ticket_price_table
624 624
 				( TKP_ID, TKT_ID, PRC_ID ) VALUES
625 625
 				( 1, 1, 1 )
626 626
 				";
627 627
 
628
-				$SQL = apply_filters( 'FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL__ticket_price', $SQL );
628
+				$SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL__ticket_price', $SQL);
629 629
 				$wpdb->query($SQL);
630 630
 			}
631 631
 		}
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_2_0.dms.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -14,18 +14,18 @@  discard block
 block discarded – undo
14 14
 //(all other times it gets resurrected from a wordpress option)
15 15
 $stages = glob(EE_CORE.'data_migration_scripts/4_2_0_stages/*');
16 16
 $class_to_filepath = array();
17
-if ( ! empty( $stages ) ) {
18
-	foreach($stages as $filepath){
17
+if ( ! empty($stages)) {
18
+	foreach ($stages as $filepath) {
19 19
 		$matches = array();
20
-		preg_match('~4_2_0_stages/(.*).dmsstage.php~',$filepath,$matches);
20
+		preg_match('~4_2_0_stages/(.*).dmsstage.php~', $filepath, $matches);
21 21
 		$class_to_filepath[$matches[1]] = $filepath;
22 22
 	}
23 23
 }
24 24
 //give addons a chance to autoload their stages too
25
-$class_to_filepath = apply_filters('FHEE__EE_DMS_4_2_0__autoloaded_stages',$class_to_filepath);
25
+$class_to_filepath = apply_filters('FHEE__EE_DMS_4_2_0__autoloaded_stages', $class_to_filepath);
26 26
 EEH_Autoloader::register_autoloader($class_to_filepath);
27 27
 
28
-class EE_DMS_Core_4_2_0 extends EE_Data_Migration_Script_Base{
28
+class EE_DMS_Core_4_2_0 extends EE_Data_Migration_Script_Base {
29 29
 
30 30
 
31 31
 
@@ -35,26 +35,26 @@  discard block
 block discarded – undo
35 35
 	 * @param TableManager  $table_manager
36 36
 	 * @param TableAnalysis $table_analysis
37 37
 	 */
38
-	public function __construct( TableManager $table_manager = null, TableAnalysis $table_analysis = null ) {
38
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) {
39 39
 		$this->_pretty_name = __("Data Migration to Event Espresso 4.2.0.P", "event_espresso");
40 40
 		$this->_priority = 10;
41 41
 		$this->_migration_stages = array(
42 42
 			new EE_DMS_4_2_0_question_group_questions(),
43 43
 			new EE_DMS_4_2_0_datetime_fields(),
44 44
 		);
45
-		parent::__construct( $table_manager, $table_analysis );
45
+		parent::__construct($table_manager, $table_analysis);
46 46
 	}
47 47
 	public function can_migrate_from_version($version_array) {
48 48
 		$version_string = $version_array['Core'];
49
-		if($version_string <= '4.2.0' && $version_string >= '4.1.0' ){
49
+		if ($version_string <= '4.2.0' && $version_string >= '4.1.0') {
50 50
 //			echo "$version_string can be migrated fro";
51 51
 			return true;
52
-		}elseif( ! $version_string ){
52
+		}elseif ( ! $version_string) {
53 53
 //			echo "no version string provided: $version_string";
54 54
 			//no version string provided... this must be pre 4.1
55 55
 			//because since 4.1 we're
56
-			return false;//changed mind. dont want people thinking they should migrate yet because they cant
57
-		}else{
56
+			return false; //changed mind. dont want people thinking they should migrate yet because they cant
57
+		} else {
58 58
 //			echo "$version_string doesnt apply";
59 59
 			return false;
60 60
 		}
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
 	}
65 65
 	public function schema_changes_before_migration() {
66 66
 		//relies on 4.1's EEH_Activation::create_table
67
-		require_once( EE_HELPERS . 'EEH_Activation.helper.php' );
68
-		$table_name='esp_answer';
69
-		$sql=" ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
67
+		require_once(EE_HELPERS.'EEH_Activation.helper.php');
68
+		$table_name = 'esp_answer';
69
+		$sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
70 70
 					REG_ID INT UNSIGNED NOT NULL,
71 71
 					QST_ID INT UNSIGNED NOT NULL,
72 72
 					ANS_value TEXT NOT NULL,
73 73
 					PRIMARY KEY  (ANS_ID)";
74
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
74
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
75 75
 
76 76
 		$table_name = 'esp_attendee_meta';
77 77
 		$sql = "ATTM_ID INT(10) UNSIGNED NOT	NULL AUTO_INCREMENT,
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 					  CNT_is_EU TINYINT(1) DEFAULT '0',
112 112
 					  CNT_active TINYINT(1) DEFAULT '0',
113 113
 					  PRIMARY KEY  (CNT_ISO)";
114
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
114
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
115 115
 
116 116
 
117 117
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
 
136 136
 
137
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
137
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
138 138
 		$table_name = 'esp_event_meta';
139 139
 		$sql = "
140 140
 			EVTM_ID INT NOT NULL AUTO_INCREMENT,
@@ -151,41 +151,41 @@  discard block
 block discarded – undo
151 151
 			EVT_external_URL VARCHAR(200) NULL,
152 152
 			EVT_donations TINYINT(1) NULL,
153 153
 			PRIMARY KEY  (EVTM_ID)";
154
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
154
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
155 155
 
156 156
 
157 157
 
158
-		$table_name='esp_event_question_group';
159
-		$sql="EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
158
+		$table_name = 'esp_event_question_group';
159
+		$sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
160 160
 					EVT_ID BIGINT(20) UNSIGNED NOT NULL,
161 161
 					QSG_ID INT UNSIGNED NOT NULL,
162 162
 					EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
163 163
 					PRIMARY KEY  (EQG_ID)";
164
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
164
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
165 165
 
166 166
 
167 167
 
168
-		$table_name='esp_event_venue';
169
-		$sql="EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
168
+		$table_name = 'esp_event_venue';
169
+		$sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
170 170
 				EVT_ID BIGINT(20) UNSIGNED NOT NULL,
171 171
 				VNU_ID BIGINT(20) UNSIGNED NOT NULL,
172 172
 				EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
173 173
 				PRIMARY KEY  (EVV_ID)";
174
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
174
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
175 175
 
176 176
 
177 177
 
178
-		$table_name='esp_extra_meta';
179
-		$sql="EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
178
+		$table_name = 'esp_extra_meta';
179
+		$sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
180 180
 				OBJ_ID INT(11) DEFAULT NULL,
181 181
 				EXM_type VARCHAR(45) DEFAULT NULL,
182 182
 				EXM_key VARCHAR(45) DEFAULT NULL,
183 183
 				EXM_value TEXT,
184 184
 				PRIMARY KEY  (EXM_ID)";
185
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
185
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
186 186
 
187
-		$table_name='esp_line_item';
188
-		$sql="LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
187
+		$table_name = 'esp_line_item';
188
+		$sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
189 189
 				LIN_code VARCHAR(245) NOT NULL DEFAULT '',
190 190
 				TXN_ID INT(11) DEFAULT NULL,
191 191
 				LIN_name VARCHAR(245) NOT NULL DEFAULT '',
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 				OBJ_ID INT(11) DEFAULT NULL,
202 202
 				OBJ_type VARCHAR(45)DEFAULT NULL,
203 203
 				PRIMARY KEY  (LIN_ID)";
204
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB' );
204
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
205 205
 
206 206
 		$table_name = 'esp_message_template';
207 207
 		$sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 					PRIMARY KEY  (GRP_ID),
229 229
 					KEY EVT_ID (EVT_ID),
230 230
 					KEY MTP_user_id (MTP_user_id)";
231
-		$this->_table_should_exist_previously( $table_name, $sql, 'ENGINE=InnoDB');
231
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
232 232
 
233 233
 
234 234
 
@@ -336,8 +336,8 @@  discard block
 block discarded – undo
336 336
 
337 337
 
338 338
 
339
-		$table_name='esp_question';
340
-		$sql='QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
339
+		$table_name = 'esp_question';
340
+		$sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
341 341
 					QST_display_text TEXT NOT NULL,
342 342
 					QST_admin_label VARCHAR(255) NOT NULL,
343 343
 					QST_system VARCHAR(25) DEFAULT NULL,
@@ -349,12 +349,12 @@  discard block
 block discarded – undo
349 349
 					QST_wp_user BIGINT UNSIGNED NULL,
350 350
 					QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0,
351 351
 					PRIMARY KEY  (QST_ID)';
352
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
352
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
353 353
 
354
-		$this->_get_table_manager()->dropIndex( 'esp_question_group', 'QSG_identifier_UNIQUE' );
354
+		$this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE');
355 355
 
356 356
 		$table_name = 'esp_question_group';
357
-		$sql='QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
357
+		$sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
358 358
 					QSG_name VARCHAR(255) NOT NULL,
359 359
 					QSG_identifier VARCHAR(100) NOT NULL,
360 360
 					QSG_desc TEXT NULL,
@@ -365,28 +365,28 @@  discard block
 block discarded – undo
365 365
 					QSG_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
366 366
 					PRIMARY KEY  (QSG_ID),
367 367
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)';
368
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
368
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
369 369
 
370 370
 
371 371
 
372
-		$table_name='esp_question_group_question';
373
-		$sql="QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
372
+		$table_name = 'esp_question_group_question';
373
+		$sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
374 374
 					QSG_ID INT UNSIGNED NOT NULL,
375 375
 					QST_ID INT UNSIGNED NOT NULL,
376 376
 					QGQ_order INT UNSIGNED NOT NULL DEFAULT 0,
377 377
 					PRIMARY KEY  (QGQ_ID) ";
378
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
378
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
379 379
 
380 380
 
381 381
 
382
-		$table_name='esp_question_option';
383
-		$sql="QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
382
+		$table_name = 'esp_question_option';
383
+		$sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
384 384
 					QSO_value VARCHAR(255) NOT NULL,
385 385
 					QSO_desc TEXT NOT NULL,
386 386
 					QST_ID INT UNSIGNED NOT NULL,
387 387
 					QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
388 388
 					PRIMARY KEY  (QSO_ID)";
389
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
389
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
390 390
 
391 391
 
392 392
 
@@ -419,8 +419,8 @@  discard block
 block discarded – undo
419 419
 
420 420
 
421 421
 
422
-		$table_name='esp_checkin';
423
-		$sql="CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
422
+		$table_name = 'esp_checkin';
423
+		$sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
424 424
 					REG_ID INT(10) UNSIGNED NOT NULL,
425 425
 					DTT_ID INT(10) UNSIGNED NOT NULL,
426 426
 					CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1,
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
495 495
 
496 496
 
497
-		$script_with_defaults = EE_Registry::instance()->load_dms( 'Core_4_1_0' );
497
+		$script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
498 498
 		//setting up the DEFAULT stats and countries is also essential for the data migrations to run
499 499
 		//(because many need to convert old string states to foreign keys into the states table)
500 500
 		$script_with_defaults->insert_default_states();
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 		return true;
517 517
 	}
518 518
 
519
-	public function migration_page_hooks(){
519
+	public function migration_page_hooks() {
520 520
 
521 521
 	}
522 522
 }
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_6_0.dms.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
 //(all other times it gets resurrected from a wordpress option)
14 14
 $stages = glob(EE_CORE.'data_migration_scripts/4_6_0_stages/*');
15 15
 $class_to_filepath = array();
16
-foreach($stages as $filepath){
16
+foreach ($stages as $filepath) {
17 17
 	$matches = array();
18
-	preg_match('~4_6_0_stages/(.*).dmsstage.php~',$filepath,$matches);
18
+	preg_match('~4_6_0_stages/(.*).dmsstage.php~', $filepath, $matches);
19 19
 	$class_to_filepath[$matches[1]] = $filepath;
20 20
 }
21 21
 //give addons a chance to autoload their stages too
22
-$class_to_filepath = apply_filters('FHEE__EE_DMS_4_6_0__autoloaded_stages',$class_to_filepath);
22
+$class_to_filepath = apply_filters('FHEE__EE_DMS_4_6_0__autoloaded_stages', $class_to_filepath);
23 23
 EEH_Autoloader::register_autoloader($class_to_filepath);
24 24
 
25 25
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
  * @since                4.6.0
36 36
  *
37 37
  */
38
-class EE_DMS_Core_4_6_0 extends EE_Data_Migration_Script_Base{
38
+class EE_DMS_Core_4_6_0 extends EE_Data_Migration_Script_Base {
39 39
 
40 40
 	/**
41 41
 	 * return EE_DMS_Core_4_6_0
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * @param TableManager  $table_manager
44 44
 	 * @param TableAnalysis $table_analysis
45 45
 	 */
46
-	public function __construct( TableManager $table_manager = null, TableAnalysis $table_analysis = null ) {
46
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) {
47 47
 		$this->_pretty_name = __("Data Migration to Event Espresso 4.6.0.P", "event_espresso");
48 48
 		$this->_priority = 10;
49 49
 		$this->_migration_stages = array(
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 			new EE_DMS_4_6_0_payments(),
58 58
 			new EE_DMS_4_6_0_invoice_settings()
59 59
 		);
60
-		parent::__construct( $table_manager, $table_analysis );
60
+		parent::__construct($table_manager, $table_analysis);
61 61
 	}
62 62
 
63 63
 
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
 	 */
69 69
 	public function can_migrate_from_version($version_array) {
70 70
 		$version_string = $version_array['Core'];
71
-		if($version_string <= '4.6.0' && $version_string >= '4.5.0' ){
71
+		if ($version_string <= '4.6.0' && $version_string >= '4.5.0') {
72 72
 //			echo "$version_string can be migrated from";
73 73
 			return true;
74
-		}elseif( ! $version_string ){
74
+		}elseif ( ! $version_string) {
75 75
 //			echo "no version string provided: $version_string";
76 76
 			//no version string provided... this must be pre 4.3
77
-			return false;//changed mind. dont want people thinking they should migrate yet because they cant
78
-		}else{
77
+			return false; //changed mind. dont want people thinking they should migrate yet because they cant
78
+		} else {
79 79
 //			echo "$version_string doesnt apply";
80 80
 			return false;
81 81
 		}
@@ -97,14 +97,14 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function schema_changes_before_migration() {
99 99
 		//relies on 4.1's EEH_Activation::create_table
100
-		require_once( EE_HELPERS . 'EEH_Activation.helper.php' );
101
-		$table_name='esp_answer';
102
-		$sql=" ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
100
+		require_once(EE_HELPERS.'EEH_Activation.helper.php');
101
+		$table_name = 'esp_answer';
102
+		$sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
103 103
 					REG_ID INT UNSIGNED NOT NULL,
104 104
 					QST_ID INT UNSIGNED NOT NULL,
105 105
 					ANS_value TEXT NOT NULL,
106 106
 					PRIMARY KEY  (ANS_ID)";
107
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
107
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
108 108
 
109 109
 		$table_name = 'esp_attendee_meta';
110 110
 		$sql = "ATTM_ID INT(10) UNSIGNED NOT	NULL AUTO_INCREMENT,
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 					  CNT_is_EU TINYINT(1) DEFAULT '0',
144 144
 					  CNT_active TINYINT(1) DEFAULT '0',
145 145
 					  PRIMARY KEY  (CNT_ISO)";
146
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
146
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
147 147
 
148 148
 		$table_name = 'esp_currency';
149 149
 		$sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL,
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 				CUR_dec_plc VARCHAR(1) COLLATE utf8_bin NOT NULL DEFAULT '2',
154 154
 				CUR_active TINYINT(1) DEFAULT '0',
155 155
 				PRIMARY KEY  (CUR_code)";
156
-		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB' );
156
+		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
157 157
 
158 158
 
159 159
 		$table_name = 'esp_currency_payment_method';
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
 
185 185
 
186
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
186
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
187 187
 		$table_name = 'esp_event_meta';
188 188
 		$sql = "
189 189
 			EVTM_ID INT NOT NULL AUTO_INCREMENT,
@@ -200,41 +200,41 @@  discard block
 block discarded – undo
200 200
 			EVT_external_URL VARCHAR(200) NULL,
201 201
 			EVT_donations TINYINT(1) NULL,
202 202
 			PRIMARY KEY  (EVTM_ID)";
203
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
203
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
204 204
 
205 205
 
206 206
 
207
-		$table_name='esp_event_question_group';
208
-		$sql="EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
207
+		$table_name = 'esp_event_question_group';
208
+		$sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
209 209
 					EVT_ID BIGINT(20) UNSIGNED NOT NULL,
210 210
 					QSG_ID INT UNSIGNED NOT NULL,
211 211
 					EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
212 212
 					PRIMARY KEY  (EQG_ID)";
213
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
213
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
214 214
 
215 215
 
216 216
 
217
-		$table_name='esp_event_venue';
218
-		$sql="EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
217
+		$table_name = 'esp_event_venue';
218
+		$sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
219 219
 				EVT_ID BIGINT(20) UNSIGNED NOT NULL,
220 220
 				VNU_ID BIGINT(20) UNSIGNED NOT NULL,
221 221
 				EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
222 222
 				PRIMARY KEY  (EVV_ID)";
223
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
223
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
224 224
 
225 225
 
226 226
 
227
-		$table_name='esp_extra_meta';
228
-		$sql="EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
227
+		$table_name = 'esp_extra_meta';
228
+		$sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
229 229
 				OBJ_ID INT(11) DEFAULT NULL,
230 230
 				EXM_type VARCHAR(45) DEFAULT NULL,
231 231
 				EXM_key VARCHAR(45) DEFAULT NULL,
232 232
 				EXM_value TEXT,
233 233
 				PRIMARY KEY  (EXM_ID)";
234
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
234
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
235 235
 
236
-		$table_name='esp_line_item';
237
-		$sql="LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
236
+		$table_name = 'esp_line_item';
237
+		$sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
238 238
 				LIN_code VARCHAR(245) NOT NULL DEFAULT '',
239 239
 				TXN_ID INT(11) DEFAULT NULL,
240 240
 				LIN_name VARCHAR(245) NOT NULL DEFAULT '',
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 				OBJ_ID INT(11) DEFAULT NULL,
251 251
 				OBJ_type VARCHAR(45)DEFAULT NULL,
252 252
 				PRIMARY KEY  (LIN_ID)";
253
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB' );
253
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
254 254
 
255 255
 		$table_name = 'esp_log';
256 256
 		$sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT,
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 					KEY GRP_ID (GRP_ID)";
274 274
 		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
275 275
 
276
-		$this->_get_table_manager()->dropIndex( 'esp_message_template_group', 'EVT_ID' );
276
+		$this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID');
277 277
 
278 278
 		$table_name = 'esp_message_template_group';
279 279
 		$sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 					MTP_is_active TINYINT(1) NOT NULL DEFAULT '1',
289 289
 					PRIMARY KEY  (GRP_ID),
290 290
 					KEY MTP_user_id (MTP_user_id)";
291
-		$this->_table_should_exist_previously( $table_name, $sql, 'ENGINE=InnoDB');
291
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
292 292
 
293 293
 		$table_name = 'esp_event_message_template';
294 294
 		$sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 					PRIMARY KEY  (EMT_ID),
298 298
 					KEY EVT_ID (EVT_ID),
299 299
 					KEY GRP_ID (GRP_ID)";
300
-		$this->_table_should_exist_previously( $table_name, $sql, 'ENGINE=InnoDB');
300
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
301 301
 
302 302
 
303 303
 		$table_name = 'esp_payment';
@@ -365,8 +365,8 @@  discard block
 block discarded – undo
365 365
 					  PRIMARY KEY  (TTM_ID)";
366 366
 		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
367 367
 
368
-		$table_name='esp_question';
369
-		$sql='QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
368
+		$table_name = 'esp_question';
369
+		$sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
370 370
 					QST_display_text TEXT NOT NULL,
371 371
 					QST_admin_label VARCHAR(255) NOT NULL,
372 372
 					QST_system VARCHAR(25) DEFAULT NULL,
@@ -378,27 +378,27 @@  discard block
 block discarded – undo
378 378
 					QST_wp_user BIGINT UNSIGNED NULL,
379 379
 					QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0,
380 380
 					PRIMARY KEY  (QST_ID)';
381
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
381
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
382 382
 
383
-		$table_name='esp_question_group_question';
384
-		$sql="QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
383
+		$table_name = 'esp_question_group_question';
384
+		$sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
385 385
 					QSG_ID INT UNSIGNED NOT NULL,
386 386
 					QST_ID INT UNSIGNED NOT NULL,
387 387
 					QGQ_order INT UNSIGNED NOT NULL DEFAULT 0,
388 388
 					PRIMARY KEY  (QGQ_ID) ";
389
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
389
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
390 390
 
391 391
 
392 392
 
393
-		$table_name='esp_question_option';
394
-		$sql="QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
393
+		$table_name = 'esp_question_option';
394
+		$sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
395 395
 					QSO_value VARCHAR(255) NOT NULL,
396 396
 					QSO_desc TEXT NOT NULL,
397 397
 					QST_ID INT UNSIGNED NOT NULL,
398 398
 					QSO_order INT UNSIGNED NOT NULL DEFAULT 0,
399 399
 					QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
400 400
 					PRIMARY KEY  (QSO_ID)";
401
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
401
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
402 402
 
403 403
 
404 404
 
@@ -431,8 +431,8 @@  discard block
 block discarded – undo
431 431
 
432 432
 
433 433
 
434
-		$table_name='esp_checkin';
435
-		$sql="CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
434
+		$table_name = 'esp_checkin';
435
+		$sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
436 436
 					REG_ID INT(10) UNSIGNED NOT NULL,
437 437
 					DTT_ID INT(10) UNSIGNED NOT NULL,
438 438
 					CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1,
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 					  PRC_wp_user BIGINT UNSIGNED NULL,
522 522
 					  PRC_parent INT(10) UNSIGNED DEFAULT 0,
523 523
 					  PRIMARY KEY  (PRC_ID)";
524
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
524
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
525 525
 
526 526
 		$table_name = "esp_price_type";
527 527
 		$sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -558,12 +558,12 @@  discard block
 block discarded – undo
558 558
 					  TKT_parent INT(10) UNSIGNED DEFAULT '0',
559 559
 					  TKT_deleted TINYINT(1) NOT NULL DEFAULT '0',
560 560
 					  PRIMARY KEY  (TKT_ID)";
561
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
561
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
562 562
 
563
-		$this->_get_table_manager()->dropIndex( 'esp_question_group', 'QSG_identifier_UNIQUE' );
563
+		$this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE');
564 564
 
565 565
 		$table_name = 'esp_question_group';
566
-		$sql='QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
566
+		$sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
567 567
 					QSG_name VARCHAR(255) NOT NULL,
568 568
 					QSG_identifier VARCHAR(100) NOT NULL,
569 569
 					QSG_desc TEXT NULL,
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
 					QSG_wp_user BIGINT UNSIGNED NULL,
576 576
 					PRIMARY KEY  (QSG_ID),
577 577
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)';
578
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
578
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
579 579
 
580 580
 		/** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */
581 581
 		$script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
@@ -603,15 +603,15 @@  discard block
 block discarded – undo
603 603
 		return true;
604 604
 	}
605 605
 
606
-	public function migration_page_hooks(){
606
+	public function migration_page_hooks() {
607 607
 
608 608
 	}
609 609
 
610
-	public function add_default_admin_only_payments(){
610
+	public function add_default_admin_only_payments() {
611 611
 		global $wpdb;
612 612
 		$table_name = $wpdb->prefix."esp_payment_method";
613 613
 		$user_id = EEH_Activation::get_default_creator_id();
614
-		if ( $this->_get_table_analysis()->tableExists( $table_name ) ) {
614
+		if ($this->_get_table_analysis()->tableExists($table_name)) {
615 615
 
616 616
 			$SQL = "SELECT COUNT( * ) FROM $table_name";
617 617
 			$existing_payment_methods = $wpdb->get_var($SQL);
@@ -632,11 +632,11 @@  discard block
 block discarded – undo
632 632
 			//so admins can record payments for them from the admin page
633 633
 
634 634
 
635
-			foreach($default_admin_only_payment_methods as $nicename => $description){
635
+			foreach ($default_admin_only_payment_methods as $nicename => $description) {
636 636
 				$slug = sanitize_key($nicename);
637 637
 			//check that such a payment method exists
638
-				$exists = $wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $table_name WHERE PMD_slug = %s",$slug));
639
-				if( ! $exists){
638
+				$exists = $wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $table_name WHERE PMD_slug = %s", $slug));
639
+				if ( ! $exists) {
640 640
 					$values = array(
641 641
 								'PMD_type'=>'Admin_Only',
642 642
 								'PMD_name'=>$nicename,
@@ -650,17 +650,17 @@  discard block
 block discarded – undo
650 650
 							$table_name,
651 651
 							$values,
652 652
 							array(
653
-								'%s',//PMD_type
654
-								'%s',//PMD_name
655
-								'%s',//PMD_admin_name
656
-								'%s',//PMD_admin_desc
657
-								'%s',//PMD_slug
658
-								'%d',//PMD_wp_user
659
-								'%s',//PMD_scope
653
+								'%s', //PMD_type
654
+								'%s', //PMD_name
655
+								'%s', //PMD_admin_name
656
+								'%s', //PMD_admin_desc
657
+								'%s', //PMD_slug
658
+								'%d', //PMD_wp_user
659
+								'%s', //PMD_scope
660 660
 							)
661 661
 							);
662
-					if( ! $success ){
663
-						$this->add_error(sprintf(__("Could not insert new admin-only payment method with values %s during migration", "event_espresso"),$this->_json_encode($values)));
662
+					if ( ! $success) {
663
+						$this->add_error(sprintf(__("Could not insert new admin-only payment method with values %s during migration", "event_espresso"), $this->_json_encode($values)));
664 664
 					}
665 665
 				}
666 666
 			}
@@ -678,11 +678,11 @@  discard block
 block discarded – undo
678 678
 
679 679
 		global $wpdb;
680 680
 		$currency_table = $wpdb->prefix."esp_currency";
681
-		if ( $this->_get_table_analysis()->tableExists( $currency_table ) ) {
681
+		if ($this->_get_table_analysis()->tableExists($currency_table)) {
682 682
 
683 683
 			$SQL = "SELECT COUNT('CUR_code') FROM $currency_table";
684 684
 			$countries = $wpdb->get_var($SQL);
685
-			if ( ! $countries ) {
685
+			if ( ! $countries) {
686 686
 				$SQL = "INSERT INTO $currency_table
687 687
 				( CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active) VALUES
688 688
 				( 'EUR',  'Euro',  'Euros',  '€',  2,1),
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_8_0.dms.php 1 patch
Spacing   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -16,13 +16,13 @@  discard block
 block discarded – undo
16 16
 //(all other times it gets resurrected from a wordpress option)
17 17
 $stages = glob(EE_CORE.'data_migration_scripts/4_8_0_stages/*');
18 18
 $class_to_filepath = array();
19
-foreach($stages as $filepath){
19
+foreach ($stages as $filepath) {
20 20
 	$matches = array();
21
-	preg_match('~4_8_0_stages/(.*).dmsstage.php~',$filepath,$matches);
21
+	preg_match('~4_8_0_stages/(.*).dmsstage.php~', $filepath, $matches);
22 22
 	$class_to_filepath[$matches[1]] = $filepath;
23 23
 }
24 24
 //give addons a chance to autoload their stages too
25
-$class_to_filepath = apply_filters('FHEE__EE_DMS_4_8_0__autoloaded_stages',$class_to_filepath);
25
+$class_to_filepath = apply_filters('FHEE__EE_DMS_4_8_0__autoloaded_stages', $class_to_filepath);
26 26
 EEH_Autoloader::register_autoloader($class_to_filepath);
27 27
 
28 28
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
  * @since                4.6.0
39 39
  *
40 40
  */
41
-class EE_DMS_Core_4_8_0 extends EE_Data_Migration_Script_Base{
41
+class EE_DMS_Core_4_8_0 extends EE_Data_Migration_Script_Base {
42 42
 
43 43
 	/**
44 44
 	 * return EE_DMS_Core_4_8_0
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 	 * @param TableManager  $table_manager
47 47
 	 * @param TableAnalysis $table_analysis
48 48
 	 */
49
-	public function __construct( TableManager $table_manager = null, TableAnalysis $table_analysis = null ) {
49
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) {
50 50
 		$this->_pretty_name = __("Data Migration to Event Espresso 4.8.0.P (for promotions)", "event_espresso");
51 51
 		$this->_priority = 10;
52 52
 		$this->_migration_stages = array(
53 53
 			new EE_DMS_4_8_0_pretax_totals(),
54 54
 			new EE_DMS_4_8_0_event_subtotals(),
55 55
 		);
56
-		parent::__construct( $table_manager, $table_analysis );
56
+		parent::__construct($table_manager, $table_analysis);
57 57
 	}
58 58
 
59 59
 
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
 	 */
69 69
 	public function can_migrate_from_version($version_array) {
70 70
 		$version_string = $version_array['Core'];
71
-		if( $version_string <= '4.8.0' && $version_string >= '4.7.0' ){
71
+		if ($version_string <= '4.8.0' && $version_string >= '4.7.0') {
72 72
 //			echo "$version_string can be migrated from";
73 73
 			return true;
74
-		}elseif( ! $version_string ){
74
+		}elseif ( ! $version_string) {
75 75
 //			echo "no version string provided: $version_string";
76 76
 			//no version string provided... this must be pre 4.3
77
-			return false;//changed mind. dont want people thinking they should migrate yet because they cant
78
-		}else{
77
+			return false; //changed mind. dont want people thinking they should migrate yet because they cant
78
+		} else {
79 79
 //			echo "$version_string doesnt apply";
80 80
 			return false;
81 81
 		}
@@ -96,19 +96,19 @@  discard block
 block discarded – undo
96 96
 	 * @return bool
97 97
 	 */
98 98
 	public function schema_changes_before_migration() {
99
-		require_once( EE_HELPERS . 'EEH_Activation.helper.php' );
100
-		$now_in_mysql = current_time( 'mysql', true );
99
+		require_once(EE_HELPERS.'EEH_Activation.helper.php');
100
+		$now_in_mysql = current_time('mysql', true);
101 101
 
102
-		require_once( EE_HELPERS . 'EEH_Activation.helper.php' );
103
-		$table_name='esp_answer';
104
-		$sql=" ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
102
+		require_once(EE_HELPERS.'EEH_Activation.helper.php');
103
+		$table_name = 'esp_answer';
104
+		$sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
105 105
 					REG_ID int(10) unsigned NOT NULL,
106 106
 					QST_ID int(10) unsigned NOT NULL,
107 107
 					ANS_value text NOT NULL,
108 108
 					PRIMARY KEY  (ANS_ID),
109 109
 					KEY REG_ID (REG_ID),
110 110
 					KEY QST_ID (QST_ID)";
111
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
111
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
112 112
 
113 113
 		$table_name = 'esp_attendee_meta';
114 114
 		$sql = "ATTM_ID int(10) unsigned NOT	NULL AUTO_INCREMENT,
@@ -148,7 +148,7 @@  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' );
151
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
152 152
 
153 153
 		$table_name = 'esp_currency';
154 154
 		$sql = "CUR_code varchar(6) collate utf8_bin NOT NULL,
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 				CUR_dec_plc varchar(1) collate utf8_bin NOT NULL DEFAULT '2',
159 159
 				CUR_active tinyint(1) DEFAULT '0',
160 160
 				PRIMARY KEY  (CUR_code)";
161
-		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' );
161
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
162 162
 
163 163
 
164 164
 		$table_name = 'esp_currency_payment_method';
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 						KEY EVT_ID (EVT_ID),
189 189
 						KEY DTT_is_primary (DTT_is_primary)";
190 190
 
191
-		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' );
191
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
192 192
 
193 193
 		$table_name = 'esp_event_meta';
194 194
 		$sql = "
@@ -207,41 +207,41 @@  discard block
 block discarded – undo
207 207
 			EVT_donations tinyint(1) NULL,
208 208
 			PRIMARY KEY  (EVTM_ID),
209 209
 			KEY EVT_ID (EVT_ID)";
210
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
210
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
211 211
 
212 212
 
213 213
 
214
-		$table_name='esp_event_question_group';
215
-		$sql="EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
214
+		$table_name = 'esp_event_question_group';
215
+		$sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
216 216
 					EVT_ID bigint(20) unsigned NOT NULL,
217 217
 					QSG_ID int(10) unsigned NOT NULL,
218 218
 					EQG_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
219 219
 					PRIMARY KEY  (EQG_ID),
220 220
 					KEY EVT_ID (EVT_ID),
221 221
 					KEY QSG_ID (QSG_ID)";
222
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
222
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
223 223
 
224 224
 
225 225
 
226
-		$table_name='esp_event_venue';
227
-		$sql="EVV_ID int(11) NOT NULL AUTO_INCREMENT,
226
+		$table_name = 'esp_event_venue';
227
+		$sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
228 228
 				EVT_ID bigint(20) unsigned NOT NULL,
229 229
 				VNU_ID bigint(20) unsigned NOT NULL,
230 230
 				EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
231 231
 				PRIMARY KEY  (EVV_ID)";
232
-		$this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB');
232
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
233 233
 
234 234
 
235 235
 
236
-		$table_name='esp_extra_meta';
237
-		$sql="EXM_ID int(11) NOT NULL AUTO_INCREMENT,
236
+		$table_name = 'esp_extra_meta';
237
+		$sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
238 238
 				OBJ_ID int(11) DEFAULT NULL,
239 239
 				EXM_type varchar(45) DEFAULT NULL,
240 240
 				EXM_key varchar(45) DEFAULT NULL,
241 241
 				EXM_value text,
242 242
 				PRIMARY KEY  (EXM_ID),
243 243
 				KEY EXM_type (EXM_type,OBJ_ID,EXM_key)";
244
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
244
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
245 245
 
246 246
 		$table_name = 'esp_extra_join';
247 247
 		$sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT,
@@ -254,8 +254,8 @@  discard block
 block discarded – undo
254 254
 				KEY second_model (EXJ_second_model_name,EXJ_second_model_id)";
255 255
 		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
256 256
 
257
-		$table_name='esp_line_item';
258
-		$sql="LIN_ID int(11) NOT NULL AUTO_INCREMENT,
257
+		$table_name = 'esp_line_item';
258
+		$sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
259 259
 				LIN_code varchar(245) NOT NULL DEFAULT '',
260 260
 				TXN_ID int(11) DEFAULT NULL,
261 261
 				LIN_name varchar(245) NOT NULL DEFAULT '',
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 				PRIMARY KEY  (LIN_ID),
275 275
 				KEY LIN_code (LIN_code(191)),
276 276
 				KEY TXN_ID (TXN_ID)";
277
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB' );
277
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
278 278
 
279 279
 		$table_name = 'esp_log';
280 280
 		$sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT,
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 					MTP_is_active tinyint(1) NOT NULL DEFAULT '1',
314 314
 					PRIMARY KEY  (GRP_ID),
315 315
 					KEY MTP_user_id (MTP_user_id)";
316
-		$this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB');
316
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
317 317
 
318 318
 		$table_name = 'esp_event_message_template';
319 319
 		$sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 					PRIMARY KEY  (EMT_ID),
323 323
 					KEY EVT_ID (EVT_ID),
324 324
 					KEY GRP_ID (GRP_ID)";
325
-		$this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB');
325
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
326 326
 
327 327
 
328 328
 		$table_name = 'esp_payment';
@@ -395,8 +395,8 @@  discard block
 block discarded – undo
395 395
 					  PRIMARY KEY  (TTM_ID)";
396 396
 		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
397 397
 
398
-		$table_name='esp_question';
399
-		$sql='QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
398
+		$table_name = 'esp_question';
399
+		$sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
400 400
 					QST_display_text text NOT NULL,
401 401
 					QST_admin_label varchar(255) NOT NULL,
402 402
 					QST_system varchar(25) NOT NULL DEFAULT "",
@@ -410,22 +410,22 @@  discard block
 block discarded – undo
410 410
 					QST_deleted tinyint(2) unsigned NOT NULL DEFAULT 0,
411 411
 					PRIMARY KEY  (QST_ID),
412 412
 					KEY QST_order (QST_order)';
413
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
413
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
414 414
 
415
-		$table_name='esp_question_group_question';
416
-		$sql="QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
415
+		$table_name = 'esp_question_group_question';
416
+		$sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
417 417
 					QSG_ID int(10) unsigned NOT NULL,
418 418
 					QST_ID int(10) unsigned NOT NULL,
419 419
 					QGQ_order int(10) unsigned NOT NULL DEFAULT 0,
420 420
 					PRIMARY KEY  (QGQ_ID),
421 421
 					KEY QST_ID (QST_ID),
422 422
 					KEY QSG_ID_order (QSG_ID,QGQ_order)";
423
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
423
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
424 424
 
425 425
 
426 426
 
427
-		$table_name='esp_question_option';
428
-		$sql="QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
427
+		$table_name = 'esp_question_option';
428
+		$sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
429 429
 					QSO_value varchar(255) NOT NULL,
430 430
 					QSO_desc text NOT NULL,
431 431
 					QST_ID int(10) unsigned NOT NULL,
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 					PRIMARY KEY  (QSO_ID),
436 436
 					KEY QST_ID (QST_ID),
437 437
 					KEY QSO_order (QSO_order)";
438
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
438
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
439 439
 
440 440
 
441 441
 
@@ -481,8 +481,8 @@  discard block
 block discarded – undo
481 481
 
482 482
 
483 483
 
484
-		$table_name='esp_checkin';
485
-		$sql="CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
484
+		$table_name = 'esp_checkin';
485
+		$sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
486 486
 					REG_ID int(10) unsigned NOT NULL,
487 487
 					DTT_ID int(10) unsigned NOT NULL,
488 488
 					CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1,
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 					  PRC_parent int(10) unsigned DEFAULT 0,
578 578
 					  PRIMARY KEY  (PRC_ID),
579 579
 					  KEY PRT_ID (PRT_ID)";
580
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
580
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
581 581
 
582 582
 		$table_name = "esp_price_type";
583 583
 		$sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
@@ -615,10 +615,10 @@  discard block
 block discarded – undo
615 615
 					  TKT_deleted tinyint(1) NOT NULL DEFAULT '0',
616 616
 					  PRIMARY KEY  (TKT_ID),
617 617
 					  KEY TKT_start_date (TKT_start_date)";
618
-		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' );
618
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
619 619
 
620 620
 		$table_name = 'esp_question_group';
621
-		$sql='QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
621
+		$sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
622 622
 					QSG_name varchar(255) NOT NULL,
623 623
 					QSG_identifier varchar(100) NOT NULL,
624 624
 					QSG_desc text NULL,
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 					PRIMARY KEY  (QSG_ID),
632 632
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier),
633 633
 					KEY QSG_order (QSG_order)';
634
-		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' );
634
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
635 635
 
636 636
 		/** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */
637 637
 		$script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 		return $script_4_7_defaults->schema_changes_after_migration();
668 668
 	}
669 669
 
670
-	public function migration_page_hooks(){
670
+	public function migration_page_hooks() {
671 671
 
672 672
 	}
673 673
 
@@ -681,19 +681,19 @@  discard block
 block discarded – undo
681 681
 		//CNT_ISO, CNT_ISO3, RGN_ID, CNT_name, CNT_cur_code, CNT_cur_single, CNT_cur_plural, CNT_cur_sign, CNT_cur_sign_b4, CNT_cur_dec_plc, CNT_tel_code, CNT_is_EU, CNT_active
682 682
 		//('AD', 'AND', 0, 'Andorra', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+376', 0, 0),
683 683
 		$newer_countries = array(
684
-			array( 'AX', 'ALA', 0, 'Alan Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0 ),
685
-			array( 'BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0 ),
686
-			array( 'CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0 ),
687
-			array( 'GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0 ),
688
-			array( 'IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2,  '+44', 0, 0  ),
689
-			array( 'JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0 ),
690
-			array( 'MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0 ),
691
-			array( 'ME', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1,  2, '+382', 0, 0 ),
692
-			array( 'RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+941', 1, 0 ),
693
-			array( 'SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0 ),
694
-			array( 'SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0 ),
695
-			array( 'XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+381', 0, 0 ),
696
-			array( 'YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0 ),
684
+			array('AX', 'ALA', 0, 'Alan Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0),
685
+			array('BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0),
686
+			array('CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0),
687
+			array('GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0),
688
+			array('IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0),
689
+			array('JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0),
690
+			array('MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0),
691
+			array('ME', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+382', 0, 0),
692
+			array('RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+941', 1, 0),
693
+			array('SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0),
694
+			array('SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0),
695
+			array('XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+381', 0, 0),
696
+			array('YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0),
697 697
 		);
698 698
 		global $wpdb;
699 699
 		$country_table = $wpdb->prefix."esp_country";
@@ -712,14 +712,14 @@  discard block
 block discarded – undo
712 712
 							"CNT_is_EU" => '%d',
713 713
 							"CNT_active" => '%d',
714 714
 						);
715
-		if ( $this->_get_table_analysis()->tableExists( $country_table ) ) {
716
-			foreach( $newer_countries as $country ) {
717
-				$SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1" ;
715
+		if ($this->_get_table_analysis()->tableExists($country_table)) {
716
+			foreach ($newer_countries as $country) {
717
+				$SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1";
718 718
 				$countries = $wpdb->get_var($SQL);
719
-				if ( ! $countries ) {
719
+				if ( ! $countries) {
720 720
 
721
-					$wpdb->insert( $country_table,
722
-							array_combine( array_keys( $country_format), $country ),
721
+					$wpdb->insert($country_table,
722
+							array_combine(array_keys($country_format), $country),
723 723
 							$country_format
724 724
 							);
725 725
 				}
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
 		// CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active
738 738
 		//( 'EUR',  'Euro',  'Euros',  '€',  2,1),
739 739
 		$newer_currencies = array(
740
-			array( 'RSD', 'Dinar', 'Dinars', '', 3, 1 ),
740
+			array('RSD', 'Dinar', 'Dinars', '', 3, 1),
741 741
 		);
742 742
 		global $wpdb;
743 743
 		$currency_table = $wpdb->prefix."esp_currency";
@@ -749,14 +749,14 @@  discard block
 block discarded – undo
749 749
 							"CUR_dec_plc" => '%d',
750 750
 							"CUR_active" => '%d',
751 751
 						);
752
-		if ( $this->_get_table_analysis()->tableExists( $currency_table ) ) {
753
-			foreach( $newer_currencies as $currency ) {
754
-				$SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1" ;
752
+		if ($this->_get_table_analysis()->tableExists($currency_table)) {
753
+			foreach ($newer_currencies as $currency) {
754
+				$SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1";
755 755
 				$countries = $wpdb->get_var($SQL);
756
-				if ( ! $countries ) {
756
+				if ( ! $countries) {
757 757
 
758
-					$wpdb->insert( $currency_table,
759
-							array_combine( array_keys( $currency_format), $currency ),
758
+					$wpdb->insert($currency_table,
759
+							array_combine(array_keys($currency_format), $currency),
760 760
 							$currency_format
761 761
 							);
762 762
 				}
@@ -768,9 +768,9 @@  discard block
 block discarded – undo
768 768
 	 * which should just be a temporary issue for folks who installed 4.8.0-4.8.5;
769 769
 	 * we should be able to stop doing this in 4.9
770 770
 	 */
771
-	public function fix_non_default_taxes(){
771
+	public function fix_non_default_taxes() {
772 772
 		global $wpdb;
773
-		$query = $wpdb->prepare( "UPDATE
773
+		$query = $wpdb->prepare("UPDATE
774 774
 				{$wpdb->prefix}esp_price p INNER JOIN
775 775
 				{$wpdb->prefix}esp_price_type pt ON p.PRT_ID = pt.PRT_ID
776 776
 			SET
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
 			WHERE
779 779
 				p.PRC_is_default = 0 AND
780 780
 				pt.PBT_ID = %d
781
-					", EEM_Price_Type::base_type_tax );
782
-		$wpdb->query( $query );
781
+					", EEM_Price_Type::base_type_tax);
782
+		$wpdb->query($query);
783 783
 	}
784 784
 }
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_3_0.dms.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -13,18 +13,18 @@  discard block
 block discarded – undo
13 13
 //(all other times it gets resurrected from a wordpress option)
14 14
 $stages = glob(EE_CORE.'data_migration_scripts/4_3_0_stages/*');
15 15
 $class_to_filepath = array();
16
-if ( ! empty( $stages ) ) {
17
-	foreach($stages as $filepath){
16
+if ( ! empty($stages)) {
17
+	foreach ($stages as $filepath) {
18 18
 		$matches = array();
19
-		preg_match('~4_3_0_stages/(.*).dmsstage.php~',$filepath,$matches);
19
+		preg_match('~4_3_0_stages/(.*).dmsstage.php~', $filepath, $matches);
20 20
 		$class_to_filepath[$matches[1]] = $filepath;
21 21
 	}
22 22
 }
23 23
 //give addons a chance to autoload their stages too
24
-$class_to_filepath = apply_filters('FHEE__EE_DMS_4_3_0__autoloaded_stages',$class_to_filepath);
24
+$class_to_filepath = apply_filters('FHEE__EE_DMS_4_3_0__autoloaded_stages', $class_to_filepath);
25 25
 EEH_Autoloader::register_autoloader($class_to_filepath);
26 26
 
27
-class EE_DMS_Core_4_3_0 extends EE_Data_Migration_Script_Base{
27
+class EE_DMS_Core_4_3_0 extends EE_Data_Migration_Script_Base {
28 28
 
29 29
 
30 30
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @param TableManager  $table_manager
35 35
 	 * @param TableAnalysis $table_analysis
36 36
 	 */
37
-	public function __construct( TableManager $table_manager = null, TableAnalysis $table_analysis = null ) {
37
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) {
38 38
 		$this->_pretty_name = __("Data Migration to Event Espresso 4.3.0.P", "event_espresso");
39 39
 		$this->_priority = 10;
40 40
 		$this->_migration_stages = array(
@@ -42,18 +42,18 @@  discard block
 block discarded – undo
42 42
 			new EE_DMS_4_3_0_event_message_templates(),
43 43
 			new EE_DMS_4_3_0_critical_page_shortcode_tracking()
44 44
 		);
45
-		parent::__construct( $table_manager, $table_analysis );
45
+		parent::__construct($table_manager, $table_analysis);
46 46
 	}
47 47
 	public function can_migrate_from_version($version_array) {
48 48
 		$version_string = $version_array['Core'];
49
-		if($version_string <= '4.3.0' && $version_string >= '4.2.0' ){
49
+		if ($version_string <= '4.3.0' && $version_string >= '4.2.0') {
50 50
 //			echo "$version_string can be migrated fro";
51 51
 			return true;
52
-		}elseif( ! $version_string ){
52
+		}elseif ( ! $version_string) {
53 53
 //			echo "no version string provided: $version_string";
54 54
 			//no version string provided... this must be pre 4.2
55
-			return false;//changed mind. dont want people thinking they should migrate yet because they cant
56
-		}else{
55
+			return false; //changed mind. dont want people thinking they should migrate yet because they cant
56
+		} else {
57 57
 //			echo "$version_string doesnt apply";
58 58
 			return false;
59 59
 		}
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
 	}
64 64
 	public function schema_changes_before_migration() {
65 65
 		//relies on 4.1's EEH_Activation::create_table
66
-		require_once( EE_HELPERS . 'EEH_Activation.helper.php' );
67
-		$table_name='esp_answer';
68
-		$sql=" ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
66
+		require_once(EE_HELPERS.'EEH_Activation.helper.php');
67
+		$table_name = 'esp_answer';
68
+		$sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
69 69
 					REG_ID INT UNSIGNED NOT NULL,
70 70
 					QST_ID INT UNSIGNED NOT NULL,
71 71
 					ANS_value TEXT NOT NULL,
72 72
 					PRIMARY KEY  (ANS_ID)";
73
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
73
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
74 74
 
75 75
 		$table_name = 'esp_attendee_meta';
76 76
 		$sql = "ATTM_ID INT(10) UNSIGNED NOT	NULL AUTO_INCREMENT,
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 					  CNT_is_EU TINYINT(1) DEFAULT '0',
110 110
 					  CNT_active TINYINT(1) DEFAULT '0',
111 111
 					  PRIMARY KEY  (CNT_ISO)";
112
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
112
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
113 113
 
114 114
 
115 115
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
 
134 134
 
135
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
135
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
136 136
 		$table_name = 'esp_event_meta';
137 137
 		$sql = "
138 138
 			EVTM_ID INT NOT NULL AUTO_INCREMENT,
@@ -149,41 +149,41 @@  discard block
 block discarded – undo
149 149
 			EVT_external_URL VARCHAR(200) NULL,
150 150
 			EVT_donations TINYINT(1) NULL,
151 151
 			PRIMARY KEY  (EVTM_ID)";
152
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
152
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
153 153
 
154 154
 
155 155
 
156
-		$table_name='esp_event_question_group';
157
-		$sql="EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
156
+		$table_name = 'esp_event_question_group';
157
+		$sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
158 158
 					EVT_ID BIGINT(20) UNSIGNED NOT NULL,
159 159
 					QSG_ID INT UNSIGNED NOT NULL,
160 160
 					EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
161 161
 					PRIMARY KEY  (EQG_ID)";
162
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
162
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
163 163
 
164 164
 
165 165
 
166
-		$table_name='esp_event_venue';
167
-		$sql="EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
166
+		$table_name = 'esp_event_venue';
167
+		$sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
168 168
 				EVT_ID BIGINT(20) UNSIGNED NOT NULL,
169 169
 				VNU_ID BIGINT(20) UNSIGNED NOT NULL,
170 170
 				EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
171 171
 				PRIMARY KEY  (EVV_ID)";
172
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
172
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
173 173
 
174 174
 
175 175
 
176
-		$table_name='esp_extra_meta';
177
-		$sql="EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
176
+		$table_name = 'esp_extra_meta';
177
+		$sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
178 178
 				OBJ_ID INT(11) DEFAULT NULL,
179 179
 				EXM_type VARCHAR(45) DEFAULT NULL,
180 180
 				EXM_key VARCHAR(45) DEFAULT NULL,
181 181
 				EXM_value TEXT,
182 182
 				PRIMARY KEY  (EXM_ID)";
183
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
183
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
184 184
 
185
-		$table_name='esp_line_item';
186
-		$sql="LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
185
+		$table_name = 'esp_line_item';
186
+		$sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
187 187
 				LIN_code VARCHAR(245) NOT NULL DEFAULT '',
188 188
 				TXN_ID INT(11) DEFAULT NULL,
189 189
 				LIN_name VARCHAR(245) NOT NULL DEFAULT '',
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 				OBJ_ID INT(11) DEFAULT NULL,
200 200
 				OBJ_type VARCHAR(45)DEFAULT NULL,
201 201
 				PRIMARY KEY  (LIN_ID)";
202
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB' );
202
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
203 203
 
204 204
 		$table_name = 'esp_message_template';
205 205
 		$sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 					KEY GRP_ID (GRP_ID)";
212 212
 		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
213 213
 
214
-		$this->_get_table_manager()->dropIndex( 'esp_message_template_group', 'EVT_ID' );
214
+		$this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID');
215 215
 
216 216
 		$table_name = 'esp_message_template_group';
217 217
 		$sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 					MTP_is_active TINYINT(1) NOT NULL DEFAULT '1',
227 227
 					PRIMARY KEY  (GRP_ID),
228 228
 					KEY MTP_user_id (MTP_user_id)";
229
-		$this->_table_should_exist_previously( $table_name, $sql, 'ENGINE=InnoDB');
229
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
230 230
 
231 231
 		$table_name = 'esp_event_message_template';
232 232
 		$sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 					PRIMARY KEY  (EMT_ID),
236 236
 					KEY EVT_ID (EVT_ID),
237 237
 					KEY GRP_ID (GRP_ID)";
238
-		$this->_table_is_new_in_this_version( $table_name, $sql, 'ENGINE=InnoDB');
238
+		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
239 239
 
240 240
 
241 241
 
@@ -344,8 +344,8 @@  discard block
 block discarded – undo
344 344
 
345 345
 
346 346
 
347
-		$table_name='esp_question';
348
-		$sql='QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
347
+		$table_name = 'esp_question';
348
+		$sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
349 349
 					QST_display_text TEXT NOT NULL,
350 350
 					QST_admin_label VARCHAR(255) NOT NULL,
351 351
 					QST_system VARCHAR(25) DEFAULT NULL,
@@ -357,12 +357,12 @@  discard block
 block discarded – undo
357 357
 					QST_wp_user BIGINT UNSIGNED NULL,
358 358
 					QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0,
359 359
 					PRIMARY KEY  (QST_ID)';
360
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
360
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
361 361
 
362
-		$this->_get_table_manager()->dropIndex( 'esp_question_group', 'QSG_identifier_UNIQUE' );
362
+		$this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE');
363 363
 
364 364
 		$table_name = 'esp_question_group';
365
-		$sql='QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
365
+		$sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
366 366
 					QSG_name VARCHAR(255) NOT NULL,
367 367
 					QSG_identifier VARCHAR(100) NOT NULL,
368 368
 					QSG_desc TEXT NULL,
@@ -373,29 +373,29 @@  discard block
 block discarded – undo
373 373
 					QSG_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
374 374
 					PRIMARY KEY  (QSG_ID),
375 375
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)';
376
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
376
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
377 377
 
378 378
 
379 379
 
380
-		$table_name='esp_question_group_question';
381
-		$sql="QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
380
+		$table_name = 'esp_question_group_question';
381
+		$sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
382 382
 					QSG_ID INT UNSIGNED NOT NULL,
383 383
 					QST_ID INT UNSIGNED NOT NULL,
384 384
 					QGQ_order INT UNSIGNED NOT NULL DEFAULT 0,
385 385
 					PRIMARY KEY  (QGQ_ID) ";
386
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
386
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
387 387
 
388 388
 
389 389
 
390
-		$table_name='esp_question_option';
391
-		$sql="QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
390
+		$table_name = 'esp_question_option';
391
+		$sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
392 392
 					QSO_value VARCHAR(255) NOT NULL,
393 393
 					QSO_desc TEXT NOT NULL,
394 394
 					QST_ID INT UNSIGNED NOT NULL,
395 395
 					QSO_order INT UNSIGNED NOT NULL DEFAULT 0,
396 396
 					QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
397 397
 					PRIMARY KEY  (QSO_ID)";
398
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
398
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
399 399
 
400 400
 
401 401
 
@@ -428,8 +428,8 @@  discard block
 block discarded – undo
428 428
 
429 429
 
430 430
 
431
-		$table_name='esp_checkin';
432
-		$sql="CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
431
+		$table_name = 'esp_checkin';
432
+		$sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
433 433
 					REG_ID INT(10) UNSIGNED NOT NULL,
434 434
 					DTT_ID INT(10) UNSIGNED NOT NULL,
435 435
 					CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1,
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
504 504
 
505 505
 
506
-		$script_with_defaults = EE_Registry::instance()->load_dms( 'Core_4_1_0' );
506
+		$script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
507 507
 		//setting up the DEFAULT stats and countries is also essential for the data migrations to run
508 508
 		//(because many need to convert old string states to foreign keys into the states table)
509 509
 		$script_with_defaults->insert_default_states();
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 		return true;
526 526
 	}
527 527
 
528
-	public function migration_page_hooks(){
528
+	public function migration_page_hooks() {
529 529
 
530 530
 	}
531 531
 
@@ -541,34 +541,34 @@  discard block
 block discarded – undo
541 541
 
542 542
 		global $wpdb;
543 543
 		$ticket_table = $wpdb->prefix."esp_ticket";
544
-		if ( $this->_get_table_analysis()->tableExists( $ticket_table ) ) {
544
+		if ($this->_get_table_analysis()->tableExists($ticket_table)) {
545 545
 
546
-			$SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table;
546
+			$SQL = 'SELECT COUNT(TKT_ID) FROM '.$ticket_table;
547 547
 			$tickets_exist = $wpdb->get_var($SQL);
548 548
 
549
-			if ( ! $tickets_exist ) {
549
+			if ( ! $tickets_exist) {
550 550
 				$SQL = "INSERT INTO $ticket_table
551 551
 					( TKT_ID, TTM_ID, TKT_name, TKT_description, TKT_qty, TKT_sold, TKT_uses, TKT_required, TKT_min, TKT_max, TKT_price, TKT_start_date, TKT_end_date, TKT_taxable, TKT_order, TKT_row, TKT_is_default, TKT_parent, TKT_deleted ) VALUES
552
-					( 1, 0, '" . __("Free Ticket", "event_espresso") . "', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, 0);";
553
-				$SQL = apply_filters( 'FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL', $SQL );
552
+					( 1, 0, '".__("Free Ticket", "event_espresso")."', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, 0);";
553
+				$SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL', $SQL);
554 554
 				$wpdb->query($SQL);
555 555
 			}
556 556
 		}
557 557
 		$ticket_price_table = $wpdb->prefix."esp_ticket_price";
558 558
 
559
-		if ( $this->_get_table_analysis()->tableExists( $ticket_price_table ) ) {
559
+		if ($this->_get_table_analysis()->tableExists($ticket_price_table)) {
560 560
 
561
-			$SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table;
561
+			$SQL = 'SELECT COUNT(TKP_ID) FROM '.$ticket_price_table;
562 562
 			$ticket_prc_exist = $wpdb->get_var($SQL);
563 563
 
564
-			if ( ! $ticket_prc_exist ) {
564
+			if ( ! $ticket_prc_exist) {
565 565
 
566 566
 				$SQL = "INSERT INTO $ticket_price_table
567 567
 				( TKP_ID, TKT_ID, PRC_ID ) VALUES
568 568
 				( 1, 1, 1 )
569 569
 				";
570 570
 
571
-				$SQL = apply_filters( 'FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL__ticket_price', $SQL );
571
+				$SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL__ticket_price', $SQL);
572 572
 				$wpdb->query($SQL);
573 573
 			}
574 574
 		}
Please login to merge, or discard this patch.
core/db_models/EEM_Registration.model.php 2 patches
Spacing   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -106,32 +106,32 @@  discard block
 block discarded – undo
106 106
 	 * @param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved).
107 107
 	 *    Note this just sends the timezone info to the date time model field objects.  Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option)
108 108
 	 */
109
-	protected function __construct( $timezone = null ) {
110
-		$this->_table_analysis = EE_Registry::instance()->create( 'TableAnalysis', array(), true );
111
-		$this->singular_item = __('Registration','event_espresso');
112
-		$this->plural_item = __('Registrations','event_espresso');
109
+	protected function __construct($timezone = null) {
110
+		$this->_table_analysis = EE_Registry::instance()->create('TableAnalysis', array(), true);
111
+		$this->singular_item = __('Registration', 'event_espresso');
112
+		$this->plural_item = __('Registrations', 'event_espresso');
113 113
 
114 114
 		$this->_tables = array(
115
-			'Registration'=>new EE_Primary_Table('esp_registration','REG_ID')
115
+			'Registration'=>new EE_Primary_Table('esp_registration', 'REG_ID')
116 116
 		);
117 117
 		$this->_fields = array(
118 118
 			'Registration'=>array(
119
-				'REG_ID'=>new EE_Primary_Key_Int_Field('REG_ID', __('Registration ID','event_espresso')),
120
-				'EVT_ID'=>new EE_Foreign_Key_Int_Field('EVT_ID', __('Event ID','event_espresso'), false, 0, 'Event'),
121
-				'ATT_ID'=>new EE_Foreign_Key_Int_Field('ATT_ID', __('Attendee ID','event_espresso'), false, 0, 'Attendee'),
122
-				'TXN_ID'=>new EE_Foreign_Key_Int_Field('TXN_ID', __('Transaction ID','event_espresso'), false, 0, 'Transaction'),
123
-				'TKT_ID'=>new EE_Foreign_Key_Int_Field('TKT_ID', __('Ticket ID','event_espresso'), false, 0, 'Ticket'),
124
-				'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID','event_espresso'), false, EEM_Registration::status_id_incomplete, 'Status'),
125
-				'REG_date'=>new EE_Datetime_Field('REG_date', __('Time registration occurred','event_espresso'), false, EE_Datetime_Field::now, $timezone ),
126
-				'REG_final_price'=>new EE_Money_Field('REG_final_price', __('Registration\'s share of the transaction total','event_espresso'), false, 0),
127
-				'REG_paid'=>new EE_Money_Field('REG_paid', __('Amount paid to date towards registration','event_espresso'), false, 0),
128
-				'REG_session'=>new EE_Plain_Text_Field('REG_session', __('Session ID of registration','event_espresso'), false, ''),
129
-				'REG_code'=>new EE_Plain_Text_Field('REG_code', __('Unique Code for this registration','event_espresso'), false, ''),
130
-				'REG_url_link'=>new EE_Plain_Text_Field('REG_url_link', __('String to be used in URL for identifying registration','event_espresso'), false, ''),
131
-				'REG_count'=>new EE_Integer_Field('REG_count', __('Count of this registration in the group registration ','event_espresso'), true, 1),
132
-				'REG_group_size'=>new EE_Integer_Field('REG_group_size', __('Number of registrations on this group','event_espresso'), false, 1),
133
-				'REG_att_is_going'=>new EE_Boolean_Field('REG_att_is_going', __('Flag indicating the registrant plans on attending','event_espresso'), false, false),
134
-				'REG_deleted' => new EE_Trashed_Flag_Field('REG_deleted', __('Flag indicating if registration has been archived or not.', 'event_espresso'), false, false )
119
+				'REG_ID'=>new EE_Primary_Key_Int_Field('REG_ID', __('Registration ID', 'event_espresso')),
120
+				'EVT_ID'=>new EE_Foreign_Key_Int_Field('EVT_ID', __('Event ID', 'event_espresso'), false, 0, 'Event'),
121
+				'ATT_ID'=>new EE_Foreign_Key_Int_Field('ATT_ID', __('Attendee ID', 'event_espresso'), false, 0, 'Attendee'),
122
+				'TXN_ID'=>new EE_Foreign_Key_Int_Field('TXN_ID', __('Transaction ID', 'event_espresso'), false, 0, 'Transaction'),
123
+				'TKT_ID'=>new EE_Foreign_Key_Int_Field('TKT_ID', __('Ticket ID', 'event_espresso'), false, 0, 'Ticket'),
124
+				'STS_ID'=>new EE_Foreign_Key_String_Field('STS_ID', __('Status ID', 'event_espresso'), false, EEM_Registration::status_id_incomplete, 'Status'),
125
+				'REG_date'=>new EE_Datetime_Field('REG_date', __('Time registration occurred', 'event_espresso'), false, EE_Datetime_Field::now, $timezone),
126
+				'REG_final_price'=>new EE_Money_Field('REG_final_price', __('Registration\'s share of the transaction total', 'event_espresso'), false, 0),
127
+				'REG_paid'=>new EE_Money_Field('REG_paid', __('Amount paid to date towards registration', 'event_espresso'), false, 0),
128
+				'REG_session'=>new EE_Plain_Text_Field('REG_session', __('Session ID of registration', 'event_espresso'), false, ''),
129
+				'REG_code'=>new EE_Plain_Text_Field('REG_code', __('Unique Code for this registration', 'event_espresso'), false, ''),
130
+				'REG_url_link'=>new EE_Plain_Text_Field('REG_url_link', __('String to be used in URL for identifying registration', 'event_espresso'), false, ''),
131
+				'REG_count'=>new EE_Integer_Field('REG_count', __('Count of this registration in the group registration ', 'event_espresso'), true, 1),
132
+				'REG_group_size'=>new EE_Integer_Field('REG_group_size', __('Number of registrations on this group', 'event_espresso'), false, 1),
133
+				'REG_att_is_going'=>new EE_Boolean_Field('REG_att_is_going', __('Flag indicating the registrant plans on attending', 'event_espresso'), false, false),
134
+				'REG_deleted' => new EE_Trashed_Flag_Field('REG_deleted', __('Flag indicating if registration has been archived or not.', 'event_espresso'), false, false)
135 135
 			)
136 136
 		);
137 137
 		$this->_model_relations = array(
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
 			'Answer'=>new EE_Has_Many_Relation(),
144 144
 			'Checkin'=>new EE_Has_Many_Relation(),
145 145
 			'Registration_Payment' => new EE_Has_Many_Relation(),
146
-			'Payment'=>new EE_HABTM_Relation( 'Registration_Payment' ),
147
-			'Message' => new EE_Has_Many_Any_Relation( false ) //allow deletes even if there are messages in the queue related
146
+			'Payment'=>new EE_HABTM_Relation('Registration_Payment'),
147
+			'Message' => new EE_Has_Many_Any_Relation(false) //allow deletes even if there are messages in the queue related
148 148
 		);
149 149
 		$this->_model_chain_to_wp_user = 'Event';
150 150
 
151
-		parent::__construct( $timezone );
151
+		parent::__construct($timezone);
152 152
 	}
153 153
 
154 154
 
@@ -243,9 +243,9 @@  discard block
 block discarded – undo
243 243
 	 *		@param bool  $translated If true will return the values as singular localized strings
244 244
 	 *		@return array
245 245
 	 */
246
-	public static function reg_status_array( $exclude = array(), $translated = FALSE ) {
247
-		EEM_Registration::instance()->_get_registration_status_array( $exclude );
248
-		return $translated ? EEM_Status::instance()->localized_status( self::$_reg_status, FALSE, 'sentence') : self::$_reg_status;
246
+	public static function reg_status_array($exclude = array(), $translated = FALSE) {
247
+		EEM_Registration::instance()->_get_registration_status_array($exclude);
248
+		return $translated ? EEM_Status::instance()->localized_status(self::$_reg_status, FALSE, 'sentence') : self::$_reg_status;
249 249
 	}
250 250
 
251 251
 
@@ -256,18 +256,18 @@  discard block
 block discarded – undo
256 256
 	 * @param array $exclude
257 257
 	 * @return array
258 258
 	 */
259
-	private function _get_registration_status_array( $exclude = array() ) {
259
+	private function _get_registration_status_array($exclude = array()) {
260 260
 		//in the very rare circumstance that we are deleting a model's table's data
261 261
 		//and the table hasn't actually been created, this could have an error
262 262
 		/** @type WPDB $wpdb */
263 263
 		global $wpdb;
264
-		if( $this->_get_table_analysis()->tableExists( $wpdb->prefix . 'esp_status' ) ){
265
-			$SQL = 'SELECT STS_ID, STS_code FROM '. $wpdb->prefix . 'esp_status WHERE STS_type = "registration"';
266
-			$results = $wpdb->get_results( $SQL );
264
+		if ($this->_get_table_analysis()->tableExists($wpdb->prefix.'esp_status')) {
265
+			$SQL = 'SELECT STS_ID, STS_code FROM '.$wpdb->prefix.'esp_status WHERE STS_type = "registration"';
266
+			$results = $wpdb->get_results($SQL);
267 267
 			self::$_reg_status = array();
268
-			foreach ( $results as $status ) {
269
-				if ( ! in_array( $status->STS_ID, $exclude )) {
270
-					self::$_reg_status[ $status->STS_ID ] = $status->STS_code;
268
+			foreach ($results as $status) {
269
+				if ( ! in_array($status->STS_ID, $exclude)) {
270
+					self::$_reg_status[$status->STS_ID] = $status->STS_code;
271 271
 				}
272 272
 			}
273 273
 		}
@@ -280,13 +280,13 @@  discard block
 block discarded – undo
280 280
 	 * @throws \EE_Error
281 281
 	 */
282 282
 	protected function _get_table_analysis() {
283
-		if( $this->_table_analysis instanceof TableAnalysis ) {
283
+		if ($this->_table_analysis instanceof TableAnalysis) {
284 284
 			return $this->_table_analysis;
285 285
 		} else {
286 286
 			throw new \EE_Error( 
287 287
 				sprintf( 
288
-					__( 'Table analysis class on class %1$s is not set properly.', 'event_espresso'), 
289
-					get_class( $this ) 
288
+					__('Table analysis class on class %1$s is not set properly.', 'event_espresso'), 
289
+					get_class($this) 
290 290
 				) 
291 291
 			);
292 292
 		}
@@ -301,15 +301,15 @@  discard block
 block discarded – undo
301 301
 	 * @return array
302 302
 	 * @throws \EE_Error
303 303
 	 */
304
-	public function get_reg_months_and_years( $where_params ) {
304
+	public function get_reg_months_and_years($where_params) {
305 305
 		$query_params[0] = $where_params;
306 306
 		$query_params['group_by'] = array('reg_year', 'reg_month');
307
-		$query_params['order_by'] = array( 'REG_date' => 'DESC' );
307
+		$query_params['order_by'] = array('REG_date' => 'DESC');
308 308
 		$columns_to_select = array(
309 309
 			'reg_year' => array('YEAR(REG_date)', '%s'),
310 310
 			'reg_month' => array('MONTHNAME(REG_date)', '%s')
311 311
 			);
312
-		return $this->_get_all_wpdb_results( $query_params, OBJECT, $columns_to_select );
312
+		return $this->_get_all_wpdb_results($query_params, OBJECT, $columns_to_select);
313 313
 	}
314 314
 
315 315
 
@@ -321,11 +321,11 @@  discard block
 block discarded – undo
321 321
 	* 		@param		int		$ATT_ID
322 322
 	*		@return 	EE_Registration[]
323 323
 	*/
324
-	public function get_all_registrations_for_attendee( $ATT_ID = 0 ) {
325
-		if ( ! $ATT_ID ) {
324
+	public function get_all_registrations_for_attendee($ATT_ID = 0) {
325
+		if ( ! $ATT_ID) {
326 326
 			return FALSE;
327 327
 		}
328
-		return $this->get_all( array( array( 'ATT_ID' => $ATT_ID )));
328
+		return $this->get_all(array(array('ATT_ID' => $ATT_ID)));
329 329
 	}
330 330
 
331 331
 
@@ -336,8 +336,8 @@  discard block
 block discarded – undo
336 336
 	 * @param string $REG_url_link
337 337
 	 * @return EE_Registration
338 338
 	 */
339
-	public function get_registration_for_reg_url_link($REG_url_link){
340
-		if(!$REG_url_link){
339
+	public function get_registration_for_reg_url_link($REG_url_link) {
340
+		if ( ! $REG_url_link) {
341 341
 			return false;
342 342
 		}
343 343
 		return $this->get_one(array(array('REG_url_link'=>$REG_url_link)));
@@ -355,13 +355,13 @@  discard block
 block discarded – undo
355 355
 	* 		@param    int		$att_nmbr 	in case the ATT_ID is the same for multiple registrations (same details used) then the attendee number is required
356 356
 	*		@return 		mixed		array on success, FALSE on fail
357 357
 	*/
358
-	public function get_registration_for_transaction_attendee( $TXN_ID = 0, $ATT_ID = 0, $att_nmbr = 0 ) {
358
+	public function get_registration_for_transaction_attendee($TXN_ID = 0, $ATT_ID = 0, $att_nmbr = 0) {
359 359
 		return $this->get_one(array(
360 360
 			array(
361 361
 				'TXN_ID'=>$TXN_ID,
362 362
 				'ATT_ID'=>$ATT_ID
363 363
 			),
364
-			'limit'=>array( min( ( $att_nmbr-1 ), 0 ), 1 )
364
+			'limit'=>array(min(($att_nmbr - 1), 0), 1)
365 365
 		));
366 366
 	}
367 367
 
@@ -373,16 +373,16 @@  discard block
 block discarded – undo
373 373
 	 *		@param $period string which can be passed to php's strtotime function (eg "-1 month")
374 374
 	 *		@return stdClass[] with properties regDate and total
375 375
 	*/
376
-	public function get_registrations_per_day_report( $period = '-1 month' ) {
376
+	public function get_registrations_per_day_report($period = '-1 month') {
377 377
 
378
-		$sql_date = $this->convert_datetime_for_query( 'REG_date', date("Y-m-d H:i:s", strtotime($period) ), 'Y-m-d H:i:s', 'UTC' );
379
-		$where = array( 'REG_date' => array( '>=', $sql_date ), 'STS_ID' => array( '!=', EEM_Registration::status_id_incomplete ) );
378
+		$sql_date = $this->convert_datetime_for_query('REG_date', date("Y-m-d H:i:s", strtotime($period)), 'Y-m-d H:i:s', 'UTC');
379
+		$where = array('REG_date' => array('>=', $sql_date), 'STS_ID' => array('!=', EEM_Registration::status_id_incomplete));
380 380
 
381
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_day_report' ) ) {
381
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_day_report')) {
382 382
 			$where['Event.EVT_wp_user'] = get_current_user_id();
383 383
 		}
384 384
 
385
-		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset( $this->get_timezone(), 'REG_date' );
385
+		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset($this->get_timezone(), 'REG_date');
386 386
 
387 387
 		$results = $this->_get_all_wpdb_results(
388 388
 				array(
@@ -392,8 +392,8 @@  discard block
 block discarded – undo
392 392
 				),
393 393
 				OBJECT,
394 394
 				array(
395
-					'regDate'=>array( 'DATE(' . $query_interval . ')','%s'),
396
-					'total'=>array('count(REG_ID)','%d')
395
+					'regDate'=>array('DATE('.$query_interval.')', '%s'),
396
+					'total'=>array('count(REG_ID)', '%d')
397 397
 				));
398 398
 		return $results;
399 399
 	}
@@ -408,22 +408,22 @@  discard block
 block discarded – undo
408 408
 	 * @return stdClass[] with properties Registration_REG_date and a column for each registration status as the STS_ID
409 409
 	 *                    (i.e. RAP)
410 410
 	 */
411
-	public function get_registrations_per_day_and_per_status_report( $period = '-1 month' ) {
411
+	public function get_registrations_per_day_and_per_status_report($period = '-1 month') {
412 412
 		global $wpdb;
413
-		$registration_table = $wpdb->prefix . 'esp_registration';
413
+		$registration_table = $wpdb->prefix.'esp_registration';
414 414
 		$event_table = $wpdb->posts;
415
-		$sql_date = date("Y-m-d H:i:s", strtotime($period) );
415
+		$sql_date = date("Y-m-d H:i:s", strtotime($period));
416 416
 
417 417
 		//prepare the query interval for displaying offset
418
-		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset( $this->get_timezone(), 'dates.REG_date' );
418
+		$query_interval = EEH_DTT_Helper::get_sql_query_interval_for_offset($this->get_timezone(), 'dates.REG_date');
419 419
 
420 420
 		//inner date query
421 421
 		$inner_date_query = "SELECT DISTINCT REG_date from $registration_table ";
422 422
 		$inner_where = " WHERE";
423 423
 		//exclude events not authored by user if permissions in effect
424
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_event_report' ) ) {
424
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_event_report')) {
425 425
 			$inner_date_query .= "LEFT JOIN $event_table ON ID = EVT_ID";
426
-			$inner_where .= " post_author = " . get_current_user_id() . " AND";
426
+			$inner_where .= " post_author = ".get_current_user_id()." AND";
427 427
 		}
428 428
 		$inner_where .= " REG_date >= '$sql_date'";
429 429
 		$inner_date_query .= $inner_where;
@@ -435,8 +435,8 @@  discard block
 block discarded – undo
435 435
 		$select_parts = array();
436 436
 
437 437
 		//loop through registration stati to do parts for each status.
438
-		foreach ( EEM_Registration::reg_status_array() as $STS_ID => $STS_code ) {
439
-			if ( $STS_ID === EEM_Registration::status_id_incomplete ) {
438
+		foreach (EEM_Registration::reg_status_array() as $STS_ID => $STS_code) {
439
+			if ($STS_ID === EEM_Registration::status_id_incomplete) {
440 440
 				continue;
441 441
 			}
442 442
 			$select_parts[] = "COUNT($STS_code.REG_ID) as $STS_ID";
@@ -444,14 +444,14 @@  discard block
 block discarded – undo
444 444
 		}
445 445
 
446 446
 		//setup the selects
447
-		$select .= implode(', ', $select_parts );
447
+		$select .= implode(', ', $select_parts);
448 448
 		$select .= " FROM ($inner_date_query) AS dates LEFT JOIN ";
449 449
 
450 450
 		//setup the joins
451
-		$join .= implode( " LEFT JOIN ", $join_parts );
451
+		$join .= implode(" LEFT JOIN ", $join_parts);
452 452
 
453 453
 		//now let's put it all together
454
-		$query = $select . $join . ' GROUP BY Registration_REG_date';
454
+		$query = $select.$join.' GROUP BY Registration_REG_date';
455 455
 
456 456
 		//and execute it
457 457
 		$results = $wpdb->get_results(
@@ -472,23 +472,23 @@  discard block
 block discarded – undo
472 472
 	 * @param $period string which can be passed to php's strtotime function (eg "-1 month")
473 473
 	 *		@return stdClass[] each with properties event_name, reg_limit, and total
474 474
 	*/
475
-	public function get_registrations_per_event_report( $period = '-1 month' ) {
475
+	public function get_registrations_per_event_report($period = '-1 month') {
476 476
 
477
-		$date_sql = $this->convert_datetime_for_query( 'REG_date', date( "Y-m-d H:i:s", strtotime( $period )), 'Y-m-d H:i:s', 'UTC' );
478
-		$where = array( 'REG_date' => array( '>=', $date_sql ), 'STS_ID' => array( '!=', EEM_Registration::status_id_incomplete ) );
477
+		$date_sql = $this->convert_datetime_for_query('REG_date', date("Y-m-d H:i:s", strtotime($period)), 'Y-m-d H:i:s', 'UTC');
478
+		$where = array('REG_date' => array('>=', $date_sql), 'STS_ID' => array('!=', EEM_Registration::status_id_incomplete));
479 479
 
480
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_event_report' ) ) {
480
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_event_report')) {
481 481
 			$where['Event.EVT_wp_user'] = get_current_user_id();
482 482
 		}
483 483
 		$results = $this->_get_all_wpdb_results(array(
484 484
 			$where,
485 485
 			'group_by'=>'Event.EVT_name',
486 486
 			'order_by'=>'Event.EVT_name',
487
-			'limit'=>array(0,24)),
487
+			'limit'=>array(0, 24)),
488 488
 			OBJECT,
489 489
 			array(
490
-				'event_name'=>array('Event_CPT.post_title','%s'),
491
-				'total'=>array('COUNT(REG_ID)','%s')
490
+				'event_name'=>array('Event_CPT.post_title', '%s'),
491
+				'total'=>array('COUNT(REG_ID)', '%s')
492 492
 			)
493 493
 		);
494 494
 
@@ -506,19 +506,19 @@  discard block
 block discarded – undo
506 506
 	 * @return stdClass[] with properties `Registration_Event` and a column for each registration status as the STS_ID
507 507
 	 *                    (i.e. RAP)
508 508
 	 */
509
-	public function get_registrations_per_event_and_per_status_report( $period = '-1 month' ) {
509
+	public function get_registrations_per_event_and_per_status_report($period = '-1 month') {
510 510
 		global $wpdb;
511
-		$registration_table = $wpdb->prefix . 'esp_registration';
511
+		$registration_table = $wpdb->prefix.'esp_registration';
512 512
 		$event_table = $wpdb->posts;
513
-		$sql_date = date("Y-m-d H:i:s", strtotime($period) );
513
+		$sql_date = date("Y-m-d H:i:s", strtotime($period));
514 514
 
515 515
 		//inner date query
516 516
 		$inner_date_query = "SELECT DISTINCT EVT_ID, REG_date from $registration_table ";
517 517
 		$inner_where = " WHERE";
518 518
 		//exclude events not authored by user if permissions in effect
519
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_event_report' ) ) {
519
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'reg_per_event_report')) {
520 520
 			$inner_date_query .= "LEFT JOIN $event_table ON ID = EVT_ID";
521
-			$inner_where .= " post_author = " . get_current_user_id() . " AND";
521
+			$inner_where .= " post_author = ".get_current_user_id()." AND";
522 522
 		}
523 523
 		$inner_where .= " REG_date >= '$sql_date'";
524 524
 		$inner_date_query .= $inner_where;
@@ -530,8 +530,8 @@  discard block
 block discarded – undo
530 530
 		$select_parts = array();
531 531
 
532 532
 		//loop through registration stati to do parts for each status.
533
-		foreach ( EEM_Registration::reg_status_array() as $STS_ID => $STS_code ) {
534
-			if ( $STS_ID === EEM_Registration::status_id_incomplete ) {
533
+		foreach (EEM_Registration::reg_status_array() as $STS_ID => $STS_code) {
534
+			if ($STS_ID === EEM_Registration::status_id_incomplete) {
535 535
 				continue;
536 536
 			}
537 537
 			$select_parts[] = "COUNT($STS_code.REG_ID) as $STS_ID";
@@ -539,14 +539,14 @@  discard block
 block discarded – undo
539 539
 		}
540 540
 
541 541
 		//setup the selects
542
-		$select .= implode( ', ', $select_parts );
542
+		$select .= implode(', ', $select_parts);
543 543
 		$select .= " FROM ($inner_date_query) AS dates LEFT JOIN $event_table as Event ON Event.ID = dates.EVT_ID LEFT JOIN ";
544 544
 
545 545
 		//setup remaining joins
546
-		$join .= implode( " LEFT JOIN ", $join_parts );
546
+		$join .= implode(" LEFT JOIN ", $join_parts);
547 547
 
548 548
 		//now put it all together
549
-		$query = $select . $join . ' GROUP BY Registration_Event';
549
+		$query = $select.$join.' GROUP BY Registration_Event';
550 550
 
551 551
 		//and execute
552 552
 		$results = $wpdb->get_results(
@@ -562,11 +562,11 @@  discard block
 block discarded – undo
562 562
 	 * @param int $TXN_ID
563 563
 	 * @return EE_Registration
564 564
 	 */
565
-	public function get_primary_registration_for_transaction_ID( $TXN_ID = 0){
566
-		if( ! $TXN_ID ){
565
+	public function get_primary_registration_for_transaction_ID($TXN_ID = 0) {
566
+		if ( ! $TXN_ID) {
567 567
 			return false;
568 568
 		}
569
-		return $this->get_one(array(array('TXN_ID'=>$TXN_ID,'REG_count'=>  EEM_Registration::PRIMARY_REGISTRANT_COUNT)));
569
+		return $this->get_one(array(array('TXN_ID'=>$TXN_ID, 'REG_count'=>  EEM_Registration::PRIMARY_REGISTRANT_COUNT)));
570 570
 	}
571 571
 
572 572
 
@@ -578,11 +578,11 @@  discard block
 block discarded – undo
578 578
 	 *		@param boolean $for_incomplete_payments
579 579
 	 *		@return int
580 580
 	 */
581
-	public function get_event_registration_count ( $EVT_ID, $for_incomplete_payments = FALSE ) {
581
+	public function get_event_registration_count($EVT_ID, $for_incomplete_payments = FALSE) {
582 582
 		// we only count approved registrations towards registration limits
583
-		$query_params = array( array( 'EVT_ID' => $EVT_ID, 'STS_ID' => self::status_id_approved ) );
584
-		if( $for_incomplete_payments ){
585
-			$query_params[0]['Transaction.STS_ID']=array('!=',  EEM_Transaction::complete_status_code);
583
+		$query_params = array(array('EVT_ID' => $EVT_ID, 'STS_ID' => self::status_id_approved));
584
+		if ($for_incomplete_payments) {
585
+			$query_params[0]['Transaction.STS_ID'] = array('!=', EEM_Transaction::complete_status_code);
586 586
 		}
587 587
 
588 588
 		return $this->count($query_params);
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
 		/** @type WPDB $wpdb */
599 599
 		global $wpdb;
600 600
 		return $wpdb->query(
601
-				'DELETE r FROM ' . $this->table() . ' r LEFT JOIN ' . EEM_Transaction::instance()->table() . ' t ON r.TXN_ID = t.TXN_ID WHERE t.TXN_ID IS NULL' );
601
+				'DELETE r FROM '.$this->table().' r LEFT JOIN '.EEM_Transaction::instance()->table().' t ON r.TXN_ID = t.TXN_ID WHERE t.TXN_ID IS NULL' );
602 602
 	}
603 603
 
604 604
 	/**
@@ -608,17 +608,17 @@  discard block
 block discarded – undo
608 608
 	 * @param boolean $checked_in whether to count registrations checked IN or OUT
609 609
 	 * @return int
610 610
 	 */
611
-	public function count_registrations_checked_into_datetime( $DTT_ID, $checked_in = true) {
611
+	public function count_registrations_checked_into_datetime($DTT_ID, $checked_in = true) {
612 612
 		global $wpdb;
613 613
 		//subquery to get latest checkin
614 614
 		$query = $wpdb->prepare(
615 615
 			'SELECT '
616 616
 				. 'COUNT( DISTINCT checkins.REG_ID ) '
617
-			. 'FROM ' . EEM_Checkin::instance()->table() . ' AS checkins INNER JOIN'
617
+			. 'FROM '.EEM_Checkin::instance()->table().' AS checkins INNER JOIN'
618 618
 				. '( SELECT '
619 619
 					. 'max( CHK_timestamp ) AS latest_checkin, '
620 620
 					. 'REG_ID AS REG_ID '
621
-				. 'FROM ' . EEM_Checkin::instance()->table() . ' '
621
+				. 'FROM '.EEM_Checkin::instance()->table().' '
622 622
 				. 'WHERE DTT_ID=%d '
623 623
 				. 'GROUP BY REG_ID'
624 624
 			. ') AS most_recent_checkin_per_reg '
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
 			$DTT_ID,
630 630
 			$checked_in
631 631
 		);
632
-		return (int)$wpdb->get_var( $query );
632
+		return (int) $wpdb->get_var($query);
633 633
 	}
634 634
 
635 635
 	/**
@@ -639,18 +639,18 @@  discard block
 block discarded – undo
639 639
 	 * @param boolean $checked_in whether to count registrations checked IN or OUT
640 640
 	 * @return int
641 641
 	 */
642
-	public function count_registrations_checked_into_event( $EVT_ID, $checked_in = true ) {
642
+	public function count_registrations_checked_into_event($EVT_ID, $checked_in = true) {
643 643
 		global $wpdb;
644 644
 		//subquery to get latest checkin
645 645
 		$query = $wpdb->prepare(
646 646
 			'SELECT '
647 647
 				. 'COUNT( DISTINCT checkins.REG_ID ) '
648
-			. 'FROM ' . EEM_Checkin::instance()->table() . ' AS checkins INNER JOIN'
648
+			. 'FROM '.EEM_Checkin::instance()->table().' AS checkins INNER JOIN'
649 649
 				. '( SELECT '
650 650
 					. 'max( CHK_timestamp ) AS latest_checkin, '
651 651
 					. 'REG_ID AS REG_ID '
652
-				. 'FROM ' . EEM_Checkin::instance()->table() . ' AS c '
653
-				. 'INNER JOIN ' . EEM_Datetime::instance()->table() . ' AS d '
652
+				. 'FROM '.EEM_Checkin::instance()->table().' AS c '
653
+				. 'INNER JOIN '.EEM_Datetime::instance()->table().' AS d '
654 654
 				. 'ON c.DTT_ID=d.DTT_ID '
655 655
 				. 'WHERE d.EVT_ID=%d '
656 656
 				. 'GROUP BY REG_ID'
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
 			$EVT_ID,
663 663
 			$checked_in
664 664
 		);
665
-		return (int)$wpdb->get_var( $query );
665
+		return (int) $wpdb->get_var($query);
666 666
 	}
667 667
 
668 668
 
@@ -677,15 +677,15 @@  discard block
 block discarded – undo
677 677
 	 * @param array $attendee_ids
678 678
 	 * @return EE_Registration[]
679 679
 	 */
680
-	public function get_latest_registration_for_each_of_given_contacts( $attendee_ids = array() ) {
680
+	public function get_latest_registration_for_each_of_given_contacts($attendee_ids = array()) {
681 681
 		//first do a native wp_query to get the latest REG_ID's matching these attendees.
682 682
 		global $wpdb;
683
-		$registration_table = $wpdb->prefix . 'esp_registration';
683
+		$registration_table = $wpdb->prefix.'esp_registration';
684 684
 		$attendee_table = $wpdb->posts;
685
-		$attendee_ids = is_array( $attendee_ids )
686
-			? array_map( 'absint', $attendee_ids )
687
-			: array( (int) $attendee_ids );
688
-		$attendee_ids = implode( ',', $attendee_ids );
685
+		$attendee_ids = is_array($attendee_ids)
686
+			? array_map('absint', $attendee_ids)
687
+			: array((int) $attendee_ids);
688
+		$attendee_ids = implode(',', $attendee_ids);
689 689
 
690 690
 
691 691
 		//first we do a query to get the registration ids
@@ -710,24 +710,24 @@  discard block
 block discarded – undo
710 710
 			ARRAY_A
711 711
 		);
712 712
 
713
-		if ( empty( $registration_ids ) ) {
713
+		if (empty($registration_ids)) {
714 714
 			return array();
715 715
 		}
716 716
 
717 717
 		$ids_for_model_query = array();
718 718
 		//let's flatten the ids so they can be used in the model query.
719
-		foreach ( $registration_ids as $registration_id ) {
720
-			if ( isset( $registration_id['registration_id'] ) ) {
719
+		foreach ($registration_ids as $registration_id) {
720
+			if (isset($registration_id['registration_id'])) {
721 721
 				$ids_for_model_query[] = $registration_id['registration_id'];
722 722
 			}
723 723
 		}
724 724
 
725 725
 		//construct query
726 726
 		$_where = array(
727
-			'REG_ID' => array( 'IN', $ids_for_model_query )
727
+			'REG_ID' => array('IN', $ids_for_model_query)
728 728
 		);
729 729
 
730
-		return $this->get_all( array( $_where ) );
730
+		return $this->get_all(array($_where));
731 731
 	}
732 732
 
733 733
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@
 block discarded – undo
5 5
  * @subpackage plugin api, messages
6 6
  * @since           4.5.0
7 7
  */
8
-if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
8
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
9
+	exit('No direct script access allowed');
10
+}
9 11
 
10 12
 /**
11 13
  * Use this to register or deregister a new message template pack variation for the EE messages system.
Please login to merge, or discard this patch.
admin_pages/payments/Payments_Admin_Page_Init.core.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 use EventEspresso\core\services\database\TableAnalysis;
3
-if (!defined('EVENT_ESPRESSO_VERSION') ){
3
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
4 4
 	exit('NO direct script access allowed');
5 5
 }
6 6
 /**
@@ -27,15 +27,15 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	public function __construct() {
29 29
 		//define some page related constants
30
-		define( 'EE_PAYMENTS_PG_SLUG', 'espresso_payment_settings' );
31
-		define( 'EE_PAYMENTS_ADMIN_URL', admin_url( 'admin.php?page=' . EE_PAYMENTS_PG_SLUG ));
32
-		define( 'EE_PAYMENTS_ADMIN', EE_ADMIN_PAGES . 'payments' . DS );
33
-		define( 'EE_PAYMENTS_TEMPLATE_PATH', EE_PAYMENTS_ADMIN . 'templates' . DS );
34
-		define( 'EE_PAYMENTS_ASSETS_URL', EE_ADMIN_PAGES_URL . 'payments/assets/' );
35
-		$this->_table_analysis = EE_Registry::instance()->create( 'TableAnalysis', array(), true );
30
+		define('EE_PAYMENTS_PG_SLUG', 'espresso_payment_settings');
31
+		define('EE_PAYMENTS_ADMIN_URL', admin_url('admin.php?page='.EE_PAYMENTS_PG_SLUG));
32
+		define('EE_PAYMENTS_ADMIN', EE_ADMIN_PAGES.'payments'.DS);
33
+		define('EE_PAYMENTS_TEMPLATE_PATH', EE_PAYMENTS_ADMIN.'templates'.DS);
34
+		define('EE_PAYMENTS_ASSETS_URL', EE_ADMIN_PAGES_URL.'payments/assets/');
35
+		$this->_table_analysis = EE_Registry::instance()->create('TableAnalysis', array(), true);
36 36
 		//check that there are active gateways on all admin page loads. but dont do it just yet
37 37
 //		echo "constructing payments admin page";die;
38
-		add_action('admin_notices',array($this,'check_payment_gateway_setup'));
38
+		add_action('admin_notices', array($this, 'check_payment_gateway_setup'));
39 39
 		parent::__construct();
40 40
 	}
41 41
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 				'show_on_menu'    => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
59 59
 				'parent_slug'     => 'espresso_events',
60 60
 				'menu_slug'       => EE_PAYMENTS_PG_SLUG,
61
-				'menu_label'      => __( 'Payment Methods', 'event_espresso' ),
61
+				'menu_label'      => __('Payment Methods', 'event_espresso'),
62 62
 				'capability'      => 'ee_manage_gateways',
63 63
 				'admin_init_page' => $this,
64 64
 			)
@@ -72,25 +72,25 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @throws \EE_Error
74 74
 	 */
75
-	public function check_payment_gateway_setup(){
75
+	public function check_payment_gateway_setup() {
76 76
 		//ONLY do this check if models can query
77 77
 		//and avoid a bug where when we nuke EE4's data that this causes a fatal error
78 78
 		//because the tables are deleted just before this request runs. see https://events.codebasehq.com/projects/event-espresso/tickets/7539
79 79
 		if (
80 80
 			! EE_Maintenance_Mode::instance()->models_can_query()
81
-			|| ! $this->_get_table_analysis()->tableExists( EEM_Payment_Method::instance()->table() )
81
+			|| ! $this->_get_table_analysis()->tableExists(EEM_Payment_Method::instance()->table())
82 82
 		) {
83 83
 			return;
84 84
 		}
85 85
 
86 86
 
87 87
 		// ensure Payment_Method model is loaded
88
-		EE_Registry::instance()->load_model( 'Payment_Method' );
89
-		$actives = EEM_Payment_Method::instance()->count_active( EEM_Payment_Method::scope_cart );
90
-		if( $actives  < 1 ){
88
+		EE_Registry::instance()->load_model('Payment_Method');
89
+		$actives = EEM_Payment_Method::instance()->count_active(EEM_Payment_Method::scope_cart);
90
+		if ($actives < 1) {
91 91
 			$url = EE_Admin_Page::add_query_args_and_nonce(array(), EE_PAYMENTS_ADMIN_URL);
92 92
 			echo '<div class="error">
93
-				 <p>'.  sprintf(__("There are no Active Payment Methods setup for Event Espresso. Please %s activate at least one.%s", "event_espresso"),"<a href='$url'>","</a>").'</p>
93
+				 <p>'.  sprintf(__("There are no Active Payment Methods setup for Event Espresso. Please %s activate at least one.%s", "event_espresso"), "<a href='$url'>", "</a>").'</p>
94 94
 			 </div>';
95 95
 		}
96 96
 	}
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
 	 * @throws \EE_Error
102 102
 	 */
103 103
 	protected function _get_table_analysis() {
104
-		if( $this->_table_analysis instanceof TableAnalysis ) {
104
+		if ($this->_table_analysis instanceof TableAnalysis) {
105 105
 			return $this->_table_analysis;
106 106
 		} else {
107 107
 			throw new \EE_Error( 
108 108
 				sprintf( 
109
-					__( 'Table analysis class on class %1$s is not set properly.', 'event_espresso'), 
110
-					get_class( $this ) 
109
+					__('Table analysis class on class %1$s is not set properly.', 'event_espresso'), 
110
+					get_class($this) 
111 111
 				) 
112 112
 			);
113 113
 		}
Please login to merge, or discard this patch.
espresso.php 1 patch
Spacing   +93 added lines, -93 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
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
  *
43 43
  */
44 44
 
45
-if ( function_exists( 'espresso_version' ) ) {
45
+if (function_exists('espresso_version')) {
46 46
 
47 47
 	/**
48 48
 	 *    espresso_duplicate_plugin_error
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
 	function espresso_duplicate_plugin_error() {
52 52
 		?>
53 53
 		<div class="error">
54
-			<p><?php _e( 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', 'event_espresso' ); ?></p>
54
+			<p><?php _e('Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', 'event_espresso'); ?></p>
55 55
 		</div>
56 56
 		<?php
57
-		espresso_deactivate_plugin( plugin_basename( __FILE__ ) );
57
+		espresso_deactivate_plugin(plugin_basename(__FILE__));
58 58
 	}
59
-	add_action( 'admin_notices', 'espresso_duplicate_plugin_error', 1 );
59
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
60 60
 
61 61
 } else {
62 62
 
@@ -67,103 +67,103 @@  discard block
 block discarded – undo
67 67
 	 * @return string
68 68
 	 */
69 69
 	function espresso_version() {
70
-		return apply_filters( 'FHEE__espresso__espresso_version', '4.9.13.rc.009' );
70
+		return apply_filters('FHEE__espresso__espresso_version', '4.9.13.rc.009');
71 71
 	}
72 72
 
73 73
 	// define versions
74
-	define( 'EVENT_ESPRESSO_VERSION', espresso_version() );
75
-	define( 'EE_MIN_WP_VER_REQUIRED', '4.1' );
76
-	define( 'EE_MIN_WP_VER_RECOMMENDED', '4.4.2' );
77
-	define( 'EE_MIN_PHP_VER_REQUIRED', '5.3.0' );
78
-	define( 'EE_MIN_PHP_VER_RECOMMENDED', '5.4.44' );
79
-	define( 'EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - ' . EVENT_ESPRESSO_VERSION );
80
-	define( 'EVENT_ESPRESSO_MAIN_FILE', __FILE__ );
74
+	define('EVENT_ESPRESSO_VERSION', espresso_version());
75
+	define('EE_MIN_WP_VER_REQUIRED', '4.1');
76
+	define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2');
77
+	define('EE_MIN_PHP_VER_REQUIRED', '5.3.0');
78
+	define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44');
79
+	define('EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - '.EVENT_ESPRESSO_VERSION);
80
+	define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
81 81
 	//used to be DIRECTORY_SEPARATOR, but that caused issues on windows
82
-	if ( ! defined( 'DS' ) ) {
83
-		define( 'DS', '/' );
82
+	if ( ! defined('DS')) {
83
+		define('DS', '/');
84 84
 	}
85
-	if ( ! defined( 'PS' ) ) {
86
-		define( 'PS', PATH_SEPARATOR );
85
+	if ( ! defined('PS')) {
86
+		define('PS', PATH_SEPARATOR);
87 87
 	}
88
-	if ( ! defined( 'SP' ) ) {
89
-		define( 'SP', ' ' );
88
+	if ( ! defined('SP')) {
89
+		define('SP', ' ');
90 90
 	}
91
-	if ( ! defined( 'EENL' ) ) {
92
-		define( 'EENL', "\n" );
91
+	if ( ! defined('EENL')) {
92
+		define('EENL', "\n");
93 93
 	}
94
-	define( 'EE_SUPPORT_EMAIL', '[email protected]' );
94
+	define('EE_SUPPORT_EMAIL', '[email protected]');
95 95
 	// define the plugin directory and URL
96
-	define( 'EE_PLUGIN_BASENAME', plugin_basename( EVENT_ESPRESSO_MAIN_FILE ) );
97
-	define( 'EE_PLUGIN_DIR_PATH', plugin_dir_path( EVENT_ESPRESSO_MAIN_FILE ) );
98
-	define( 'EE_PLUGIN_DIR_URL', plugin_dir_url( EVENT_ESPRESSO_MAIN_FILE ) );
96
+	define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE));
97
+	define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE));
98
+	define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE));
99 99
 	// main root folder paths
100
-	define( 'EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS );
101
-	define( 'EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS );
102
-	define( 'EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS );
103
-	define( 'EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS );
104
-	define( 'EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS );
105
-	define( 'EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS );
106
-	define( 'EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS );
107
-	define( 'EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS );
100
+	define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH.'admin_pages'.DS);
101
+	define('EE_CORE', EE_PLUGIN_DIR_PATH.'core'.DS);
102
+	define('EE_MODULES', EE_PLUGIN_DIR_PATH.'modules'.DS);
103
+	define('EE_PUBLIC', EE_PLUGIN_DIR_PATH.'public'.DS);
104
+	define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH.'shortcodes'.DS);
105
+	define('EE_WIDGETS', EE_PLUGIN_DIR_PATH.'widgets'.DS);
106
+	define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH.'payment_methods'.DS);
107
+	define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH.'caffeinated'.DS);
108 108
 	// core system paths
109
-	define( 'EE_ADMIN', EE_CORE . 'admin' . DS );
110
-	define( 'EE_CPTS', EE_CORE . 'CPTs' . DS );
111
-	define( 'EE_CLASSES', EE_CORE . 'db_classes' . DS );
112
-	define( 'EE_INTERFACES', EE_CORE . 'interfaces' . DS );
113
-	define( 'EE_BUSINESS', EE_CORE . 'business' . DS );
114
-	define( 'EE_MODELS', EE_CORE . 'db_models' . DS );
115
-	define( 'EE_HELPERS', EE_CORE . 'helpers' . DS );
116
-	define( 'EE_LIBRARIES', EE_CORE . 'libraries' . DS );
117
-	define( 'EE_TEMPLATES', EE_CORE . 'templates' . DS );
118
-	define( 'EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS );
119
-	define( 'EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS );
120
-	define( 'EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS );
109
+	define('EE_ADMIN', EE_CORE.'admin'.DS);
110
+	define('EE_CPTS', EE_CORE.'CPTs'.DS);
111
+	define('EE_CLASSES', EE_CORE.'db_classes'.DS);
112
+	define('EE_INTERFACES', EE_CORE.'interfaces'.DS);
113
+	define('EE_BUSINESS', EE_CORE.'business'.DS);
114
+	define('EE_MODELS', EE_CORE.'db_models'.DS);
115
+	define('EE_HELPERS', EE_CORE.'helpers'.DS);
116
+	define('EE_LIBRARIES', EE_CORE.'libraries'.DS);
117
+	define('EE_TEMPLATES', EE_CORE.'templates'.DS);
118
+	define('EE_THIRD_PARTY', EE_CORE.'third_party_libs'.DS);
119
+	define('EE_GLOBAL_ASSETS', EE_TEMPLATES.'global_assets'.DS);
120
+	define('EE_FORM_SECTIONS', EE_LIBRARIES.'form_sections'.DS);
121 121
 	// gateways
122
-	define( 'EE_GATEWAYS', EE_MODULES . 'gateways' . DS );
123
-	define( 'EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS );
122
+	define('EE_GATEWAYS', EE_MODULES.'gateways'.DS);
123
+	define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL.'modules'.DS.'gateways'.DS);
124 124
 	// asset URL paths
125
-	define( 'EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS );
126
-	define( 'EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS );
127
-	define( 'EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS );
128
-	define( 'EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS );
129
-	define( 'EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/' );
130
-	define( 'EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/' );
125
+	define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL.'core'.DS.'templates'.DS);
126
+	define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL.'global_assets'.DS);
127
+	define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL.'images'.DS);
128
+	define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL.'core'.DS.'third_party_libs'.DS);
129
+	define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL.'core/helpers/assets/');
130
+	define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL.'core/libraries/');
131 131
 	// define upload paths
132 132
 	$uploads = wp_upload_dir();
133 133
 	// define the uploads directory and URL
134
-	define( 'EVENT_ESPRESSO_UPLOAD_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS );
135
-	define( 'EVENT_ESPRESSO_UPLOAD_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS );
134
+	define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'].DS.'espresso'.DS);
135
+	define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'].DS.'espresso'.DS);
136 136
 	// define the templates directory and URL
137
-	define( 'EVENT_ESPRESSO_TEMPLATE_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'templates' . DS );
138
-	define( 'EVENT_ESPRESSO_TEMPLATE_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'templates' . DS );
137
+	define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'].DS.'espresso'.DS.'templates'.DS);
138
+	define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'].DS.'espresso'.DS.'templates'.DS);
139 139
 	// define the gateway directory and URL
140
-	define( 'EVENT_ESPRESSO_GATEWAY_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'gateways' . DS );
141
-	define( 'EVENT_ESPRESSO_GATEWAY_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'gateways' . DS );
140
+	define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'].DS.'espresso'.DS.'gateways'.DS);
141
+	define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'].DS.'espresso'.DS.'gateways'.DS);
142 142
 	// languages folder/path
143
-	define( 'EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS );
144
-	define( 'EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS );
143
+	define('EE_LANGUAGES_SAFE_LOC', '..'.DS.'uploads'.DS.'espresso'.DS.'languages'.DS);
144
+	define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'languages'.DS);
145 145
 	//check for dompdf fonts in uploads
146
-	if ( file_exists( EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ) ) {
147
-		define( 'DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS );
146
+	if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS)) {
147
+		define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS);
148 148
 	}
149 149
 	//ajax constants
150
-	define( 'EE_FRONT_AJAX', isset( $_REQUEST[ 'ee_front_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_front_ajax' ] ) ? true : false );
151
-	define( 'EE_ADMIN_AJAX', isset( $_REQUEST[ 'ee_admin_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_admin_ajax' ] ) ? true : false );
150
+	define('EE_FRONT_AJAX', isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false);
151
+	define('EE_ADMIN_AJAX', isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false);
152 152
 	//just a handy constant occasionally needed for finding values representing infinity in the DB
153 153
 	//you're better to use this than its straight value (currently -1) in case you ever
154 154
 	//want to change its default value! or find when -1 means infinity
155
-	define( 'EE_INF_IN_DB', -1 );
156
-	define( 'EE_INF', INF > (float)PHP_INT_MAX ? INF : PHP_INT_MAX );
157
-	define( 'EE_DEBUG', false );
155
+	define('EE_INF_IN_DB', -1);
156
+	define('EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX);
157
+	define('EE_DEBUG', false);
158 158
 
159 159
 	/**
160 160
 	 *    espresso_plugin_activation
161 161
 	 *    adds a wp-option to indicate that EE has been activated via the WP admin plugins page
162 162
 	 */
163 163
 	function espresso_plugin_activation() {
164
-		update_option( 'ee_espresso_activation', true );
164
+		update_option('ee_espresso_activation', true);
165 165
 	}
166
-	register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' );
166
+	register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
167 167
 
168 168
 
169 169
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		//	}
178 178
 		//
179 179
 	}
180
-	register_deactivation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation' );
180
+	register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation');
181 181
 
182 182
 
183 183
 
@@ -187,15 +187,15 @@  discard block
 block discarded – undo
187 187
 	 */
188 188
 	function espresso_load_error_handling() {
189 189
 		// load debugging tools
190
-		if ( WP_DEBUG === true && is_readable( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ) ) {
191
-			require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' );
190
+		if (WP_DEBUG === true && is_readable(EE_HELPERS.'EEH_Debug_Tools.helper.php')) {
191
+			require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php');
192 192
 			EEH_Debug_Tools::instance();
193 193
 		}
194 194
 		// load error handling
195
-		if ( is_readable( EE_CORE . 'EE_Error.core.php' ) ) {
196
-			require_once( EE_CORE . 'EE_Error.core.php' );
195
+		if (is_readable(EE_CORE.'EE_Error.core.php')) {
196
+			require_once(EE_CORE.'EE_Error.core.php');
197 197
 		} else {
198
-			wp_die( __( 'The EE_Error core class could not be loaded.', 'event_espresso' ) );
198
+			wp_die(__('The EE_Error core class could not be loaded.', 'event_espresso'));
199 199
 		}
200 200
 	}
201 201
 
@@ -209,25 +209,25 @@  discard block
 block discarded – undo
209 209
 	 * @param    string $full_path_to_file
210 210
 	 * @throws    EE_Error
211 211
 	 */
212
-	function espresso_load_required( $classname, $full_path_to_file ) {
212
+	function espresso_load_required($classname, $full_path_to_file) {
213 213
 		static $error_handling_loaded = false;
214
-		if ( ! $error_handling_loaded ) {
214
+		if ( ! $error_handling_loaded) {
215 215
 			espresso_load_error_handling();
216 216
 			$error_handling_loaded = true;
217 217
 		}
218
-		if ( is_readable( $full_path_to_file ) ) {
219
-			require_once( $full_path_to_file );
218
+		if (is_readable($full_path_to_file)) {
219
+			require_once($full_path_to_file);
220 220
 		} else {
221
-			throw new EE_Error ( sprintf(
222
-				__( 'The %s class file could not be located or is not readable due to file permissions.', 'event_espresso' ),
221
+			throw new EE_Error(sprintf(
222
+				__('The %s class file could not be located or is not readable due to file permissions.', 'event_espresso'),
223 223
 				$classname
224
-			) );
224
+			));
225 225
 		}
226 226
 	}
227 227
 
228
-	espresso_load_required( 'EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' );
229
-	espresso_load_required( 'EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' );
230
-	espresso_load_required( 'EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php' );
228
+	espresso_load_required('EEH_Base', EE_CORE.'helpers'.DS.'EEH_Base.helper.php');
229
+	espresso_load_required('EEH_File', EE_CORE.'helpers'.DS.'EEH_File.helper.php');
230
+	espresso_load_required('EE_Bootstrap', EE_CORE.'EE_Bootstrap.core.php');
231 231
 	new EE_Bootstrap();
232 232
 
233 233
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 
237 237
 
238 238
 
239
-if ( ! function_exists( 'espresso_deactivate_plugin' ) ) {
239
+if ( ! function_exists('espresso_deactivate_plugin')) {
240 240
 	/**
241 241
 	*    deactivate_plugin
242 242
 	* usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
@@ -245,11 +245,11 @@  discard block
 block discarded – undo
245 245
 	* @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
246 246
 	* @return    void
247 247
 	*/
248
-	function espresso_deactivate_plugin( $plugin_basename = '' ) {
249
-		if ( ! function_exists( 'deactivate_plugins' ) ) {
250
-			require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
248
+	function espresso_deactivate_plugin($plugin_basename = '') {
249
+		if ( ! function_exists('deactivate_plugins')) {
250
+			require_once(ABSPATH.'wp-admin/includes/plugin.php');
251 251
 		}
252
-		unset( $_GET[ 'activate' ], $_REQUEST[ 'activate' ] );
253
-		deactivate_plugins( $plugin_basename );
252
+		unset($_GET['activate'], $_REQUEST['activate']);
253
+		deactivate_plugins($plugin_basename);
254 254
 	}
255 255
 }
Please login to merge, or discard this patch.
core/EE_Config.core.php 1 patch
Spacing   +392 added lines, -392 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 
5 5
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public static function instance() {
123 123
 		// check if class object is instantiated, and instantiated properly
124
-		if ( ! self::$_instance instanceof EE_Config ) {
124
+		if ( ! self::$_instance instanceof EE_Config) {
125 125
 			self::$_instance = new self();
126 126
 		}
127 127
 		return self::$_instance;
@@ -141,20 +141,20 @@  discard block
 block discarded – undo
141 141
 	 *                               site was put into maintenance mode)
142 142
 	 * @return EE_Config
143 143
 	 */
144
-	public static function reset( $hard_reset = false, $reinstantiate = true ) {
145
-		if ( $hard_reset ) {
144
+	public static function reset($hard_reset = false, $reinstantiate = true) {
145
+		if ($hard_reset) {
146 146
 			self::$_instance->_addon_option_names = array();
147 147
 			self::$_instance->_initialize_config();
148 148
 			self::$_instance->update_espresso_config();
149 149
 		}
150
-		if ( self::$_instance instanceof EE_Config ) {
150
+		if (self::$_instance instanceof EE_Config) {
151 151
 			self::$_instance->update_addon_option_names();
152 152
 		}
153 153
 		self::$_instance = null;
154 154
 		//we don't need to reset the static properties imo because those should
155 155
 		//only change when a module is added or removed. Currently we don't
156 156
 		//support removing a module during a request when it previously existed
157
-		if ( $reinstantiate ) {
157
+		if ($reinstantiate) {
158 158
 			return self::instance();
159 159
 		} else {
160 160
 			return null;
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 	 * @access    private
170 170
 	 */
171 171
 	private function __construct() {
172
-		do_action( 'AHEE__EE_Config__construct__begin', $this );
172
+		do_action('AHEE__EE_Config__construct__begin', $this);
173 173
 		// setup empty config classes
174 174
 		$this->_initialize_config();
175 175
 		// load existing EE site settings
@@ -179,17 +179,17 @@  discard block
 block discarded – undo
179 179
 		//  register shortcodes and modules
180 180
 		add_action(
181 181
 			'AHEE__EE_System__register_shortcodes_modules_and_widgets',
182
-			array( $this, 'register_shortcodes_and_modules' ),
182
+			array($this, 'register_shortcodes_and_modules'),
183 183
 			999
184 184
 		);
185 185
 		//  initialize shortcodes and modules
186
-		add_action( 'AHEE__EE_System__core_loaded_and_ready', array( $this, 'initialize_shortcodes_and_modules' ) );
186
+		add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'initialize_shortcodes_and_modules'));
187 187
 		// register widgets
188
-		add_action( 'widgets_init', array( $this, 'widgets_init' ), 10 );
188
+		add_action('widgets_init', array($this, 'widgets_init'), 10);
189 189
 		// shutdown
190
-		add_action( 'shutdown', array( $this, 'shutdown' ), 10 );
190
+		add_action('shutdown', array($this, 'shutdown'), 10);
191 191
 		// construct__end hook
192
-		do_action( 'AHEE__EE_Config__construct__end', $this );
192
+		do_action('AHEE__EE_Config__construct__end', $this);
193 193
 		// hardcoded hack
194 194
 		$this->template_settings->current_espresso_theme = 'Espresso_Arabica_2014';
195 195
 	}
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 	 * @return string current theme set.
203 203
 	 */
204 204
 	public static function get_current_theme() {
205
-		return isset( self::$_instance->template_settings->current_espresso_theme )
205
+		return isset(self::$_instance->template_settings->current_espresso_theme)
206 206
 			? self::$_instance->template_settings->current_espresso_theme : 'Espresso_Arabica_2014';
207 207
 	}
208 208
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	private function _initialize_config() {
218 218
 		EE_Config::trim_log();
219 219
 		//set defaults
220
-		$this->_addon_option_names = get_option( EE_Config::ADDON_OPTION_NAMES, array() );
220
+		$this->_addon_option_names = get_option(EE_Config::ADDON_OPTION_NAMES, array());
221 221
 		$this->addons = new stdClass();
222 222
 		// set _module_route_map
223 223
 		EE_Config::$_module_route_map = array();
@@ -237,9 +237,9 @@  discard block
 block discarded – undo
237 237
 	 */
238 238
 	private function _load_core_config() {
239 239
 		// load_core_config__start hook
240
-		do_action( 'AHEE__EE_Config___load_core_config__start', $this );
240
+		do_action('AHEE__EE_Config___load_core_config__start', $this);
241 241
 		$espresso_config = $this->get_espresso_config();
242
-		foreach ( $espresso_config as $config => $settings ) {
242
+		foreach ($espresso_config as $config => $settings) {
243 243
 			// load_core_config__start hook
244 244
 			$settings = apply_filters(
245 245
 				'FHEE__EE_Config___load_core_config__config_settings',
@@ -247,22 +247,22 @@  discard block
 block discarded – undo
247 247
 				$config,
248 248
 				$this
249 249
 			);
250
-			if ( is_object( $settings ) && property_exists( $this, $config ) ) {
251
-				$this->{$config} = apply_filters( 'FHEE__EE_Config___load_core_config__' . $config, $settings );
250
+			if (is_object($settings) && property_exists($this, $config)) {
251
+				$this->{$config} = apply_filters('FHEE__EE_Config___load_core_config__'.$config, $settings);
252 252
 				//call configs populate method to ensure any defaults are set for empty values.
253
-				if ( method_exists( $settings, 'populate' ) ) {
253
+				if (method_exists($settings, 'populate')) {
254 254
 					$this->{$config}->populate();
255 255
 				}
256
-				if ( method_exists( $settings, 'do_hooks' ) ) {
256
+				if (method_exists($settings, 'do_hooks')) {
257 257
 					$this->{$config}->do_hooks();
258 258
 				}
259 259
 			}
260 260
 		}
261
-		if ( apply_filters( 'FHEE__EE_Config___load_core_config__update_espresso_config', false ) ) {
261
+		if (apply_filters('FHEE__EE_Config___load_core_config__update_espresso_config', false)) {
262 262
 			$this->update_espresso_config();
263 263
 		}
264 264
 		// load_core_config__end hook
265
-		do_action( 'AHEE__EE_Config___load_core_config__end', $this );
265
+		do_action('AHEE__EE_Config___load_core_config__end', $this);
266 266
 	}
267 267
 
268 268
 
@@ -277,23 +277,23 @@  discard block
 block discarded – undo
277 277
 		$this->core = $this->core instanceof EE_Core_Config
278 278
 			? $this->core
279 279
 			: new EE_Core_Config();
280
-		$this->core = apply_filters( 'FHEE__EE_Config___initialize_config__core', $this->core );
280
+		$this->core = apply_filters('FHEE__EE_Config___initialize_config__core', $this->core);
281 281
 		$this->organization = $this->organization instanceof EE_Organization_Config
282 282
 			? $this->organization
283 283
 			: new EE_Organization_Config();
284
-		$this->organization = apply_filters( 'FHEE__EE_Config___initialize_config__organization', $this->organization );
284
+		$this->organization = apply_filters('FHEE__EE_Config___initialize_config__organization', $this->organization);
285 285
 		$this->currency = $this->currency instanceof EE_Currency_Config
286 286
 			? $this->currency
287 287
 			: new EE_Currency_Config();
288
-		$this->currency = apply_filters( 'FHEE__EE_Config___initialize_config__currency', $this->currency );
288
+		$this->currency = apply_filters('FHEE__EE_Config___initialize_config__currency', $this->currency);
289 289
 		$this->registration = $this->registration instanceof EE_Registration_Config
290 290
 			? $this->registration
291 291
 			: new EE_Registration_Config();
292
-		$this->registration = apply_filters( 'FHEE__EE_Config___initialize_config__registration', $this->registration );
292
+		$this->registration = apply_filters('FHEE__EE_Config___initialize_config__registration', $this->registration);
293 293
 		$this->admin = $this->admin instanceof EE_Admin_Config
294 294
 			? $this->admin
295 295
 			: new EE_Admin_Config();
296
-		$this->admin = apply_filters( 'FHEE__EE_Config___initialize_config__admin', $this->admin );
296
+		$this->admin = apply_filters('FHEE__EE_Config___initialize_config__admin', $this->admin);
297 297
 		$this->template_settings = $this->template_settings instanceof EE_Template_Config
298 298
 			? $this->template_settings
299 299
 			: new EE_Template_Config();
@@ -304,15 +304,15 @@  discard block
 block discarded – undo
304 304
 		$this->map_settings = $this->map_settings instanceof EE_Map_Config
305 305
 			? $this->map_settings
306 306
 			: new EE_Map_Config();
307
-		$this->map_settings = apply_filters( 'FHEE__EE_Config___initialize_config__map_settings', $this->map_settings );
307
+		$this->map_settings = apply_filters('FHEE__EE_Config___initialize_config__map_settings', $this->map_settings);
308 308
 		$this->environment = $this->environment instanceof EE_Environment_Config
309 309
 			? $this->environment
310 310
 			: new EE_Environment_Config();
311
-		$this->environment = apply_filters( 'FHEE__EE_Config___initialize_config__environment', $this->environment );
311
+		$this->environment = apply_filters('FHEE__EE_Config___initialize_config__environment', $this->environment);
312 312
 		$this->gateway = $this->gateway instanceof EE_Gateway_Config
313 313
 			? $this->gateway
314 314
 			: new EE_Gateway_Config();
315
-		$this->gateway = apply_filters( 'FHEE__EE_Config___initialize_config__gateway', $this->gateway );
315
+		$this->gateway = apply_filters('FHEE__EE_Config___initialize_config__gateway', $this->gateway);
316 316
 	}
317 317
 
318 318
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 		// grab espresso configuration
328 328
 		return apply_filters(
329 329
 			'FHEE__EE_Config__get_espresso_config__CFG',
330
-			get_option( EE_Config::OPTION_NAME, array() )
330
+			get_option(EE_Config::OPTION_NAME, array())
331 331
 		);
332 332
 	}
333 333
 
@@ -341,12 +341,12 @@  discard block
 block discarded – undo
341 341
 	 * @param        $old_value
342 342
 	 * @param        $value
343 343
 	 */
344
-	public function double_check_config_comparison( $option = '', $old_value, $value ) {
344
+	public function double_check_config_comparison($option = '', $old_value, $value) {
345 345
 		// make sure we're checking the ee config
346
-		if ( $option === EE_Config::OPTION_NAME ) {
346
+		if ($option === EE_Config::OPTION_NAME) {
347 347
 			// run a loose comparison of the old value against the new value for type and properties,
348 348
 			// but NOT exact instance like WP update_option does (ie: NOT type safe comparison)
349
-			if ( $value != $old_value ) {
349
+			if ($value != $old_value) {
350 350
 				// if they are NOT the same, then remove the hook,
351 351
 				// which means the subsequent update results will be based solely on the update query results
352 352
 				// the reason we do this is because, as stated above,
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 				// the string it sees in the db looks the same as the new one it has been passed!!!
362 362
 				// This results in the query returning an "affected rows" value of ZERO,
363 363
 				// which gets returned immediately by WP update_option and looks like an error.
364
-				remove_action( 'update_option', array( $this, 'check_config_updated' ) );
364
+				remove_action('update_option', array($this, 'check_config_updated'));
365 365
 			}
366 366
 		}
367 367
 	}
@@ -375,11 +375,11 @@  discard block
 block discarded – undo
375 375
 	 */
376 376
 	protected function _reset_espresso_addon_config() {
377 377
 		$this->_addon_option_names = array();
378
-		foreach ( $this->addons as $addon_name => $addon_config_obj ) {
379
-			$addon_config_obj = maybe_unserialize( $addon_config_obj );
380
-			$config_class = get_class( $addon_config_obj );
381
-			if ( $addon_config_obj instanceof $config_class && ! $addon_config_obj instanceof __PHP_Incomplete_Class ) {
382
-				$this->update_config( 'addons', $addon_name, $addon_config_obj, false );
378
+		foreach ($this->addons as $addon_name => $addon_config_obj) {
379
+			$addon_config_obj = maybe_unserialize($addon_config_obj);
380
+			$config_class = get_class($addon_config_obj);
381
+			if ($addon_config_obj instanceof $config_class && ! $addon_config_obj instanceof __PHP_Incomplete_Class) {
382
+				$this->update_config('addons', $addon_name, $addon_config_obj, false);
383 383
 			}
384 384
 			$this->addons->{$addon_name} = null;
385 385
 		}
@@ -395,22 +395,22 @@  discard block
 block discarded – undo
395 395
 	 * @param   bool $add_error
396 396
 	 * @return   bool
397 397
 	 */
398
-	public function update_espresso_config( $add_success = false, $add_error = true ) {
398
+	public function update_espresso_config($add_success = false, $add_error = true) {
399 399
 		// don't allow config updates during WP heartbeats
400
-		if ( \EE_Registry::instance()->REQ->get( 'action', '' ) === 'heartbeat' ) {
400
+		if (\EE_Registry::instance()->REQ->get('action', '') === 'heartbeat') {
401 401
 			return false;
402 402
 		}
403 403
 		// commented out the following re: https://events.codebasehq.com/projects/event-espresso/tickets/8197
404 404
 		//$clone = clone( self::$_instance );
405 405
 		//self::$_instance = NULL;
406
-		do_action( 'AHEE__EE_Config__update_espresso_config__begin', $this );
406
+		do_action('AHEE__EE_Config__update_espresso_config__begin', $this);
407 407
 		$this->_reset_espresso_addon_config();
408 408
 		// hook into update_option because that happens AFTER the ( $value === $old_value ) conditional
409 409
 		// but BEFORE the actual update occurs
410
-		add_action( 'update_option', array( $this, 'double_check_config_comparison' ), 1, 3 );
410
+		add_action('update_option', array($this, 'double_check_config_comparison'), 1, 3);
411 411
 		// now update "ee_config"
412
-		$saved = update_option( EE_Config::OPTION_NAME, $this );
413
-		EE_Config::log( EE_Config::OPTION_NAME );
412
+		$saved = update_option(EE_Config::OPTION_NAME, $this);
413
+		EE_Config::log(EE_Config::OPTION_NAME);
414 414
 		// if not saved... check if the hook we just added still exists;
415 415
 		// if it does, it means one of two things:
416 416
 		// 		that update_option bailed at the ( $value === $old_value ) conditional,
@@ -421,17 +421,17 @@  discard block
 block discarded – undo
421 421
 		// but just means no update occurred, so don't display an error to the user.
422 422
 		// BUT... if update_option returns FALSE, AND the hook is missing,
423 423
 		// then it means that something truly went wrong
424
-		$saved = ! $saved ? has_action( 'update_option', array( $this, 'double_check_config_comparison' ) ) : $saved;
424
+		$saved = ! $saved ? has_action('update_option', array($this, 'double_check_config_comparison')) : $saved;
425 425
 		// remove our action since we don't want it in the system anymore
426
-		remove_action( 'update_option', array( $this, 'double_check_config_comparison' ), 1 );
427
-		do_action( 'AHEE__EE_Config__update_espresso_config__end', $this, $saved );
426
+		remove_action('update_option', array($this, 'double_check_config_comparison'), 1);
427
+		do_action('AHEE__EE_Config__update_espresso_config__end', $this, $saved);
428 428
 		//self::$_instance = $clone;
429 429
 		//unset( $clone );
430 430
 		// if config remains the same or was updated successfully
431
-		if ( $saved ) {
432
-			if ( $add_success ) {
431
+		if ($saved) {
432
+			if ($add_success) {
433 433
 				EE_Error::add_success(
434
-					__( 'The Event Espresso Configuration Settings have been successfully updated.', 'event_espresso' ),
434
+					__('The Event Espresso Configuration Settings have been successfully updated.', 'event_espresso'),
435 435
 					__FILE__,
436 436
 					__FUNCTION__,
437 437
 					__LINE__
@@ -439,9 +439,9 @@  discard block
 block discarded – undo
439 439
 			}
440 440
 			return true;
441 441
 		} else {
442
-			if ( $add_error ) {
442
+			if ($add_error) {
443 443
 				EE_Error::add_error(
444
-					__( 'The Event Espresso Configuration Settings were not updated.', 'event_espresso' ),
444
+					__('The Event Espresso Configuration Settings were not updated.', 'event_espresso'),
445 445
 					__FILE__,
446 446
 					__FUNCTION__,
447 447
 					__LINE__
@@ -470,16 +470,16 @@  discard block
 block discarded – undo
470 470
 		$name = '',
471 471
 		$config_class = '',
472 472
 		$config_obj = null,
473
-		$tests_to_run = array( 1, 2, 3, 4, 5, 6, 7, 8 ),
473
+		$tests_to_run = array(1, 2, 3, 4, 5, 6, 7, 8),
474 474
 		$display_errors = true
475 475
 	) {
476 476
 		try {
477
-			foreach ( $tests_to_run as $test ) {
478
-				switch ( $test ) {
477
+			foreach ($tests_to_run as $test) {
478
+				switch ($test) {
479 479
 					// TEST #1 : check that section was set
480 480
 					case 1 :
481
-						if ( empty( $section ) ) {
482
-							if ( $display_errors ) {
481
+						if (empty($section)) {
482
+							if ($display_errors) {
483 483
 								throw new EE_Error(
484 484
 									sprintf(
485 485
 										__(
@@ -495,11 +495,11 @@  discard block
 block discarded – undo
495 495
 						break;
496 496
 					// TEST #2 : check that settings section exists
497 497
 					case 2 :
498
-						if ( ! isset( $this->{$section} ) ) {
499
-							if ( $display_errors ) {
498
+						if ( ! isset($this->{$section} )) {
499
+							if ($display_errors) {
500 500
 								throw new EE_Error(
501 501
 									sprintf(
502
-										__( 'The "%s" configuration section does not exist.', 'event_espresso' ),
502
+										__('The "%s" configuration section does not exist.', 'event_espresso'),
503 503
 										$section
504 504
 									)
505 505
 								);
@@ -510,9 +510,9 @@  discard block
 block discarded – undo
510 510
 					// TEST #3 : check that section is the proper format
511 511
 					case 3 :
512 512
 						if (
513
-						! ( $this->{$section} instanceof EE_Config_Base || $this->{$section} instanceof stdClass )
513
+						! ($this->{$section} instanceof EE_Config_Base || $this->{$section} instanceof stdClass)
514 514
 						) {
515
-							if ( $display_errors ) {
515
+							if ($display_errors) {
516 516
 								throw new EE_Error(
517 517
 									sprintf(
518 518
 										__(
@@ -528,8 +528,8 @@  discard block
 block discarded – undo
528 528
 						break;
529 529
 					// TEST #4 : check that config section name has been set
530 530
 					case 4 :
531
-						if ( empty( $name ) ) {
532
-							if ( $display_errors ) {
531
+						if (empty($name)) {
532
+							if ($display_errors) {
533 533
 								throw new EE_Error(
534 534
 									__(
535 535
 										'No name has been provided for the specific configuration section.',
@@ -542,8 +542,8 @@  discard block
 block discarded – undo
542 542
 						break;
543 543
 					// TEST #5 : check that a config class name has been set
544 544
 					case 5 :
545
-						if ( empty( $config_class ) ) {
546
-							if ( $display_errors ) {
545
+						if (empty($config_class)) {
546
+							if ($display_errors) {
547 547
 								throw new EE_Error(
548 548
 									__(
549 549
 										'No class name has been provided for the specific configuration section.',
@@ -556,8 +556,8 @@  discard block
 block discarded – undo
556 556
 						break;
557 557
 					// TEST #6 : verify config class is accessible
558 558
 					case 6 :
559
-						if ( ! class_exists( $config_class ) ) {
560
-							if ( $display_errors ) {
559
+						if ( ! class_exists($config_class)) {
560
+							if ($display_errors) {
561 561
 								throw new EE_Error(
562 562
 									sprintf(
563 563
 										__(
@@ -573,11 +573,11 @@  discard block
 block discarded – undo
573 573
 						break;
574 574
 					// TEST #7 : check that config has even been set
575 575
 					case 7 :
576
-						if ( ! isset( $this->{$section}->{$name} ) ) {
577
-							if ( $display_errors ) {
576
+						if ( ! isset($this->{$section}->{$name} )) {
577
+							if ($display_errors) {
578 578
 								throw new EE_Error(
579 579
 									sprintf(
580
-										__( 'No configuration has been set for "%1$s->%2$s".', 'event_espresso' ),
580
+										__('No configuration has been set for "%1$s->%2$s".', 'event_espresso'),
581 581
 										$section,
582 582
 										$name
583 583
 									)
@@ -586,13 +586,13 @@  discard block
 block discarded – undo
586 586
 							return false;
587 587
 						} else {
588 588
 							// and make sure it's not serialized
589
-							$this->{$section}->{$name} = maybe_unserialize( $this->{$section}->{$name} );
589
+							$this->{$section}->{$name} = maybe_unserialize($this->{$section}->{$name} );
590 590
 						}
591 591
 						break;
592 592
 					// TEST #8 : check that config is the requested type
593 593
 					case 8 :
594
-						if ( ! $this->{$section}->{$name} instanceof $config_class ) {
595
-							if ( $display_errors ) {
594
+						if ( ! $this->{$section}->{$name} instanceof $config_class) {
595
+							if ($display_errors) {
596 596
 								throw new EE_Error(
597 597
 									sprintf(
598 598
 										__(
@@ -610,12 +610,12 @@  discard block
 block discarded – undo
610 610
 						break;
611 611
 					// TEST #9 : verify config object
612 612
 					case 9 :
613
-						if ( ! $config_obj instanceof EE_Config_Base ) {
614
-							if ( $display_errors ) {
613
+						if ( ! $config_obj instanceof EE_Config_Base) {
614
+							if ($display_errors) {
615 615
 								throw new EE_Error(
616 616
 									sprintf(
617
-										__( 'The "%s" class is not an instance of EE_Config_Base.', 'event_espresso' ),
618
-										print_r( $config_obj, true )
617
+										__('The "%s" class is not an instance of EE_Config_Base.', 'event_espresso'),
618
+										print_r($config_obj, true)
619 619
 									)
620 620
 								);
621 621
 							}
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 						break;
625 625
 				}
626 626
 			}
627
-		} catch ( EE_Error $e ) {
627
+		} catch (EE_Error $e) {
628 628
 			$e->get_error();
629 629
 		}
630 630
 		// you have successfully run the gauntlet
@@ -641,8 +641,8 @@  discard block
 block discarded – undo
641 641
 	 * @param        string $name
642 642
 	 * @return        string
643 643
 	 */
644
-	private function _generate_config_option_name( $section = '', $name = '' ) {
645
-		return 'ee_config-' . strtolower( $section . '-' . str_replace( array( 'EE_', 'EED_' ), '', $name ) );
644
+	private function _generate_config_option_name($section = '', $name = '') {
645
+		return 'ee_config-'.strtolower($section.'-'.str_replace(array('EE_', 'EED_'), '', $name));
646 646
 	}
647 647
 
648 648
 
@@ -656,10 +656,10 @@  discard block
 block discarded – undo
656 656
 	 * @param    string $name
657 657
 	 * @return    string
658 658
 	 */
659
-	private function _set_config_class( $config_class = '', $name = '' ) {
660
-		return ! empty( $config_class )
659
+	private function _set_config_class($config_class = '', $name = '') {
660
+		return ! empty($config_class)
661 661
 			? $config_class
662
-			: str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $name ) ) ) . '_Config';
662
+			: str_replace(' ', '_', ucwords(str_replace('_', ' ', $name))).'_Config';
663 663
 	}
664 664
 
665 665
 
@@ -674,36 +674,36 @@  discard block
 block discarded – undo
674 674
 	 * @param    EE_Config_Base $config_obj
675 675
 	 * @return    EE_Config_Base
676 676
 	 */
677
-	public function set_config( $section = '', $name = '', $config_class = '', EE_Config_Base $config_obj = null ) {
677
+	public function set_config($section = '', $name = '', $config_class = '', EE_Config_Base $config_obj = null) {
678 678
 		// ensure config class is set to something
679
-		$config_class = $this->_set_config_class( $config_class, $name );
679
+		$config_class = $this->_set_config_class($config_class, $name);
680 680
 		// run tests 1-4, 6, and 7 to verify all config params are set and valid
681
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, null, array( 1, 2, 3, 4, 5, 6 ) ) ) {
681
+		if ( ! $this->_verify_config_params($section, $name, $config_class, null, array(1, 2, 3, 4, 5, 6))) {
682 682
 			return null;
683 683
 		}
684
-		$config_option_name = $this->_generate_config_option_name( $section, $name );
684
+		$config_option_name = $this->_generate_config_option_name($section, $name);
685 685
 		// if the config option name hasn't been added yet to the list of option names we're tracking, then do so now
686
-		if ( ! isset( $this->_addon_option_names[ $config_option_name ] ) ) {
687
-			$this->_addon_option_names[ $config_option_name ] = $config_class;
686
+		if ( ! isset($this->_addon_option_names[$config_option_name])) {
687
+			$this->_addon_option_names[$config_option_name] = $config_class;
688 688
 			$this->update_addon_option_names();
689 689
 		}
690 690
 		// verify the incoming config object but suppress errors
691
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ), false ) ) {
691
+		if ( ! $this->_verify_config_params($section, $name, $config_class, $config_obj, array(9), false)) {
692 692
 			$config_obj = new $config_class();
693 693
 		}
694
-		if ( get_option( $config_option_name ) ) {
695
-			EE_Config::log( $config_option_name );
696
-			update_option( $config_option_name, $config_obj );
694
+		if (get_option($config_option_name)) {
695
+			EE_Config::log($config_option_name);
696
+			update_option($config_option_name, $config_obj);
697 697
 			$this->{$section}->{$name} = $config_obj;
698 698
 			return $this->{$section}->{$name};
699 699
 		} else {
700 700
 			// create a wp-option for this config
701
-			if ( add_option( $config_option_name, $config_obj, '', 'no' ) ) {
702
-				$this->{$section}->{$name} = maybe_unserialize( $config_obj );
701
+			if (add_option($config_option_name, $config_obj, '', 'no')) {
702
+				$this->{$section}->{$name} = maybe_unserialize($config_obj);
703 703
 				return $this->{$section}->{$name};
704 704
 			} else {
705 705
 				EE_Error::add_error(
706
-					sprintf( __( 'The "%s" could not be saved to the database.', 'event_espresso' ), $config_class ),
706
+					sprintf(__('The "%s" could not be saved to the database.', 'event_espresso'), $config_class),
707 707
 					__FILE__,
708 708
 					__FUNCTION__,
709 709
 					__LINE__
@@ -726,46 +726,46 @@  discard block
 block discarded – undo
726 726
 	 * @param    bool                  $throw_errors
727 727
 	 * @return    bool
728 728
 	 */
729
-	public function update_config( $section = '', $name = '', $config_obj = '', $throw_errors = true ) {
729
+	public function update_config($section = '', $name = '', $config_obj = '', $throw_errors = true) {
730 730
 		// don't allow config updates during WP heartbeats
731
-		if ( \EE_Registry::instance()->REQ->get( 'action', '' ) === 'heartbeat' ) {
731
+		if (\EE_Registry::instance()->REQ->get('action', '') === 'heartbeat') {
732 732
 			return false;
733 733
 		}
734
-		$config_obj = maybe_unserialize( $config_obj );
734
+		$config_obj = maybe_unserialize($config_obj);
735 735
 		// get class name of the incoming object
736
-		$config_class = get_class( $config_obj );
736
+		$config_class = get_class($config_obj);
737 737
 		// run tests 1-5 and 9 to verify config
738 738
 		if ( ! $this->_verify_config_params(
739 739
 			$section,
740 740
 			$name,
741 741
 			$config_class,
742 742
 			$config_obj,
743
-			array( 1, 2, 3, 4, 7, 9 )
743
+			array(1, 2, 3, 4, 7, 9)
744 744
 		)
745 745
 		) {
746 746
 			return false;
747 747
 		}
748
-		$config_option_name = $this->_generate_config_option_name( $section, $name );
748
+		$config_option_name = $this->_generate_config_option_name($section, $name);
749 749
 		// check if config object has been added to db by seeing if config option name is in $this->_addon_option_names array
750
-		if ( ! isset( $this->_addon_option_names[ $config_option_name ] ) ) {
750
+		if ( ! isset($this->_addon_option_names[$config_option_name])) {
751 751
 			// save new config to db
752
-			if( $this->set_config( $section, $name, $config_class, $config_obj ) ) {
752
+			if ($this->set_config($section, $name, $config_class, $config_obj)) {
753 753
 				return true;
754 754
 			}
755 755
 		} else {
756 756
 			// first check if the record already exists
757
-			$existing_config = get_option( $config_option_name );
758
-			$config_obj = serialize( $config_obj );
757
+			$existing_config = get_option($config_option_name);
758
+			$config_obj = serialize($config_obj);
759 759
 			// just return if db record is already up to date (NOT type safe comparison)
760
-			if ( $existing_config == $config_obj ) {
760
+			if ($existing_config == $config_obj) {
761 761
 				$this->{$section}->{$name} = $config_obj;
762 762
 				return true;
763
-			} else if ( update_option( $config_option_name, $config_obj ) ) {
764
-				EE_Config::log( $config_option_name );
763
+			} else if (update_option($config_option_name, $config_obj)) {
764
+				EE_Config::log($config_option_name);
765 765
 				// update wp-option for this config class
766 766
 				$this->{$section}->{$name} = $config_obj;
767 767
 				return true;
768
-			} elseif ( $throw_errors ) {
768
+			} elseif ($throw_errors) {
769 769
 				EE_Error::add_error(
770 770
 					sprintf(
771 771
 						__(
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 							'event_espresso'
774 774
 						),
775 775
 						$config_class,
776
-						'EE_Config->' . $section . '->' . $name
776
+						'EE_Config->'.$section.'->'.$name
777 777
 					),
778 778
 					__FILE__,
779 779
 					__FUNCTION__,
@@ -795,34 +795,34 @@  discard block
 block discarded – undo
795 795
 	 * @param    string $config_class
796 796
 	 * @return    mixed EE_Config_Base | NULL
797 797
 	 */
798
-	public function get_config( $section = '', $name = '', $config_class = '' ) {
798
+	public function get_config($section = '', $name = '', $config_class = '') {
799 799
 		// ensure config class is set to something
800
-		$config_class = $this->_set_config_class( $config_class, $name );
800
+		$config_class = $this->_set_config_class($config_class, $name);
801 801
 		// run tests 1-4, 6 and 7 to verify that all params have been set
802
-		if ( ! $this->_verify_config_params( $section, $name, $config_class, null, array( 1, 2, 3, 4, 5, 6 ) ) ) {
802
+		if ( ! $this->_verify_config_params($section, $name, $config_class, null, array(1, 2, 3, 4, 5, 6))) {
803 803
 			return null;
804 804
 		}
805 805
 		// now test if the requested config object exists, but suppress errors
806
-		if ( $this->_verify_config_params( $section, $name, $config_class, null, array( 7, 8 ), false ) ) {
806
+		if ($this->_verify_config_params($section, $name, $config_class, null, array(7, 8), false)) {
807 807
 			// config already exists, so pass it back
808 808
 			return $this->{$section}->{$name};
809 809
 		}
810 810
 		// load config option from db if it exists
811
-		$config_obj = $this->get_config_option( $this->_generate_config_option_name( $section, $name ) );
811
+		$config_obj = $this->get_config_option($this->_generate_config_option_name($section, $name));
812 812
 		// verify the newly retrieved config object, but suppress errors
813
-		if ( $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ), false ) ) {
813
+		if ($this->_verify_config_params($section, $name, $config_class, $config_obj, array(9), false)) {
814 814
 			// config is good, so set it and pass it back
815 815
 			$this->{$section}->{$name} = $config_obj;
816 816
 			return $this->{$section}->{$name};
817 817
 		}
818 818
 		// oops! $config_obj is not already set and does not exist in the db, so create a new one
819
-		$config_obj = $this->set_config( $section, $name, $config_class );
819
+		$config_obj = $this->set_config($section, $name, $config_class);
820 820
 		// verify the newly created config object
821
-		if ( $this->_verify_config_params( $section, $name, $config_class, $config_obj, array( 9 ) ) ) {
821
+		if ($this->_verify_config_params($section, $name, $config_class, $config_obj, array(9))) {
822 822
 			return $this->{$section}->{$name};
823 823
 		} else {
824 824
 			EE_Error::add_error(
825
-				sprintf( __( 'The "%s" could not be retrieved from the database.', 'event_espresso' ), $config_class ),
825
+				sprintf(__('The "%s" could not be retrieved from the database.', 'event_espresso'), $config_class),
826 826
 				__FILE__,
827 827
 				__FUNCTION__,
828 828
 				__LINE__
@@ -840,11 +840,11 @@  discard block
 block discarded – undo
840 840
 	 * @param    string $config_option_name
841 841
 	 * @return    mixed EE_Config_Base | FALSE
842 842
 	 */
843
-	public function get_config_option( $config_option_name = '' ) {
843
+	public function get_config_option($config_option_name = '') {
844 844
 		// retrieve the wp-option for this config class.
845
-		$config_option = maybe_unserialize( get_option( $config_option_name, array() ) );
846
-		if ( empty( $config_option ) ) {
847
-			EE_Config::log( $config_option_name . '-NOT-FOUND' );
845
+		$config_option = maybe_unserialize(get_option($config_option_name, array()));
846
+		if (empty($config_option)) {
847
+			EE_Config::log($config_option_name.'-NOT-FOUND');
848 848
 		}
849 849
 		return $config_option;
850 850
 	}
@@ -856,17 +856,17 @@  discard block
 block discarded – undo
856 856
 	 *
857 857
 	 * @param string $config_option_name
858 858
 	 */
859
-	public static function log( $config_option_name = '' ) {
860
-		if ( ! empty( $config_option_name ) ) {
861
-			$config_log = get_option( EE_Config::LOG_NAME, array() );
859
+	public static function log($config_option_name = '') {
860
+		if ( ! empty($config_option_name)) {
861
+			$config_log = get_option(EE_Config::LOG_NAME, array());
862 862
 			//copy incoming $_REQUEST and sanitize it so we can save it
863 863
 			$_request = $_REQUEST;
864
-			array_walk_recursive( $_request, 'sanitize_text_field' );
865
-			$config_log[ (string) microtime( true ) ] = array(
864
+			array_walk_recursive($_request, 'sanitize_text_field');
865
+			$config_log[(string) microtime(true)] = array(
866 866
 				'config_name' => $config_option_name,
867 867
 				'request'     => $_request,
868 868
 			);
869
-			update_option( EE_Config::LOG_NAME, $config_log );
869
+			update_option(EE_Config::LOG_NAME, $config_log);
870 870
 		}
871 871
 	}
872 872
 
@@ -877,12 +877,12 @@  discard block
 block discarded – undo
877 877
 	 * reduces the size of the config log to the length specified by EE_Config::LOG_LENGTH
878 878
 	 */
879 879
 	public static function trim_log() {
880
-		$config_log = get_option( EE_Config::LOG_NAME, array() );
881
-		$log_length = count( $config_log );
882
-		if ( $log_length > EE_Config::LOG_LENGTH ) {
883
-			ksort( $config_log );
884
-			$config_log = array_slice( $config_log, $log_length - EE_Config::LOG_LENGTH, null, true );
885
-			update_option( EE_Config::LOG_NAME, $config_log );
880
+		$config_log = get_option(EE_Config::LOG_NAME, array());
881
+		$log_length = count($config_log);
882
+		if ($log_length > EE_Config::LOG_LENGTH) {
883
+			ksort($config_log);
884
+			$config_log = array_slice($config_log, $log_length - EE_Config::LOG_LENGTH, null, true);
885
+			update_option(EE_Config::LOG_NAME, $config_log);
886 886
 		}
887 887
 	}
888 888
 
@@ -897,14 +897,14 @@  discard block
 block discarded – undo
897 897
 	 * @return    string
898 898
 	 */
899 899
 	public static function get_page_for_posts() {
900
-		$page_for_posts = get_option( 'page_for_posts' );
901
-		if ( ! $page_for_posts ) {
900
+		$page_for_posts = get_option('page_for_posts');
901
+		if ( ! $page_for_posts) {
902 902
 			return 'posts';
903 903
 		}
904 904
 		/** @type WPDB $wpdb */
905 905
 		global $wpdb;
906 906
 		$SQL = "SELECT post_name from $wpdb->posts WHERE post_type='posts' OR post_type='page' AND post_status='publish' AND ID=%d";
907
-		return $wpdb->get_var( $wpdb->prepare( $SQL, $page_for_posts ) );
907
+		return $wpdb->get_var($wpdb->prepare($SQL, $page_for_posts));
908 908
 	}
909 909
 
910 910
 
@@ -960,17 +960,17 @@  discard block
 block discarded – undo
960 960
 			)
961 961
 		) {
962 962
 			// grab list of installed widgets
963
-			$widgets_to_register = glob( EE_WIDGETS . '*', GLOB_ONLYDIR );
963
+			$widgets_to_register = glob(EE_WIDGETS.'*', GLOB_ONLYDIR);
964 964
 			// filter list of modules to register
965 965
 			$widgets_to_register = apply_filters(
966 966
 				'FHEE__EE_Config__register_widgets__widgets_to_register',
967 967
 				$widgets_to_register
968 968
 			);
969
-			if ( ! empty( $widgets_to_register ) ) {
969
+			if ( ! empty($widgets_to_register)) {
970 970
 				// cycle thru widget folders
971
-				foreach ( $widgets_to_register as $widget_path ) {
971
+				foreach ($widgets_to_register as $widget_path) {
972 972
 					// add to list of installed widget modules
973
-					EE_Config::register_ee_widget( $widget_path );
973
+					EE_Config::register_ee_widget($widget_path);
974 974
 				}
975 975
 			}
976 976
 			// filter list of installed modules
@@ -990,57 +990,57 @@  discard block
 block discarded – undo
990 990
 	 * @param    string $widget_path - full path up to and including widget folder
991 991
 	 * @return    void
992 992
 	 */
993
-	public static function register_ee_widget( $widget_path = null ) {
994
-		do_action( 'AHEE__EE_Config__register_widget__begin', $widget_path );
993
+	public static function register_ee_widget($widget_path = null) {
994
+		do_action('AHEE__EE_Config__register_widget__begin', $widget_path);
995 995
 		$widget_ext = '.widget.php';
996 996
 		// make all separators match
997
-		$widget_path = rtrim( str_replace( '/\\', DS, $widget_path ), DS );
997
+		$widget_path = rtrim(str_replace('/\\', DS, $widget_path), DS);
998 998
 		// does the file path INCLUDE the actual file name as part of the path ?
999
-		if ( strpos( $widget_path, $widget_ext ) !== false ) {
999
+		if (strpos($widget_path, $widget_ext) !== false) {
1000 1000
 			// grab and shortcode file name from directory name and break apart at dots
1001
-			$file_name = explode( '.', basename( $widget_path ) );
1001
+			$file_name = explode('.', basename($widget_path));
1002 1002
 			// take first segment from file name pieces and remove class prefix if it exists
1003
-			$widget = strpos( $file_name[0], 'EEW_' ) === 0 ? substr( $file_name[0], 4 ) : $file_name[0];
1003
+			$widget = strpos($file_name[0], 'EEW_') === 0 ? substr($file_name[0], 4) : $file_name[0];
1004 1004
 			// sanitize shortcode directory name
1005
-			$widget = sanitize_key( $widget );
1005
+			$widget = sanitize_key($widget);
1006 1006
 			// now we need to rebuild the shortcode path
1007
-			$widget_path = explode( DS, $widget_path );
1007
+			$widget_path = explode(DS, $widget_path);
1008 1008
 			// remove last segment
1009
-			array_pop( $widget_path );
1009
+			array_pop($widget_path);
1010 1010
 			// glue it back together
1011
-			$widget_path = implode( DS, $widget_path );
1011
+			$widget_path = implode(DS, $widget_path);
1012 1012
 		} else {
1013 1013
 			// grab and sanitize widget directory name
1014
-			$widget = sanitize_key( basename( $widget_path ) );
1014
+			$widget = sanitize_key(basename($widget_path));
1015 1015
 		}
1016 1016
 		// create classname from widget directory name
1017
-		$widget = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $widget ) ) );
1017
+		$widget = str_replace(' ', '_', ucwords(str_replace('_', ' ', $widget)));
1018 1018
 		// add class prefix
1019
-		$widget_class = 'EEW_' . $widget;
1019
+		$widget_class = 'EEW_'.$widget;
1020 1020
 		// does the widget exist ?
1021
-		if ( ! is_readable( $widget_path . DS . $widget_class . $widget_ext ) ) {
1021
+		if ( ! is_readable($widget_path.DS.$widget_class.$widget_ext)) {
1022 1022
 			$msg = sprintf(
1023 1023
 				__(
1024 1024
 					'The requested %s widget file could not be found or is not readable due to file permissions. Please ensure the following path is correct: %s',
1025 1025
 					'event_espresso'
1026 1026
 				),
1027 1027
 				$widget_class,
1028
-				$widget_path . DS . $widget_class . $widget_ext
1028
+				$widget_path.DS.$widget_class.$widget_ext
1029 1029
 			);
1030
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1030
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1031 1031
 			return;
1032 1032
 		}
1033 1033
 		// load the widget class file
1034
-		require_once( $widget_path . DS . $widget_class . $widget_ext );
1034
+		require_once($widget_path.DS.$widget_class.$widget_ext);
1035 1035
 		// verify that class exists
1036
-		if ( ! class_exists( $widget_class ) ) {
1037
-			$msg = sprintf( __( 'The requested %s widget class does not exist.', 'event_espresso' ), $widget_class );
1038
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1036
+		if ( ! class_exists($widget_class)) {
1037
+			$msg = sprintf(__('The requested %s widget class does not exist.', 'event_espresso'), $widget_class);
1038
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1039 1039
 			return;
1040 1040
 		}
1041
-		register_widget( $widget_class );
1041
+		register_widget($widget_class);
1042 1042
 		// add to array of registered widgets
1043
-		EE_Registry::instance()->widgets->{$widget_class} = $widget_path . DS . $widget_class . $widget_ext;
1043
+		EE_Registry::instance()->widgets->{$widget_class} = $widget_path.DS.$widget_class.$widget_ext;
1044 1044
 	}
1045 1045
 
1046 1046
 
@@ -1053,17 +1053,17 @@  discard block
 block discarded – undo
1053 1053
 	 */
1054 1054
 	private function _register_shortcodes() {
1055 1055
 		// grab list of installed shortcodes
1056
-		$shortcodes_to_register = glob( EE_SHORTCODES . '*', GLOB_ONLYDIR );
1056
+		$shortcodes_to_register = glob(EE_SHORTCODES.'*', GLOB_ONLYDIR);
1057 1057
 		// filter list of modules to register
1058 1058
 		$shortcodes_to_register = apply_filters(
1059 1059
 			'FHEE__EE_Config__register_shortcodes__shortcodes_to_register',
1060 1060
 			$shortcodes_to_register
1061 1061
 		);
1062
-		if ( ! empty( $shortcodes_to_register ) ) {
1062
+		if ( ! empty($shortcodes_to_register)) {
1063 1063
 			// cycle thru shortcode folders
1064
-			foreach ( $shortcodes_to_register as $shortcode_path ) {
1064
+			foreach ($shortcodes_to_register as $shortcode_path) {
1065 1065
 				// add to list of installed shortcode modules
1066
-				EE_Config::register_shortcode( $shortcode_path );
1066
+				EE_Config::register_shortcode($shortcode_path);
1067 1067
 			}
1068 1068
 		}
1069 1069
 		// filter list of installed modules
@@ -1082,64 +1082,64 @@  discard block
 block discarded – undo
1082 1082
 	 * @param    string $shortcode_path - full path up to and including shortcode folder
1083 1083
 	 * @return    bool
1084 1084
 	 */
1085
-	public static function register_shortcode( $shortcode_path = null ) {
1086
-		do_action( 'AHEE__EE_Config__register_shortcode__begin', $shortcode_path );
1085
+	public static function register_shortcode($shortcode_path = null) {
1086
+		do_action('AHEE__EE_Config__register_shortcode__begin', $shortcode_path);
1087 1087
 		$shortcode_ext = '.shortcode.php';
1088 1088
 		// make all separators match
1089
-		$shortcode_path = str_replace( array( '\\', '/' ), DS, $shortcode_path );
1089
+		$shortcode_path = str_replace(array('\\', '/'), DS, $shortcode_path);
1090 1090
 		// does the file path INCLUDE the actual file name as part of the path ?
1091
-		if ( strpos( $shortcode_path, $shortcode_ext ) !== false ) {
1091
+		if (strpos($shortcode_path, $shortcode_ext) !== false) {
1092 1092
 			// grab shortcode file name from directory name and break apart at dots
1093
-			$shortcode_file = explode( '.', basename( $shortcode_path ) );
1093
+			$shortcode_file = explode('.', basename($shortcode_path));
1094 1094
 			// take first segment from file name pieces and remove class prefix if it exists
1095
-			$shortcode = strpos( $shortcode_file[0], 'EES_' ) === 0
1096
-				? substr( $shortcode_file[0], 4 )
1095
+			$shortcode = strpos($shortcode_file[0], 'EES_') === 0
1096
+				? substr($shortcode_file[0], 4)
1097 1097
 				: $shortcode_file[0];
1098 1098
 			// sanitize shortcode directory name
1099
-			$shortcode = sanitize_key( $shortcode );
1099
+			$shortcode = sanitize_key($shortcode);
1100 1100
 			// now we need to rebuild the shortcode path
1101
-			$shortcode_path = explode( DS, $shortcode_path );
1101
+			$shortcode_path = explode(DS, $shortcode_path);
1102 1102
 			// remove last segment
1103
-			array_pop( $shortcode_path );
1103
+			array_pop($shortcode_path);
1104 1104
 			// glue it back together
1105
-			$shortcode_path = implode( DS, $shortcode_path ) . DS;
1105
+			$shortcode_path = implode(DS, $shortcode_path).DS;
1106 1106
 		} else {
1107 1107
 			// we need to generate the filename based off of the folder name
1108 1108
 			// grab and sanitize shortcode directory name
1109
-			$shortcode = sanitize_key( basename( $shortcode_path ) );
1110
-			$shortcode_path = rtrim( $shortcode_path, DS ) . DS;
1109
+			$shortcode = sanitize_key(basename($shortcode_path));
1110
+			$shortcode_path = rtrim($shortcode_path, DS).DS;
1111 1111
 		}
1112 1112
 		// create classname from shortcode directory or file name
1113
-		$shortcode = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $shortcode ) ) );
1113
+		$shortcode = str_replace(' ', '_', ucwords(str_replace('_', ' ', $shortcode)));
1114 1114
 		// add class prefix
1115
-		$shortcode_class = 'EES_' . $shortcode;
1115
+		$shortcode_class = 'EES_'.$shortcode;
1116 1116
 		// does the shortcode exist ?
1117
-		if ( ! is_readable( $shortcode_path . DS . $shortcode_class . $shortcode_ext ) ) {
1117
+		if ( ! is_readable($shortcode_path.DS.$shortcode_class.$shortcode_ext)) {
1118 1118
 			$msg = sprintf(
1119 1119
 				__(
1120 1120
 					'The requested %s shortcode file could not be found or is not readable due to file permissions. It should be in %s',
1121 1121
 					'event_espresso'
1122 1122
 				),
1123 1123
 				$shortcode_class,
1124
-				$shortcode_path . DS . $shortcode_class . $shortcode_ext
1124
+				$shortcode_path.DS.$shortcode_class.$shortcode_ext
1125 1125
 			);
1126
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1126
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1127 1127
 			return false;
1128 1128
 		}
1129 1129
 		// load the shortcode class file
1130
-		require_once( $shortcode_path . $shortcode_class . $shortcode_ext );
1130
+		require_once($shortcode_path.$shortcode_class.$shortcode_ext);
1131 1131
 		// verify that class exists
1132
-		if ( ! class_exists( $shortcode_class ) ) {
1132
+		if ( ! class_exists($shortcode_class)) {
1133 1133
 			$msg = sprintf(
1134
-				__( 'The requested %s shortcode class does not exist.', 'event_espresso' ),
1134
+				__('The requested %s shortcode class does not exist.', 'event_espresso'),
1135 1135
 				$shortcode_class
1136 1136
 			);
1137
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1137
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1138 1138
 			return false;
1139 1139
 		}
1140
-		$shortcode = strtoupper( $shortcode );
1140
+		$shortcode = strtoupper($shortcode);
1141 1141
 		// add to array of registered shortcodes
1142
-		EE_Registry::instance()->shortcodes->{$shortcode} = $shortcode_path . $shortcode_class . $shortcode_ext;
1142
+		EE_Registry::instance()->shortcodes->{$shortcode} = $shortcode_path.$shortcode_class.$shortcode_ext;
1143 1143
 		return true;
1144 1144
 	}
1145 1145
 
@@ -1153,22 +1153,22 @@  discard block
 block discarded – undo
1153 1153
 	 */
1154 1154
 	private function _register_modules() {
1155 1155
 		// grab list of installed modules
1156
-		$modules_to_register = glob( EE_MODULES . '*', GLOB_ONLYDIR );
1156
+		$modules_to_register = glob(EE_MODULES.'*', GLOB_ONLYDIR);
1157 1157
 		// filter list of modules to register
1158 1158
 		$modules_to_register = apply_filters(
1159 1159
 			'FHEE__EE_Config__register_modules__modules_to_register',
1160 1160
 			$modules_to_register
1161 1161
 		);
1162
-		if ( ! empty( $modules_to_register ) ) {
1162
+		if ( ! empty($modules_to_register)) {
1163 1163
 			// loop through folders
1164
-			foreach ( $modules_to_register as $module_path ) {
1164
+			foreach ($modules_to_register as $module_path) {
1165 1165
 				/**TEMPORARILY EXCLUDE gateways from modules for time being**/
1166 1166
 				if (
1167
-					$module_path !== EE_MODULES . 'zzz-copy-this-module-template'
1168
-					&& $module_path !== EE_MODULES . 'gateways'
1167
+					$module_path !== EE_MODULES.'zzz-copy-this-module-template'
1168
+					&& $module_path !== EE_MODULES.'gateways'
1169 1169
 				) {
1170 1170
 					// add to list of installed modules
1171
-					EE_Config::register_module( $module_path );
1171
+					EE_Config::register_module($module_path);
1172 1172
 				}
1173 1173
 			}
1174 1174
 		}
@@ -1188,39 +1188,39 @@  discard block
 block discarded – undo
1188 1188
 	 * @param    string $module_path - full path up to and including module folder
1189 1189
 	 * @return    bool
1190 1190
 	 */
1191
-	public static function register_module( $module_path = null ) {
1192
-		do_action( 'AHEE__EE_Config__register_module__begin', $module_path );
1191
+	public static function register_module($module_path = null) {
1192
+		do_action('AHEE__EE_Config__register_module__begin', $module_path);
1193 1193
 		$module_ext = '.module.php';
1194 1194
 		// make all separators match
1195
-		$module_path = str_replace( array( '\\', '/' ), DS, $module_path );
1195
+		$module_path = str_replace(array('\\', '/'), DS, $module_path);
1196 1196
 		// does the file path INCLUDE the actual file name as part of the path ?
1197
-		if ( strpos( $module_path, $module_ext ) !== false ) {
1197
+		if (strpos($module_path, $module_ext) !== false) {
1198 1198
 			// grab and shortcode file name from directory name and break apart at dots
1199
-			$module_file = explode( '.', basename( $module_path ) );
1199
+			$module_file = explode('.', basename($module_path));
1200 1200
 			// now we need to rebuild the shortcode path
1201
-			$module_path = explode( DS, $module_path );
1201
+			$module_path = explode(DS, $module_path);
1202 1202
 			// remove last segment
1203
-			array_pop( $module_path );
1203
+			array_pop($module_path);
1204 1204
 			// glue it back together
1205
-			$module_path = implode( DS, $module_path ) . DS;
1205
+			$module_path = implode(DS, $module_path).DS;
1206 1206
 			// take first segment from file name pieces and sanitize it
1207
-			$module = preg_replace( '/[^a-zA-Z0-9_\-]/', '', $module_file[0] );
1207
+			$module = preg_replace('/[^a-zA-Z0-9_\-]/', '', $module_file[0]);
1208 1208
 			// ensure class prefix is added
1209
-			$module_class = strpos( $module, 'EED_' ) !== 0 ? 'EED_' . $module : $module;
1209
+			$module_class = strpos($module, 'EED_') !== 0 ? 'EED_'.$module : $module;
1210 1210
 		} else {
1211 1211
 			// we need to generate the filename based off of the folder name
1212 1212
 			// grab and sanitize module name
1213
-			$module = strtolower( basename( $module_path ) );
1214
-			$module = preg_replace( '/[^a-z0-9_\-]/', '', $module );
1213
+			$module = strtolower(basename($module_path));
1214
+			$module = preg_replace('/[^a-z0-9_\-]/', '', $module);
1215 1215
 			// like trailingslashit()
1216
-			$module_path = rtrim( $module_path, DS ) . DS;
1216
+			$module_path = rtrim($module_path, DS).DS;
1217 1217
 			// create classname from module directory name
1218
-			$module = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $module ) ) );
1218
+			$module = str_replace(' ', '_', ucwords(str_replace('_', ' ', $module)));
1219 1219
 			// add class prefix
1220
-			$module_class = 'EED_' . $module;
1220
+			$module_class = 'EED_'.$module;
1221 1221
 		}
1222 1222
 		// does the module exist ?
1223
-		if ( ! is_readable( $module_path . DS . $module_class . $module_ext ) ) {
1223
+		if ( ! is_readable($module_path.DS.$module_class.$module_ext)) {
1224 1224
 			$msg = sprintf(
1225 1225
 				__(
1226 1226
 					'The requested %s module file could not be found or is not readable due to file permissions.',
@@ -1228,19 +1228,19 @@  discard block
 block discarded – undo
1228 1228
 				),
1229 1229
 				$module
1230 1230
 			);
1231
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1231
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1232 1232
 			return false;
1233 1233
 		}
1234 1234
 		// load the module class file
1235
-		require_once( $module_path . $module_class . $module_ext );
1235
+		require_once($module_path.$module_class.$module_ext);
1236 1236
 		// verify that class exists
1237
-		if ( ! class_exists( $module_class ) ) {
1238
-			$msg = sprintf( __( 'The requested %s module class does not exist.', 'event_espresso' ), $module_class );
1239
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1237
+		if ( ! class_exists($module_class)) {
1238
+			$msg = sprintf(__('The requested %s module class does not exist.', 'event_espresso'), $module_class);
1239
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1240 1240
 			return false;
1241 1241
 		}
1242 1242
 		// add to array of registered modules
1243
-		EE_Registry::instance()->modules->{$module_class} = $module_path . $module_class . $module_ext;
1243
+		EE_Registry::instance()->modules->{$module_class} = $module_path.$module_class.$module_ext;
1244 1244
 		do_action(
1245 1245
 			'AHEE__EE_Config__register_module__complete',
1246 1246
 			$module_class,
@@ -1260,26 +1260,26 @@  discard block
 block discarded – undo
1260 1260
 	 */
1261 1261
 	private function _initialize_shortcodes() {
1262 1262
 		// cycle thru shortcode folders
1263
-		foreach ( EE_Registry::instance()->shortcodes as $shortcode => $shortcode_path ) {
1263
+		foreach (EE_Registry::instance()->shortcodes as $shortcode => $shortcode_path) {
1264 1264
 			// add class prefix
1265
-			$shortcode_class = 'EES_' . $shortcode;
1265
+			$shortcode_class = 'EES_'.$shortcode;
1266 1266
 			// fire the shortcode class's set_hooks methods in case it needs to hook into other parts of the system
1267 1267
 			// which set hooks ?
1268
-			if ( is_admin() ) {
1268
+			if (is_admin()) {
1269 1269
 				// fire immediately
1270
-				call_user_func( array( $shortcode_class, 'set_hooks_admin' ) );
1270
+				call_user_func(array($shortcode_class, 'set_hooks_admin'));
1271 1271
 			} else {
1272 1272
 				// delay until other systems are online
1273 1273
 				add_action(
1274 1274
 					'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons',
1275
-					array( $shortcode_class, 'set_hooks' )
1275
+					array($shortcode_class, 'set_hooks')
1276 1276
 				);
1277 1277
 				// convert classname to UPPERCASE and create WP shortcode.
1278
-				$shortcode_tag = strtoupper( $shortcode );
1278
+				$shortcode_tag = strtoupper($shortcode);
1279 1279
 				// but first check if the shortcode has already been added before assigning 'fallback_shortcode_processor'
1280
-				if ( ! shortcode_exists( $shortcode_tag ) ) {
1280
+				if ( ! shortcode_exists($shortcode_tag)) {
1281 1281
 					// NOTE: this shortcode declaration will get overridden if the shortcode is successfully detected in the post content in EE_Front_Controller->_initialize_shortcodes()
1282
-					add_shortcode( $shortcode_tag, array( $shortcode_class, 'fallback_shortcode_processor' ) );
1282
+					add_shortcode($shortcode_tag, array($shortcode_class, 'fallback_shortcode_processor'));
1283 1283
 				}
1284 1284
 			}
1285 1285
 		}
@@ -1296,17 +1296,17 @@  discard block
 block discarded – undo
1296 1296
 	 */
1297 1297
 	private function _initialize_modules() {
1298 1298
 		// cycle thru shortcode folders
1299
-		foreach ( EE_Registry::instance()->modules as $module_class => $module_path ) {
1299
+		foreach (EE_Registry::instance()->modules as $module_class => $module_path) {
1300 1300
 			// fire the shortcode class's set_hooks methods in case it needs to hook into other parts of the system
1301 1301
 			// which set hooks ?
1302
-			if ( is_admin() ) {
1302
+			if (is_admin()) {
1303 1303
 				// fire immediately
1304
-				call_user_func( array( $module_class, 'set_hooks_admin' ) );
1304
+				call_user_func(array($module_class, 'set_hooks_admin'));
1305 1305
 			} else {
1306 1306
 				// delay until other systems are online
1307 1307
 				add_action(
1308 1308
 					'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons',
1309
-					array( $module_class, 'set_hooks' )
1309
+					array($module_class, 'set_hooks')
1310 1310
 				);
1311 1311
 			}
1312 1312
 		}
@@ -1324,29 +1324,29 @@  discard block
 block discarded – undo
1324 1324
 	 * @param    string $key         - url param key indicating a route is being called
1325 1325
 	 * @return    bool
1326 1326
 	 */
1327
-	public static function register_route( $route = null, $module = null, $method_name = null, $key = 'ee' ) {
1328
-		do_action( 'AHEE__EE_Config__register_route__begin', $route, $module, $method_name );
1329
-		$module = str_replace( 'EED_', '', $module );
1330
-		$module_class = 'EED_' . $module;
1331
-		if ( ! isset( EE_Registry::instance()->modules->{$module_class} ) ) {
1332
-			$msg = sprintf( __( 'The module %s has not been registered.', 'event_espresso' ), $module );
1333
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1327
+	public static function register_route($route = null, $module = null, $method_name = null, $key = 'ee') {
1328
+		do_action('AHEE__EE_Config__register_route__begin', $route, $module, $method_name);
1329
+		$module = str_replace('EED_', '', $module);
1330
+		$module_class = 'EED_'.$module;
1331
+		if ( ! isset(EE_Registry::instance()->modules->{$module_class} )) {
1332
+			$msg = sprintf(__('The module %s has not been registered.', 'event_espresso'), $module);
1333
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1334 1334
 			return false;
1335 1335
 		}
1336
-		if ( empty( $route ) ) {
1337
-			$msg = sprintf( __( 'No route has been supplied.', 'event_espresso' ), $route );
1338
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1336
+		if (empty($route)) {
1337
+			$msg = sprintf(__('No route has been supplied.', 'event_espresso'), $route);
1338
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1339 1339
 			return false;
1340 1340
 		}
1341
-		if ( ! method_exists( 'EED_' . $module, $method_name ) ) {
1341
+		if ( ! method_exists('EED_'.$module, $method_name)) {
1342 1342
 			$msg = sprintf(
1343
-				__( 'A valid class method for the %s route has not been supplied.', 'event_espresso' ),
1343
+				__('A valid class method for the %s route has not been supplied.', 'event_espresso'),
1344 1344
 				$route
1345 1345
 			);
1346
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1346
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1347 1347
 			return false;
1348 1348
 		}
1349
-		EE_Config::$_module_route_map[ $key ][ $route ] = array( 'EED_' . $module, $method_name );
1349
+		EE_Config::$_module_route_map[$key][$route] = array('EED_'.$module, $method_name);
1350 1350
 		return true;
1351 1351
 	}
1352 1352
 
@@ -1360,11 +1360,11 @@  discard block
 block discarded – undo
1360 1360
 	 * @param    string $key   - url param key indicating a route is being called
1361 1361
 	 * @return    string
1362 1362
 	 */
1363
-	public static function get_route( $route = null, $key = 'ee' ) {
1364
-		do_action( 'AHEE__EE_Config__get_route__begin', $route );
1365
-		$route = (string) apply_filters( 'FHEE__EE_Config__get_route', $route );
1366
-		if ( isset( EE_Config::$_module_route_map[ $key ][ $route ] ) ) {
1367
-			return EE_Config::$_module_route_map[ $key ][ $route ];
1363
+	public static function get_route($route = null, $key = 'ee') {
1364
+		do_action('AHEE__EE_Config__get_route__begin', $route);
1365
+		$route = (string) apply_filters('FHEE__EE_Config__get_route', $route);
1366
+		if (isset(EE_Config::$_module_route_map[$key][$route])) {
1367
+			return EE_Config::$_module_route_map[$key][$route];
1368 1368
 		}
1369 1369
 		return null;
1370 1370
 	}
@@ -1394,49 +1394,49 @@  discard block
 block discarded – undo
1394 1394
 	 * @param    string       $key     - url param key indicating a route is being called
1395 1395
 	 * @return    bool
1396 1396
 	 */
1397
-	public static function register_forward( $route = null, $status = 0, $forward = null, $key = 'ee' ) {
1398
-		do_action( 'AHEE__EE_Config__register_forward', $route, $status, $forward );
1399
-		if ( ! isset( EE_Config::$_module_route_map[ $key ][ $route ] ) || empty( $route ) ) {
1397
+	public static function register_forward($route = null, $status = 0, $forward = null, $key = 'ee') {
1398
+		do_action('AHEE__EE_Config__register_forward', $route, $status, $forward);
1399
+		if ( ! isset(EE_Config::$_module_route_map[$key][$route]) || empty($route)) {
1400 1400
 			$msg = sprintf(
1401
-				__( 'The module route %s for this forward has not been registered.', 'event_espresso' ),
1401
+				__('The module route %s for this forward has not been registered.', 'event_espresso'),
1402 1402
 				$route
1403 1403
 			);
1404
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1404
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1405 1405
 			return false;
1406 1406
 		}
1407
-		if ( empty( $forward ) ) {
1408
-			$msg = sprintf( __( 'No forwarding route has been supplied.', 'event_espresso' ), $route );
1409
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1407
+		if (empty($forward)) {
1408
+			$msg = sprintf(__('No forwarding route has been supplied.', 'event_espresso'), $route);
1409
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1410 1410
 			return false;
1411 1411
 		}
1412
-		if ( is_array( $forward ) ) {
1413
-			if ( ! isset( $forward[1] ) ) {
1412
+		if (is_array($forward)) {
1413
+			if ( ! isset($forward[1])) {
1414 1414
 				$msg = sprintf(
1415
-					__( 'A class method for the %s forwarding route has not been supplied.', 'event_espresso' ),
1415
+					__('A class method for the %s forwarding route has not been supplied.', 'event_espresso'),
1416 1416
 					$route
1417 1417
 				);
1418
-				EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1418
+				EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1419 1419
 				return false;
1420 1420
 			}
1421
-			if ( ! method_exists( $forward[0], $forward[1] ) ) {
1421
+			if ( ! method_exists($forward[0], $forward[1])) {
1422 1422
 				$msg = sprintf(
1423
-					__( 'The class method %s for the %s forwarding route is in invalid.', 'event_espresso' ),
1423
+					__('The class method %s for the %s forwarding route is in invalid.', 'event_espresso'),
1424 1424
 					$forward[1],
1425 1425
 					$route
1426 1426
 				);
1427
-				EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1427
+				EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1428 1428
 				return false;
1429 1429
 			}
1430
-		} else if ( ! function_exists( $forward ) ) {
1430
+		} else if ( ! function_exists($forward)) {
1431 1431
 			$msg = sprintf(
1432
-				__( 'The function %s for the %s forwarding route is in invalid.', 'event_espresso' ),
1432
+				__('The function %s for the %s forwarding route is in invalid.', 'event_espresso'),
1433 1433
 				$forward,
1434 1434
 				$route
1435 1435
 			);
1436
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1436
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1437 1437
 			return false;
1438 1438
 		}
1439
-		EE_Config::$_module_forward_map[ $key ][ $route ][ absint( $status ) ] = $forward;
1439
+		EE_Config::$_module_forward_map[$key][$route][absint($status)] = $forward;
1440 1440
 		return true;
1441 1441
 	}
1442 1442
 
@@ -1452,12 +1452,12 @@  discard block
 block discarded – undo
1452 1452
 	 * @param    string  $key    - url param key indicating a route is being called
1453 1453
 	 * @return    string
1454 1454
 	 */
1455
-	public static function get_forward( $route = null, $status = 0, $key = 'ee' ) {
1456
-		do_action( 'AHEE__EE_Config__get_forward__begin', $route, $status );
1457
-		if ( isset( EE_Config::$_module_forward_map[ $key ][ $route ][ $status ] ) ) {
1455
+	public static function get_forward($route = null, $status = 0, $key = 'ee') {
1456
+		do_action('AHEE__EE_Config__get_forward__begin', $route, $status);
1457
+		if (isset(EE_Config::$_module_forward_map[$key][$route][$status])) {
1458 1458
 			return apply_filters(
1459 1459
 				'FHEE__EE_Config__get_forward',
1460
-				EE_Config::$_module_forward_map[ $key ][ $route ][ $status ],
1460
+				EE_Config::$_module_forward_map[$key][$route][$status],
1461 1461
 				$route,
1462 1462
 				$status
1463 1463
 			);
@@ -1479,17 +1479,17 @@  discard block
 block discarded – undo
1479 1479
 	 * @param    string  $key    - url param key indicating a route is being called
1480 1480
 	 * @return    bool
1481 1481
 	 */
1482
-	public static function register_view( $route = null, $status = 0, $view = null, $key = 'ee' ) {
1483
-		do_action( 'AHEE__EE_Config__register_view__begin', $route, $status, $view );
1484
-		if ( ! isset( EE_Config::$_module_route_map[ $key ][ $route ] ) || empty( $route ) ) {
1482
+	public static function register_view($route = null, $status = 0, $view = null, $key = 'ee') {
1483
+		do_action('AHEE__EE_Config__register_view__begin', $route, $status, $view);
1484
+		if ( ! isset(EE_Config::$_module_route_map[$key][$route]) || empty($route)) {
1485 1485
 			$msg = sprintf(
1486
-				__( 'The module route %s for this view has not been registered.', 'event_espresso' ),
1486
+				__('The module route %s for this view has not been registered.', 'event_espresso'),
1487 1487
 				$route
1488 1488
 			);
1489
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1489
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1490 1490
 			return false;
1491 1491
 		}
1492
-		if ( ! is_readable( $view ) ) {
1492
+		if ( ! is_readable($view)) {
1493 1493
 			$msg = sprintf(
1494 1494
 				__(
1495 1495
 					'The %s view file could not be found or is not readable due to file permissions.',
@@ -1497,10 +1497,10 @@  discard block
 block discarded – undo
1497 1497
 				),
1498 1498
 				$view
1499 1499
 			);
1500
-			EE_Error::add_error( $msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__ );
1500
+			EE_Error::add_error($msg.'||'.$msg, __FILE__, __FUNCTION__, __LINE__);
1501 1501
 			return false;
1502 1502
 		}
1503
-		EE_Config::$_module_view_map[ $key ][ $route ][ absint( $status ) ] = $view;
1503
+		EE_Config::$_module_view_map[$key][$route][absint($status)] = $view;
1504 1504
 		return true;
1505 1505
 	}
1506 1506
 
@@ -1516,12 +1516,12 @@  discard block
 block discarded – undo
1516 1516
 	 * @param    string  $key    - url param key indicating a route is being called
1517 1517
 	 * @return    string
1518 1518
 	 */
1519
-	public static function get_view( $route = null, $status = 0, $key = 'ee' ) {
1520
-		do_action( 'AHEE__EE_Config__get_view__begin', $route, $status );
1521
-		if ( isset( EE_Config::$_module_view_map[ $key ][ $route ][ $status ] ) ) {
1519
+	public static function get_view($route = null, $status = 0, $key = 'ee') {
1520
+		do_action('AHEE__EE_Config__get_view__begin', $route, $status);
1521
+		if (isset(EE_Config::$_module_view_map[$key][$route][$status])) {
1522 1522
 			return apply_filters(
1523 1523
 				'FHEE__EE_Config__get_view',
1524
-				EE_Config::$_module_view_map[ $key ][ $route ][ $status ],
1524
+				EE_Config::$_module_view_map[$key][$route][$status],
1525 1525
 				$route,
1526 1526
 				$status
1527 1527
 			);
@@ -1532,7 +1532,7 @@  discard block
 block discarded – undo
1532 1532
 
1533 1533
 
1534 1534
 	public function update_addon_option_names() {
1535
-		update_option( EE_Config::ADDON_OPTION_NAMES, $this->_addon_option_names );
1535
+		update_option(EE_Config::ADDON_OPTION_NAMES, $this->_addon_option_names);
1536 1536
 	}
1537 1537
 
1538 1538
 
@@ -1560,22 +1560,22 @@  discard block
 block discarded – undo
1560 1560
 	 * @return mixed if a detected type found return the escaped value, otherwise just the raw value is returned.
1561 1561
 	 * @throws \EE_Error
1562 1562
 	 */
1563
-	public function get_pretty( $property ) {
1564
-		if ( ! property_exists( $this, $property ) ) {
1563
+	public function get_pretty($property) {
1564
+		if ( ! property_exists($this, $property)) {
1565 1565
 			throw new EE_Error(
1566 1566
 				sprintf(
1567 1567
 					__(
1568 1568
 						'%1$s::get_pretty() has been called with the property %2$s which does not exist on the %1$s config class.',
1569 1569
 						'event_espresso'
1570 1570
 					),
1571
-					get_class( $this ),
1571
+					get_class($this),
1572 1572
 					$property
1573 1573
 				)
1574 1574
 			);
1575 1575
 		}
1576 1576
 		//just handling escaping of strings for now.
1577
-		if ( is_string( $this->{$property} ) ) {
1578
-			return stripslashes( $this->{$property} );
1577
+		if (is_string($this->{$property} )) {
1578
+			return stripslashes($this->{$property} );
1579 1579
 		}
1580 1580
 		return $this->{$property};
1581 1581
 	}
@@ -1584,17 +1584,17 @@  discard block
 block discarded – undo
1584 1584
 
1585 1585
 	public function populate() {
1586 1586
 		//grab defaults via a new instance of this class.
1587
-		$class_name = get_class( $this );
1587
+		$class_name = get_class($this);
1588 1588
 		$defaults = new $class_name;
1589 1589
 		//loop through the properties for this class and see if they are set.  If they are NOT, then grab the
1590 1590
 		//default from our $defaults object.
1591
-		foreach ( get_object_vars( $defaults ) as $property => $value ) {
1592
-			if ( $this->{$property} === null ) {
1591
+		foreach (get_object_vars($defaults) as $property => $value) {
1592
+			if ($this->{$property} === null) {
1593 1593
 				$this->{$property} = $value;
1594 1594
 			}
1595 1595
 		}
1596 1596
 		//cleanup
1597
-		unset( $defaults );
1597
+		unset($defaults);
1598 1598
 	}
1599 1599
 
1600 1600
 
@@ -1610,7 +1610,7 @@  discard block
 block discarded – undo
1610 1610
 	 * @param $a
1611 1611
 	 * @return bool
1612 1612
 	 */
1613
-	public function __isset( $a ) {
1613
+	public function __isset($a) {
1614 1614
 		return false;
1615 1615
 	}
1616 1616
 
@@ -1622,7 +1622,7 @@  discard block
 block discarded – undo
1622 1622
 	 * @param $a
1623 1623
 	 * @return bool
1624 1624
 	 */
1625
-	public function __unset( $a ) {
1625
+	public function __unset($a) {
1626 1626
 		return false;
1627 1627
 	}
1628 1628
 
@@ -1732,7 +1732,7 @@  discard block
 block discarded – undo
1732 1732
 		$this->current_blog_id = get_current_blog_id();
1733 1733
 		$this->current_blog_id = $this->current_blog_id === NULL ? 1 : $this->current_blog_id;
1734 1734
 		$this->ee_ueip_optin = $this->_get_main_ee_ueip_optin();
1735
-		$this->ee_ueip_has_notified = is_main_site() ? get_option( 'ee_ueip_has_notified', false ) : true;
1735
+		$this->ee_ueip_has_notified = is_main_site() ? get_option('ee_ueip_has_notified', false) : true;
1736 1736
 		$this->post_shortcodes = array();
1737 1737
 		$this->module_route_map = array();
1738 1738
 		$this->module_forward_map = array();
@@ -1748,9 +1748,9 @@  discard block
 block discarded – undo
1748 1748
 		$this->thank_you_page_url = '';
1749 1749
 		$this->cancel_page_url = '';
1750 1750
 		//cpt slugs
1751
-		$this->event_cpt_slug = __( 'events', 'event_espresso' );
1751
+		$this->event_cpt_slug = __('events', 'event_espresso');
1752 1752
 		//ueip constant check
1753
-		if ( defined( 'EE_DISABLE_UXIP' ) && EE_DISABLE_UXIP ) {
1753
+		if (defined('EE_DISABLE_UXIP') && EE_DISABLE_UXIP) {
1754 1754
 			$this->ee_ueip_optin = false;
1755 1755
 			$this->ee_ueip_has_notified = true;
1756 1756
 		}
@@ -1793,11 +1793,11 @@  discard block
 block discarded – undo
1793 1793
 	 * @return    string
1794 1794
 	 */
1795 1795
 	public function reg_page_url() {
1796
-		if ( ! $this->reg_page_url ) {
1796
+		if ( ! $this->reg_page_url) {
1797 1797
 			$this->reg_page_url = add_query_arg(
1798
-				array( 'uts' => time() ),
1799
-				get_permalink( $this->reg_page_id )
1800
-			) . '#checkout';
1798
+				array('uts' => time()),
1799
+				get_permalink($this->reg_page_id)
1800
+			).'#checkout';
1801 1801
 		}
1802 1802
 		return $this->reg_page_url;
1803 1803
 	}
@@ -1812,12 +1812,12 @@  discard block
 block discarded – undo
1812 1812
 	 * @access    public
1813 1813
 	 * @return    string
1814 1814
 	 */
1815
-	public function txn_page_url( $query_args = array() ) {
1816
-		if ( ! $this->txn_page_url ) {
1817
-			$this->txn_page_url = get_permalink( $this->txn_page_id );
1815
+	public function txn_page_url($query_args = array()) {
1816
+		if ( ! $this->txn_page_url) {
1817
+			$this->txn_page_url = get_permalink($this->txn_page_id);
1818 1818
 		}
1819
-		if ( $query_args ) {
1820
-			return add_query_arg( $query_args, $this->txn_page_url );
1819
+		if ($query_args) {
1820
+			return add_query_arg($query_args, $this->txn_page_url);
1821 1821
 		} else {
1822 1822
 			return $this->txn_page_url;
1823 1823
 		}
@@ -1833,12 +1833,12 @@  discard block
 block discarded – undo
1833 1833
 	 * @access    public
1834 1834
 	 * @return    string
1835 1835
 	 */
1836
-	public function thank_you_page_url( $query_args = array() ) {
1837
-		if ( ! $this->thank_you_page_url ) {
1838
-			$this->thank_you_page_url = get_permalink( $this->thank_you_page_id );
1836
+	public function thank_you_page_url($query_args = array()) {
1837
+		if ( ! $this->thank_you_page_url) {
1838
+			$this->thank_you_page_url = get_permalink($this->thank_you_page_id);
1839 1839
 		}
1840
-		if ( $query_args ) {
1841
-			return add_query_arg( $query_args, $this->thank_you_page_url );
1840
+		if ($query_args) {
1841
+			return add_query_arg($query_args, $this->thank_you_page_url);
1842 1842
 		} else {
1843 1843
 			return $this->thank_you_page_url;
1844 1844
 		}
@@ -1853,8 +1853,8 @@  discard block
 block discarded – undo
1853 1853
 	 * @return    string
1854 1854
 	 */
1855 1855
 	public function cancel_page_url() {
1856
-		if ( ! $this->cancel_page_url ) {
1857
-			$this->cancel_page_url = get_permalink( $this->cancel_page_id );
1856
+		if ( ! $this->cancel_page_url) {
1857
+			$this->cancel_page_url = get_permalink($this->cancel_page_id);
1858 1858
 		}
1859 1859
 		return $this->cancel_page_url;
1860 1860
 	}
@@ -1883,22 +1883,22 @@  discard block
 block discarded – undo
1883 1883
 	 */
1884 1884
 	protected function _get_main_ee_ueip_optin() {
1885 1885
 		//if this is the main site then we can just bypass our direct query.
1886
-		if ( is_main_site() ) {
1887
-			return get_option( 'ee_ueip_optin', false );
1886
+		if (is_main_site()) {
1887
+			return get_option('ee_ueip_optin', false);
1888 1888
 		}
1889 1889
 
1890 1890
 		//is this already cached for this request?  If so use it.
1891
-		if ( ! empty( EE_Core_Config::$ee_ueip_option ) ) {
1891
+		if ( ! empty(EE_Core_Config::$ee_ueip_option)) {
1892 1892
 			return EE_Core_Config::$ee_ueip_option;
1893 1893
 		}
1894 1894
 
1895 1895
 		global $wpdb;
1896 1896
 		$current_network_main_site = is_multisite() ? get_current_site() : null;
1897
-		$current_main_site_id = ! empty( $current_network_main_site ) ? $current_network_main_site->blog_id : 1;
1897
+		$current_main_site_id = ! empty($current_network_main_site) ? $current_network_main_site->blog_id : 1;
1898 1898
 		$option = 'ee_ueip_optin';
1899 1899
 
1900 1900
 		//set correct table for query
1901
-		$table_name = $wpdb->get_blog_prefix( $current_main_site_id ) . 'options';
1901
+		$table_name = $wpdb->get_blog_prefix($current_main_site_id).'options';
1902 1902
 
1903 1903
 
1904 1904
 		//rather than getting blog option for the $current_main_site_id, we do a direct $wpdb query because
@@ -1906,20 +1906,20 @@  discard block
 block discarded – undo
1906 1906
 		//re-constructed on the blog switch.  Note, we are still executing any core wp filters on this option retrieval.
1907 1907
 		//this bit of code is basically a direct copy of get_option without any caching because we are NOT switched to the blog
1908 1908
 		//for the purpose of caching.
1909
-		$pre = apply_filters( 'pre_option_' . $option, false, $option );
1910
-		if ( false !== $pre ) {
1909
+		$pre = apply_filters('pre_option_'.$option, false, $option);
1910
+		if (false !== $pre) {
1911 1911
 			EE_Core_Config::$ee_ueip_option = $pre;
1912 1912
 			return EE_Core_Config::$ee_ueip_option;
1913 1913
 		}
1914 1914
 
1915
-		$row = $wpdb->get_row( $wpdb->prepare( "SELECT option_value FROM $table_name WHERE option_name = %s LIMIT 1", $option ) );
1916
-		if ( is_object( $row ) ) {
1915
+		$row = $wpdb->get_row($wpdb->prepare("SELECT option_value FROM $table_name WHERE option_name = %s LIMIT 1", $option));
1916
+		if (is_object($row)) {
1917 1917
 			$value = $row->option_value;
1918 1918
 		} else { //option does not exist so use default.
1919
-			return apply_filters( 'default_option_' . $option, false, $option );
1919
+			return apply_filters('default_option_'.$option, false, $option);
1920 1920
 		}
1921 1921
 
1922
-		EE_Core_Config::$ee_ueip_option = apply_filters( 'option_' . $option, maybe_unserialize( $value ), $option );
1922
+		EE_Core_Config::$ee_ueip_option = apply_filters('option_'.$option, maybe_unserialize($value), $option);
1923 1923
 		return EE_Core_Config::$ee_ueip_option;
1924 1924
 	}
1925 1925
 
@@ -1935,7 +1935,7 @@  discard block
 block discarded – undo
1935 1935
 		//reset all url properties
1936 1936
 		$this->_reset_urls();
1937 1937
 		//return what to save to db
1938
-		return array_keys( get_object_vars( $this ) );
1938
+		return array_keys(get_object_vars($this));
1939 1939
 	}
1940 1940
 
1941 1941
 }
@@ -2082,14 +2082,14 @@  discard block
 block discarded – undo
2082 2082
 	 */
2083 2083
 	public function __construct() {
2084 2084
 		// set default organization settings
2085
-		$this->name = get_bloginfo( 'name' );
2085
+		$this->name = get_bloginfo('name');
2086 2086
 		$this->address_1 = '123 Onna Road';
2087 2087
 		$this->address_2 = 'PO Box 123';
2088 2088
 		$this->city = 'Inna City';
2089 2089
 		$this->STA_ID = 4;
2090 2090
 		$this->CNT_ISO = 'US';
2091 2091
 		$this->zip = '12345';
2092
-		$this->email = get_bloginfo( 'admin_email' );
2092
+		$this->email = get_bloginfo('admin_email');
2093 2093
 		$this->phone = '';
2094 2094
 		$this->vat = '123456789';
2095 2095
 		$this->logo_url = '';
@@ -2177,46 +2177,46 @@  discard block
 block discarded – undo
2177 2177
 	 * @param string $CNT_ISO
2178 2178
 	 * @throws \EE_Error
2179 2179
 	 */
2180
-	public function __construct( $CNT_ISO = '' ) {
2180
+	public function __construct($CNT_ISO = '') {
2181 2181
 		/** @var \EventEspresso\core\services\database\TableAnalysis $table_analysis */
2182
-		$table_analysis = EE_Registry::instance()->create( 'TableAnalysis', array(), true );
2182
+		$table_analysis = EE_Registry::instance()->create('TableAnalysis', array(), true);
2183 2183
 		// get country code from organization settings or use default
2184
-		$ORG_CNT = isset( EE_Registry::instance()->CFG->organization )
2184
+		$ORG_CNT = isset(EE_Registry::instance()->CFG->organization)
2185 2185
 		           && EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config
2186 2186
 			? EE_Registry::instance()->CFG->organization->CNT_ISO
2187 2187
 			: '';
2188 2188
 		// but override if requested
2189
-		$CNT_ISO = ! empty( $CNT_ISO ) ? $CNT_ISO : $ORG_CNT;
2189
+		$CNT_ISO = ! empty($CNT_ISO) ? $CNT_ISO : $ORG_CNT;
2190 2190
 		// so if that all went well, and we are not in M-Mode (cuz you can't query the db in M-Mode) and double-check the countries table exists
2191 2191
 		if (
2192
-			! empty( $CNT_ISO )
2192
+			! empty($CNT_ISO)
2193 2193
 			&& EE_Maintenance_Mode::instance()->models_can_query()
2194
-			&& $table_analysis->tableExists( EE_Registry::instance()->load_model( 'Country' )->table() )
2194
+			&& $table_analysis->tableExists(EE_Registry::instance()->load_model('Country')->table())
2195 2195
 		) {
2196 2196
 			// retrieve the country settings from the db, just in case they have been customized
2197
-			$country = EE_Registry::instance()->load_model( 'Country' )->get_one_by_ID( $CNT_ISO );
2198
-			if ( $country instanceof EE_Country ) {
2199
-				$this->code = $country->currency_code();    // currency code: USD, CAD, EUR
2200
-				$this->name = $country->currency_name_single();    // Dollar
2201
-				$this->plural = $country->currency_name_plural();    // Dollars
2202
-				$this->sign = $country->currency_sign();            // currency sign: $
2203
-				$this->sign_b4 = $country->currency_sign_before();        // currency sign before or after: $TRUE  or  FALSE$
2204
-				$this->dec_plc = $country->currency_decimal_places();    // decimal places: 2 = 0.00  3 = 0.000
2205
-				$this->dec_mrk = $country->currency_decimal_mark();    // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
2206
-				$this->thsnds = $country->currency_thousands_separator();    // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
2197
+			$country = EE_Registry::instance()->load_model('Country')->get_one_by_ID($CNT_ISO);
2198
+			if ($country instanceof EE_Country) {
2199
+				$this->code = $country->currency_code(); // currency code: USD, CAD, EUR
2200
+				$this->name = $country->currency_name_single(); // Dollar
2201
+				$this->plural = $country->currency_name_plural(); // Dollars
2202
+				$this->sign = $country->currency_sign(); // currency sign: $
2203
+				$this->sign_b4 = $country->currency_sign_before(); // currency sign before or after: $TRUE  or  FALSE$
2204
+				$this->dec_plc = $country->currency_decimal_places(); // decimal places: 2 = 0.00  3 = 0.000
2205
+				$this->dec_mrk = $country->currency_decimal_mark(); // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
2206
+				$this->thsnds = $country->currency_thousands_separator(); // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
2207 2207
 			}
2208 2208
 		}
2209 2209
 		// fallback to hardcoded defaults, in case the above failed
2210
-		if ( empty( $this->code ) ) {
2210
+		if (empty($this->code)) {
2211 2211
 			// set default currency settings
2212
-			$this->code = 'USD';    // currency code: USD, CAD, EUR
2213
-			$this->name = __( 'Dollar', 'event_espresso' );    // Dollar
2214
-			$this->plural = __( 'Dollars', 'event_espresso' );    // Dollars
2215
-			$this->sign = '$';    // currency sign: $
2216
-			$this->sign_b4 = true;    // currency sign before or after: $TRUE  or  FALSE$
2217
-			$this->dec_plc = 2;    // decimal places: 2 = 0.00  3 = 0.000
2218
-			$this->dec_mrk = '.';    // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
2219
-			$this->thsnds = ',';    // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
2212
+			$this->code = 'USD'; // currency code: USD, CAD, EUR
2213
+			$this->name = __('Dollar', 'event_espresso'); // Dollar
2214
+			$this->plural = __('Dollars', 'event_espresso'); // Dollars
2215
+			$this->sign = '$'; // currency sign: $
2216
+			$this->sign_b4 = true; // currency sign before or after: $TRUE  or  FALSE$
2217
+			$this->dec_plc = 2; // decimal places: 2 = 0.00  3 = 0.000
2218
+			$this->dec_mrk = '.'; // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
2219
+			$this->thsnds = ','; // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
2220 2220
 		}
2221 2221
 	}
2222 2222
 }
@@ -2378,7 +2378,7 @@  discard block
 block discarded – undo
2378 2378
 	 * @since 4.8.8.rc.019
2379 2379
 	 */
2380 2380
 	public function do_hooks() {
2381
-		add_action( 'AHEE__EE_Config___load_core_config__end', array( $this, 'set_default_reg_status_on_EEM_Event' ) );
2381
+		add_action('AHEE__EE_Config___load_core_config__end', array($this, 'set_default_reg_status_on_EEM_Event'));
2382 2382
 	}
2383 2383
 
2384 2384
 
@@ -2387,7 +2387,7 @@  discard block
 block discarded – undo
2387 2387
 	 * @return void
2388 2388
 	 */
2389 2389
 	public function set_default_reg_status_on_EEM_Event() {
2390
-		EEM_Event::set_default_reg_status( $this->default_STS_ID );
2390
+		EEM_Event::set_default_reg_status($this->default_STS_ID);
2391 2391
 	}
2392 2392
 
2393 2393
 
@@ -2491,10 +2491,10 @@  discard block
 block discarded – undo
2491 2491
 	 * @param bool $reset
2492 2492
 	 * @return string
2493 2493
 	 */
2494
-	public function log_file_name( $reset = false ) {
2495
-		if ( empty( $this->log_file_name ) || $reset ) {
2496
-			$this->log_file_name = sanitize_key( 'espresso_log_' . md5( uniqid( '', true ) ) ) . '.txt';
2497
-			EE_Config::instance()->update_espresso_config( false, false );
2494
+	public function log_file_name($reset = false) {
2495
+		if (empty($this->log_file_name) || $reset) {
2496
+			$this->log_file_name = sanitize_key('espresso_log_'.md5(uniqid('', true))).'.txt';
2497
+			EE_Config::instance()->update_espresso_config(false, false);
2498 2498
 		}
2499 2499
 		return $this->log_file_name;
2500 2500
 	}
@@ -2505,10 +2505,10 @@  discard block
 block discarded – undo
2505 2505
 	 * @param bool $reset
2506 2506
 	 * @return string
2507 2507
 	 */
2508
-	public function debug_file_name( $reset = false ) {
2509
-		if ( empty( $this->debug_file_name ) || $reset ) {
2510
-			$this->debug_file_name = sanitize_key( 'espresso_debug_' . md5( uniqid( '', true ) ) ) . '.txt';
2511
-			EE_Config::instance()->update_espresso_config( false, false );
2508
+	public function debug_file_name($reset = false) {
2509
+		if (empty($this->debug_file_name) || $reset) {
2510
+			$this->debug_file_name = sanitize_key('espresso_debug_'.md5(uniqid('', true))).'.txt';
2511
+			EE_Config::instance()->update_espresso_config(false, false);
2512 2512
 		}
2513 2513
 		return $this->debug_file_name;
2514 2514
 	}
@@ -2519,7 +2519,7 @@  discard block
 block discarded – undo
2519 2519
 	 * @return string
2520 2520
 	 */
2521 2521
 	public function affiliate_id() {
2522
-		return ! empty( $this->affiliate_id ) ? $this->affiliate_id : 'default';
2522
+		return ! empty($this->affiliate_id) ? $this->affiliate_id : 'default';
2523 2523
 	}
2524 2524
 
2525 2525
 
@@ -2699,21 +2699,21 @@  discard block
 block discarded – undo
2699 2699
 		$this->use_google_maps = true;
2700 2700
 		$this->google_map_api_key = '';
2701 2701
 		// for event details pages (reg page)
2702
-		$this->event_details_map_width = 585;            // ee_map_width_single
2703
-		$this->event_details_map_height = 362;            // ee_map_height_single
2704
-		$this->event_details_map_zoom = 14;            // ee_map_zoom_single
2705
-		$this->event_details_display_nav = true;            // ee_map_nav_display_single
2706
-		$this->event_details_nav_size = false;            // ee_map_nav_size_single
2707
-		$this->event_details_control_type = 'default';        // ee_map_type_control_single
2708
-		$this->event_details_map_align = 'center';            // ee_map_align_single
2702
+		$this->event_details_map_width = 585; // ee_map_width_single
2703
+		$this->event_details_map_height = 362; // ee_map_height_single
2704
+		$this->event_details_map_zoom = 14; // ee_map_zoom_single
2705
+		$this->event_details_display_nav = true; // ee_map_nav_display_single
2706
+		$this->event_details_nav_size = false; // ee_map_nav_size_single
2707
+		$this->event_details_control_type = 'default'; // ee_map_type_control_single
2708
+		$this->event_details_map_align = 'center'; // ee_map_align_single
2709 2709
 		// for event list pages
2710
-		$this->event_list_map_width = 300;            // ee_map_width
2711
-		$this->event_list_map_height = 185;        // ee_map_height
2712
-		$this->event_list_map_zoom = 12;            // ee_map_zoom
2713
-		$this->event_list_display_nav = false;        // ee_map_nav_display
2714
-		$this->event_list_nav_size = true;            // ee_map_nav_size
2715
-		$this->event_list_control_type = 'dropdown';        // ee_map_type_control
2716
-		$this->event_list_map_align = 'center';            // ee_map_align
2710
+		$this->event_list_map_width = 300; // ee_map_width
2711
+		$this->event_list_map_height = 185; // ee_map_height
2712
+		$this->event_list_map_zoom = 12; // ee_map_zoom
2713
+		$this->event_list_display_nav = false; // ee_map_nav_display
2714
+		$this->event_list_nav_size = true; // ee_map_nav_size
2715
+		$this->event_list_control_type = 'dropdown'; // ee_map_type_control
2716
+		$this->event_list_map_align = 'center'; // ee_map_align
2717 2717
 	}
2718 2718
 
2719 2719
 }
@@ -2866,7 +2866,7 @@  discard block
 block discarded – undo
2866 2866
 	 * @return void
2867 2867
 	 */
2868 2868
 	protected function _set_php_values() {
2869
-		$this->php->max_input_vars = ini_get( 'max_input_vars' );
2869
+		$this->php->max_input_vars = ini_get('max_input_vars');
2870 2870
 		$this->php->version = phpversion();
2871 2871
 	}
2872 2872
 
@@ -2885,10 +2885,10 @@  discard block
 block discarded – undo
2885 2885
 	 * @type string $msg         Any message to be displayed.
2886 2886
 	 *                           }
2887 2887
 	 */
2888
-	public function max_input_vars_limit_check( $input_count = 0 ) {
2889
-		if ( ! empty( $this->php->max_input_vars )
2890
-		     && ( $input_count >= $this->php->max_input_vars )
2891
-		     && ( PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 && PHP_RELEASE_VERSION >= 9 )
2888
+	public function max_input_vars_limit_check($input_count = 0) {
2889
+		if ( ! empty($this->php->max_input_vars)
2890
+		     && ($input_count >= $this->php->max_input_vars)
2891
+		     && (PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 && PHP_RELEASE_VERSION >= 9)
2892 2892
 		) {
2893 2893
 			return sprintf(
2894 2894
 				__(
@@ -2954,7 +2954,7 @@  discard block
 block discarded – undo
2954 2954
 	 */
2955 2955
 	public function __construct() {
2956 2956
 		$this->payment_settings = array();
2957
-		$this->active_gateways = array( 'Invoice' => false );
2957
+		$this->active_gateways = array('Invoice' => false);
2958 2958
 	}
2959 2959
 }
2960 2960
 
Please login to merge, or discard this patch.