Completed
Branch FET/add-status-circle-componen... (87b160)
by
unknown
33:37 queued 25:26
created
4_2_0_stages/EE_DMS_4_2_0_question_group_questions.dmsstage.php 2 patches
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -6,42 +6,42 @@
 block discarded – undo
6 6
 
7 7
 class EE_DMS_4_2_0_question_group_questions extends EE_Data_Migration_Script_Stage_Table
8 8
 {
9
-    private $_qgq_table;
10
-    public function __construct()
11
-    {
12
-        global $wpdb;
13
-        $this->_pretty_name = __("Question Group Questions", "event_espresso");
14
-        $this->_old_table = $wpdb->prefix."esp_question";
15
-        $this->_qgq_table = $wpdb->prefix."esp_question_group_question";
16
-        parent::__construct();
17
-    }
18
-    protected function _migrate_old_row($old_row)
19
-    {
20
-        // foreach question_group_question entry with this QST_ID, we want to set its
21
-        // QSG_order equal to this question's QST_order
22
-        global $wpdb;
23
-        $updated = $wpdb->update(
24
-            $this->_qgq_table,
25
-            array('QGQ_order'=>$old_row['QST_order']),
26
-            array('QST_ID'=>$old_row['QST_ID']),
27
-            array('%d',// QGQ_order
28
-                    ),
29
-            array('%d',// QST_ID
30
-                    )
31
-        );
32
-        if (false === $updated) {
33
-            $this->add_error(
34
-                sprintf(
35
-                    __(
36
-                        "Error in updating table %s setting QGQ_order = %d where QST_ID = %d",
37
-                        'event_espresso'
38
-                    ),
39
-                    $this->_qgq_table,
40
-                    $old_row['QST_order'],
41
-                    $old_row['QST_ID']
42
-                )
43
-            );
44
-        }
45
-        // nothing to map really
46
-    }
9
+	private $_qgq_table;
10
+	public function __construct()
11
+	{
12
+		global $wpdb;
13
+		$this->_pretty_name = __("Question Group Questions", "event_espresso");
14
+		$this->_old_table = $wpdb->prefix."esp_question";
15
+		$this->_qgq_table = $wpdb->prefix."esp_question_group_question";
16
+		parent::__construct();
17
+	}
18
+	protected function _migrate_old_row($old_row)
19
+	{
20
+		// foreach question_group_question entry with this QST_ID, we want to set its
21
+		// QSG_order equal to this question's QST_order
22
+		global $wpdb;
23
+		$updated = $wpdb->update(
24
+			$this->_qgq_table,
25
+			array('QGQ_order'=>$old_row['QST_order']),
26
+			array('QST_ID'=>$old_row['QST_ID']),
27
+			array('%d',// QGQ_order
28
+					),
29
+			array('%d',// QST_ID
30
+					)
31
+		);
32
+		if (false === $updated) {
33
+			$this->add_error(
34
+				sprintf(
35
+					__(
36
+						"Error in updating table %s setting QGQ_order = %d where QST_ID = %d",
37
+						'event_espresso'
38
+					),
39
+					$this->_qgq_table,
40
+					$old_row['QST_order'],
41
+					$old_row['QST_ID']
42
+				)
43
+			);
44
+		}
45
+		// nothing to map really
46
+	}
47 47
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@
 block discarded – undo
24 24
             $this->_qgq_table,
25 25
             array('QGQ_order'=>$old_row['QST_order']),
26 26
             array('QST_ID'=>$old_row['QST_ID']),
27
-            array('%d',// QGQ_order
27
+            array('%d', // QGQ_order
28 28
                     ),
29
-            array('%d',// QST_ID
29
+            array('%d', // QST_ID
30 30
                     )
31 31
         );
32 32
         if (false === $updated) {
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_9_0.dms.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
9 9
 // unfortunately, this needs to be done upon INCLUSION of this file,
10 10
 // instead of construction, because it only gets constructed on first page load
11 11
 // (all other times it gets resurrected from a wordpress option)
12
-$stages = glob(EE_CORE . 'data_migration_scripts/4_9_0_stages/*');
12
+$stages = glob(EE_CORE.'data_migration_scripts/4_9_0_stages/*');
13 13
 $class_to_filepath = array();
14 14
 foreach ($stages as $filepath) {
15 15
     $matches = array();
16 16
     preg_match('~4_9_0_stages/(.*).dmsstage.php~', $filepath, $matches);
17
-    $class_to_filepath[ $matches[1] ] = $filepath;
17
+    $class_to_filepath[$matches[1]] = $filepath;
18 18
 }
19 19
 // give addons a chance to autoload their stages too
20 20
 $class_to_filepath = apply_filters('FHEE__EE_DMS_4_9_0__autoloaded_stages', $class_to_filepath);
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
         if (version_compare($version_string, '4.9.0', '<=') && version_compare($version_string, '4.8.0', '>=')) {
65 65
             //          echo "$version_string can be migrated from";
66 66
             return true;
67
-        } elseif (! $version_string) {
67
+        } elseif ( ! $version_string) {
68 68
             //          echo "no version string provided: $version_string";
69 69
             // no version string provided... this must be pre 4.3
70
-            return false;// changed mind. dont want people thinking they should migrate yet because they cant
70
+            return false; // changed mind. dont want people thinking they should migrate yet because they cant
71 71
         } else {
72 72
             //          echo "$version_string doesnt apply";
73 73
             return false;
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function schema_changes_before_migration()
83 83
     {
84
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
84
+        require_once(EE_HELPERS.'EEH_Activation.helper.php');
85 85
         $now_in_mysql = current_time('mysql', true);
86 86
         $table_name = 'esp_answer';
87 87
         $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
     {
725 725
         foreach ($tables_to_check as $table_name) {
726 726
             $table_name = $this->_table_analysis->ensureTableNameHasPrefix($table_name);
727
-            if (! apply_filters('FHEE__EE_DMS_Core_4_9_0__verify_db_collations__check_overridden', false, $table_name)
727
+            if ( ! apply_filters('FHEE__EE_DMS_Core_4_9_0__verify_db_collations__check_overridden', false, $table_name)
728 728
                 && $this->_get_table_analysis()->tableExists($table_name)
729 729
             ) {
730 730
                 maybe_convert_table_to_utf8mb4($table_name);
Please login to merge, or discard this patch.
Indentation   +304 added lines, -304 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 $stages = glob(EE_CORE . 'data_migration_scripts/4_9_0_stages/*');
16 16
 $class_to_filepath = array();
17 17
 foreach ($stages as $filepath) {
18
-    $matches = array();
19
-    preg_match('~4_9_0_stages/(.*).dmsstage.php~', $filepath, $matches);
20
-    $class_to_filepath[ $matches[1] ] = $filepath;
18
+	$matches = array();
19
+	preg_match('~4_9_0_stages/(.*).dmsstage.php~', $filepath, $matches);
20
+	$class_to_filepath[ $matches[1] ] = $filepath;
21 21
 }
22 22
 // give addons a chance to autoload their stages too
23 23
 $class_to_filepath = apply_filters('FHEE__EE_DMS_4_9_0__autoloaded_stages', $class_to_filepath);
@@ -36,68 +36,68 @@  discard block
 block discarded – undo
36 36
 class EE_DMS_Core_4_9_0 extends EE_Data_Migration_Script_Base
37 37
 {
38 38
 
39
-    /**
40
-     * return EE_DMS_Core_4_9_0
41
-     *
42
-     * @param TableManager  $table_manager
43
-     * @param TableAnalysis $table_analysis
44
-     */
45
-    public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null)
46
-    {
47
-        $this->_pretty_name = esc_html__("Data Update to Event Espresso 4.9.0", "event_espresso");
48
-        $this->_priority = 10;
49
-        $this->_migration_stages = array(
50
-            new EE_DMS_4_9_0_Email_System_Question(),
51
-            new EE_DMS_4_9_0_Answers_With_No_Registration(),
52
-        );
53
-        parent::__construct($table_manager, $table_analysis);
54
-    }
39
+	/**
40
+	 * return EE_DMS_Core_4_9_0
41
+	 *
42
+	 * @param TableManager  $table_manager
43
+	 * @param TableAnalysis $table_analysis
44
+	 */
45
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null)
46
+	{
47
+		$this->_pretty_name = esc_html__("Data Update to Event Espresso 4.9.0", "event_espresso");
48
+		$this->_priority = 10;
49
+		$this->_migration_stages = array(
50
+			new EE_DMS_4_9_0_Email_System_Question(),
51
+			new EE_DMS_4_9_0_Answers_With_No_Registration(),
52
+		);
53
+		parent::__construct($table_manager, $table_analysis);
54
+	}
55 55
 
56 56
 
57 57
 
58
-    /**
59
-     * Whether to migrate or not.
60
-     *
61
-     * @param array $version_array
62
-     * @return bool
63
-     */
64
-    public function can_migrate_from_version($version_array)
65
-    {
66
-        $version_string = $version_array['Core'];
67
-        if (version_compare($version_string, '4.9.0', '<=') && version_compare($version_string, '4.8.0', '>=')) {
68
-            //          echo "$version_string can be migrated from";
69
-            return true;
70
-        } elseif (! $version_string) {
71
-            //          echo "no version string provided: $version_string";
72
-            // no version string provided... this must be pre 4.3
73
-            return false;// changed mind. dont want people thinking they should migrate yet because they cant
74
-        } else {
75
-            //          echo "$version_string doesnt apply";
76
-            return false;
77
-        }
78
-    }
58
+	/**
59
+	 * Whether to migrate or not.
60
+	 *
61
+	 * @param array $version_array
62
+	 * @return bool
63
+	 */
64
+	public function can_migrate_from_version($version_array)
65
+	{
66
+		$version_string = $version_array['Core'];
67
+		if (version_compare($version_string, '4.9.0', '<=') && version_compare($version_string, '4.8.0', '>=')) {
68
+			//          echo "$version_string can be migrated from";
69
+			return true;
70
+		} elseif (! $version_string) {
71
+			//          echo "no version string provided: $version_string";
72
+			// no version string provided... this must be pre 4.3
73
+			return false;// changed mind. dont want people thinking they should migrate yet because they cant
74
+		} else {
75
+			//          echo "$version_string doesnt apply";
76
+			return false;
77
+		}
78
+	}
79 79
 
80 80
 
81 81
 
82
-    /**
83
-     * @return bool
84
-     */
85
-    public function schema_changes_before_migration()
86
-    {
87
-        require_once(EE_HELPERS . 'EEH_Activation.helper.php');
88
-        $now_in_mysql = current_time('mysql', true);
89
-        $table_name = 'esp_answer';
90
-        $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
82
+	/**
83
+	 * @return bool
84
+	 */
85
+	public function schema_changes_before_migration()
86
+	{
87
+		require_once(EE_HELPERS . 'EEH_Activation.helper.php');
88
+		$now_in_mysql = current_time('mysql', true);
89
+		$table_name = 'esp_answer';
90
+		$sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
91 91
 					REG_ID int(10) unsigned NOT NULL,
92 92
 					QST_ID int(10) unsigned NOT NULL,
93 93
 					ANS_value text NOT NULL,
94 94
 					PRIMARY KEY  (ANS_ID),
95 95
 					KEY REG_ID (REG_ID),
96 96
 					KEY QST_ID (QST_ID)";
97
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
98
-        $table_name = 'esp_attendee_meta';
99
-        $this->_get_table_manager()->dropIndexIfSizeNot($table_name, 'ATT_email');
100
-        $sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
97
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
98
+		$table_name = 'esp_attendee_meta';
99
+		$this->_get_table_manager()->dropIndexIfSizeNot($table_name, 'ATT_email');
100
+		$sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
101 101
 				ATT_ID bigint(20) unsigned NOT NULL,
102 102
 				ATT_fname varchar(45) NOT NULL,
103 103
 				ATT_lname varchar(45) NOT NULL,
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 				KEY ATT_email (ATT_email(191)),
115 115
 				KEY ATT_lname (ATT_lname),
116 116
 				KEY ATT_fname (ATT_fname)";
117
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
118
-        $table_name = 'esp_checkin';
119
-        $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
117
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
118
+		$table_name = 'esp_checkin';
119
+		$sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
120 120
 				REG_ID int(10) unsigned NOT NULL,
121 121
 				DTT_ID int(10) unsigned NOT NULL,
122 122
 				CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1,
@@ -124,9 +124,9 @@  discard block
 block discarded – undo
124 124
 				PRIMARY KEY  (CHK_ID),
125 125
 				KEY REG_ID (REG_ID),
126 126
 				KEY DTT_ID (DTT_ID)";
127
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
128
-        $table_name = 'esp_country';
129
-        $sql = "CNT_ISO varchar(2) NOT NULL,
127
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
128
+		$table_name = 'esp_country';
129
+		$sql = "CNT_ISO varchar(2) NOT NULL,
130 130
 				CNT_ISO3 varchar(3) NOT NULL,
131 131
 				RGN_ID tinyint(3) unsigned DEFAULT NULL,
132 132
 				CNT_name varchar(45) NOT NULL,
@@ -142,29 +142,29 @@  discard block
 block discarded – undo
142 142
 				CNT_is_EU tinyint(1) DEFAULT '0',
143 143
 				CNT_active tinyint(1) DEFAULT '0',
144 144
 				PRIMARY KEY  (CNT_ISO)";
145
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
146
-        $table_name = 'esp_currency';
147
-        $sql = "CUR_code varchar(6) NOT NULL,
145
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
146
+		$table_name = 'esp_currency';
147
+		$sql = "CUR_code varchar(6) NOT NULL,
148 148
 				CUR_single varchar(45) DEFAULT 'dollar',
149 149
 				CUR_plural varchar(45) DEFAULT 'dollars',
150 150
 				CUR_sign varchar(45) DEFAULT '$',
151 151
 				CUR_dec_plc varchar(1) NOT NULL DEFAULT '2',
152 152
 				CUR_active tinyint(1) DEFAULT '0',
153 153
 				PRIMARY KEY  (CUR_code)";
154
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
155
-        // note: although this table is no longer in use,
156
-        // it hasn't been removed because then queries to the model will have errors.
157
-        // but you should expect this table and its corresponding model to be removed in
158
-        // the next few months
159
-        $table_name = 'esp_currency_payment_method';
160
-        $sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT,
154
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
155
+		// note: although this table is no longer in use,
156
+		// it hasn't been removed because then queries to the model will have errors.
157
+		// but you should expect this table and its corresponding model to be removed in
158
+		// the next few months
159
+		$table_name = 'esp_currency_payment_method';
160
+		$sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT,
161 161
 				CUR_code varchar(6) NOT NULL,
162 162
 				PMD_ID int(11) NOT NULL,
163 163
 				PRIMARY KEY  (CPM_ID),
164 164
 				KEY PMD_ID (PMD_ID)";
165
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
166
-        $table_name = 'esp_datetime';
167
-        $sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
165
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
166
+		$table_name = 'esp_datetime';
167
+		$sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
168 168
 				EVT_ID bigint(20) unsigned NOT NULL,
169 169
 				DTT_name varchar(255) NOT NULL DEFAULT '',
170 170
 				DTT_description text NOT NULL,
@@ -181,25 +181,25 @@  discard block
 block discarded – undo
181 181
 				KEY DTT_EVT_start (DTT_EVT_start),
182 182
 				KEY EVT_ID (EVT_ID),
183 183
 				KEY DTT_is_primary (DTT_is_primary)";
184
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
185
-        $table_name = "esp_datetime_ticket";
186
-        $sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
184
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
185
+		$table_name = "esp_datetime_ticket";
186
+		$sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
187 187
 				DTT_ID int(10) unsigned NOT NULL,
188 188
 				TKT_ID int(10) unsigned NOT NULL,
189 189
 				PRIMARY KEY  (DTK_ID),
190 190
 				KEY DTT_ID (DTT_ID),
191 191
 				KEY TKT_ID (TKT_ID)";
192
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
193
-        $table_name = 'esp_event_message_template';
194
-        $sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
192
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
193
+		$table_name = 'esp_event_message_template';
194
+		$sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
195 195
 				EVT_ID bigint(20) unsigned NOT NULL DEFAULT 0,
196 196
 				GRP_ID int(10) unsigned NOT NULL DEFAULT 0,
197 197
 				PRIMARY KEY  (EMT_ID),
198 198
 				KEY EVT_ID (EVT_ID),
199 199
 				KEY GRP_ID (GRP_ID)";
200
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
201
-        $table_name = 'esp_event_meta';
202
-        $sql = "EVTM_ID int(10) NOT NULL AUTO_INCREMENT,
200
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
201
+		$table_name = 'esp_event_meta';
202
+		$sql = "EVTM_ID int(10) NOT NULL AUTO_INCREMENT,
203 203
 				EVT_ID bigint(20) unsigned NOT NULL,
204 204
 				EVT_display_desc tinyint(1) unsigned NOT NULL DEFAULT 1,
205 205
 				EVT_display_ticket_selector tinyint(1) unsigned NOT NULL DEFAULT 1,
@@ -214,34 +214,34 @@  discard block
 block discarded – undo
214 214
 				EVT_donations tinyint(1) NULL,
215 215
 				PRIMARY KEY  (EVTM_ID),
216 216
 				KEY EVT_ID (EVT_ID)";
217
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
218
-        $table_name = 'esp_event_question_group';
219
-        $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
217
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
218
+		$table_name = 'esp_event_question_group';
219
+		$sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
220 220
 				EVT_ID bigint(20) unsigned NOT NULL,
221 221
 				QSG_ID int(10) unsigned NOT NULL,
222 222
 				EQG_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
223 223
 				PRIMARY KEY  (EQG_ID),
224 224
 				KEY EVT_ID (EVT_ID),
225 225
 				KEY QSG_ID (QSG_ID)";
226
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
227
-        $table_name = 'esp_event_venue';
228
-        $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
226
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
227
+		$table_name = 'esp_event_venue';
228
+		$sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
229 229
 				EVT_ID bigint(20) unsigned NOT NULL,
230 230
 				VNU_ID bigint(20) unsigned NOT NULL,
231 231
 				EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
232 232
 				PRIMARY KEY  (EVV_ID)";
233
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
234
-        $table_name = 'esp_extra_meta';
235
-        $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
233
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
234
+		$table_name = 'esp_extra_meta';
235
+		$sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
236 236
 				OBJ_ID int(11) DEFAULT NULL,
237 237
 				EXM_type varchar(45) DEFAULT NULL,
238 238
 				EXM_key varchar(45) DEFAULT NULL,
239 239
 				EXM_value text,
240 240
 				PRIMARY KEY  (EXM_ID),
241 241
 				KEY EXM_type (EXM_type,OBJ_ID,EXM_key)";
242
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
243
-        $table_name = 'esp_extra_join';
244
-        $sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT,
242
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
243
+		$table_name = 'esp_extra_join';
244
+		$sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT,
245 245
 				EXJ_first_model_id varchar(6) NOT NULL,
246 246
 				EXJ_first_model_name varchar(20) NOT NULL,
247 247
 				EXJ_second_model_id varchar(6) NOT NULL,
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
 				PRIMARY KEY  (EXJ_ID),
250 250
 				KEY first_model (EXJ_first_model_name,EXJ_first_model_id),
251 251
 				KEY second_model (EXJ_second_model_name,EXJ_second_model_id)";
252
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
253
-        $table_name = 'esp_line_item';
254
-        $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
252
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
253
+		$table_name = 'esp_line_item';
254
+		$sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
255 255
 				LIN_code varchar(245) NOT NULL DEFAULT '',
256 256
 				TXN_ID int(11) DEFAULT NULL,
257 257
 				LIN_name varchar(245) NOT NULL DEFAULT '',
@@ -272,11 +272,11 @@  discard block
 block discarded – undo
272 272
 				KEY txn_type_timestamp (TXN_ID,LIN_type,LIN_timestamp),
273 273
 				KEY txn_obj_id_obj_type (TXN_ID,OBJ_ID,OBJ_type),
274 274
 				KEY obj_id_obj_type (OBJ_ID,OBJ_type)";
275
-        $this->_get_table_manager()->dropIndex('esp_line_item', 'TXN_ID');
276
-        $this->_get_table_manager()->dropIndex('esp_line_item', 'LIN_code');
277
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
278
-        $table_name = 'esp_log';
279
-        $sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT,
275
+		$this->_get_table_manager()->dropIndex('esp_line_item', 'TXN_ID');
276
+		$this->_get_table_manager()->dropIndex('esp_line_item', 'LIN_code');
277
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
278
+		$table_name = 'esp_log';
279
+		$sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT,
280 280
 				LOG_time datetime DEFAULT NULL,
281 281
 				OBJ_ID varchar(45) DEFAULT NULL,
282 282
 				OBJ_type varchar(45) DEFAULT NULL,
@@ -287,12 +287,12 @@  discard block
 block discarded – undo
287 287
 				KEY LOG_time (LOG_time),
288 288
 				KEY OBJ (OBJ_type,OBJ_ID),
289 289
 				KEY LOG_type (LOG_type)";
290
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
291
-        $table_name = 'esp_message';
292
-        $this->_get_table_manager()->dropIndexIfSizeNot($table_name, 'MSG_to');
293
-        $this->_get_table_manager()->dropIndexIfSizeNot($table_name, 'MSG_from');
294
-        $this->_get_table_manager()->dropIndexIfSizeNot($table_name, 'MSG_subject');
295
-        $sql = "MSG_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
290
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
291
+		$table_name = 'esp_message';
292
+		$this->_get_table_manager()->dropIndexIfSizeNot($table_name, 'MSG_to');
293
+		$this->_get_table_manager()->dropIndexIfSizeNot($table_name, 'MSG_from');
294
+		$this->_get_table_manager()->dropIndexIfSizeNot($table_name, 'MSG_subject');
295
+		$sql = "MSG_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
296 296
 				GRP_ID int(10) unsigned NULL,
297 297
 				MSG_token varchar(255) NULL,
298 298
 				TXN_ID int(10) unsigned NULL,
@@ -324,18 +324,18 @@  discard block
 block discarded – undo
324 324
 				KEY STS_ID (STS_ID),
325 325
 				KEY MSG_created (MSG_created),
326 326
 				KEY MSG_modified (MSG_modified)";
327
-        $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
328
-        $table_name = 'esp_message_template';
329
-        $sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
327
+		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
328
+		$table_name = 'esp_message_template';
329
+		$sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
330 330
 				GRP_ID int(10) unsigned NOT NULL,
331 331
 				MTP_context varchar(50) NOT NULL,
332 332
 				MTP_template_field varchar(30) NOT NULL,
333 333
 				MTP_content text NOT NULL,
334 334
 				PRIMARY KEY  (MTP_ID),
335 335
 				KEY GRP_ID (GRP_ID)";
336
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
337
-        $table_name = 'esp_message_template_group';
338
-        $sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
336
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
337
+		$table_name = 'esp_message_template_group';
338
+		$sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
339 339
 				MTP_user_id int(10) NOT NULL DEFAULT '1',
340 340
 				MTP_name varchar(245) NOT NULL DEFAULT '',
341 341
 				MTP_description varchar(245) NOT NULL DEFAULT '',
@@ -347,9 +347,9 @@  discard block
 block discarded – undo
347 347
 				MTP_is_active tinyint(1) NOT NULL DEFAULT '1',
348 348
 				PRIMARY KEY  (GRP_ID),
349 349
 				KEY MTP_user_id (MTP_user_id)";
350
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
351
-        $table_name = 'esp_payment';
352
-        $sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
350
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
351
+		$table_name = 'esp_payment';
352
+		$sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
353 353
 				TXN_ID int(10) unsigned DEFAULT NULL,
354 354
 				STS_ID varchar(3) DEFAULT NULL,
355 355
 				PAY_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -366,9 +366,9 @@  discard block
 block discarded – undo
366 366
 				PRIMARY KEY  (PAY_ID),
367 367
 				KEY PAY_timestamp (PAY_timestamp),
368 368
 				KEY TXN_ID (TXN_ID)";
369
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
370
-        $table_name = 'esp_payment_method';
371
-        $sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT,
369
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
370
+		$table_name = 'esp_payment_method';
371
+		$sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT,
372 372
 				PMD_type varchar(124) DEFAULT NULL,
373 373
 				PMD_name varchar(255) DEFAULT NULL,
374 374
 				PMD_desc text,
@@ -384,24 +384,24 @@  discard block
 block discarded – undo
384 384
 				PRIMARY KEY  (PMD_ID),
385 385
 				UNIQUE KEY PMD_slug_UNIQUE (PMD_slug),
386 386
 				KEY PMD_type (PMD_type)";
387
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
388
-        $table_name = "esp_ticket_price";
389
-        $sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
387
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
388
+		$table_name = "esp_ticket_price";
389
+		$sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
390 390
 				TKT_ID int(10) unsigned NOT NULL,
391 391
 				PRC_ID int(10) unsigned NOT NULL,
392 392
 				PRIMARY KEY  (TKP_ID),
393 393
 				KEY TKT_ID (TKT_ID),
394 394
 				KEY PRC_ID (PRC_ID)";
395
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
396
-        $table_name = "esp_ticket_template";
397
-        $sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
395
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
396
+		$table_name = "esp_ticket_template";
397
+		$sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
398 398
 				TTM_name varchar(45) NOT NULL,
399 399
 				TTM_description text,
400 400
 				TTM_file varchar(45),
401 401
 				PRIMARY KEY  (TTM_ID)";
402
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
403
-        $table_name = 'esp_question';
404
-        $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
402
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
403
+		$table_name = 'esp_question';
404
+		$sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
405 405
 				QST_display_text text NOT NULL,
406 406
 				QST_admin_label varchar(255) NOT NULL,
407 407
 				QST_system varchar(25) DEFAULT NULL,
@@ -415,18 +415,18 @@  discard block
 block discarded – undo
415 415
 				QST_deleted tinyint(2) unsigned NOT NULL DEFAULT 0,
416 416
 				PRIMARY KEY  (QST_ID),
417 417
 				KEY QST_order (QST_order)';
418
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
419
-        $table_name = 'esp_question_group_question';
420
-        $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
418
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
419
+		$table_name = 'esp_question_group_question';
420
+		$sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
421 421
 				QSG_ID int(10) unsigned NOT NULL,
422 422
 				QST_ID int(10) unsigned NOT NULL,
423 423
 				QGQ_order int(10) unsigned NOT NULL DEFAULT 0,
424 424
 				PRIMARY KEY  (QGQ_ID),
425 425
 				KEY QST_ID (QST_ID),
426 426
 				KEY QSG_ID_order (QSG_ID,QGQ_order)";
427
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
428
-        $table_name = 'esp_question_option';
429
-        $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
427
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
428
+		$table_name = 'esp_question_option';
429
+		$sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
430 430
 				QSO_value varchar(255) NOT NULL,
431 431
 				QSO_desc text NOT NULL,
432 432
 				QST_ID int(10) unsigned NOT NULL,
@@ -436,9 +436,9 @@  discard block
 block discarded – undo
436 436
 				PRIMARY KEY  (QSO_ID),
437 437
 				KEY QST_ID (QST_ID),
438 438
 				KEY QSO_order (QSO_order)";
439
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
440
-        $table_name = 'esp_registration';
441
-        $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
439
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
440
+		$table_name = 'esp_registration';
441
+		$sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
442 442
 				EVT_ID bigint(20) unsigned NOT NULL,
443 443
 				ATT_ID bigint(20) unsigned NOT NULL,
444 444
 				TXN_ID int(10) unsigned NOT NULL,
@@ -462,18 +462,18 @@  discard block
 block discarded – undo
462 462
 				KEY TKT_ID (TKT_ID),
463 463
 				KEY EVT_ID (EVT_ID),
464 464
 				KEY STS_ID (STS_ID)";
465
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
466
-        $table_name = 'esp_registration_payment';
467
-        $sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
465
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
466
+		$table_name = 'esp_registration_payment';
467
+		$sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
468 468
 					  REG_ID int(10) unsigned NOT NULL,
469 469
 					  PAY_ID int(10) unsigned NULL,
470 470
 					  RPY_amount decimal(12,3) NOT NULL DEFAULT '0.00',
471 471
 					  PRIMARY KEY  (RPY_ID),
472 472
 					  KEY REG_ID (REG_ID),
473 473
 					  KEY PAY_ID (PAY_ID)";
474
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
475
-        $table_name = 'esp_state';
476
-        $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
474
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
475
+		$table_name = 'esp_state';
476
+		$sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT,
477 477
 				CNT_ISO varchar(2) NOT NULL,
478 478
 				STA_abbrev varchar(24) NOT NULL,
479 479
 				STA_name varchar(100) NOT NULL,
@@ -481,9 +481,9 @@  discard block
 block discarded – undo
481 481
 				PRIMARY KEY  (STA_ID),
482 482
 				KEY STA_abbrev (STA_abbrev),
483 483
 				KEY CNT_ISO (CNT_ISO)";
484
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
485
-        $table_name = 'esp_status';
486
-        $sql = "STS_ID varchar(3) NOT NULL,
484
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
485
+		$table_name = 'esp_status';
486
+		$sql = "STS_ID varchar(3) NOT NULL,
487 487
 				STS_code varchar(45) NOT NULL,
488 488
 				STS_type varchar(45) NOT NULL,
489 489
 				STS_can_edit tinyint(1) NOT NULL DEFAULT 0,
@@ -491,9 +491,9 @@  discard block
 block discarded – undo
491 491
 				STS_open tinyint(1) NOT NULL DEFAULT 1,
492 492
 				UNIQUE KEY STS_ID_UNIQUE (STS_ID),
493 493
 				KEY STS_type (STS_type)";
494
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
495
-        $table_name = 'esp_transaction';
496
-        $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
494
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
495
+		$table_name = 'esp_transaction';
496
+		$sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
497 497
 				TXN_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
498 498
 				TXN_total decimal(12,3) DEFAULT '0.00',
499 499
 				TXN_paid decimal(12,3) NOT NULL DEFAULT '0.00',
@@ -505,9 +505,9 @@  discard block
 block discarded – undo
505 505
 				PRIMARY KEY  (TXN_ID),
506 506
 				KEY TXN_timestamp (TXN_timestamp),
507 507
 				KEY STS_ID (STS_ID)";
508
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
509
-        $table_name = 'esp_venue_meta';
510
-        $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
508
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
509
+		$table_name = 'esp_venue_meta';
510
+		$sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT,
511 511
 			VNU_ID bigint(20) unsigned NOT NULL DEFAULT 0,
512 512
 			VNU_address varchar(255) DEFAULT NULL,
513 513
 			VNU_address2 varchar(255) DEFAULT NULL,
@@ -526,10 +526,10 @@  discard block
 block discarded – undo
526 526
 			KEY VNU_ID (VNU_ID),
527 527
 			KEY STA_ID (STA_ID),
528 528
 			KEY CNT_ISO (CNT_ISO)";
529
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
530
-        // modified tables
531
-        $table_name = "esp_price";
532
-        $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
529
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
530
+		// modified tables
531
+		$table_name = "esp_price";
532
+		$sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
533 533
 				PRT_ID tinyint(3) unsigned NOT NULL,
534 534
 				PRC_amount decimal(12,3) NOT NULL DEFAULT '0.00',
535 535
 				PRC_name varchar(245) NOT NULL,
@@ -542,9 +542,9 @@  discard block
 block discarded – undo
542 542
 				PRC_parent int(10) unsigned DEFAULT 0,
543 543
 				PRIMARY KEY  (PRC_ID),
544 544
 				KEY PRT_ID (PRT_ID)";
545
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
546
-        $table_name = "esp_price_type";
547
-        $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
545
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
546
+		$table_name = "esp_price_type";
547
+		$sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
548 548
 				PRT_name varchar(45) NOT NULL,
549 549
 				PBT_ID tinyint(3) unsigned NOT NULL DEFAULT '1',
550 550
 				PRT_is_percent tinyint(1) NOT NULL DEFAULT '0',
@@ -553,9 +553,9 @@  discard block
 block discarded – undo
553 553
 				PRT_deleted tinyint(1) NOT NULL DEFAULT '0',
554 554
 				UNIQUE KEY PRT_name_UNIQUE (PRT_name),
555 555
 				PRIMARY KEY  (PRT_ID)";
556
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
557
-        $table_name = "esp_ticket";
558
-        $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
556
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
557
+		$table_name = "esp_ticket";
558
+		$sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
559 559
 				TTM_ID int(10) unsigned NOT NULL,
560 560
 				TKT_name varchar(245) NOT NULL DEFAULT '',
561 561
 				TKT_description text NOT NULL,
@@ -578,9 +578,9 @@  discard block
 block discarded – undo
578 578
 				TKT_deleted tinyint(1) NOT NULL DEFAULT '0',
579 579
 				PRIMARY KEY  (TKT_ID),
580 580
 				KEY TKT_start_date (TKT_start_date)";
581
-        $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
582
-        $table_name = 'esp_question_group';
583
-        $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
581
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
582
+		$table_name = 'esp_question_group';
583
+		$sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
584 584
 				QSG_name varchar(255) NOT NULL,
585 585
 				QSG_identifier varchar(100) NOT NULL,
586 586
 				QSG_desc text NULL,
@@ -593,159 +593,159 @@  discard block
 block discarded – undo
593 593
 				PRIMARY KEY  (QSG_ID),
594 594
 				UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier),
595 595
 				KEY QSG_order (QSG_order)';
596
-        $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
597
-        $this->insert_default_data();
598
-        return true;
599
-    }
596
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
597
+		$this->insert_default_data();
598
+		return true;
599
+	}
600 600
 
601
-    /**
602
-     * Inserts default data after parent was called.
603
-     * @since $VID:$
604
-     * @throws EE_Error
605
-     * @throws InvalidArgumentException
606
-     * @throws ReflectionException
607
-     * @throws InvalidDataTypeException
608
-     * @throws InvalidInterfaceException
609
-     */
610
-    public function insert_default_data()
611
-    {
612
-        /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */
613
-        $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
614
-        // (because many need to convert old string states to foreign keys into the states table)
615
-        $script_4_1_defaults->insert_default_states();
616
-        $script_4_1_defaults->insert_default_countries();
617
-        /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */
618
-        $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0');
619
-        $script_4_5_defaults->insert_default_price_types();
620
-        $script_4_5_defaults->insert_default_prices();
621
-        $script_4_5_defaults->insert_default_tickets();
622
-        /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */
623
-        $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0');
624
-        $script_4_6_defaults->add_default_admin_only_payments();
625
-        $script_4_6_defaults->insert_default_currencies();
626
-        /** @var EE_DMS_Core_4_8_0 $script_4_8_defaults */
627
-        $script_4_8_defaults = EE_Registry::instance()->load_dms('Core_4_8_0');
628
-        $script_4_8_defaults->verify_new_countries();
629
-        $script_4_8_defaults->verify_new_currencies();
630
-        $this->verify_db_collations();
631
-        $this->verify_db_collations_again();
632
-    }
601
+	/**
602
+	 * Inserts default data after parent was called.
603
+	 * @since $VID:$
604
+	 * @throws EE_Error
605
+	 * @throws InvalidArgumentException
606
+	 * @throws ReflectionException
607
+	 * @throws InvalidDataTypeException
608
+	 * @throws InvalidInterfaceException
609
+	 */
610
+	public function insert_default_data()
611
+	{
612
+		/** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */
613
+		$script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
614
+		// (because many need to convert old string states to foreign keys into the states table)
615
+		$script_4_1_defaults->insert_default_states();
616
+		$script_4_1_defaults->insert_default_countries();
617
+		/** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */
618
+		$script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0');
619
+		$script_4_5_defaults->insert_default_price_types();
620
+		$script_4_5_defaults->insert_default_prices();
621
+		$script_4_5_defaults->insert_default_tickets();
622
+		/** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */
623
+		$script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0');
624
+		$script_4_6_defaults->add_default_admin_only_payments();
625
+		$script_4_6_defaults->insert_default_currencies();
626
+		/** @var EE_DMS_Core_4_8_0 $script_4_8_defaults */
627
+		$script_4_8_defaults = EE_Registry::instance()->load_dms('Core_4_8_0');
628
+		$script_4_8_defaults->verify_new_countries();
629
+		$script_4_8_defaults->verify_new_currencies();
630
+		$this->verify_db_collations();
631
+		$this->verify_db_collations_again();
632
+	}
633 633
 
634 634
 
635 635
 
636
-    /**
637
-     * @return boolean
638
-     */
639
-    public function schema_changes_after_migration()
640
-    {
641
-        return true;
642
-    }
636
+	/**
637
+	 * @return boolean
638
+	 */
639
+	public function schema_changes_after_migration()
640
+	{
641
+		return true;
642
+	}
643 643
 
644 644
 
645 645
 
646
-    public function migration_page_hooks()
647
-    {
648
-    }
646
+	public function migration_page_hooks()
647
+	{
648
+	}
649 649
 
650 650
 
651 651
 
652
-    /**
653
-     * Verify all EE4 models' tables use utf8mb4 collation
654
-     *
655
-     * @return void
656
-     */
657
-    public function verify_db_collations()
658
-    {
659
-        global $wpdb;
660
-        // double-check we haven't already done it or that that the DB doesn't support utf8mb4
661
-        if ('utf8mb4' !== $wpdb->charset
662
-            || get_option('ee_verified_db_collations', false)) {
663
-            return;
664
-        }
665
-        // grab tables from each model
666
-        $tables_to_check = array();
667
-        foreach (EE_Registry::instance()->non_abstract_db_models as $model_name) {
668
-            if (method_exists($model_name, 'instance')) {
669
-                $model_obj = call_user_func(array($model_name, 'instance'));
670
-                if ($model_obj instanceof EEM_Base) {
671
-                    foreach ($model_obj->get_tables() as $table) {
672
-                        if (strpos($table->get_table_name(), 'esp_')
673
-                            && (is_main_site()// for main tables, verify global tables
674
-                                || ! $table->is_global()// if not the main site, then only verify non-global tables (avoid doubling up)
675
-                            )
676
-                            && function_exists('maybe_convert_table_to_utf8mb4')
677
-                        ) {
678
-                            $tables_to_check[] = $table->get_table_name();
679
-                        }
680
-                    }
681
-                }
682
-            }
683
-        }
684
-        // and let's just be sure these addons' tables get migrated too. They already get handled if their addons are active
685
-        // when this code is run, but not otherwise. Once we record what tables EE added, we'll be able to use that instead
686
-        // of hard-coding this
687
-        $addon_tables = array(
688
-            // mailchimp
689
-            'esp_event_mailchimp_list_group',
690
-            'esp_event_question_mailchimp_field',
691
-            // multisite
692
-            'esp_blog_meta',
693
-            // people
694
-            'esp_people_to_post',
695
-            // promotions
696
-            'esp_promotion',
697
-            'esp_promotion_object',
698
-        );
699
-        foreach ($addon_tables as $table_name) {
700
-                $tables_to_check[] = $table_name;
701
-        }
702
-        $this->_verify_db_collations_for_tables(array_unique($tables_to_check));
703
-        // ok and now let's remember this was done (without needing to check the db schemas all over again)
704
-        add_option('ee_verified_db_collations', true, null, 'no');
705
-        // seeing how this ran with the fix from 10435, no need to check again
706
-        add_option('ee_verified_db_collations_again', true, null, 'no');
707
-    }
652
+	/**
653
+	 * Verify all EE4 models' tables use utf8mb4 collation
654
+	 *
655
+	 * @return void
656
+	 */
657
+	public function verify_db_collations()
658
+	{
659
+		global $wpdb;
660
+		// double-check we haven't already done it or that that the DB doesn't support utf8mb4
661
+		if ('utf8mb4' !== $wpdb->charset
662
+			|| get_option('ee_verified_db_collations', false)) {
663
+			return;
664
+		}
665
+		// grab tables from each model
666
+		$tables_to_check = array();
667
+		foreach (EE_Registry::instance()->non_abstract_db_models as $model_name) {
668
+			if (method_exists($model_name, 'instance')) {
669
+				$model_obj = call_user_func(array($model_name, 'instance'));
670
+				if ($model_obj instanceof EEM_Base) {
671
+					foreach ($model_obj->get_tables() as $table) {
672
+						if (strpos($table->get_table_name(), 'esp_')
673
+							&& (is_main_site()// for main tables, verify global tables
674
+								|| ! $table->is_global()// if not the main site, then only verify non-global tables (avoid doubling up)
675
+							)
676
+							&& function_exists('maybe_convert_table_to_utf8mb4')
677
+						) {
678
+							$tables_to_check[] = $table->get_table_name();
679
+						}
680
+					}
681
+				}
682
+			}
683
+		}
684
+		// and let's just be sure these addons' tables get migrated too. They already get handled if their addons are active
685
+		// when this code is run, but not otherwise. Once we record what tables EE added, we'll be able to use that instead
686
+		// of hard-coding this
687
+		$addon_tables = array(
688
+			// mailchimp
689
+			'esp_event_mailchimp_list_group',
690
+			'esp_event_question_mailchimp_field',
691
+			// multisite
692
+			'esp_blog_meta',
693
+			// people
694
+			'esp_people_to_post',
695
+			// promotions
696
+			'esp_promotion',
697
+			'esp_promotion_object',
698
+		);
699
+		foreach ($addon_tables as $table_name) {
700
+				$tables_to_check[] = $table_name;
701
+		}
702
+		$this->_verify_db_collations_for_tables(array_unique($tables_to_check));
703
+		// ok and now let's remember this was done (without needing to check the db schemas all over again)
704
+		add_option('ee_verified_db_collations', true, null, 'no');
705
+		// seeing how this ran with the fix from 10435, no need to check again
706
+		add_option('ee_verified_db_collations_again', true, null, 'no');
707
+	}
708 708
 
709 709
 
710 710
 
711
-    /**
712
-     * Verifies DB collations because a bug was discovered on https://events.codebasehq.com/projects/event-espresso/tickets/10435
713
-     * which meant some DB collations might not have been updated
714
-     * @return void
715
-     */
716
-    public function verify_db_collations_again()
717
-    {
718
-        global $wpdb;
719
-        // double-check we haven't already done this or that the DB doesn't support it
720
-        // compare to how WordPress' upgrade_430() function does this check
721
-        if ('utf8mb4' !== $wpdb->charset
722
-            || get_option('ee_verified_db_collations_again', false)) {
723
-            return;
724
-        }
725
-        $tables_to_check = array(
726
-            'esp_attendee_meta',
727
-            'esp_message'
728
-        );
729
-        $this->_verify_db_collations_for_tables(array_unique($tables_to_check));
730
-        add_option('ee_verified_db_collations_again', true, null, 'no');
731
-    }
711
+	/**
712
+	 * Verifies DB collations because a bug was discovered on https://events.codebasehq.com/projects/event-espresso/tickets/10435
713
+	 * which meant some DB collations might not have been updated
714
+	 * @return void
715
+	 */
716
+	public function verify_db_collations_again()
717
+	{
718
+		global $wpdb;
719
+		// double-check we haven't already done this or that the DB doesn't support it
720
+		// compare to how WordPress' upgrade_430() function does this check
721
+		if ('utf8mb4' !== $wpdb->charset
722
+			|| get_option('ee_verified_db_collations_again', false)) {
723
+			return;
724
+		}
725
+		$tables_to_check = array(
726
+			'esp_attendee_meta',
727
+			'esp_message'
728
+		);
729
+		$this->_verify_db_collations_for_tables(array_unique($tables_to_check));
730
+		add_option('ee_verified_db_collations_again', true, null, 'no');
731
+	}
732 732
 
733 733
 
734 734
 
735
-    /**
736
-     * Runs maybe_convert_table_to_utf8mb4 on the specified tables
737
-     * @param $tables_to_check
738
-     * @return boolean true if logic ran, false if it didn't
739
-     */
740
-    protected function _verify_db_collations_for_tables($tables_to_check)
741
-    {
742
-        foreach ($tables_to_check as $table_name) {
743
-            $table_name = $this->_table_analysis->ensureTableNameHasPrefix($table_name);
744
-            if (! apply_filters('FHEE__EE_DMS_Core_4_9_0__verify_db_collations__check_overridden', false, $table_name)
745
-                && $this->_get_table_analysis()->tableExists($table_name)
746
-            ) {
747
-                maybe_convert_table_to_utf8mb4($table_name);
748
-            }
749
-        }
750
-    }
735
+	/**
736
+	 * Runs maybe_convert_table_to_utf8mb4 on the specified tables
737
+	 * @param $tables_to_check
738
+	 * @return boolean true if logic ran, false if it didn't
739
+	 */
740
+	protected function _verify_db_collations_for_tables($tables_to_check)
741
+	{
742
+		foreach ($tables_to_check as $table_name) {
743
+			$table_name = $this->_table_analysis->ensureTableNameHasPrefix($table_name);
744
+			if (! apply_filters('FHEE__EE_DMS_Core_4_9_0__verify_db_collations__check_overridden', false, $table_name)
745
+				&& $this->_get_table_analysis()->tableExists($table_name)
746
+			) {
747
+				maybe_convert_table_to_utf8mb4($table_name);
748
+			}
749
+		}
750
+	}
751 751
 }
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_Data_Migration_Script_Stage.core.php 1 patch
Indentation   +90 added lines, -90 removed lines patch added patch discarded remove patch
@@ -37,103 +37,103 @@
 block discarded – undo
37 37
  */
38 38
 abstract class EE_Data_Migration_Script_Stage extends EE_Data_Migration_Class_Base
39 39
 {
40
-    /**
41
-     * The migration script this is a stage of
42
-     *
43
-     * @var EE_Data_Migration_Script_Base
44
-     */
45
-    protected $_migration_script;
40
+	/**
41
+	 * The migration script this is a stage of
42
+	 *
43
+	 * @var EE_Data_Migration_Script_Base
44
+	 */
45
+	protected $_migration_script;
46 46
 
47
-    /**
48
-     * This should eb called to essentially 'finalize' construction of the stage.
49
-     * This isn't done on the main constructor in order to avoid repetitive code. Instead, this is
50
-     * called by EE_Data_Migration_Script_Base's __construct() method so children don't have to
51
-     *
52
-     * @param EE_Data_Migration_Script_Base $migration_script
53
-     */
54
-    public function _construct_finalize($migration_script)
55
-    {
56
-        $this->_migration_script = $migration_script;
57
-    }
47
+	/**
48
+	 * This should eb called to essentially 'finalize' construction of the stage.
49
+	 * This isn't done on the main constructor in order to avoid repetitive code. Instead, this is
50
+	 * called by EE_Data_Migration_Script_Base's __construct() method so children don't have to
51
+	 *
52
+	 * @param EE_Data_Migration_Script_Base $migration_script
53
+	 */
54
+	public function _construct_finalize($migration_script)
55
+	{
56
+		$this->_migration_script = $migration_script;
57
+	}
58 58
 
59
-    /**
60
-     * Migrates X old records to the new format. If a fatal error is encountered it is NOT caught here,
61
-     * but is propagated upwards for catching. So basically, the _migration_step() function implemented by children
62
-     * needs to catch exceptions and decide what's a fatal error and what isn't.
63
-     *
64
-     * @param int $num_items_to_migrate
65
-     * @return int
66
-     */
67
-    public function migration_step($num_items_to_migrate = 50)
68
-    {
69
-        // before we run the migration step, we want ot take note of warnings that get outputted
70
-        ob_start();
71
-        $items_migrated = $this->_migration_step($num_items_to_migrate);
72
-        $output = ob_get_contents();
73
-        ob_end_clean();
74
-        if ($output) {
75
-            $this->add_error($output);
76
-        }
77
-        $this->_records_migrated += $items_migrated;
78
-        return $items_migrated;
79
-    }
59
+	/**
60
+	 * Migrates X old records to the new format. If a fatal error is encountered it is NOT caught here,
61
+	 * but is propagated upwards for catching. So basically, the _migration_step() function implemented by children
62
+	 * needs to catch exceptions and decide what's a fatal error and what isn't.
63
+	 *
64
+	 * @param int $num_items_to_migrate
65
+	 * @return int
66
+	 */
67
+	public function migration_step($num_items_to_migrate = 50)
68
+	{
69
+		// before we run the migration step, we want ot take note of warnings that get outputted
70
+		ob_start();
71
+		$items_migrated = $this->_migration_step($num_items_to_migrate);
72
+		$output = ob_get_contents();
73
+		ob_end_clean();
74
+		if ($output) {
75
+			$this->add_error($output);
76
+		}
77
+		$this->_records_migrated += $items_migrated;
78
+		return $items_migrated;
79
+	}
80 80
 
81 81
 
82
-    /**
83
-     * IMPORTANT: if an error is encountered, or everything is finished, this stage should update its status property
84
-     * accordingly. Note: it should not alter the count of items migrated. That is done in the public function that
85
-     * calls this. IMPORTANT: The count of items migrated should ONLY be less than $num_items_to_migrate when it's the
86
-     * last migration step, otherwise it should always return $num_items_to_migrate. (Eg, if we're migrating attendees
87
-     * rows from the database, and $num_items_to_migrate is set to 50, then we SHOULD actually migrate 50 rows,but at
88
-     * very least we MUST report/return 50 items migrated)
89
-     *
90
-     * @param int $num_items_to_migrate
91
-     * @return int number of items ACTUALLY migrated
92
-     */
93
-    abstract protected function _migration_step($num_items_to_migrate = 50);
82
+	/**
83
+	 * IMPORTANT: if an error is encountered, or everything is finished, this stage should update its status property
84
+	 * accordingly. Note: it should not alter the count of items migrated. That is done in the public function that
85
+	 * calls this. IMPORTANT: The count of items migrated should ONLY be less than $num_items_to_migrate when it's the
86
+	 * last migration step, otherwise it should always return $num_items_to_migrate. (Eg, if we're migrating attendees
87
+	 * rows from the database, and $num_items_to_migrate is set to 50, then we SHOULD actually migrate 50 rows,but at
88
+	 * very least we MUST report/return 50 items migrated)
89
+	 *
90
+	 * @param int $num_items_to_migrate
91
+	 * @return int number of items ACTUALLY migrated
92
+	 */
93
+	abstract protected function _migration_step($num_items_to_migrate = 50);
94 94
 
95
-    /**
96
-     * Counts the records that have been migrated so far
97
-     *
98
-     * @return int
99
-     */
100
-    public function count_records_migrated()
101
-    {
102
-        return $this->_records_migrated;
103
-    }
95
+	/**
96
+	 * Counts the records that have been migrated so far
97
+	 *
98
+	 * @return int
99
+	 */
100
+	public function count_records_migrated()
101
+	{
102
+		return $this->_records_migrated;
103
+	}
104 104
 
105
-    /**
106
-     * returns an array of strings describing errors
107
-     *
108
-     * @return array
109
-     */
110
-    public function get_errors()
111
-    {
112
-        return $this->_errors;
113
-    }
105
+	/**
106
+	 * returns an array of strings describing errors
107
+	 *
108
+	 * @return array
109
+	 */
110
+	public function get_errors()
111
+	{
112
+		return $this->_errors;
113
+	}
114 114
 
115 115
 
116
-    /**
117
-     * Sets all of the properties of this script stage to match what's in the array, which is assumed
118
-     * to have been made from the properties_as_array() function.
119
-     *
120
-     * @param array $array_of_properties like what's produced from properties_as_array() method
121
-     */
122
-    public function instantiate_from_array_of_properties($array_of_properties)
123
-    {
124
-        unset($array_of_properties['class']);
125
-        foreach ($array_of_properties as $property_name => $property_value) {
126
-            $this->{$property_name} = $property_value;
127
-        }
128
-    }
116
+	/**
117
+	 * Sets all of the properties of this script stage to match what's in the array, which is assumed
118
+	 * to have been made from the properties_as_array() function.
119
+	 *
120
+	 * @param array $array_of_properties like what's produced from properties_as_array() method
121
+	 */
122
+	public function instantiate_from_array_of_properties($array_of_properties)
123
+	{
124
+		unset($array_of_properties['class']);
125
+		foreach ($array_of_properties as $property_name => $property_value) {
126
+			$this->{$property_name} = $property_value;
127
+		}
128
+	}
129 129
 
130
-    /**
131
-     * Gets the script this is a stage of
132
-     *
133
-     * @return EE_Data_Migration_Script_Base
134
-     */
135
-    protected function get_migration_script()
136
-    {
137
-        return $this->_migration_script;
138
-    }
130
+	/**
131
+	 * Gets the script this is a stage of
132
+	 *
133
+	 * @return EE_Data_Migration_Script_Base
134
+	 */
135
+	protected function get_migration_script()
136
+	{
137
+		return $this->_migration_script;
138
+	}
139 139
 }
Please login to merge, or discard this patch.
4_3_0_stages/EE_DMS_4_3_0_event_message_templates.dmsstage.php 2 patches
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -13,59 +13,59 @@
 block discarded – undo
13 13
 class EE_DMS_4_3_0_event_message_templates extends EE_Data_Migration_Script_Stage_Table
14 14
 {
15 15
 
16
-    /**
17
-     * This property will hold the table name for event_message_templates
18
-     * @var string
19
-     */
20
-    private $_emt_table;
16
+	/**
17
+	 * This property will hold the table name for event_message_templates
18
+	 * @var string
19
+	 */
20
+	private $_emt_table;
21 21
 
22 22
 
23
-    public function __construct()
24
-    {
25
-        global $wpdb;
26
-        $this->_pretty_name = __('Event Message Templates', 'event_espresso');
27
-        $this->_old_table = $wpdb->prefix."esp_message_template_group";
28
-        $this->_emt_table = $wpdb->prefix."esp_event_message_template";
29
-        parent::__construct();
30
-    }
23
+	public function __construct()
24
+	{
25
+		global $wpdb;
26
+		$this->_pretty_name = __('Event Message Templates', 'event_espresso');
27
+		$this->_old_table = $wpdb->prefix."esp_message_template_group";
28
+		$this->_emt_table = $wpdb->prefix."esp_event_message_template";
29
+		parent::__construct();
30
+	}
31 31
 
32 32
 
33 33
 
34
-    protected function _migrate_old_row($old_row)
35
-    {
36
-        // foreach row that has an evt_id ..let's create an equivalent entry in the new event_messages_template table to link the message template to the event (since EVT_ID is no longer referenced in esp_message_template_groups )
37
-        global $wpdb;
38
-        if ($old_row['EVT_ID'] > 0) {
39
-                                    // let's get the EVT for this id so we can update the custom name on the old row.
40
-                                    $event_name = 'Custom Template for ' . $wpdb->get_var($wpdb->prepare("SELECT post_title from $wpdb->posts WHERE ID = %d", absint($old_row['EVT_ID'])));
34
+	protected function _migrate_old_row($old_row)
35
+	{
36
+		// foreach row that has an evt_id ..let's create an equivalent entry in the new event_messages_template table to link the message template to the event (since EVT_ID is no longer referenced in esp_message_template_groups )
37
+		global $wpdb;
38
+		if ($old_row['EVT_ID'] > 0) {
39
+									// let's get the EVT for this id so we can update the custom name on the old row.
40
+									$event_name = 'Custom Template for ' . $wpdb->get_var($wpdb->prepare("SELECT post_title from $wpdb->posts WHERE ID = %d", absint($old_row['EVT_ID'])));
41 41
 
42
-                                    // update name
43
-                                    $updated = $wpdb->update(
44
-                                        $this->_old_table,
45
-                                        array(
46
-                                            'MTP_name' =>$event_name
47
-                                            ),
48
-                                        array( 'GRP_ID' => (int) $old_row['GRP_ID'] ),
49
-                                        array( '%s' ),
50
-                                        array( '%d' )
51
-                                    );
42
+									// update name
43
+									$updated = $wpdb->update(
44
+										$this->_old_table,
45
+										array(
46
+											'MTP_name' =>$event_name
47
+											),
48
+										array( 'GRP_ID' => (int) $old_row['GRP_ID'] ),
49
+										array( '%s' ),
50
+										array( '%d' )
51
+									);
52 52
 
53
-            $inserted = $wpdb->insert(
54
-                $this->_emt_table,
55
-                array(
56
-                    'EVT_ID' => (int) $old_row['EVT_ID'],
57
-                    'GRP_ID' => (int) $old_row['GRP_ID'],
58
-                    ),
59
-                array( '%d', '%d' )
60
-            );
53
+			$inserted = $wpdb->insert(
54
+				$this->_emt_table,
55
+				array(
56
+					'EVT_ID' => (int) $old_row['EVT_ID'],
57
+					'GRP_ID' => (int) $old_row['GRP_ID'],
58
+					),
59
+				array( '%d', '%d' )
60
+			);
61 61
 
62
-            if (false === $updated) {
63
-                $this->add_error(sprintf(__("Error in updating the row in %s setting 'MTP_name = %s", 'event_espresso'), $this->_old_table, $event_name));
64
-            }
62
+			if (false === $updated) {
63
+				$this->add_error(sprintf(__("Error in updating the row in %s setting 'MTP_name = %s", 'event_espresso'), $this->_old_table, $event_name));
64
+			}
65 65
 
66
-            if (false === $inserted) {
67
-                $this->add_error(sprintf(__("Error in inserting a row into  setting EVT_ID = %d and GRP_ID = %d", "event_espresso"), $this->_emt_table, $old_row['EVT_ID'], $old_row['GRP_ID']));
68
-            }
69
-        }
70
-    }
66
+			if (false === $inserted) {
67
+				$this->add_error(sprintf(__("Error in inserting a row into  setting EVT_ID = %d and GRP_ID = %d", "event_espresso"), $this->_emt_table, $old_row['EVT_ID'], $old_row['GRP_ID']));
68
+			}
69
+		}
70
+	}
71 71
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         global $wpdb;
38 38
         if ($old_row['EVT_ID'] > 0) {
39 39
                                     // let's get the EVT for this id so we can update the custom name on the old row.
40
-                                    $event_name = 'Custom Template for ' . $wpdb->get_var($wpdb->prepare("SELECT post_title from $wpdb->posts WHERE ID = %d", absint($old_row['EVT_ID'])));
40
+                                    $event_name = 'Custom Template for '.$wpdb->get_var($wpdb->prepare("SELECT post_title from $wpdb->posts WHERE ID = %d", absint($old_row['EVT_ID'])));
41 41
 
42 42
                                     // update name
43 43
                                     $updated = $wpdb->update(
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
                                         array(
46 46
                                             'MTP_name' =>$event_name
47 47
                                             ),
48
-                                        array( 'GRP_ID' => (int) $old_row['GRP_ID'] ),
49
-                                        array( '%s' ),
50
-                                        array( '%d' )
48
+                                        array('GRP_ID' => (int) $old_row['GRP_ID']),
49
+                                        array('%s'),
50
+                                        array('%d')
51 51
                                     );
52 52
 
53 53
             $inserted = $wpdb->insert(
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
                     'EVT_ID' => (int) $old_row['EVT_ID'],
57 57
                     'GRP_ID' => (int) $old_row['GRP_ID'],
58 58
                     ),
59
-                array( '%d', '%d' )
59
+                array('%d', '%d')
60 60
             );
61 61
 
62 62
             if (false === $updated) {
Please login to merge, or discard this patch.
4_3_0_stages/EE_DMS_4_3_0_question_option_order.dmsstage.php 2 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -7,39 +7,39 @@
 block discarded – undo
7 7
 
8 8
 class EE_DMS_4_3_0_question_option_order extends EE_Data_Migration_Script_Stage_Table
9 9
 {
10
-    public function __construct()
11
-    {
12
-        global $wpdb;
13
-        $this->_pretty_name = __("Question Options", "event_espresso");
14
-        $this->_old_table = $wpdb->prefix."esp_question_option";
15
-        parent::__construct();
16
-    }
17
-    protected function _migrate_old_row($old_row)
18
-    {
19
-        // foreach question_group_question entry with this QST_ID, we want to set its
20
-        // QSG_order equal to this question's QST_order
21
-        global $wpdb;
22
-        $updated = $wpdb->update(
23
-            $this->_old_table,
24
-            array('QSO_order'=>$old_row['QSO_ID']),
25
-            array('QSO_ID'=>$old_row['QSO_ID']),
26
-            array('%d',// QSO_order
27
-                    ),
28
-            array('%d',// QSO_ID
29
-                    )
30
-        );
31
-        if (false === $updated) {
32
-            $this->add_error(
33
-                sprintf(
34
-                    __(
35
-                        "Error in updating table %s setting QSO_order = %d where QSO_ID = %d",
36
-                        'event_espresso'
37
-                    ),
38
-                    $this->_old_table,
39
-                    $old_row['QSO_ID'],
40
-                    $old_row['QSO_ID']
41
-                )
42
-            );
43
-        }
44
-    }
10
+	public function __construct()
11
+	{
12
+		global $wpdb;
13
+		$this->_pretty_name = __("Question Options", "event_espresso");
14
+		$this->_old_table = $wpdb->prefix."esp_question_option";
15
+		parent::__construct();
16
+	}
17
+	protected function _migrate_old_row($old_row)
18
+	{
19
+		// foreach question_group_question entry with this QST_ID, we want to set its
20
+		// QSG_order equal to this question's QST_order
21
+		global $wpdb;
22
+		$updated = $wpdb->update(
23
+			$this->_old_table,
24
+			array('QSO_order'=>$old_row['QSO_ID']),
25
+			array('QSO_ID'=>$old_row['QSO_ID']),
26
+			array('%d',// QSO_order
27
+					),
28
+			array('%d',// QSO_ID
29
+					)
30
+		);
31
+		if (false === $updated) {
32
+			$this->add_error(
33
+				sprintf(
34
+					__(
35
+						"Error in updating table %s setting QSO_order = %d where QSO_ID = %d",
36
+						'event_espresso'
37
+					),
38
+					$this->_old_table,
39
+					$old_row['QSO_ID'],
40
+					$old_row['QSO_ID']
41
+				)
42
+			);
43
+		}
44
+	}
45 45
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@
 block discarded – undo
23 23
             $this->_old_table,
24 24
             array('QSO_order'=>$old_row['QSO_ID']),
25 25
             array('QSO_ID'=>$old_row['QSO_ID']),
26
-            array('%d',// QSO_order
26
+            array('%d', // QSO_order
27 27
                     ),
28
-            array('%d',// QSO_ID
28
+            array('%d', // QSO_ID
29 29
                     )
30 30
         );
31 31
         if (false === $updated) {
Please login to merge, or discard this patch.
core/EE_Front_Controller.core.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
         print(
345 345
         apply_filters(
346 346
             'FHEE__EE_Front_Controller__header_meta_tag',
347
-            '<meta name="generator" content="Event Espresso Version ' . EVENT_ESPRESSO_VERSION . "\" />\n"
347
+            '<meta name="generator" content="Event Espresso Version '.EVENT_ESPRESSO_VERSION."\" />\n"
348 348
         )
349 349
         );
350 350
 
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
             print(
361 361
             apply_filters(
362 362
                 'FHEE__EE_Front_Controller__header_meta_tag__noindex_for_event_type',
363
-                '<meta name="robots" content="noindex,follow" />' . "\n"
363
+                '<meta name="robots" content="noindex,follow" />'."\n"
364 364
             )
365 365
             );
366 366
         }
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
     {
414 414
         static $shown_already = false;
415 415
         do_action('AHEE__EE_Front_Controller__display_errors__begin');
416
-        if (! $shown_already
416
+        if ( ! $shown_already
417 417
             && apply_filters('FHEE__EE_Front_Controller__display_errors', true)
418 418
             && is_main_query()
419 419
             && ! is_feed()
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         ) {
423 423
             echo EE_Error::get_notices();
424 424
             $shown_already = true;
425
-            EEH_Template::display_template(EE_TEMPLATES . 'espresso-ajax-notices.template.php');
425
+            EEH_Template::display_template(EE_TEMPLATES.'espresso-ajax-notices.template.php');
426 426
         }
427 427
         do_action('AHEE__EE_Front_Controller__display_errors__end');
428 428
     }
Please login to merge, or discard this patch.
Indentation   +463 added lines, -463 removed lines patch added patch discarded remove patch
@@ -26,467 +26,467 @@
 block discarded – undo
26 26
 final class EE_Front_Controller
27 27
 {
28 28
 
29
-    /**
30
-     * @var string $_template_path
31
-     */
32
-    private $_template_path;
33
-
34
-    /**
35
-     * @var string $_template
36
-     */
37
-    private $_template;
38
-
39
-    /**
40
-     * @type EE_Registry $Registry
41
-     */
42
-    protected $Registry;
43
-
44
-    /**
45
-     * @type EE_Request_Handler $Request_Handler
46
-     */
47
-    protected $Request_Handler;
48
-
49
-    /**
50
-     * @type EE_Module_Request_Router $Module_Request_Router
51
-     */
52
-    protected $Module_Request_Router;
53
-
54
-
55
-    /**
56
-     *    class constructor
57
-     *    should fire after shortcode, module, addon, or other plugin's default priority init phases have run
58
-     *
59
-     * @access    public
60
-     * @param \EE_Registry              $Registry
61
-     * @param \EE_Request_Handler       $Request_Handler
62
-     * @param \EE_Module_Request_Router $Module_Request_Router
63
-     */
64
-    public function __construct(
65
-        EE_Registry $Registry,
66
-        EE_Request_Handler $Request_Handler,
67
-        EE_Module_Request_Router $Module_Request_Router
68
-    ) {
69
-        $this->Registry = $Registry;
70
-        $this->Request_Handler = $Request_Handler;
71
-        $this->Module_Request_Router = $Module_Request_Router;
72
-        // load other resources and begin to actually run shortcodes and modules
73
-        add_action('wp_loaded', array($this, 'wp_loaded'), 5);
74
-        // analyse the incoming WP request
75
-        add_action('parse_request', array($this, 'get_request'), 1, 1);
76
-        // process request with module factory
77
-        add_action('pre_get_posts', array($this, 'pre_get_posts'), 10, 1);
78
-        // before headers sent
79
-        add_action('wp', array($this, 'wp'), 5);
80
-        // primarily used to process any content shortcodes
81
-        add_action('template_redirect', array($this, 'templateRedirect'), 999);
82
-        // header
83
-        add_action('wp_head', array($this, 'header_meta_tag'), 5);
84
-        add_action('wp_print_scripts', array($this, 'wp_print_scripts'), 10);
85
-        add_filter('template_include', array($this, 'template_include'), 1);
86
-        // display errors
87
-        add_action('loop_start', array($this, 'display_errors'), 2);
88
-        // the content
89
-        // add_filter( 'the_content', array( $this, 'the_content' ), 5, 1 );
90
-        // exclude our private cpt comments
91
-        add_filter('comments_clauses', array($this, 'filter_wp_comments'), 10, 1);
92
-        // make sure any ajax requests will respect the url schema when requests are made against admin-ajax.php (http:// or https://)
93
-        add_filter('admin_url', array($this, 'maybe_force_admin_ajax_ssl'), 200, 1);
94
-        // action hook EE
95
-        do_action('AHEE__EE_Front_Controller__construct__done', $this);
96
-    }
97
-
98
-
99
-    /**
100
-     * @return EE_Request_Handler
101
-     */
102
-    public function Request_Handler()
103
-    {
104
-        return $this->Request_Handler;
105
-    }
106
-
107
-
108
-    /**
109
-     * @return EE_Module_Request_Router
110
-     */
111
-    public function Module_Request_Router()
112
-    {
113
-        return $this->Module_Request_Router;
114
-    }
115
-
116
-
117
-    /**
118
-     * @return LegacyShortcodesManager
119
-     */
120
-    public function getLegacyShortcodesManager()
121
-    {
122
-        return EE_Config::getLegacyShortcodesManager();
123
-    }
124
-
125
-
126
-
127
-
128
-
129
-    /***********************************************        INIT ACTION HOOK         ***********************************************/
130
-    /**
131
-     * filter_wp_comments
132
-     * This simply makes sure that any "private" EE CPTs do not have their comments show up in any wp comment
133
-     * widgets/queries done on frontend
134
-     *
135
-     * @param  array $clauses array of comment clauses setup by WP_Comment_Query
136
-     * @return array array of comment clauses with modifications.
137
-     * @throws InvalidArgumentException
138
-     * @throws InvalidDataTypeException
139
-     * @throws InvalidInterfaceException
140
-     */
141
-    public function filter_wp_comments($clauses)
142
-    {
143
-        global $wpdb;
144
-        if (strpos($clauses['join'], $wpdb->posts) !== false) {
145
-            /** @var EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions $custom_post_types */
146
-            $custom_post_types = LoaderFactory::getLoader()->getShared(
147
-                'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'
148
-            );
149
-            $cpts = $custom_post_types->getPrivateCustomPostTypes();
150
-            foreach ($cpts as $cpt => $details) {
151
-                $clauses['where'] .= $wpdb->prepare(" AND $wpdb->posts.post_type != %s", $cpt);
152
-            }
153
-        }
154
-        return $clauses;
155
-    }
156
-
157
-
158
-    /**
159
-     * this just makes sure that if the site is using ssl that we force that for any admin ajax calls from frontend
160
-     *
161
-     * @param  string $url incoming url
162
-     * @return string         final assembled url
163
-     */
164
-    public function maybe_force_admin_ajax_ssl($url)
165
-    {
166
-        if (is_ssl() && preg_match('/admin-ajax.php/', $url)) {
167
-            $url = str_replace('http://', 'https://', $url);
168
-        }
169
-        return $url;
170
-    }
171
-
172
-
173
-
174
-
175
-
176
-
177
-    /***********************************************        WP_LOADED ACTION HOOK         ***********************************************/
178
-
179
-
180
-    /**
181
-     *    wp_loaded - should fire after shortcode, module, addon, or other plugin's have been registered and their
182
-     *    default priority init phases have run
183
-     *
184
-     * @access    public
185
-     * @return    void
186
-     */
187
-    public function wp_loaded()
188
-    {
189
-    }
190
-
191
-
192
-
193
-
194
-
195
-    /***********************************************        PARSE_REQUEST HOOK         ***********************************************/
196
-    /**
197
-     *    _get_request
198
-     *
199
-     * @access public
200
-     * @param WP $WP
201
-     * @return void
202
-     */
203
-    public function get_request(WP $WP)
204
-    {
205
-        do_action('AHEE__EE_Front_Controller__get_request__start');
206
-        $this->Request_Handler->parse_request($WP);
207
-        do_action('AHEE__EE_Front_Controller__get_request__complete');
208
-    }
209
-
210
-
211
-    /**
212
-     *    pre_get_posts - basically a module factory for instantiating modules and selecting the final view template
213
-     *
214
-     * @access    public
215
-     * @param   WP_Query $WP_Query
216
-     * @return    void
217
-     */
218
-    public function pre_get_posts($WP_Query)
219
-    {
220
-        // only load Module_Request_Router if this is the main query
221
-        if ($this->Module_Request_Router instanceof EE_Module_Request_Router
222
-            && $WP_Query->is_main_query()
223
-        ) {
224
-            // cycle thru module routes
225
-            while ($route = $this->Module_Request_Router->get_route($WP_Query)) {
226
-                // determine module and method for route
227
-                $module = $this->Module_Request_Router->resolve_route($route[0], $route[1]);
228
-                if ($module instanceof EED_Module) {
229
-                    // get registered view for route
230
-                    $this->_template_path = $this->Module_Request_Router->get_view($route);
231
-                    // grab module name
232
-                    $module_name = $module->module_name();
233
-                    // map the module to the module objects
234
-                    $this->Registry->modules->{$module_name} = $module;
235
-                }
236
-            }
237
-        }
238
-    }
239
-
240
-
241
-
242
-
243
-
244
-    /***********************************************        WP HOOK         ***********************************************/
245
-
246
-
247
-    /**
248
-     *    wp - basically last chance to do stuff before headers sent
249
-     *
250
-     * @access    public
251
-     * @return    void
252
-     */
253
-    public function wp()
254
-    {
255
-    }
256
-
257
-
258
-
259
-    /***********************     GET_HEADER && WP_HEAD HOOK     ***********************/
260
-
261
-
262
-    /**
263
-     * callback for the "template_redirect" hook point
264
-     * checks sidebars for EE widgets
265
-     * loads resources and assets accordingly
266
-     *
267
-     * @return void
268
-     */
269
-    public function templateRedirect()
270
-    {
271
-        global $wp_query;
272
-        if (empty($wp_query->posts)) {
273
-            return;
274
-        }
275
-        // if we already know this is an espresso page, then load assets
276
-        $load_assets = $this->Request_Handler->is_espresso_page();
277
-        // if we are already loading assets then just move along, otherwise check for widgets
278
-        $load_assets = $load_assets ? $load_assets : $this->espresso_widgets_in_active_sidebars();
279
-        if ($load_assets) {
280
-            add_action('wp_enqueue_scripts', array($this, 'enqueueStyle'), 10);
281
-            add_action('wp_print_footer_scripts', array($this, 'enqueueScripts'), 10);
282
-        }
283
-    }
284
-
285
-
286
-    /**
287
-     * builds list of active widgets then scans active sidebars looking for them
288
-     * returns true is an EE widget is found in an active sidebar
289
-     * Please Note: this does NOT mean that the sidebar or widget
290
-     * is actually in use in a given template, as that is unfortunately not known
291
-     * until a sidebar and it's widgets are actually loaded
292
-     *
293
-     * @return boolean
294
-     */
295
-    private function espresso_widgets_in_active_sidebars()
296
-    {
297
-        $espresso_widgets = array();
298
-        foreach ($this->Registry->widgets as $widget_class => $widget) {
299
-            $id_base = EspressoWidget::getIdBase($widget_class);
300
-            if (is_active_widget(false, false, $id_base)) {
301
-                $espresso_widgets[] = $id_base;
302
-            }
303
-        }
304
-        $all_sidebar_widgets = wp_get_sidebars_widgets();
305
-        foreach ($all_sidebar_widgets as $sidebar_name => $sidebar_widgets) {
306
-            if (is_array($sidebar_widgets) && ! empty($sidebar_widgets)) {
307
-                foreach ($sidebar_widgets as $sidebar_widget) {
308
-                    foreach ($espresso_widgets as $espresso_widget) {
309
-                        if (strpos($sidebar_widget, $espresso_widget) !== false) {
310
-                            return true;
311
-                        }
312
-                    }
313
-                }
314
-            }
315
-        }
316
-        return false;
317
-    }
318
-
319
-
320
-    /**
321
-     *    header_meta_tag
322
-     *
323
-     * @access    public
324
-     * @return    void
325
-     */
326
-    public function header_meta_tag()
327
-    {
328
-        print(
329
-        apply_filters(
330
-            'FHEE__EE_Front_Controller__header_meta_tag',
331
-            '<meta name="generator" content="Event Espresso Version ' . EVENT_ESPRESSO_VERSION . "\" />\n"
332
-        )
333
-        );
334
-
335
-        // let's exclude all event type taxonomy term archive pages from search engine indexing
336
-        // @see https://events.codebasehq.com/projects/event-espresso/tickets/10249
337
-        // also exclude all critical pages from indexing
338
-        if ((
339
-                is_tax('espresso_event_type')
340
-                && get_option('blog_public') !== '0'
341
-            )
342
-            || is_page(EE_Registry::instance()->CFG->core->get_critical_pages_array())
343
-        ) {
344
-            print(
345
-            apply_filters(
346
-                'FHEE__EE_Front_Controller__header_meta_tag__noindex_for_event_type',
347
-                '<meta name="robots" content="noindex,follow" />' . "\n"
348
-            )
349
-            );
350
-        }
351
-    }
352
-
353
-
354
-    /**
355
-     * wp_print_scripts
356
-     *
357
-     * @return void
358
-     */
359
-    public function wp_print_scripts()
360
-    {
361
-        global $post;
362
-        if (isset($post->EE_Event)
363
-            && $post->EE_Event instanceof EE_Event
364
-            && get_post_type() === 'espresso_events'
365
-            && is_singular()
366
-        ) {
367
-            \EEH_Schema::add_json_linked_data_for_event($post->EE_Event);
368
-        }
369
-    }
370
-
371
-
372
-    public function enqueueStyle()
373
-    {
374
-        wp_enqueue_style('espresso_default');
375
-        wp_enqueue_style('espresso_custom_css');
376
-    }
377
-
378
-
379
-
380
-    /***********************************************        WP_FOOTER         ***********************************************/
381
-
382
-
383
-    public function enqueueScripts()
384
-    {
385
-        wp_enqueue_script('espresso_core');
386
-    }
387
-
388
-
389
-    /**
390
-     * display_errors
391
-     *
392
-     * @access public
393
-     * @return void
394
-     * @throws DomainException
395
-     */
396
-    public function display_errors()
397
-    {
398
-        static $shown_already = false;
399
-        do_action('AHEE__EE_Front_Controller__display_errors__begin');
400
-        if (! $shown_already
401
-            && apply_filters('FHEE__EE_Front_Controller__display_errors', true)
402
-            && is_main_query()
403
-            && ! is_feed()
404
-            && in_the_loop()
405
-            && did_action('wp_head')
406
-            && $this->Request_Handler->is_espresso_page()
407
-        ) {
408
-            echo EE_Error::get_notices();
409
-            $shown_already = true;
410
-            EEH_Template::display_template(EE_TEMPLATES . 'espresso-ajax-notices.template.php');
411
-        }
412
-        do_action('AHEE__EE_Front_Controller__display_errors__end');
413
-    }
414
-
415
-
416
-
417
-
418
-
419
-    /***********************************************        UTILITIES         ***********************************************/
420
-    /**
421
-     *    template_include
422
-     *
423
-     * @access    public
424
-     * @param   string $template_include_path
425
-     * @return    string
426
-     */
427
-    public function template_include($template_include_path = null)
428
-    {
429
-        if ($this->Request_Handler->is_espresso_page()) {
430
-            $this->_template_path = ! empty($this->_template_path)
431
-                ? basename($this->_template_path)
432
-                : basename(
433
-                    $template_include_path
434
-                );
435
-            $template_path = EEH_Template::locate_template($this->_template_path, array(), false);
436
-            $this->_template_path = ! empty($template_path) ? $template_path : $template_include_path;
437
-            $this->_template = basename($this->_template_path);
438
-            return $this->_template_path;
439
-        }
440
-        return $template_include_path;
441
-    }
442
-
443
-
444
-    /**
445
-     *    get_selected_template
446
-     *
447
-     * @access    public
448
-     * @param bool $with_path
449
-     * @return    string
450
-     */
451
-    public function get_selected_template($with_path = false)
452
-    {
453
-        return $with_path ? $this->_template_path : $this->_template;
454
-    }
455
-
456
-
457
-    /**
458
-     * @deprecated 4.9.26
459
-     * @param string $shortcode_class
460
-     * @param \WP    $wp
461
-     */
462
-    public function initialize_shortcode($shortcode_class = '', WP $wp = null)
463
-    {
464
-        \EE_Error::doing_it_wrong(
465
-            __METHOD__,
466
-            __(
467
-                'Usage is deprecated. Please use \EventEspresso\core\services\shortcodes\LegacyShortcodesManager::initializeShortcode() instead.',
468
-                'event_espresso'
469
-            ),
470
-            '4.9.26'
471
-        );
472
-        $this->getLegacyShortcodesManager()->initializeShortcode($shortcode_class, $wp);
473
-    }
474
-
475
-
476
-    /**
477
-     * @return void
478
-     * @deprecated 4.9.57.p
479
-     */
480
-    public function loadPersistentAdminNoticeManager()
481
-    {
482
-    }
483
-
484
-
485
-    /**
486
-     * @return void
487
-     * @deprecated 4.9.64.p
488
-     */
489
-    public function employ_CPT_Strategy()
490
-    {
491
-    }
29
+	/**
30
+	 * @var string $_template_path
31
+	 */
32
+	private $_template_path;
33
+
34
+	/**
35
+	 * @var string $_template
36
+	 */
37
+	private $_template;
38
+
39
+	/**
40
+	 * @type EE_Registry $Registry
41
+	 */
42
+	protected $Registry;
43
+
44
+	/**
45
+	 * @type EE_Request_Handler $Request_Handler
46
+	 */
47
+	protected $Request_Handler;
48
+
49
+	/**
50
+	 * @type EE_Module_Request_Router $Module_Request_Router
51
+	 */
52
+	protected $Module_Request_Router;
53
+
54
+
55
+	/**
56
+	 *    class constructor
57
+	 *    should fire after shortcode, module, addon, or other plugin's default priority init phases have run
58
+	 *
59
+	 * @access    public
60
+	 * @param \EE_Registry              $Registry
61
+	 * @param \EE_Request_Handler       $Request_Handler
62
+	 * @param \EE_Module_Request_Router $Module_Request_Router
63
+	 */
64
+	public function __construct(
65
+		EE_Registry $Registry,
66
+		EE_Request_Handler $Request_Handler,
67
+		EE_Module_Request_Router $Module_Request_Router
68
+	) {
69
+		$this->Registry = $Registry;
70
+		$this->Request_Handler = $Request_Handler;
71
+		$this->Module_Request_Router = $Module_Request_Router;
72
+		// load other resources and begin to actually run shortcodes and modules
73
+		add_action('wp_loaded', array($this, 'wp_loaded'), 5);
74
+		// analyse the incoming WP request
75
+		add_action('parse_request', array($this, 'get_request'), 1, 1);
76
+		// process request with module factory
77
+		add_action('pre_get_posts', array($this, 'pre_get_posts'), 10, 1);
78
+		// before headers sent
79
+		add_action('wp', array($this, 'wp'), 5);
80
+		// primarily used to process any content shortcodes
81
+		add_action('template_redirect', array($this, 'templateRedirect'), 999);
82
+		// header
83
+		add_action('wp_head', array($this, 'header_meta_tag'), 5);
84
+		add_action('wp_print_scripts', array($this, 'wp_print_scripts'), 10);
85
+		add_filter('template_include', array($this, 'template_include'), 1);
86
+		// display errors
87
+		add_action('loop_start', array($this, 'display_errors'), 2);
88
+		// the content
89
+		// add_filter( 'the_content', array( $this, 'the_content' ), 5, 1 );
90
+		// exclude our private cpt comments
91
+		add_filter('comments_clauses', array($this, 'filter_wp_comments'), 10, 1);
92
+		// make sure any ajax requests will respect the url schema when requests are made against admin-ajax.php (http:// or https://)
93
+		add_filter('admin_url', array($this, 'maybe_force_admin_ajax_ssl'), 200, 1);
94
+		// action hook EE
95
+		do_action('AHEE__EE_Front_Controller__construct__done', $this);
96
+	}
97
+
98
+
99
+	/**
100
+	 * @return EE_Request_Handler
101
+	 */
102
+	public function Request_Handler()
103
+	{
104
+		return $this->Request_Handler;
105
+	}
106
+
107
+
108
+	/**
109
+	 * @return EE_Module_Request_Router
110
+	 */
111
+	public function Module_Request_Router()
112
+	{
113
+		return $this->Module_Request_Router;
114
+	}
115
+
116
+
117
+	/**
118
+	 * @return LegacyShortcodesManager
119
+	 */
120
+	public function getLegacyShortcodesManager()
121
+	{
122
+		return EE_Config::getLegacyShortcodesManager();
123
+	}
124
+
125
+
126
+
127
+
128
+
129
+	/***********************************************        INIT ACTION HOOK         ***********************************************/
130
+	/**
131
+	 * filter_wp_comments
132
+	 * This simply makes sure that any "private" EE CPTs do not have their comments show up in any wp comment
133
+	 * widgets/queries done on frontend
134
+	 *
135
+	 * @param  array $clauses array of comment clauses setup by WP_Comment_Query
136
+	 * @return array array of comment clauses with modifications.
137
+	 * @throws InvalidArgumentException
138
+	 * @throws InvalidDataTypeException
139
+	 * @throws InvalidInterfaceException
140
+	 */
141
+	public function filter_wp_comments($clauses)
142
+	{
143
+		global $wpdb;
144
+		if (strpos($clauses['join'], $wpdb->posts) !== false) {
145
+			/** @var EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions $custom_post_types */
146
+			$custom_post_types = LoaderFactory::getLoader()->getShared(
147
+				'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'
148
+			);
149
+			$cpts = $custom_post_types->getPrivateCustomPostTypes();
150
+			foreach ($cpts as $cpt => $details) {
151
+				$clauses['where'] .= $wpdb->prepare(" AND $wpdb->posts.post_type != %s", $cpt);
152
+			}
153
+		}
154
+		return $clauses;
155
+	}
156
+
157
+
158
+	/**
159
+	 * this just makes sure that if the site is using ssl that we force that for any admin ajax calls from frontend
160
+	 *
161
+	 * @param  string $url incoming url
162
+	 * @return string         final assembled url
163
+	 */
164
+	public function maybe_force_admin_ajax_ssl($url)
165
+	{
166
+		if (is_ssl() && preg_match('/admin-ajax.php/', $url)) {
167
+			$url = str_replace('http://', 'https://', $url);
168
+		}
169
+		return $url;
170
+	}
171
+
172
+
173
+
174
+
175
+
176
+
177
+	/***********************************************        WP_LOADED ACTION HOOK         ***********************************************/
178
+
179
+
180
+	/**
181
+	 *    wp_loaded - should fire after shortcode, module, addon, or other plugin's have been registered and their
182
+	 *    default priority init phases have run
183
+	 *
184
+	 * @access    public
185
+	 * @return    void
186
+	 */
187
+	public function wp_loaded()
188
+	{
189
+	}
190
+
191
+
192
+
193
+
194
+
195
+	/***********************************************        PARSE_REQUEST HOOK         ***********************************************/
196
+	/**
197
+	 *    _get_request
198
+	 *
199
+	 * @access public
200
+	 * @param WP $WP
201
+	 * @return void
202
+	 */
203
+	public function get_request(WP $WP)
204
+	{
205
+		do_action('AHEE__EE_Front_Controller__get_request__start');
206
+		$this->Request_Handler->parse_request($WP);
207
+		do_action('AHEE__EE_Front_Controller__get_request__complete');
208
+	}
209
+
210
+
211
+	/**
212
+	 *    pre_get_posts - basically a module factory for instantiating modules and selecting the final view template
213
+	 *
214
+	 * @access    public
215
+	 * @param   WP_Query $WP_Query
216
+	 * @return    void
217
+	 */
218
+	public function pre_get_posts($WP_Query)
219
+	{
220
+		// only load Module_Request_Router if this is the main query
221
+		if ($this->Module_Request_Router instanceof EE_Module_Request_Router
222
+			&& $WP_Query->is_main_query()
223
+		) {
224
+			// cycle thru module routes
225
+			while ($route = $this->Module_Request_Router->get_route($WP_Query)) {
226
+				// determine module and method for route
227
+				$module = $this->Module_Request_Router->resolve_route($route[0], $route[1]);
228
+				if ($module instanceof EED_Module) {
229
+					// get registered view for route
230
+					$this->_template_path = $this->Module_Request_Router->get_view($route);
231
+					// grab module name
232
+					$module_name = $module->module_name();
233
+					// map the module to the module objects
234
+					$this->Registry->modules->{$module_name} = $module;
235
+				}
236
+			}
237
+		}
238
+	}
239
+
240
+
241
+
242
+
243
+
244
+	/***********************************************        WP HOOK         ***********************************************/
245
+
246
+
247
+	/**
248
+	 *    wp - basically last chance to do stuff before headers sent
249
+	 *
250
+	 * @access    public
251
+	 * @return    void
252
+	 */
253
+	public function wp()
254
+	{
255
+	}
256
+
257
+
258
+
259
+	/***********************     GET_HEADER && WP_HEAD HOOK     ***********************/
260
+
261
+
262
+	/**
263
+	 * callback for the "template_redirect" hook point
264
+	 * checks sidebars for EE widgets
265
+	 * loads resources and assets accordingly
266
+	 *
267
+	 * @return void
268
+	 */
269
+	public function templateRedirect()
270
+	{
271
+		global $wp_query;
272
+		if (empty($wp_query->posts)) {
273
+			return;
274
+		}
275
+		// if we already know this is an espresso page, then load assets
276
+		$load_assets = $this->Request_Handler->is_espresso_page();
277
+		// if we are already loading assets then just move along, otherwise check for widgets
278
+		$load_assets = $load_assets ? $load_assets : $this->espresso_widgets_in_active_sidebars();
279
+		if ($load_assets) {
280
+			add_action('wp_enqueue_scripts', array($this, 'enqueueStyle'), 10);
281
+			add_action('wp_print_footer_scripts', array($this, 'enqueueScripts'), 10);
282
+		}
283
+	}
284
+
285
+
286
+	/**
287
+	 * builds list of active widgets then scans active sidebars looking for them
288
+	 * returns true is an EE widget is found in an active sidebar
289
+	 * Please Note: this does NOT mean that the sidebar or widget
290
+	 * is actually in use in a given template, as that is unfortunately not known
291
+	 * until a sidebar and it's widgets are actually loaded
292
+	 *
293
+	 * @return boolean
294
+	 */
295
+	private function espresso_widgets_in_active_sidebars()
296
+	{
297
+		$espresso_widgets = array();
298
+		foreach ($this->Registry->widgets as $widget_class => $widget) {
299
+			$id_base = EspressoWidget::getIdBase($widget_class);
300
+			if (is_active_widget(false, false, $id_base)) {
301
+				$espresso_widgets[] = $id_base;
302
+			}
303
+		}
304
+		$all_sidebar_widgets = wp_get_sidebars_widgets();
305
+		foreach ($all_sidebar_widgets as $sidebar_name => $sidebar_widgets) {
306
+			if (is_array($sidebar_widgets) && ! empty($sidebar_widgets)) {
307
+				foreach ($sidebar_widgets as $sidebar_widget) {
308
+					foreach ($espresso_widgets as $espresso_widget) {
309
+						if (strpos($sidebar_widget, $espresso_widget) !== false) {
310
+							return true;
311
+						}
312
+					}
313
+				}
314
+			}
315
+		}
316
+		return false;
317
+	}
318
+
319
+
320
+	/**
321
+	 *    header_meta_tag
322
+	 *
323
+	 * @access    public
324
+	 * @return    void
325
+	 */
326
+	public function header_meta_tag()
327
+	{
328
+		print(
329
+		apply_filters(
330
+			'FHEE__EE_Front_Controller__header_meta_tag',
331
+			'<meta name="generator" content="Event Espresso Version ' . EVENT_ESPRESSO_VERSION . "\" />\n"
332
+		)
333
+		);
334
+
335
+		// let's exclude all event type taxonomy term archive pages from search engine indexing
336
+		// @see https://events.codebasehq.com/projects/event-espresso/tickets/10249
337
+		// also exclude all critical pages from indexing
338
+		if ((
339
+				is_tax('espresso_event_type')
340
+				&& get_option('blog_public') !== '0'
341
+			)
342
+			|| is_page(EE_Registry::instance()->CFG->core->get_critical_pages_array())
343
+		) {
344
+			print(
345
+			apply_filters(
346
+				'FHEE__EE_Front_Controller__header_meta_tag__noindex_for_event_type',
347
+				'<meta name="robots" content="noindex,follow" />' . "\n"
348
+			)
349
+			);
350
+		}
351
+	}
352
+
353
+
354
+	/**
355
+	 * wp_print_scripts
356
+	 *
357
+	 * @return void
358
+	 */
359
+	public function wp_print_scripts()
360
+	{
361
+		global $post;
362
+		if (isset($post->EE_Event)
363
+			&& $post->EE_Event instanceof EE_Event
364
+			&& get_post_type() === 'espresso_events'
365
+			&& is_singular()
366
+		) {
367
+			\EEH_Schema::add_json_linked_data_for_event($post->EE_Event);
368
+		}
369
+	}
370
+
371
+
372
+	public function enqueueStyle()
373
+	{
374
+		wp_enqueue_style('espresso_default');
375
+		wp_enqueue_style('espresso_custom_css');
376
+	}
377
+
378
+
379
+
380
+	/***********************************************        WP_FOOTER         ***********************************************/
381
+
382
+
383
+	public function enqueueScripts()
384
+	{
385
+		wp_enqueue_script('espresso_core');
386
+	}
387
+
388
+
389
+	/**
390
+	 * display_errors
391
+	 *
392
+	 * @access public
393
+	 * @return void
394
+	 * @throws DomainException
395
+	 */
396
+	public function display_errors()
397
+	{
398
+		static $shown_already = false;
399
+		do_action('AHEE__EE_Front_Controller__display_errors__begin');
400
+		if (! $shown_already
401
+			&& apply_filters('FHEE__EE_Front_Controller__display_errors', true)
402
+			&& is_main_query()
403
+			&& ! is_feed()
404
+			&& in_the_loop()
405
+			&& did_action('wp_head')
406
+			&& $this->Request_Handler->is_espresso_page()
407
+		) {
408
+			echo EE_Error::get_notices();
409
+			$shown_already = true;
410
+			EEH_Template::display_template(EE_TEMPLATES . 'espresso-ajax-notices.template.php');
411
+		}
412
+		do_action('AHEE__EE_Front_Controller__display_errors__end');
413
+	}
414
+
415
+
416
+
417
+
418
+
419
+	/***********************************************        UTILITIES         ***********************************************/
420
+	/**
421
+	 *    template_include
422
+	 *
423
+	 * @access    public
424
+	 * @param   string $template_include_path
425
+	 * @return    string
426
+	 */
427
+	public function template_include($template_include_path = null)
428
+	{
429
+		if ($this->Request_Handler->is_espresso_page()) {
430
+			$this->_template_path = ! empty($this->_template_path)
431
+				? basename($this->_template_path)
432
+				: basename(
433
+					$template_include_path
434
+				);
435
+			$template_path = EEH_Template::locate_template($this->_template_path, array(), false);
436
+			$this->_template_path = ! empty($template_path) ? $template_path : $template_include_path;
437
+			$this->_template = basename($this->_template_path);
438
+			return $this->_template_path;
439
+		}
440
+		return $template_include_path;
441
+	}
442
+
443
+
444
+	/**
445
+	 *    get_selected_template
446
+	 *
447
+	 * @access    public
448
+	 * @param bool $with_path
449
+	 * @return    string
450
+	 */
451
+	public function get_selected_template($with_path = false)
452
+	{
453
+		return $with_path ? $this->_template_path : $this->_template;
454
+	}
455
+
456
+
457
+	/**
458
+	 * @deprecated 4.9.26
459
+	 * @param string $shortcode_class
460
+	 * @param \WP    $wp
461
+	 */
462
+	public function initialize_shortcode($shortcode_class = '', WP $wp = null)
463
+	{
464
+		\EE_Error::doing_it_wrong(
465
+			__METHOD__,
466
+			__(
467
+				'Usage is deprecated. Please use \EventEspresso\core\services\shortcodes\LegacyShortcodesManager::initializeShortcode() instead.',
468
+				'event_espresso'
469
+			),
470
+			'4.9.26'
471
+		);
472
+		$this->getLegacyShortcodesManager()->initializeShortcode($shortcode_class, $wp);
473
+	}
474
+
475
+
476
+	/**
477
+	 * @return void
478
+	 * @deprecated 4.9.57.p
479
+	 */
480
+	public function loadPersistentAdminNoticeManager()
481
+	{
482
+	}
483
+
484
+
485
+	/**
486
+	 * @return void
487
+	 * @deprecated 4.9.64.p
488
+	 */
489
+	public function employ_CPT_Strategy()
490
+	{
491
+	}
492 492
 }
Please login to merge, or discard this patch.
core/EE_Psr4AutoloaderInit.core.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -17,38 +17,38 @@
 block discarded – undo
17 17
 {
18 18
 
19 19
 
20
-    /**
21
-     * @type \EventEspresso\core\Psr4Autoloader
22
-     */
23
-    protected static $psr4_loader;
24
-
25
-
26
-    /**
27
-     * @return \EventEspresso\core\Psr4Autoloader
28
-     */
29
-    public function initializeAutoloader()
30
-    {
31
-        static $initialized = false;
32
-        if (! $initialized) {
33
-            // instantiate PSR4 autoloader
34
-            espresso_load_required('Psr4Autoloader', EE_CORE . 'Psr4Autoloader.php');
35
-            EE_Psr4AutoloaderInit::$psr4_loader = new Psr4Autoloader();
36
-            // register the autoloader
37
-            EE_Psr4AutoloaderInit::$psr4_loader->register();
38
-            // register the base directories for the namespace prefix
39
-            EE_Psr4AutoloaderInit::$psr4_loader->addNamespace('EventEspresso', EE_PLUGIN_DIR_PATH);
40
-            EE_Psr4AutoloaderInit::$psr4_loader->addNamespace('EventEspressoBatchRequest', EE_LIBRARIES . 'batch');
41
-            EE_Psr4AutoloaderInit::$psr4_loader->addNamespace('EventEspressoVendor', EE_THIRD_PARTY);
42
-            $initialized = true;
43
-        }
44
-    }
45
-
46
-
47
-    /**
48
-     * @return \EventEspresso\core\Psr4Autoloader
49
-     */
50
-    public static function psr4_loader()
51
-    {
52
-        return self::$psr4_loader;
53
-    }
20
+	/**
21
+	 * @type \EventEspresso\core\Psr4Autoloader
22
+	 */
23
+	protected static $psr4_loader;
24
+
25
+
26
+	/**
27
+	 * @return \EventEspresso\core\Psr4Autoloader
28
+	 */
29
+	public function initializeAutoloader()
30
+	{
31
+		static $initialized = false;
32
+		if (! $initialized) {
33
+			// instantiate PSR4 autoloader
34
+			espresso_load_required('Psr4Autoloader', EE_CORE . 'Psr4Autoloader.php');
35
+			EE_Psr4AutoloaderInit::$psr4_loader = new Psr4Autoloader();
36
+			// register the autoloader
37
+			EE_Psr4AutoloaderInit::$psr4_loader->register();
38
+			// register the base directories for the namespace prefix
39
+			EE_Psr4AutoloaderInit::$psr4_loader->addNamespace('EventEspresso', EE_PLUGIN_DIR_PATH);
40
+			EE_Psr4AutoloaderInit::$psr4_loader->addNamespace('EventEspressoBatchRequest', EE_LIBRARIES . 'batch');
41
+			EE_Psr4AutoloaderInit::$psr4_loader->addNamespace('EventEspressoVendor', EE_THIRD_PARTY);
42
+			$initialized = true;
43
+		}
44
+	}
45
+
46
+
47
+	/**
48
+	 * @return \EventEspresso\core\Psr4Autoloader
49
+	 */
50
+	public static function psr4_loader()
51
+	{
52
+		return self::$psr4_loader;
53
+	}
54 54
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@
 block discarded – undo
29 29
     public function initializeAutoloader()
30 30
     {
31 31
         static $initialized = false;
32
-        if (! $initialized) {
32
+        if ( ! $initialized) {
33 33
             // instantiate PSR4 autoloader
34
-            espresso_load_required('Psr4Autoloader', EE_CORE . 'Psr4Autoloader.php');
34
+            espresso_load_required('Psr4Autoloader', EE_CORE.'Psr4Autoloader.php');
35 35
             EE_Psr4AutoloaderInit::$psr4_loader = new Psr4Autoloader();
36 36
             // register the autoloader
37 37
             EE_Psr4AutoloaderInit::$psr4_loader->register();
38 38
             // register the base directories for the namespace prefix
39 39
             EE_Psr4AutoloaderInit::$psr4_loader->addNamespace('EventEspresso', EE_PLUGIN_DIR_PATH);
40
-            EE_Psr4AutoloaderInit::$psr4_loader->addNamespace('EventEspressoBatchRequest', EE_LIBRARIES . 'batch');
40
+            EE_Psr4AutoloaderInit::$psr4_loader->addNamespace('EventEspressoBatchRequest', EE_LIBRARIES.'batch');
41 41
             EE_Psr4AutoloaderInit::$psr4_loader->addNamespace('EventEspressoVendor', EE_THIRD_PARTY);
42 42
             $initialized = true;
43 43
         }
Please login to merge, or discard this patch.
core/EE_Object_Repository.core.php 1 patch
Indentation   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -16,98 +16,98 @@
 block discarded – undo
16 16
 abstract class EE_Object_Repository extends EE_Object_Collection implements EEI_Repository
17 17
 {
18 18
 
19
-    /**
20
-     * default persist method called on repository objects if none supplied
21
-     *
22
-     * @type string $persist_method
23
-     */
24
-    protected $persist_method;
19
+	/**
20
+	 * default persist method called on repository objects if none supplied
21
+	 *
22
+	 * @type string $persist_method
23
+	 */
24
+	protected $persist_method;
25 25
 
26 26
 
27
-    /**
28
-     * _call_user_func_array_on_current
29
-     *
30
-     * calls the supplied callback method name on the current repository object,
31
-     * an array of arguments can also be supplied that will be passed along to the callback method,
32
-     * where each element of the $arguments array corresponds to a parameter for the callback method
33
-     * PLZ NOTE: if the first argument of the callback requires an array, for example array( 'key' => 'value' )
34
-     * then $arguments needs to be a DOUBLE array ie: array( array( 'key' => 'value' ) )
35
-     *
36
-     * @access public
37
-     * @param string $callback  name of method found on object to be called.
38
-     * @param array  $arguments arrays of arguments that will be passed to the object's callback method
39
-     * @return bool | int
40
-     */
41
-    protected function _call_user_func_array_on_current($callback = '', $arguments = array())
42
-    {
43
-        if ($callback !== '' && method_exists($this->current(), $callback)) {
44
-            return call_user_func_array(array($this->current(), $callback), $arguments);
45
-        }
46
-        return false;
47
-    }
27
+	/**
28
+	 * _call_user_func_array_on_current
29
+	 *
30
+	 * calls the supplied callback method name on the current repository object,
31
+	 * an array of arguments can also be supplied that will be passed along to the callback method,
32
+	 * where each element of the $arguments array corresponds to a parameter for the callback method
33
+	 * PLZ NOTE: if the first argument of the callback requires an array, for example array( 'key' => 'value' )
34
+	 * then $arguments needs to be a DOUBLE array ie: array( array( 'key' => 'value' ) )
35
+	 *
36
+	 * @access public
37
+	 * @param string $callback  name of method found on object to be called.
38
+	 * @param array  $arguments arrays of arguments that will be passed to the object's callback method
39
+	 * @return bool | int
40
+	 */
41
+	protected function _call_user_func_array_on_current($callback = '', $arguments = array())
42
+	{
43
+		if ($callback !== '' && method_exists($this->current(), $callback)) {
44
+			return call_user_func_array(array($this->current(), $callback), $arguments);
45
+		}
46
+		return false;
47
+	}
48 48
 
49 49
 
50
-    /**
51
-     * _call_user_func_on_all
52
-     *
53
-     * calls the supplied callback method name on ALL repository objects,
54
-     *
55
-     * @access public
56
-     * @param string $callback name of method found on repository objects to be called
57
-     * @return bool | int
58
-     */
59
-    protected function _call_user_func_on_all($callback = '')
60
-    {
61
-        $success = true;
62
-        if ($this->valid()) {
63
-            $this->rewind();
64
-            while ($this->valid()) {
65
-                // any negative result will toggle success to false
66
-                $success = $this->_call_user_func_array_on_current($callback) ? $success : false;
67
-                $this->next();
68
-            }
69
-            $this->rewind();
70
-        }
71
-        return $success;
72
-    }
50
+	/**
51
+	 * _call_user_func_on_all
52
+	 *
53
+	 * calls the supplied callback method name on ALL repository objects,
54
+	 *
55
+	 * @access public
56
+	 * @param string $callback name of method found on repository objects to be called
57
+	 * @return bool | int
58
+	 */
59
+	protected function _call_user_func_on_all($callback = '')
60
+	{
61
+		$success = true;
62
+		if ($this->valid()) {
63
+			$this->rewind();
64
+			while ($this->valid()) {
65
+				// any negative result will toggle success to false
66
+				$success = $this->_call_user_func_array_on_current($callback) ? $success : false;
67
+				$this->next();
68
+			}
69
+			$this->rewind();
70
+		}
71
+		return $success;
72
+	}
73 73
 
74 74
 
75
-    /**
76
-     * persist
77
-     *
78
-     * primarily used for saving EE_Base_Class classes to the database,
79
-     * but can be supplied with a "persistence callback" that can be used for classes that are not instances of
80
-     * EE_Base_Class, or for providing alternate ways to persist an object such as session caching, etc... an array of
81
-     * arguments can also be supplied that will be passed along to the object's persistence method
82
-     *
83
-     * @access public
84
-     * @param string $persistence_callback                                    name of method found on object that can
85
-     *                                                                        be used for persisting the object
86
-     *                                                                        defaults to
87
-     *                                                                        EE_Object_Repository::$persist_method
88
-     * @param array  $persistence_arguments                                   arrays of arguments that will be passed
89
-     *                                                                        to the object's persistence method
90
-     * @return bool | int
91
-     */
92
-    public function persist($persistence_callback = '', $persistence_arguments = array())
93
-    {
94
-        $persistence_callback = ! empty($persistence_callback) ? $persistence_callback : $this->persist_method;
95
-        return $this->_call_user_func_array_on_current($persistence_callback, $persistence_arguments);
96
-    }
75
+	/**
76
+	 * persist
77
+	 *
78
+	 * primarily used for saving EE_Base_Class classes to the database,
79
+	 * but can be supplied with a "persistence callback" that can be used for classes that are not instances of
80
+	 * EE_Base_Class, or for providing alternate ways to persist an object such as session caching, etc... an array of
81
+	 * arguments can also be supplied that will be passed along to the object's persistence method
82
+	 *
83
+	 * @access public
84
+	 * @param string $persistence_callback                                    name of method found on object that can
85
+	 *                                                                        be used for persisting the object
86
+	 *                                                                        defaults to
87
+	 *                                                                        EE_Object_Repository::$persist_method
88
+	 * @param array  $persistence_arguments                                   arrays of arguments that will be passed
89
+	 *                                                                        to the object's persistence method
90
+	 * @return bool | int
91
+	 */
92
+	public function persist($persistence_callback = '', $persistence_arguments = array())
93
+	{
94
+		$persistence_callback = ! empty($persistence_callback) ? $persistence_callback : $this->persist_method;
95
+		return $this->_call_user_func_array_on_current($persistence_callback, $persistence_arguments);
96
+	}
97 97
 
98 98
 
99
-    /**
100
-     * persist_all
101
-     *
102
-     * calls \EE_Object_Repository::persist() on all objects within the repository
103
-     *
104
-     * @access public
105
-     * @param string $persistence_callback name of method found on object that can be used for persisting the object
106
-     * @return bool | int
107
-     */
108
-    public function persist_all($persistence_callback = '')
109
-    {
110
-        $persistence_callback = ! empty($persistence_callback) ? $persistence_callback : $this->persist_method;
111
-        return $this->_call_user_func_on_all($persistence_callback);
112
-    }
99
+	/**
100
+	 * persist_all
101
+	 *
102
+	 * calls \EE_Object_Repository::persist() on all objects within the repository
103
+	 *
104
+	 * @access public
105
+	 * @param string $persistence_callback name of method found on object that can be used for persisting the object
106
+	 * @return bool | int
107
+	 */
108
+	public function persist_all($persistence_callback = '')
109
+	{
110
+		$persistence_callback = ! empty($persistence_callback) ? $persistence_callback : $this->persist_method;
111
+		return $this->_call_user_func_on_all($persistence_callback);
112
+	}
113 113
 }
Please login to merge, or discard this patch.
core/EED_Module.module.php 2 patches
Indentation   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -12,110 +12,110 @@
 block discarded – undo
12 12
 abstract class EED_Module extends EE_Configurable implements ResettableInterface
13 13
 {
14 14
 
15
-    /**
16
-     * rendered output to be returned to WP
17
-     *
18
-     * @var    string $output
19
-     */
20
-    protected $output = '';
21
-
22
-    /**
23
-     * the current active espresso template theme
24
-     *
25
-     * @var    string $theme
26
-     */
27
-    protected $theme = '';
28
-
29
-
30
-    /**
31
-     * @return void
32
-     */
33
-    public static function reset()
34
-    {
35
-        $module_name = get_called_class();
36
-        new $module_name();
37
-    }
38
-
39
-
40
-    /**
41
-     *    set_hooks - for hooking into EE Core, other modules, etc
42
-     *
43
-     * @access    public
44
-     * @return    void
45
-     */
46
-    public static function set_hooks()
47
-    {
48
-    }
49
-
50
-
51
-    /**
52
-     *    set_hooks_admin - for hooking into EE Admin Core, other modules, etc
53
-     *
54
-     * @access    public
55
-     * @return    void
56
-     */
57
-    public static function set_hooks_admin()
58
-    {
59
-    }
60
-
61
-
62
-    /**
63
-     *    run - initial module setup
64
-     *    this method is primarily used for activating resources in the EE_Front_Controller thru the use of filters
65
-     *
66
-     * @access    public
67
-     * @var            WP $WP
68
-     * @return    void
69
-     */
70
-    abstract public function run($WP);
71
-
72
-
73
-    /**
74
-     * EED_Module constructor.
75
-     */
76
-    final public function __construct()
77
-    {
78
-        $this->theme = EE_Config::get_current_theme();
79
-        $module_name = $this->module_name();
80
-        EE_Registry::instance()->modules->{$module_name} = $this;
81
-    }
82
-
83
-
84
-    /**
85
-     * @param $module_name
86
-     * @return EED_Module
87
-     */
88
-    protected static function get_instance($module_name = '')
89
-    {
90
-        $module_name = ! empty($module_name)
91
-            ? $module_name
92
-            : get_called_class();
93
-        if (! isset(EE_Registry::instance()->modules->{$module_name})
94
-            || ! EE_Registry::instance()->modules->{$module_name} instanceof EED_Module
95
-        ) {
96
-            EE_Registry::instance()->add_module($module_name);
97
-        }
98
-        return EE_Registry::instance()->get_module($module_name);
99
-    }
100
-
101
-
102
-    /**
103
-     *    module_name
104
-     *
105
-     * @access    public
106
-     * @return    string
107
-     */
108
-    public function module_name()
109
-    {
110
-        return get_class($this);
111
-    }
112
-
113
-
114
-    /**
115
-     * @return string
116
-     */
117
-    public function theme()
118
-    {
119
-        return $this->theme;
120
-    }
15
+	/**
16
+	 * rendered output to be returned to WP
17
+	 *
18
+	 * @var    string $output
19
+	 */
20
+	protected $output = '';
21
+
22
+	/**
23
+	 * the current active espresso template theme
24
+	 *
25
+	 * @var    string $theme
26
+	 */
27
+	protected $theme = '';
28
+
29
+
30
+	/**
31
+	 * @return void
32
+	 */
33
+	public static function reset()
34
+	{
35
+		$module_name = get_called_class();
36
+		new $module_name();
37
+	}
38
+
39
+
40
+	/**
41
+	 *    set_hooks - for hooking into EE Core, other modules, etc
42
+	 *
43
+	 * @access    public
44
+	 * @return    void
45
+	 */
46
+	public static function set_hooks()
47
+	{
48
+	}
49
+
50
+
51
+	/**
52
+	 *    set_hooks_admin - for hooking into EE Admin Core, other modules, etc
53
+	 *
54
+	 * @access    public
55
+	 * @return    void
56
+	 */
57
+	public static function set_hooks_admin()
58
+	{
59
+	}
60
+
61
+
62
+	/**
63
+	 *    run - initial module setup
64
+	 *    this method is primarily used for activating resources in the EE_Front_Controller thru the use of filters
65
+	 *
66
+	 * @access    public
67
+	 * @var            WP $WP
68
+	 * @return    void
69
+	 */
70
+	abstract public function run($WP);
71
+
72
+
73
+	/**
74
+	 * EED_Module constructor.
75
+	 */
76
+	final public function __construct()
77
+	{
78
+		$this->theme = EE_Config::get_current_theme();
79
+		$module_name = $this->module_name();
80
+		EE_Registry::instance()->modules->{$module_name} = $this;
81
+	}
82
+
83
+
84
+	/**
85
+	 * @param $module_name
86
+	 * @return EED_Module
87
+	 */
88
+	protected static function get_instance($module_name = '')
89
+	{
90
+		$module_name = ! empty($module_name)
91
+			? $module_name
92
+			: get_called_class();
93
+		if (! isset(EE_Registry::instance()->modules->{$module_name})
94
+			|| ! EE_Registry::instance()->modules->{$module_name} instanceof EED_Module
95
+		) {
96
+			EE_Registry::instance()->add_module($module_name);
97
+		}
98
+		return EE_Registry::instance()->get_module($module_name);
99
+	}
100
+
101
+
102
+	/**
103
+	 *    module_name
104
+	 *
105
+	 * @access    public
106
+	 * @return    string
107
+	 */
108
+	public function module_name()
109
+	{
110
+		return get_class($this);
111
+	}
112
+
113
+
114
+	/**
115
+	 * @return string
116
+	 */
117
+	public function theme()
118
+	{
119
+		return $this->theme;
120
+	}
121 121
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
         $module_name = ! empty($module_name)
91 91
             ? $module_name
92 92
             : get_called_class();
93
-        if (! isset(EE_Registry::instance()->modules->{$module_name})
93
+        if ( ! isset(EE_Registry::instance()->modules->{$module_name})
94 94
             || ! EE_Registry::instance()->modules->{$module_name} instanceof EED_Module
95 95
         ) {
96 96
             EE_Registry::instance()->add_module($module_name);
Please login to merge, or discard this patch.