@@ -24,37 +24,37 @@ |
||
24 | 24 | { |
25 | 25 | |
26 | 26 | |
27 | - /** |
|
28 | - * @var CopyRegistrationService $copy_registration_service |
|
29 | - */ |
|
30 | - private $copy_registration_service; |
|
31 | - |
|
32 | - |
|
33 | - /** |
|
34 | - * Command constructor |
|
35 | - * |
|
36 | - * @param CopyRegistrationService $copy_registration_service |
|
37 | - */ |
|
38 | - public function __construct(CopyRegistrationService $copy_registration_service) |
|
39 | - { |
|
40 | - $this->copy_registration_service = $copy_registration_service; |
|
41 | - } |
|
42 | - |
|
43 | - |
|
44 | - /** |
|
45 | - * @param CommandInterface|CopyRegistrationDetailsCommand $command |
|
46 | - * @return boolean |
|
47 | - * @throws InvalidEntityException |
|
48 | - * @throws EE_Error |
|
49 | - * @throws EntityNotFoundException |
|
50 | - * @throws UnexpectedEntityException |
|
51 | - * @throws RuntimeException |
|
52 | - */ |
|
53 | - public function handle(CommandInterface $command) |
|
54 | - { |
|
55 | - return $this->copy_registration_service->copyRegistrationDetails( |
|
56 | - $command->targetRegistration(), |
|
57 | - $command->registrationToCopy() |
|
58 | - ); |
|
59 | - } |
|
27 | + /** |
|
28 | + * @var CopyRegistrationService $copy_registration_service |
|
29 | + */ |
|
30 | + private $copy_registration_service; |
|
31 | + |
|
32 | + |
|
33 | + /** |
|
34 | + * Command constructor |
|
35 | + * |
|
36 | + * @param CopyRegistrationService $copy_registration_service |
|
37 | + */ |
|
38 | + public function __construct(CopyRegistrationService $copy_registration_service) |
|
39 | + { |
|
40 | + $this->copy_registration_service = $copy_registration_service; |
|
41 | + } |
|
42 | + |
|
43 | + |
|
44 | + /** |
|
45 | + * @param CommandInterface|CopyRegistrationDetailsCommand $command |
|
46 | + * @return boolean |
|
47 | + * @throws InvalidEntityException |
|
48 | + * @throws EE_Error |
|
49 | + * @throws EntityNotFoundException |
|
50 | + * @throws UnexpectedEntityException |
|
51 | + * @throws RuntimeException |
|
52 | + */ |
|
53 | + public function handle(CommandInterface $command) |
|
54 | + { |
|
55 | + return $this->copy_registration_service->copyRegistrationDetails( |
|
56 | + $command->targetRegistration(), |
|
57 | + $command->registrationToCopy() |
|
58 | + ); |
|
59 | + } |
|
60 | 60 | } |
@@ -34,74 +34,74 @@ |
||
34 | 34 | class CommandBus implements CommandBusInterface |
35 | 35 | { |
36 | 36 | |
37 | - /** |
|
38 | - * @type CommandHandlerManagerInterface $command_handler_manager |
|
39 | - */ |
|
40 | - private $command_handler_manager; |
|
37 | + /** |
|
38 | + * @type CommandHandlerManagerInterface $command_handler_manager |
|
39 | + */ |
|
40 | + private $command_handler_manager; |
|
41 | 41 | |
42 | - /** |
|
43 | - * @type CommandBusMiddlewareInterface[] $command_bus_middleware |
|
44 | - */ |
|
45 | - private $command_bus_middleware; |
|
42 | + /** |
|
43 | + * @type CommandBusMiddlewareInterface[] $command_bus_middleware |
|
44 | + */ |
|
45 | + private $command_bus_middleware; |
|
46 | 46 | |
47 | 47 | |
48 | - /** |
|
49 | - * CommandBus constructor |
|
50 | - * |
|
51 | - * @param CommandHandlerManagerInterface $command_handler_manager |
|
52 | - * @param CommandBusMiddlewareInterface[] $command_bus_middleware |
|
53 | - */ |
|
54 | - public function __construct( |
|
55 | - CommandHandlerManagerInterface $command_handler_manager, |
|
56 | - array $command_bus_middleware = array() |
|
57 | - ) { |
|
58 | - $this->command_handler_manager = $command_handler_manager; |
|
59 | - $this->command_bus_middleware = is_array($command_bus_middleware) |
|
60 | - ? $command_bus_middleware |
|
61 | - : array($command_bus_middleware); |
|
62 | - } |
|
48 | + /** |
|
49 | + * CommandBus constructor |
|
50 | + * |
|
51 | + * @param CommandHandlerManagerInterface $command_handler_manager |
|
52 | + * @param CommandBusMiddlewareInterface[] $command_bus_middleware |
|
53 | + */ |
|
54 | + public function __construct( |
|
55 | + CommandHandlerManagerInterface $command_handler_manager, |
|
56 | + array $command_bus_middleware = array() |
|
57 | + ) { |
|
58 | + $this->command_handler_manager = $command_handler_manager; |
|
59 | + $this->command_bus_middleware = is_array($command_bus_middleware) |
|
60 | + ? $command_bus_middleware |
|
61 | + : array($command_bus_middleware); |
|
62 | + } |
|
63 | 63 | |
64 | 64 | |
65 | - /** |
|
66 | - * @return CommandHandlerManagerInterface |
|
67 | - */ |
|
68 | - public function getCommandHandlerManager() |
|
69 | - { |
|
70 | - return $this->command_handler_manager; |
|
71 | - } |
|
65 | + /** |
|
66 | + * @return CommandHandlerManagerInterface |
|
67 | + */ |
|
68 | + public function getCommandHandlerManager() |
|
69 | + { |
|
70 | + return $this->command_handler_manager; |
|
71 | + } |
|
72 | 72 | |
73 | 73 | |
74 | - /** |
|
75 | - * @param CommandInterface $command |
|
76 | - * @return mixed |
|
77 | - * @throws InvalidDataTypeException |
|
78 | - * @throws InvalidCommandBusMiddlewareException |
|
79 | - */ |
|
80 | - public function execute($command) |
|
81 | - { |
|
82 | - if (! $command instanceof CommandInterface) { |
|
83 | - throw new InvalidDataTypeException(__METHOD__ . '( $command )', $command, 'CommandInterface'); |
|
84 | - } |
|
85 | - // we're going to add the Command Handler as a callable |
|
86 | - // that will get run at the end of our middleware stack |
|
87 | - // can't pass $this to a Closure, so use a named variable |
|
88 | - $command_bus = $this; |
|
89 | - $middleware = static function ($command) use ($command_bus) { |
|
90 | - return $command_bus->getCommandHandlerManager() |
|
91 | - ->getCommandHandler($command, $command_bus) |
|
92 | - ->verify($command) |
|
93 | - ->handle($command); |
|
94 | - }; |
|
95 | - // now build the rest of the middleware stack |
|
96 | - while ($command_bus_middleware = array_pop($this->command_bus_middleware)) { |
|
97 | - if (! $command_bus_middleware instanceof CommandBusMiddlewareInterface) { |
|
98 | - throw new InvalidCommandBusMiddlewareException($command_bus_middleware); |
|
99 | - } |
|
100 | - $middleware = static function ($command) use ($command_bus_middleware, $middleware) { |
|
101 | - return $command_bus_middleware->handle($command, $middleware); |
|
102 | - }; |
|
103 | - } |
|
104 | - // and finally, pass the command into the stack and return the results |
|
105 | - return $middleware($command); |
|
106 | - } |
|
74 | + /** |
|
75 | + * @param CommandInterface $command |
|
76 | + * @return mixed |
|
77 | + * @throws InvalidDataTypeException |
|
78 | + * @throws InvalidCommandBusMiddlewareException |
|
79 | + */ |
|
80 | + public function execute($command) |
|
81 | + { |
|
82 | + if (! $command instanceof CommandInterface) { |
|
83 | + throw new InvalidDataTypeException(__METHOD__ . '( $command )', $command, 'CommandInterface'); |
|
84 | + } |
|
85 | + // we're going to add the Command Handler as a callable |
|
86 | + // that will get run at the end of our middleware stack |
|
87 | + // can't pass $this to a Closure, so use a named variable |
|
88 | + $command_bus = $this; |
|
89 | + $middleware = static function ($command) use ($command_bus) { |
|
90 | + return $command_bus->getCommandHandlerManager() |
|
91 | + ->getCommandHandler($command, $command_bus) |
|
92 | + ->verify($command) |
|
93 | + ->handle($command); |
|
94 | + }; |
|
95 | + // now build the rest of the middleware stack |
|
96 | + while ($command_bus_middleware = array_pop($this->command_bus_middleware)) { |
|
97 | + if (! $command_bus_middleware instanceof CommandBusMiddlewareInterface) { |
|
98 | + throw new InvalidCommandBusMiddlewareException($command_bus_middleware); |
|
99 | + } |
|
100 | + $middleware = static function ($command) use ($command_bus_middleware, $middleware) { |
|
101 | + return $command_bus_middleware->handle($command, $middleware); |
|
102 | + }; |
|
103 | + } |
|
104 | + // and finally, pass the command into the stack and return the results |
|
105 | + return $middleware($command); |
|
106 | + } |
|
107 | 107 | } |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function execute($command) |
81 | 81 | { |
82 | - if (! $command instanceof CommandInterface) { |
|
83 | - throw new InvalidDataTypeException(__METHOD__ . '( $command )', $command, 'CommandInterface'); |
|
82 | + if ( ! $command instanceof CommandInterface) { |
|
83 | + throw new InvalidDataTypeException(__METHOD__.'( $command )', $command, 'CommandInterface'); |
|
84 | 84 | } |
85 | 85 | // we're going to add the Command Handler as a callable |
86 | 86 | // that will get run at the end of our middleware stack |
87 | 87 | // can't pass $this to a Closure, so use a named variable |
88 | 88 | $command_bus = $this; |
89 | - $middleware = static function ($command) use ($command_bus) { |
|
89 | + $middleware = static function($command) use ($command_bus) { |
|
90 | 90 | return $command_bus->getCommandHandlerManager() |
91 | 91 | ->getCommandHandler($command, $command_bus) |
92 | 92 | ->verify($command) |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | }; |
95 | 95 | // now build the rest of the middleware stack |
96 | 96 | while ($command_bus_middleware = array_pop($this->command_bus_middleware)) { |
97 | - if (! $command_bus_middleware instanceof CommandBusMiddlewareInterface) { |
|
97 | + if ( ! $command_bus_middleware instanceof CommandBusMiddlewareInterface) { |
|
98 | 98 | throw new InvalidCommandBusMiddlewareException($command_bus_middleware); |
99 | 99 | } |
100 | - $middleware = static function ($command) use ($command_bus_middleware, $middleware) { |
|
100 | + $middleware = static function($command) use ($command_bus_middleware, $middleware) { |
|
101 | 101 | return $command_bus_middleware->handle($command, $middleware); |
102 | 102 | }; |
103 | 103 | } |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | // unfortunately, this needs to be done upon INCLUSION of this file, |
16 | 16 | // instead of construction, because it only gets constructed on first page load |
17 | 17 | // (all other times it gets resurrected from a wordpress option) |
18 | -$stages = glob(EE_CORE . 'data_migration_scripts/4_7_0_stages/*'); |
|
18 | +$stages = glob(EE_CORE.'data_migration_scripts/4_7_0_stages/*'); |
|
19 | 19 | $class_to_filepath = array(); |
20 | 20 | foreach ($stages as $filepath) { |
21 | 21 | $matches = array(); |
22 | 22 | preg_match('~4_7_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
23 | - $class_to_filepath[ $matches[1] ] = $filepath; |
|
23 | + $class_to_filepath[$matches[1]] = $filepath; |
|
24 | 24 | } |
25 | 25 | // give addons a chance to autoload their stages too |
26 | 26 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_7_0__autoloaded_stages', $class_to_filepath); |
@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | ) |
77 | 77 | ) { |
78 | 78 | return true; |
79 | - } elseif (! $version_string) { |
|
79 | + } elseif ( ! $version_string) { |
|
80 | 80 | // no version string provided... this must be pre 4.3 |
81 | - return false;// changed mind. dont want people thinking they should migrate yet because they cant |
|
81 | + return false; // changed mind. dont want people thinking they should migrate yet because they cant |
|
82 | 82 | } else { |
83 | 83 | return false; |
84 | 84 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | public function schema_changes_before_migration() |
93 | 93 | { |
94 | 94 | // relies on 4.1's EEH_Activation::create_table |
95 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
95 | + require_once(EE_HELPERS.'EEH_Activation.helper.php'); |
|
96 | 96 | $table_name = 'esp_answer'; |
97 | 97 | $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
98 | 98 | REG_ID int(10) unsigned NOT NULL, |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | $stages = glob(EE_CORE . 'data_migration_scripts/4_7_0_stages/*'); |
20 | 20 | $class_to_filepath = array(); |
21 | 21 | foreach ($stages as $filepath) { |
22 | - $matches = array(); |
|
23 | - preg_match('~4_7_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
24 | - $class_to_filepath[ $matches[1] ] = $filepath; |
|
22 | + $matches = array(); |
|
23 | + preg_match('~4_7_0_stages/(.*).dmsstage.php~', $filepath, $matches); |
|
24 | + $class_to_filepath[ $matches[1] ] = $filepath; |
|
25 | 25 | } |
26 | 26 | // give addons a chance to autoload their stages too |
27 | 27 | $class_to_filepath = apply_filters('FHEE__EE_DMS_4_7_0__autoloaded_stages', $class_to_filepath); |
@@ -40,72 +40,72 @@ discard block |
||
40 | 40 | class EE_DMS_Core_4_7_0 extends EE_Data_Migration_Script_Base |
41 | 41 | { |
42 | 42 | |
43 | - /** |
|
44 | - * return EE_DMS_Core_4_7_0 |
|
45 | - * |
|
46 | - * @param TableManager $table_manager |
|
47 | - * @param TableAnalysis $table_analysis |
|
48 | - */ |
|
49 | - public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
50 | - { |
|
51 | - $this->_pretty_name = esc_html__("Data Update to Event Espresso 4.7.0", "event_espresso"); |
|
52 | - $this->_priority = 10; |
|
53 | - $this->_migration_stages = array( |
|
54 | - new EE_DMS_4_7_0_Add_Taxes_To_REG_Final_Price(), |
|
55 | - new EE_DMS_4_7_0_Registration_Payments(), |
|
56 | - ); |
|
57 | - parent::__construct($table_manager, $table_analysis); |
|
58 | - } |
|
43 | + /** |
|
44 | + * return EE_DMS_Core_4_7_0 |
|
45 | + * |
|
46 | + * @param TableManager $table_manager |
|
47 | + * @param TableAnalysis $table_analysis |
|
48 | + */ |
|
49 | + public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) |
|
50 | + { |
|
51 | + $this->_pretty_name = esc_html__("Data Update to Event Espresso 4.7.0", "event_espresso"); |
|
52 | + $this->_priority = 10; |
|
53 | + $this->_migration_stages = array( |
|
54 | + new EE_DMS_4_7_0_Add_Taxes_To_REG_Final_Price(), |
|
55 | + new EE_DMS_4_7_0_Registration_Payments(), |
|
56 | + ); |
|
57 | + parent::__construct($table_manager, $table_analysis); |
|
58 | + } |
|
59 | 59 | |
60 | 60 | |
61 | 61 | |
62 | - /** |
|
63 | - * @param array $version_array |
|
64 | - * @return bool |
|
65 | - */ |
|
66 | - public function can_migrate_from_version($version_array) |
|
67 | - { |
|
68 | - $version_string = $version_array['Core']; |
|
69 | - if ( |
|
70 | - ( |
|
71 | - version_compare($version_string, '4.7.0.decaf', '<') |
|
72 | - && version_compare($version_string, '4.6.0.decaf', '>=') |
|
73 | - ) |
|
74 | - || ( |
|
75 | - version_compare($version_string, '4.7.0.decaf', '>=') |
|
76 | - && ! $this->_get_table_analysis()->tableExists('esp_registration_payment') |
|
77 | - && $this->_get_table_analysis()->tableExists('esp_registration') |
|
78 | - ) |
|
79 | - ) { |
|
80 | - return true; |
|
81 | - } elseif (! $version_string) { |
|
82 | - // no version string provided... this must be pre 4.3 |
|
83 | - return false;// changed mind. dont want people thinking they should migrate yet because they cant |
|
84 | - } else { |
|
85 | - return false; |
|
86 | - } |
|
87 | - } |
|
62 | + /** |
|
63 | + * @param array $version_array |
|
64 | + * @return bool |
|
65 | + */ |
|
66 | + public function can_migrate_from_version($version_array) |
|
67 | + { |
|
68 | + $version_string = $version_array['Core']; |
|
69 | + if ( |
|
70 | + ( |
|
71 | + version_compare($version_string, '4.7.0.decaf', '<') |
|
72 | + && version_compare($version_string, '4.6.0.decaf', '>=') |
|
73 | + ) |
|
74 | + || ( |
|
75 | + version_compare($version_string, '4.7.0.decaf', '>=') |
|
76 | + && ! $this->_get_table_analysis()->tableExists('esp_registration_payment') |
|
77 | + && $this->_get_table_analysis()->tableExists('esp_registration') |
|
78 | + ) |
|
79 | + ) { |
|
80 | + return true; |
|
81 | + } elseif (! $version_string) { |
|
82 | + // no version string provided... this must be pre 4.3 |
|
83 | + return false;// changed mind. dont want people thinking they should migrate yet because they cant |
|
84 | + } else { |
|
85 | + return false; |
|
86 | + } |
|
87 | + } |
|
88 | 88 | |
89 | 89 | |
90 | 90 | |
91 | - /** |
|
92 | - * @return bool |
|
93 | - */ |
|
94 | - public function schema_changes_before_migration() |
|
95 | - { |
|
96 | - // relies on 4.1's EEH_Activation::create_table |
|
97 | - require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
98 | - $table_name = 'esp_answer'; |
|
99 | - $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
91 | + /** |
|
92 | + * @return bool |
|
93 | + */ |
|
94 | + public function schema_changes_before_migration() |
|
95 | + { |
|
96 | + // relies on 4.1's EEH_Activation::create_table |
|
97 | + require_once(EE_HELPERS . 'EEH_Activation.helper.php'); |
|
98 | + $table_name = 'esp_answer'; |
|
99 | + $sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
100 | 100 | REG_ID int(10) unsigned NOT NULL, |
101 | 101 | QST_ID int(10) unsigned NOT NULL, |
102 | 102 | ANS_value text NOT NULL, |
103 | 103 | PRIMARY KEY (ANS_ID), |
104 | 104 | KEY REG_ID (REG_ID), |
105 | 105 | KEY QST_ID (QST_ID)"; |
106 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
107 | - $table_name = 'esp_attendee_meta'; |
|
108 | - $sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
106 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
107 | + $table_name = 'esp_attendee_meta'; |
|
108 | + $sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
109 | 109 | ATT_ID bigint(20) unsigned NOT NULL, |
110 | 110 | ATT_fname varchar(45) NOT NULL, |
111 | 111 | ATT_lname varchar(45) NOT NULL, |
@@ -122,9 +122,9 @@ discard block |
||
122 | 122 | KEY ATT_email (ATT_email(191)), |
123 | 123 | KEY ATT_lname (ATT_lname), |
124 | 124 | KEY ATT_fname (ATT_fname)"; |
125 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
126 | - $table_name = 'esp_country'; |
|
127 | - $sql = "CNT_ISO varchar(2) COLLATE utf8_bin NOT NULL, |
|
125 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
126 | + $table_name = 'esp_country'; |
|
127 | + $sql = "CNT_ISO varchar(2) COLLATE utf8_bin NOT NULL, |
|
128 | 128 | CNT_ISO3 varchar(3) COLLATE utf8_bin NOT NULL, |
129 | 129 | RGN_ID tinyint(3) unsigned DEFAULT NULL, |
130 | 130 | CNT_name varchar(45) COLLATE utf8_bin NOT NULL, |
@@ -140,25 +140,25 @@ discard block |
||
140 | 140 | CNT_is_EU tinyint(1) DEFAULT '0', |
141 | 141 | CNT_active tinyint(1) DEFAULT '0', |
142 | 142 | PRIMARY KEY (CNT_ISO)"; |
143 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
144 | - $table_name = 'esp_currency'; |
|
145 | - $sql = "CUR_code varchar(6) COLLATE utf8_bin NOT NULL, |
|
143 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
144 | + $table_name = 'esp_currency'; |
|
145 | + $sql = "CUR_code varchar(6) COLLATE utf8_bin NOT NULL, |
|
146 | 146 | CUR_single varchar(45) COLLATE utf8_bin DEFAULT 'dollar', |
147 | 147 | CUR_plural varchar(45) COLLATE utf8_bin DEFAULT 'dollars', |
148 | 148 | CUR_sign varchar(45) COLLATE utf8_bin DEFAULT '$', |
149 | 149 | CUR_dec_plc varchar(1) COLLATE utf8_bin NOT NULL DEFAULT '2', |
150 | 150 | CUR_active tinyint(1) DEFAULT '0', |
151 | 151 | PRIMARY KEY (CUR_code)"; |
152 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
153 | - $table_name = 'esp_currency_payment_method'; |
|
154 | - $sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
152 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
153 | + $table_name = 'esp_currency_payment_method'; |
|
154 | + $sql = "CPM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
155 | 155 | CUR_code varchar(6) COLLATE utf8_bin NOT NULL, |
156 | 156 | PMD_ID int(11) NOT NULL, |
157 | 157 | PRIMARY KEY (CPM_ID), |
158 | 158 | KEY PMD_ID (PMD_ID)"; |
159 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
160 | - $table_name = 'esp_datetime'; |
|
161 | - $sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
159 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
160 | + $table_name = 'esp_datetime'; |
|
161 | + $sql = "DTT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
162 | 162 | EVT_ID bigint(20) unsigned NOT NULL, |
163 | 163 | DTT_name varchar(255) NOT NULL DEFAULT '', |
164 | 164 | DTT_description text NOT NULL, |
@@ -174,9 +174,9 @@ discard block |
||
174 | 174 | KEY DTT_EVT_start (DTT_EVT_start), |
175 | 175 | KEY EVT_ID (EVT_ID), |
176 | 176 | KEY DTT_is_primary (DTT_is_primary)"; |
177 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
178 | - $table_name = 'esp_event_meta'; |
|
179 | - $sql = " |
|
177 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
178 | + $table_name = 'esp_event_meta'; |
|
179 | + $sql = " |
|
180 | 180 | EVTM_ID int(10) NOT NULL AUTO_INCREMENT, |
181 | 181 | EVT_ID bigint(20) unsigned NOT NULL, |
182 | 182 | EVT_display_desc tinyint(1) unsigned NOT NULL DEFAULT 1, |
@@ -192,34 +192,34 @@ discard block |
||
192 | 192 | EVT_donations tinyint(1) NULL, |
193 | 193 | PRIMARY KEY (EVTM_ID), |
194 | 194 | KEY EVT_ID (EVT_ID)"; |
195 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
196 | - $table_name = 'esp_event_question_group'; |
|
197 | - $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
195 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
196 | + $table_name = 'esp_event_question_group'; |
|
197 | + $sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
198 | 198 | EVT_ID bigint(20) unsigned NOT NULL, |
199 | 199 | QSG_ID int(10) unsigned NOT NULL, |
200 | 200 | EQG_primary tinyint(1) unsigned NOT NULL DEFAULT 0, |
201 | 201 | PRIMARY KEY (EQG_ID), |
202 | 202 | KEY EVT_ID (EVT_ID), |
203 | 203 | KEY QSG_ID (QSG_ID)"; |
204 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
205 | - $table_name = 'esp_event_venue'; |
|
206 | - $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT, |
|
204 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
205 | + $table_name = 'esp_event_venue'; |
|
206 | + $sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT, |
|
207 | 207 | EVT_ID bigint(20) unsigned NOT NULL, |
208 | 208 | VNU_ID bigint(20) unsigned NOT NULL, |
209 | 209 | EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0, |
210 | 210 | PRIMARY KEY (EVV_ID)"; |
211 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
212 | - $table_name = 'esp_extra_meta'; |
|
213 | - $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
211 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
212 | + $table_name = 'esp_extra_meta'; |
|
213 | + $sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
214 | 214 | OBJ_ID int(11) DEFAULT NULL, |
215 | 215 | EXM_type varchar(45) DEFAULT NULL, |
216 | 216 | EXM_key varchar(45) DEFAULT NULL, |
217 | 217 | EXM_value text, |
218 | 218 | PRIMARY KEY (EXM_ID), |
219 | 219 | KEY EXM_type (EXM_type, OBJ_ID, EXM_key(45))"; |
220 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
221 | - $table_name = 'esp_line_item'; |
|
222 | - $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT, |
|
220 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
221 | + $table_name = 'esp_line_item'; |
|
222 | + $sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT, |
|
223 | 223 | LIN_code varchar(245) NOT NULL DEFAULT '', |
224 | 224 | TXN_ID int(11) DEFAULT NULL, |
225 | 225 | LIN_name varchar(245) NOT NULL DEFAULT '', |
@@ -237,9 +237,9 @@ discard block |
||
237 | 237 | PRIMARY KEY (LIN_ID), |
238 | 238 | KEY LIN_code (LIN_code(191)), |
239 | 239 | KEY TXN_ID (TXN_ID)"; |
240 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
241 | - $table_name = 'esp_log'; |
|
242 | - $sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT, |
|
240 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
241 | + $table_name = 'esp_log'; |
|
242 | + $sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT, |
|
243 | 243 | LOG_time datetime DEFAULT NULL, |
244 | 244 | OBJ_ID varchar(45) DEFAULT NULL, |
245 | 245 | OBJ_type varchar(45) DEFAULT NULL, |
@@ -250,18 +250,18 @@ discard block |
||
250 | 250 | KEY LOG_time (LOG_time), |
251 | 251 | KEY OBJ (OBJ_type,OBJ_ID), |
252 | 252 | KEY LOG_type (LOG_type)"; |
253 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
254 | - $table_name = 'esp_message_template'; |
|
255 | - $sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
253 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
254 | + $table_name = 'esp_message_template'; |
|
255 | + $sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
256 | 256 | GRP_ID int(10) unsigned NOT NULL, |
257 | 257 | MTP_context varchar(50) NOT NULL, |
258 | 258 | MTP_template_field varchar(30) NOT NULL, |
259 | 259 | MTP_content text NOT NULL, |
260 | 260 | PRIMARY KEY (MTP_ID), |
261 | 261 | KEY GRP_ID (GRP_ID)"; |
262 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
263 | - $table_name = 'esp_message_template_group'; |
|
264 | - $sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
262 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
263 | + $table_name = 'esp_message_template_group'; |
|
264 | + $sql = "GRP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
265 | 265 | MTP_user_id int(10) NOT NULL DEFAULT '1', |
266 | 266 | MTP_name varchar(245) NOT NULL DEFAULT '', |
267 | 267 | MTP_description varchar(245) NOT NULL DEFAULT '', |
@@ -273,17 +273,17 @@ discard block |
||
273 | 273 | MTP_is_active tinyint(1) NOT NULL DEFAULT '1', |
274 | 274 | PRIMARY KEY (GRP_ID), |
275 | 275 | KEY MTP_user_id (MTP_user_id)"; |
276 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
277 | - $table_name = 'esp_event_message_template'; |
|
278 | - $sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
|
276 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
277 | + $table_name = 'esp_event_message_template'; |
|
278 | + $sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
|
279 | 279 | EVT_ID bigint(20) unsigned NOT NULL DEFAULT 0, |
280 | 280 | GRP_ID int(10) unsigned NOT NULL DEFAULT 0, |
281 | 281 | PRIMARY KEY (EMT_ID), |
282 | 282 | KEY EVT_ID (EVT_ID), |
283 | 283 | KEY GRP_ID (GRP_ID)"; |
284 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
285 | - $table_name = 'esp_payment'; |
|
286 | - $sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
284 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
285 | + $table_name = 'esp_payment'; |
|
286 | + $sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
287 | 287 | TXN_ID int(10) unsigned DEFAULT NULL, |
288 | 288 | STS_ID varchar(3) COLLATE utf8_bin DEFAULT NULL, |
289 | 289 | PAY_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00', |
@@ -300,9 +300,9 @@ discard block |
||
300 | 300 | PRIMARY KEY (PAY_ID), |
301 | 301 | KEY PAY_timestamp (PAY_timestamp), |
302 | 302 | KEY TXN_ID (TXN_ID)"; |
303 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
304 | - $table_name = 'esp_payment_method'; |
|
305 | - $sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT, |
|
303 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
304 | + $table_name = 'esp_payment_method'; |
|
305 | + $sql = "PMD_ID int(11) NOT NULL AUTO_INCREMENT, |
|
306 | 306 | PMD_type varchar(124) DEFAULT NULL, |
307 | 307 | PMD_name varchar(255) DEFAULT NULL, |
308 | 308 | PMD_desc text, |
@@ -318,32 +318,32 @@ discard block |
||
318 | 318 | PRIMARY KEY (PMD_ID), |
319 | 319 | UNIQUE KEY PMD_slug_UNIQUE (PMD_slug), |
320 | 320 | KEY PMD_type (PMD_type)"; |
321 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
322 | - $table_name = "esp_ticket_price"; |
|
323 | - $sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
321 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
322 | + $table_name = "esp_ticket_price"; |
|
323 | + $sql = "TKP_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
324 | 324 | TKT_ID int(10) unsigned NOT NULL, |
325 | 325 | PRC_ID int(10) unsigned NOT NULL, |
326 | 326 | PRIMARY KEY (TKP_ID), |
327 | 327 | KEY TKT_ID (TKT_ID), |
328 | 328 | KEY PRC_ID (PRC_ID)"; |
329 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
330 | - $table_name = "esp_datetime_ticket"; |
|
331 | - $sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
329 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
330 | + $table_name = "esp_datetime_ticket"; |
|
331 | + $sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
332 | 332 | DTT_ID int(10) unsigned NOT NULL, |
333 | 333 | TKT_ID int(10) unsigned NOT NULL, |
334 | 334 | PRIMARY KEY (DTK_ID), |
335 | 335 | KEY DTT_ID (DTT_ID), |
336 | 336 | KEY TKT_ID (TKT_ID)"; |
337 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
338 | - $table_name = "esp_ticket_template"; |
|
339 | - $sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
337 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
338 | + $table_name = "esp_ticket_template"; |
|
339 | + $sql = "TTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
340 | 340 | TTM_name varchar(45) NOT NULL, |
341 | 341 | TTM_description text, |
342 | 342 | TTM_file varchar(45), |
343 | 343 | PRIMARY KEY (TTM_ID)"; |
344 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
345 | - $table_name = 'esp_question'; |
|
346 | - $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
344 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
345 | + $table_name = 'esp_question'; |
|
346 | + $sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
347 | 347 | QST_display_text text NOT NULL, |
348 | 348 | QST_admin_label varchar(255) NOT NULL, |
349 | 349 | QST_system varchar(25) DEFAULT NULL, |
@@ -356,18 +356,18 @@ discard block |
||
356 | 356 | QST_deleted tinyint(2) unsigned NOT NULL DEFAULT 0, |
357 | 357 | PRIMARY KEY (QST_ID), |
358 | 358 | KEY QST_order (QST_order)'; |
359 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
360 | - $table_name = 'esp_question_group_question'; |
|
361 | - $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
359 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
360 | + $table_name = 'esp_question_group_question'; |
|
361 | + $sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
362 | 362 | QSG_ID int(10) unsigned NOT NULL, |
363 | 363 | QST_ID int(10) unsigned NOT NULL, |
364 | 364 | QGQ_order int(10) unsigned NOT NULL DEFAULT 0, |
365 | 365 | PRIMARY KEY (QGQ_ID), |
366 | 366 | KEY QST_ID (QST_ID), |
367 | 367 | KEY QSG_ID_order (QSG_ID, QGQ_order)"; |
368 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
369 | - $table_name = 'esp_question_option'; |
|
370 | - $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
368 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
369 | + $table_name = 'esp_question_option'; |
|
370 | + $sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
371 | 371 | QSO_value varchar(255) NOT NULL, |
372 | 372 | QSO_desc text NOT NULL, |
373 | 373 | QST_ID int(10) unsigned NOT NULL, |
@@ -376,9 +376,9 @@ discard block |
||
376 | 376 | PRIMARY KEY (QSO_ID), |
377 | 377 | KEY QST_ID (QST_ID), |
378 | 378 | KEY QSO_order (QSO_order)"; |
379 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
380 | - $table_name = 'esp_registration'; |
|
381 | - $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
379 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
380 | + $table_name = 'esp_registration'; |
|
381 | + $sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
382 | 382 | EVT_ID bigint(20) unsigned NOT NULL, |
383 | 383 | ATT_ID bigint(20) unsigned NOT NULL, |
384 | 384 | TXN_ID int(10) unsigned NOT NULL, |
@@ -402,18 +402,18 @@ discard block |
||
402 | 402 | KEY TKT_ID (TKT_ID), |
403 | 403 | KEY EVT_ID (EVT_ID), |
404 | 404 | KEY STS_ID (STS_ID)"; |
405 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
406 | - $table_name = 'esp_registration_payment'; |
|
407 | - $sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
405 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
406 | + $table_name = 'esp_registration_payment'; |
|
407 | + $sql = "RPY_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
408 | 408 | REG_ID int(10) unsigned NOT NULL, |
409 | 409 | PAY_ID int(10) unsigned NULL, |
410 | 410 | RPY_amount decimal(10,3) NOT NULL DEFAULT '0.00', |
411 | 411 | PRIMARY KEY (RPY_ID), |
412 | 412 | KEY REG_ID (REG_ID), |
413 | 413 | KEY PAY_ID (PAY_ID)"; |
414 | - $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
415 | - $table_name = 'esp_checkin'; |
|
416 | - $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
414 | + $this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB '); |
|
415 | + $table_name = 'esp_checkin'; |
|
416 | + $sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
417 | 417 | REG_ID int(10) unsigned NOT NULL, |
418 | 418 | DTT_ID int(10) unsigned NOT NULL, |
419 | 419 | CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1, |
@@ -421,9 +421,9 @@ discard block |
||
421 | 421 | PRIMARY KEY (CHK_ID), |
422 | 422 | KEY REG_ID (REG_ID), |
423 | 423 | KEY DTT_ID (DTT_ID)"; |
424 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
425 | - $table_name = 'esp_state'; |
|
426 | - $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT, |
|
424 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
425 | + $table_name = 'esp_state'; |
|
426 | + $sql = "STA_ID smallint(5) unsigned NOT NULL AUTO_INCREMENT, |
|
427 | 427 | CNT_ISO varchar(2) COLLATE utf8_bin NOT NULL, |
428 | 428 | STA_abbrev varchar(24) COLLATE utf8_bin NOT NULL, |
429 | 429 | STA_name varchar(100) COLLATE utf8_bin NOT NULL, |
@@ -431,9 +431,9 @@ discard block |
||
431 | 431 | PRIMARY KEY (STA_ID), |
432 | 432 | KEY STA_abbrev (STA_abbrev), |
433 | 433 | KEY CNT_ISO (CNT_ISO)"; |
434 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
435 | - $table_name = 'esp_status'; |
|
436 | - $sql = "STS_ID varchar(3) COLLATE utf8_bin NOT NULL, |
|
434 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
435 | + $table_name = 'esp_status'; |
|
436 | + $sql = "STS_ID varchar(3) COLLATE utf8_bin NOT NULL, |
|
437 | 437 | STS_code varchar(45) COLLATE utf8_bin NOT NULL, |
438 | 438 | STS_type set('event','registration','transaction','payment','email') COLLATE utf8_bin NOT NULL, |
439 | 439 | STS_can_edit tinyint(1) NOT NULL DEFAULT 0, |
@@ -441,9 +441,9 @@ discard block |
||
441 | 441 | STS_open tinyint(1) NOT NULL DEFAULT 1, |
442 | 442 | UNIQUE KEY STS_ID_UNIQUE (STS_ID), |
443 | 443 | KEY STS_type (STS_type)"; |
444 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
445 | - $table_name = 'esp_transaction'; |
|
446 | - $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
444 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
445 | + $table_name = 'esp_transaction'; |
|
446 | + $sql = "TXN_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
447 | 447 | TXN_timestamp datetime NOT NULL DEFAULT '0000-00-00 00:00:00', |
448 | 448 | TXN_total decimal(10,3) DEFAULT '0.00', |
449 | 449 | TXN_paid decimal(10,3) NOT NULL DEFAULT '0.00', |
@@ -455,9 +455,9 @@ discard block |
||
455 | 455 | PRIMARY KEY (TXN_ID), |
456 | 456 | KEY TXN_timestamp (TXN_timestamp), |
457 | 457 | KEY STS_ID (STS_ID)"; |
458 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
459 | - $table_name = 'esp_venue_meta'; |
|
460 | - $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
458 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB'); |
|
459 | + $table_name = 'esp_venue_meta'; |
|
460 | + $sql = "VNUM_ID int(11) NOT NULL AUTO_INCREMENT, |
|
461 | 461 | VNU_ID bigint(20) unsigned NOT NULL DEFAULT 0, |
462 | 462 | VNU_address varchar(255) DEFAULT NULL, |
463 | 463 | VNU_address2 varchar(255) DEFAULT NULL, |
@@ -476,10 +476,10 @@ discard block |
||
476 | 476 | KEY VNU_ID (VNU_ID), |
477 | 477 | KEY STA_ID (STA_ID), |
478 | 478 | KEY CNT_ISO (CNT_ISO)"; |
479 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
480 | - // modified tables |
|
481 | - $table_name = "esp_price"; |
|
482 | - $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
479 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
480 | + // modified tables |
|
481 | + $table_name = "esp_price"; |
|
482 | + $sql = "PRC_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
483 | 483 | PRT_ID tinyint(3) unsigned NOT NULL, |
484 | 484 | PRC_amount decimal(10,3) NOT NULL DEFAULT '0.00', |
485 | 485 | PRC_name varchar(245) NOT NULL, |
@@ -492,9 +492,9 @@ discard block |
||
492 | 492 | PRC_parent int(10) unsigned DEFAULT 0, |
493 | 493 | PRIMARY KEY (PRC_ID), |
494 | 494 | KEY PRT_ID (PRT_ID)"; |
495 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
496 | - $table_name = "esp_price_type"; |
|
497 | - $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT, |
|
495 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
496 | + $table_name = "esp_price_type"; |
|
497 | + $sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT, |
|
498 | 498 | PRT_name varchar(45) NOT NULL, |
499 | 499 | PBT_ID tinyint(3) unsigned NOT NULL DEFAULT '1', |
500 | 500 | PRT_is_percent tinyint(1) NOT NULL DEFAULT '0', |
@@ -503,9 +503,9 @@ discard block |
||
503 | 503 | PRT_deleted tinyint(1) NOT NULL DEFAULT '0', |
504 | 504 | UNIQUE KEY PRT_name_UNIQUE (PRT_name), |
505 | 505 | PRIMARY KEY (PRT_ID)"; |
506 | - $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
507 | - $table_name = "esp_ticket"; |
|
508 | - $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
506 | + $this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB '); |
|
507 | + $table_name = "esp_ticket"; |
|
508 | + $sql = "TKT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
509 | 509 | TTM_ID int(10) unsigned NOT NULL, |
510 | 510 | TKT_name varchar(245) NOT NULL DEFAULT '', |
511 | 511 | TKT_description text NOT NULL, |
@@ -527,9 +527,9 @@ discard block |
||
527 | 527 | TKT_deleted tinyint(1) NOT NULL DEFAULT '0', |
528 | 528 | PRIMARY KEY (TKT_ID), |
529 | 529 | KEY TKT_start_date (TKT_start_date)"; |
530 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
531 | - $table_name = 'esp_question_group'; |
|
532 | - $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
530 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
531 | + $table_name = 'esp_question_group'; |
|
532 | + $sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT, |
|
533 | 533 | QSG_name varchar(255) NOT NULL, |
534 | 534 | QSG_identifier varchar(100) NOT NULL, |
535 | 535 | QSG_desc text NULL, |
@@ -542,38 +542,38 @@ discard block |
||
542 | 542 | PRIMARY KEY (QSG_ID), |
543 | 543 | UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier), |
544 | 544 | KEY QSG_order (QSG_order)'; |
545 | - $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
546 | - /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
547 | - $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
548 | - // (because many need to convert old string states to foreign keys into the states table) |
|
549 | - $script_4_1_defaults->insert_default_states(); |
|
550 | - $script_4_1_defaults->insert_default_countries(); |
|
551 | - /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
552 | - $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
553 | - $script_4_5_defaults->insert_default_price_types(); |
|
554 | - $script_4_5_defaults->insert_default_prices(); |
|
555 | - $script_4_5_defaults->insert_default_tickets(); |
|
556 | - /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */ |
|
557 | - $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0'); |
|
558 | - $script_4_6_defaults->add_default_admin_only_payments(); |
|
559 | - $script_4_6_defaults->insert_default_currencies(); |
|
560 | - return true; |
|
561 | - } |
|
545 | + $this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB'); |
|
546 | + /** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */ |
|
547 | + $script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0'); |
|
548 | + // (because many need to convert old string states to foreign keys into the states table) |
|
549 | + $script_4_1_defaults->insert_default_states(); |
|
550 | + $script_4_1_defaults->insert_default_countries(); |
|
551 | + /** @var EE_DMS_Core_4_5_0 $script_4_5_defaults */ |
|
552 | + $script_4_5_defaults = EE_Registry::instance()->load_dms('Core_4_5_0'); |
|
553 | + $script_4_5_defaults->insert_default_price_types(); |
|
554 | + $script_4_5_defaults->insert_default_prices(); |
|
555 | + $script_4_5_defaults->insert_default_tickets(); |
|
556 | + /** @var EE_DMS_Core_4_6_0 $script_4_6_defaults */ |
|
557 | + $script_4_6_defaults = EE_Registry::instance()->load_dms('Core_4_6_0'); |
|
558 | + $script_4_6_defaults->add_default_admin_only_payments(); |
|
559 | + $script_4_6_defaults->insert_default_currencies(); |
|
560 | + return true; |
|
561 | + } |
|
562 | 562 | |
563 | 563 | |
564 | 564 | |
565 | - /** |
|
566 | - * @return boolean |
|
567 | - */ |
|
568 | - public function schema_changes_after_migration() |
|
569 | - { |
|
570 | - return true; |
|
571 | - } |
|
565 | + /** |
|
566 | + * @return boolean |
|
567 | + */ |
|
568 | + public function schema_changes_after_migration() |
|
569 | + { |
|
570 | + return true; |
|
571 | + } |
|
572 | 572 | |
573 | 573 | |
574 | 574 | |
575 | - public function migration_page_hooks() |
|
576 | - { |
|
577 | - } |
|
575 | + public function migration_page_hooks() |
|
576 | + { |
|
577 | + } |
|
578 | 578 | } |
579 | 579 | // end of file: /core/data_migration_scripts/EE_DMS_Core_4_7_0.dms.php |
@@ -135,11 +135,11 @@ discard block |
||
135 | 135 | static $previous_recaptcha_response = array(); |
136 | 136 | $grecaptcha_response = $request->getRequestParam('g-recaptcha-response'); |
137 | 137 | // if this token has already been verified, then return previous response |
138 | - if (isset($previous_recaptcha_response[ $grecaptcha_response ])) { |
|
139 | - return $previous_recaptcha_response[ $grecaptcha_response ]; |
|
138 | + if (isset($previous_recaptcha_response[$grecaptcha_response])) { |
|
139 | + return $previous_recaptcha_response[$grecaptcha_response]; |
|
140 | 140 | } |
141 | 141 | // still here but no g-recaptcha-response ? - verification failed |
142 | - if (! $grecaptcha_response) { |
|
142 | + if ( ! $grecaptcha_response) { |
|
143 | 143 | EE_Error::add_error( |
144 | 144 | sprintf( |
145 | 145 | /* translators: 1: missing parameter */ |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | return false; |
159 | 159 | } |
160 | 160 | // will update to true if everything passes |
161 | - $previous_recaptcha_response[ $grecaptcha_response ] = false; |
|
161 | + $previous_recaptcha_response[$grecaptcha_response] = false; |
|
162 | 162 | $response = wp_safe_remote_post( |
163 | 163 | InvisibleRecaptcha::URL_GOOGLE_RECAPTCHA_API, |
164 | 164 | array( |
@@ -175,16 +175,16 @@ discard block |
||
175 | 175 | } |
176 | 176 | $results = json_decode(wp_remote_retrieve_body($response), true); |
177 | 177 | if (filter_var($results['success'], FILTER_VALIDATE_BOOLEAN) !== true) { |
178 | - $errors = array_map( |
|
178 | + $errors = array_map( |
|
179 | 179 | array($this, 'getErrorCode'), |
180 | 180 | $results['error-codes'] |
181 | 181 | ); |
182 | 182 | if (isset($results['challenge_ts'])) { |
183 | - $errors[] = 'challenge timestamp: ' . $results['challenge_ts'] . '.'; |
|
183 | + $errors[] = 'challenge timestamp: '.$results['challenge_ts'].'.'; |
|
184 | 184 | } |
185 | 185 | $this->generateError(implode(' ', $errors), true); |
186 | 186 | } |
187 | - $previous_recaptcha_response[ $grecaptcha_response ] = true; |
|
187 | + $previous_recaptcha_response[$grecaptcha_response] = true; |
|
188 | 188 | add_action('shutdown', array($this, 'setSessionData')); |
189 | 189 | return true; |
190 | 190 | } |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | 'bad-request' => 'The request is invalid or malformed.', |
226 | 226 | 'timeout-or-duplicate' => 'The request took too long to be sent or was a duplicate of a previous request.', |
227 | 227 | ); |
228 | - return isset($error_codes[ $error_code ]) ? $error_codes[ $error_code ] : ''; |
|
228 | + return isset($error_codes[$error_code]) ? $error_codes[$error_code] : ''; |
|
229 | 229 | } |
230 | 230 | |
231 | 231 |
@@ -27,270 +27,270 @@ |
||
27 | 27 | class InvisibleRecaptcha |
28 | 28 | { |
29 | 29 | |
30 | - const URL_GOOGLE_RECAPTCHA_API = 'https://www.google.com/recaptcha/api/siteverify'; |
|
30 | + const URL_GOOGLE_RECAPTCHA_API = 'https://www.google.com/recaptcha/api/siteverify'; |
|
31 | 31 | |
32 | - const SESSION_DATA_KEY_RECAPTCHA_PASSED = 'recaptcha_passed'; |
|
32 | + const SESSION_DATA_KEY_RECAPTCHA_PASSED = 'recaptcha_passed'; |
|
33 | 33 | |
34 | - /** |
|
35 | - * @var EE_Registration_Config $config |
|
36 | - */ |
|
37 | - private $config; |
|
34 | + /** |
|
35 | + * @var EE_Registration_Config $config |
|
36 | + */ |
|
37 | + private $config; |
|
38 | 38 | |
39 | - /** |
|
40 | - * @var EE_Session $session |
|
41 | - */ |
|
42 | - private $session; |
|
39 | + /** |
|
40 | + * @var EE_Session $session |
|
41 | + */ |
|
42 | + private $session; |
|
43 | 43 | |
44 | - /** |
|
45 | - * @var boolean $recaptcha_passed |
|
46 | - */ |
|
47 | - private $recaptcha_passed; |
|
44 | + /** |
|
45 | + * @var boolean $recaptcha_passed |
|
46 | + */ |
|
47 | + private $recaptcha_passed; |
|
48 | 48 | |
49 | 49 | |
50 | - /** |
|
51 | - * InvisibleRecaptcha constructor. |
|
52 | - * |
|
53 | - * @param EE_Registration_Config $registration_config |
|
54 | - * @param EE_Session $session |
|
55 | - */ |
|
56 | - public function __construct(EE_Registration_Config $registration_config, EE_Session $session) |
|
57 | - { |
|
58 | - $this->config = $registration_config; |
|
59 | - $this->session = $session; |
|
60 | - } |
|
50 | + /** |
|
51 | + * InvisibleRecaptcha constructor. |
|
52 | + * |
|
53 | + * @param EE_Registration_Config $registration_config |
|
54 | + * @param EE_Session $session |
|
55 | + */ |
|
56 | + public function __construct(EE_Registration_Config $registration_config, EE_Session $session) |
|
57 | + { |
|
58 | + $this->config = $registration_config; |
|
59 | + $this->session = $session; |
|
60 | + } |
|
61 | 61 | |
62 | 62 | |
63 | - /** |
|
64 | - * @return boolean |
|
65 | - */ |
|
66 | - public function useInvisibleRecaptcha() |
|
67 | - { |
|
68 | - return $this->config->use_captcha && $this->config->recaptcha_theme === 'invisible'; |
|
69 | - } |
|
63 | + /** |
|
64 | + * @return boolean |
|
65 | + */ |
|
66 | + public function useInvisibleRecaptcha() |
|
67 | + { |
|
68 | + return $this->config->use_captcha && $this->config->recaptcha_theme === 'invisible'; |
|
69 | + } |
|
70 | 70 | |
71 | 71 | |
72 | - /** |
|
73 | - * @param array $input_settings |
|
74 | - * @return EE_Invisible_Recaptcha_Input |
|
75 | - * @throws InvalidDataTypeException |
|
76 | - * @throws InvalidInterfaceException |
|
77 | - * @throws InvalidArgumentException |
|
78 | - * @throws DomainException |
|
79 | - */ |
|
80 | - public function getInput(array $input_settings = array()) |
|
81 | - { |
|
82 | - return new EE_Invisible_Recaptcha_Input( |
|
83 | - $input_settings, |
|
84 | - $this->config |
|
85 | - ); |
|
86 | - } |
|
72 | + /** |
|
73 | + * @param array $input_settings |
|
74 | + * @return EE_Invisible_Recaptcha_Input |
|
75 | + * @throws InvalidDataTypeException |
|
76 | + * @throws InvalidInterfaceException |
|
77 | + * @throws InvalidArgumentException |
|
78 | + * @throws DomainException |
|
79 | + */ |
|
80 | + public function getInput(array $input_settings = array()) |
|
81 | + { |
|
82 | + return new EE_Invisible_Recaptcha_Input( |
|
83 | + $input_settings, |
|
84 | + $this->config |
|
85 | + ); |
|
86 | + } |
|
87 | 87 | |
88 | 88 | |
89 | - /** |
|
90 | - * @param array $input_settings |
|
91 | - * @return string |
|
92 | - * @throws EE_Error |
|
93 | - * @throws InvalidDataTypeException |
|
94 | - * @throws InvalidInterfaceException |
|
95 | - * @throws InvalidArgumentException |
|
96 | - * @throws DomainException |
|
97 | - */ |
|
98 | - public function getInputHtml(array $input_settings = array()) |
|
99 | - { |
|
100 | - return $this->getInput($input_settings)->get_html_for_input(); |
|
101 | - } |
|
89 | + /** |
|
90 | + * @param array $input_settings |
|
91 | + * @return string |
|
92 | + * @throws EE_Error |
|
93 | + * @throws InvalidDataTypeException |
|
94 | + * @throws InvalidInterfaceException |
|
95 | + * @throws InvalidArgumentException |
|
96 | + * @throws DomainException |
|
97 | + */ |
|
98 | + public function getInputHtml(array $input_settings = array()) |
|
99 | + { |
|
100 | + return $this->getInput($input_settings)->get_html_for_input(); |
|
101 | + } |
|
102 | 102 | |
103 | 103 | |
104 | - /** |
|
105 | - * @param EE_Form_Section_Proper $form |
|
106 | - * @param array $input_settings |
|
107 | - * @throws EE_Error |
|
108 | - * @throws InvalidArgumentException |
|
109 | - * @throws InvalidDataTypeException |
|
110 | - * @throws InvalidInterfaceException |
|
111 | - * @throws DomainException |
|
112 | - */ |
|
113 | - public function addToFormSection(EE_Form_Section_Proper $form, array $input_settings = array()) |
|
114 | - { |
|
115 | - $form->add_subsections( |
|
116 | - array( |
|
117 | - 'espresso_recaptcha' => $this->getInput($input_settings), |
|
118 | - ), |
|
119 | - null, |
|
120 | - false |
|
121 | - ); |
|
122 | - } |
|
104 | + /** |
|
105 | + * @param EE_Form_Section_Proper $form |
|
106 | + * @param array $input_settings |
|
107 | + * @throws EE_Error |
|
108 | + * @throws InvalidArgumentException |
|
109 | + * @throws InvalidDataTypeException |
|
110 | + * @throws InvalidInterfaceException |
|
111 | + * @throws DomainException |
|
112 | + */ |
|
113 | + public function addToFormSection(EE_Form_Section_Proper $form, array $input_settings = array()) |
|
114 | + { |
|
115 | + $form->add_subsections( |
|
116 | + array( |
|
117 | + 'espresso_recaptcha' => $this->getInput($input_settings), |
|
118 | + ), |
|
119 | + null, |
|
120 | + false |
|
121 | + ); |
|
122 | + } |
|
123 | 123 | |
124 | 124 | |
125 | - /** |
|
126 | - * @param RequestInterface $request |
|
127 | - * @return boolean |
|
128 | - * @throws InvalidArgumentException |
|
129 | - * @throws InvalidDataTypeException |
|
130 | - * @throws InvalidInterfaceException |
|
131 | - * @throws RuntimeException |
|
132 | - */ |
|
133 | - public function verifyToken(RequestInterface $request) |
|
134 | - { |
|
135 | - static $previous_recaptcha_response = array(); |
|
136 | - $grecaptcha_response = $request->getRequestParam('g-recaptcha-response'); |
|
137 | - // if this token has already been verified, then return previous response |
|
138 | - if (isset($previous_recaptcha_response[ $grecaptcha_response ])) { |
|
139 | - return $previous_recaptcha_response[ $grecaptcha_response ]; |
|
140 | - } |
|
141 | - // still here but no g-recaptcha-response ? - verification failed |
|
142 | - if (! $grecaptcha_response) { |
|
143 | - EE_Error::add_error( |
|
144 | - sprintf( |
|
145 | - /* translators: 1: missing parameter */ |
|
146 | - esc_html__( |
|
147 | - // @codingStandardsIgnoreStart |
|
148 | - 'We\'re sorry but an attempt to verify the form\'s reCAPTCHA has failed. Missing "%1$s". Please try again.', |
|
149 | - // @codingStandardsIgnoreEnd |
|
150 | - 'event_espresso' |
|
151 | - ), |
|
152 | - 'g-recaptcha-response' |
|
153 | - ), |
|
154 | - __FILE__, |
|
155 | - __FUNCTION__, |
|
156 | - __LINE__ |
|
157 | - ); |
|
158 | - return false; |
|
159 | - } |
|
160 | - // will update to true if everything passes |
|
161 | - $previous_recaptcha_response[ $grecaptcha_response ] = false; |
|
162 | - $response = wp_safe_remote_post( |
|
163 | - InvisibleRecaptcha::URL_GOOGLE_RECAPTCHA_API, |
|
164 | - array( |
|
165 | - 'body' => array( |
|
166 | - 'secret' => $this->config->recaptcha_privatekey, |
|
167 | - 'response' => $grecaptcha_response, |
|
168 | - 'remoteip' => $request->ipAddress(), |
|
169 | - ), |
|
170 | - ) |
|
171 | - ); |
|
172 | - if ($response instanceof WP_Error) { |
|
173 | - $this->generateError($response->get_error_messages()); |
|
174 | - return false; |
|
175 | - } |
|
176 | - $results = json_decode(wp_remote_retrieve_body($response), true); |
|
177 | - if (filter_var($results['success'], FILTER_VALIDATE_BOOLEAN) !== true) { |
|
178 | - $errors = array_map( |
|
179 | - array($this, 'getErrorCode'), |
|
180 | - $results['error-codes'] |
|
181 | - ); |
|
182 | - if (isset($results['challenge_ts'])) { |
|
183 | - $errors[] = 'challenge timestamp: ' . $results['challenge_ts'] . '.'; |
|
184 | - } |
|
185 | - $this->generateError(implode(' ', $errors), true); |
|
186 | - } |
|
187 | - $previous_recaptcha_response[ $grecaptcha_response ] = true; |
|
188 | - add_action('shutdown', array($this, 'setSessionData')); |
|
189 | - return true; |
|
190 | - } |
|
125 | + /** |
|
126 | + * @param RequestInterface $request |
|
127 | + * @return boolean |
|
128 | + * @throws InvalidArgumentException |
|
129 | + * @throws InvalidDataTypeException |
|
130 | + * @throws InvalidInterfaceException |
|
131 | + * @throws RuntimeException |
|
132 | + */ |
|
133 | + public function verifyToken(RequestInterface $request) |
|
134 | + { |
|
135 | + static $previous_recaptcha_response = array(); |
|
136 | + $grecaptcha_response = $request->getRequestParam('g-recaptcha-response'); |
|
137 | + // if this token has already been verified, then return previous response |
|
138 | + if (isset($previous_recaptcha_response[ $grecaptcha_response ])) { |
|
139 | + return $previous_recaptcha_response[ $grecaptcha_response ]; |
|
140 | + } |
|
141 | + // still here but no g-recaptcha-response ? - verification failed |
|
142 | + if (! $grecaptcha_response) { |
|
143 | + EE_Error::add_error( |
|
144 | + sprintf( |
|
145 | + /* translators: 1: missing parameter */ |
|
146 | + esc_html__( |
|
147 | + // @codingStandardsIgnoreStart |
|
148 | + 'We\'re sorry but an attempt to verify the form\'s reCAPTCHA has failed. Missing "%1$s". Please try again.', |
|
149 | + // @codingStandardsIgnoreEnd |
|
150 | + 'event_espresso' |
|
151 | + ), |
|
152 | + 'g-recaptcha-response' |
|
153 | + ), |
|
154 | + __FILE__, |
|
155 | + __FUNCTION__, |
|
156 | + __LINE__ |
|
157 | + ); |
|
158 | + return false; |
|
159 | + } |
|
160 | + // will update to true if everything passes |
|
161 | + $previous_recaptcha_response[ $grecaptcha_response ] = false; |
|
162 | + $response = wp_safe_remote_post( |
|
163 | + InvisibleRecaptcha::URL_GOOGLE_RECAPTCHA_API, |
|
164 | + array( |
|
165 | + 'body' => array( |
|
166 | + 'secret' => $this->config->recaptcha_privatekey, |
|
167 | + 'response' => $grecaptcha_response, |
|
168 | + 'remoteip' => $request->ipAddress(), |
|
169 | + ), |
|
170 | + ) |
|
171 | + ); |
|
172 | + if ($response instanceof WP_Error) { |
|
173 | + $this->generateError($response->get_error_messages()); |
|
174 | + return false; |
|
175 | + } |
|
176 | + $results = json_decode(wp_remote_retrieve_body($response), true); |
|
177 | + if (filter_var($results['success'], FILTER_VALIDATE_BOOLEAN) !== true) { |
|
178 | + $errors = array_map( |
|
179 | + array($this, 'getErrorCode'), |
|
180 | + $results['error-codes'] |
|
181 | + ); |
|
182 | + if (isset($results['challenge_ts'])) { |
|
183 | + $errors[] = 'challenge timestamp: ' . $results['challenge_ts'] . '.'; |
|
184 | + } |
|
185 | + $this->generateError(implode(' ', $errors), true); |
|
186 | + } |
|
187 | + $previous_recaptcha_response[ $grecaptcha_response ] = true; |
|
188 | + add_action('shutdown', array($this, 'setSessionData')); |
|
189 | + return true; |
|
190 | + } |
|
191 | 191 | |
192 | 192 | |
193 | - /** |
|
194 | - * @param string $error_response |
|
195 | - * @param bool $show_errors |
|
196 | - * @return void |
|
197 | - * @throws RuntimeException |
|
198 | - */ |
|
199 | - public function generateError($error_response = '', $show_errors = false) |
|
200 | - { |
|
201 | - throw new RuntimeException( |
|
202 | - sprintf( |
|
203 | - esc_html__( |
|
204 | - 'We\'re sorry but an attempt to verify the form\'s reCAPTCHA has failed. %1$s %2$s Please try again.', |
|
205 | - 'event_espresso' |
|
206 | - ), |
|
207 | - '<br />', |
|
208 | - $show_errors || current_user_can('manage_options') ? $error_response : '' |
|
209 | - ) |
|
210 | - ); |
|
211 | - } |
|
193 | + /** |
|
194 | + * @param string $error_response |
|
195 | + * @param bool $show_errors |
|
196 | + * @return void |
|
197 | + * @throws RuntimeException |
|
198 | + */ |
|
199 | + public function generateError($error_response = '', $show_errors = false) |
|
200 | + { |
|
201 | + throw new RuntimeException( |
|
202 | + sprintf( |
|
203 | + esc_html__( |
|
204 | + 'We\'re sorry but an attempt to verify the form\'s reCAPTCHA has failed. %1$s %2$s Please try again.', |
|
205 | + 'event_espresso' |
|
206 | + ), |
|
207 | + '<br />', |
|
208 | + $show_errors || current_user_can('manage_options') ? $error_response : '' |
|
209 | + ) |
|
210 | + ); |
|
211 | + } |
|
212 | 212 | |
213 | 213 | |
214 | - /** |
|
215 | - * @param string $error_code |
|
216 | - * @return string |
|
217 | - */ |
|
218 | - public function getErrorCode(&$error_code) |
|
219 | - { |
|
220 | - $error_codes = array( |
|
221 | - 'missing-input-secret' => 'The secret parameter is missing.', |
|
222 | - 'invalid-input-secret' => 'The secret parameter is invalid or malformed.', |
|
223 | - 'missing-input-response' => 'The response parameter is missing.', |
|
224 | - 'invalid-input-response' => 'The response parameter is invalid or malformed.', |
|
225 | - 'bad-request' => 'The request is invalid or malformed.', |
|
226 | - 'timeout-or-duplicate' => 'The request took too long to be sent or was a duplicate of a previous request.', |
|
227 | - ); |
|
228 | - return isset($error_codes[ $error_code ]) ? $error_codes[ $error_code ] : ''; |
|
229 | - } |
|
214 | + /** |
|
215 | + * @param string $error_code |
|
216 | + * @return string |
|
217 | + */ |
|
218 | + public function getErrorCode(&$error_code) |
|
219 | + { |
|
220 | + $error_codes = array( |
|
221 | + 'missing-input-secret' => 'The secret parameter is missing.', |
|
222 | + 'invalid-input-secret' => 'The secret parameter is invalid or malformed.', |
|
223 | + 'missing-input-response' => 'The response parameter is missing.', |
|
224 | + 'invalid-input-response' => 'The response parameter is invalid or malformed.', |
|
225 | + 'bad-request' => 'The request is invalid or malformed.', |
|
226 | + 'timeout-or-duplicate' => 'The request took too long to be sent or was a duplicate of a previous request.', |
|
227 | + ); |
|
228 | + return isset($error_codes[ $error_code ]) ? $error_codes[ $error_code ] : ''; |
|
229 | + } |
|
230 | 230 | |
231 | 231 | |
232 | - /** |
|
233 | - * @return array |
|
234 | - * @throws InvalidInterfaceException |
|
235 | - * @throws InvalidDataTypeException |
|
236 | - * @throws InvalidArgumentException |
|
237 | - */ |
|
238 | - public function getLocalizedVars() |
|
239 | - { |
|
240 | - return (array) apply_filters( |
|
241 | - 'FHEE__EventEspresso_caffeinated_modules_recaptcha_invisible_InvisibleRecaptcha__getLocalizedVars__localized_vars', |
|
242 | - array( |
|
243 | - 'siteKey' => $this->config->recaptcha_publickey, |
|
244 | - 'recaptcha_passed' => $this->recaptchaPassed(), |
|
245 | - 'wp_debug' => WP_DEBUG, |
|
246 | - 'disable_submit' => defined('EE_EVENT_QUEUE_BASE_URL'), |
|
247 | - 'failed_message' => wp_strip_all_tags( |
|
248 | - __( |
|
249 | - 'We\'re sorry but an attempt to verify the form\'s reCAPTCHA has failed. Please try again.', |
|
250 | - 'event_espresso' |
|
251 | - ) |
|
252 | - ) |
|
253 | - ) |
|
254 | - ); |
|
255 | - } |
|
232 | + /** |
|
233 | + * @return array |
|
234 | + * @throws InvalidInterfaceException |
|
235 | + * @throws InvalidDataTypeException |
|
236 | + * @throws InvalidArgumentException |
|
237 | + */ |
|
238 | + public function getLocalizedVars() |
|
239 | + { |
|
240 | + return (array) apply_filters( |
|
241 | + 'FHEE__EventEspresso_caffeinated_modules_recaptcha_invisible_InvisibleRecaptcha__getLocalizedVars__localized_vars', |
|
242 | + array( |
|
243 | + 'siteKey' => $this->config->recaptcha_publickey, |
|
244 | + 'recaptcha_passed' => $this->recaptchaPassed(), |
|
245 | + 'wp_debug' => WP_DEBUG, |
|
246 | + 'disable_submit' => defined('EE_EVENT_QUEUE_BASE_URL'), |
|
247 | + 'failed_message' => wp_strip_all_tags( |
|
248 | + __( |
|
249 | + 'We\'re sorry but an attempt to verify the form\'s reCAPTCHA has failed. Please try again.', |
|
250 | + 'event_espresso' |
|
251 | + ) |
|
252 | + ) |
|
253 | + ) |
|
254 | + ); |
|
255 | + } |
|
256 | 256 | |
257 | 257 | |
258 | - /** |
|
259 | - * @return boolean |
|
260 | - * @throws InvalidInterfaceException |
|
261 | - * @throws InvalidDataTypeException |
|
262 | - * @throws InvalidArgumentException |
|
263 | - */ |
|
264 | - public function recaptchaPassed() |
|
265 | - { |
|
266 | - if ($this->recaptcha_passed !== null) { |
|
267 | - return $this->recaptcha_passed; |
|
268 | - } |
|
269 | - // logged in means you have already passed a turing test of sorts |
|
270 | - if ($this->useInvisibleRecaptcha() === false || is_user_logged_in()) { |
|
271 | - $this->recaptcha_passed = true; |
|
272 | - return $this->recaptcha_passed; |
|
273 | - } |
|
274 | - // was test already passed? |
|
275 | - $this->recaptcha_passed = filter_var( |
|
276 | - $this->session->get_session_data( |
|
277 | - InvisibleRecaptcha::SESSION_DATA_KEY_RECAPTCHA_PASSED |
|
278 | - ), |
|
279 | - FILTER_VALIDATE_BOOLEAN |
|
280 | - ); |
|
281 | - return $this->recaptcha_passed; |
|
282 | - } |
|
258 | + /** |
|
259 | + * @return boolean |
|
260 | + * @throws InvalidInterfaceException |
|
261 | + * @throws InvalidDataTypeException |
|
262 | + * @throws InvalidArgumentException |
|
263 | + */ |
|
264 | + public function recaptchaPassed() |
|
265 | + { |
|
266 | + if ($this->recaptcha_passed !== null) { |
|
267 | + return $this->recaptcha_passed; |
|
268 | + } |
|
269 | + // logged in means you have already passed a turing test of sorts |
|
270 | + if ($this->useInvisibleRecaptcha() === false || is_user_logged_in()) { |
|
271 | + $this->recaptcha_passed = true; |
|
272 | + return $this->recaptcha_passed; |
|
273 | + } |
|
274 | + // was test already passed? |
|
275 | + $this->recaptcha_passed = filter_var( |
|
276 | + $this->session->get_session_data( |
|
277 | + InvisibleRecaptcha::SESSION_DATA_KEY_RECAPTCHA_PASSED |
|
278 | + ), |
|
279 | + FILTER_VALIDATE_BOOLEAN |
|
280 | + ); |
|
281 | + return $this->recaptcha_passed; |
|
282 | + } |
|
283 | 283 | |
284 | 284 | |
285 | - /** |
|
286 | - * @throws InvalidArgumentException |
|
287 | - * @throws InvalidDataTypeException |
|
288 | - * @throws InvalidInterfaceException |
|
289 | - */ |
|
290 | - public function setSessionData() |
|
291 | - { |
|
292 | - $this->session->set_session_data( |
|
293 | - array(InvisibleRecaptcha::SESSION_DATA_KEY_RECAPTCHA_PASSED => true) |
|
294 | - ); |
|
295 | - } |
|
285 | + /** |
|
286 | + * @throws InvalidArgumentException |
|
287 | + * @throws InvalidDataTypeException |
|
288 | + * @throws InvalidInterfaceException |
|
289 | + */ |
|
290 | + public function setSessionData() |
|
291 | + { |
|
292 | + $this->session->set_session_data( |
|
293 | + array(InvisibleRecaptcha::SESSION_DATA_KEY_RECAPTCHA_PASSED => true) |
|
294 | + ); |
|
295 | + } |
|
296 | 296 | } |
@@ -8,24 +8,24 @@ |
||
8 | 8 | */ |
9 | 9 | interface CommandHandlerInterface |
10 | 10 | { |
11 | - /** |
|
12 | - * verifies that the supplied command is the correct class for the handler. |
|
13 | - * |
|
14 | - * !!! IMPORTANT !!! |
|
15 | - * Must return $this (ie: the handler itself) |
|
16 | - * as the CommandBus utilizes method chaining |
|
17 | - * |
|
18 | - * @param CommandInterface $command |
|
19 | - * @return CommandHandlerInterface |
|
20 | - * @since 4.9.80.p |
|
21 | - */ |
|
22 | - public function verify(CommandInterface $command); |
|
11 | + /** |
|
12 | + * verifies that the supplied command is the correct class for the handler. |
|
13 | + * |
|
14 | + * !!! IMPORTANT !!! |
|
15 | + * Must return $this (ie: the handler itself) |
|
16 | + * as the CommandBus utilizes method chaining |
|
17 | + * |
|
18 | + * @param CommandInterface $command |
|
19 | + * @return CommandHandlerInterface |
|
20 | + * @since 4.9.80.p |
|
21 | + */ |
|
22 | + public function verify(CommandInterface $command); |
|
23 | 23 | |
24 | - /** |
|
25 | - * Performs the command handler's logic. |
|
26 | - * |
|
27 | - * @param CommandInterface $command |
|
28 | - * @return mixed |
|
29 | - */ |
|
30 | - public function handle(CommandInterface $command); |
|
24 | + /** |
|
25 | + * Performs the command handler's logic. |
|
26 | + * |
|
27 | + * @param CommandInterface $command |
|
28 | + * @return mixed |
|
29 | + */ |
|
30 | + public function handle(CommandInterface $command); |
|
31 | 31 | } |
@@ -15,21 +15,21 @@ |
||
15 | 15 | */ |
16 | 16 | interface JsonSerializableAndUnserializable |
17 | 17 | { |
18 | - /** |
|
19 | - * Creates a simple PHP array or stdClass from this object's properties, which can be easily serialized using |
|
20 | - * wp_json_serialize(). |
|
21 | - * @since 4.9.80.p |
|
22 | - * @return mixed |
|
23 | - */ |
|
24 | - public function toJsonSerializableData(); |
|
18 | + /** |
|
19 | + * Creates a simple PHP array or stdClass from this object's properties, which can be easily serialized using |
|
20 | + * wp_json_serialize(). |
|
21 | + * @since 4.9.80.p |
|
22 | + * @return mixed |
|
23 | + */ |
|
24 | + public function toJsonSerializableData(); |
|
25 | 25 | |
26 | - /** |
|
27 | - * Initializes this object from data |
|
28 | - * @since 4.9.80.p |
|
29 | - * @param mixed $data |
|
30 | - * @return boolean success |
|
31 | - */ |
|
32 | - public function fromJsonSerializedData($data); |
|
26 | + /** |
|
27 | + * Initializes this object from data |
|
28 | + * @since 4.9.80.p |
|
29 | + * @param mixed $data |
|
30 | + * @return boolean success |
|
31 | + */ |
|
32 | + public function fromJsonSerializedData($data); |
|
33 | 33 | } |
34 | 34 | // End of file JsonSerializableAndUnserializable.php |
35 | 35 | // Location: EventEspresso\core\services\json/JsonSerializableAndUnserializable.php |
@@ -15,37 +15,37 @@ |
||
15 | 15 | interface FileSubmissionInterface |
16 | 16 | { |
17 | 17 | |
18 | - /** |
|
19 | - * @return string |
|
20 | - */ |
|
21 | - public function getName(); |
|
22 | - |
|
23 | - /** |
|
24 | - * @return string |
|
25 | - */ |
|
26 | - public function getType(); |
|
27 | - |
|
28 | - /** |
|
29 | - * @return int |
|
30 | - */ |
|
31 | - public function getSize(); |
|
32 | - |
|
33 | - /** |
|
34 | - * @return string |
|
35 | - */ |
|
36 | - public function getTmpFile(); |
|
37 | - |
|
38 | - /** |
|
39 | - * Should just return the filename. |
|
40 | - * @since 4.9.80.p |
|
41 | - * @return string |
|
42 | - */ |
|
43 | - public function __toString(); |
|
44 | - |
|
45 | - /** |
|
46 | - * @return string |
|
47 | - */ |
|
48 | - public function getErrorCode(); |
|
18 | + /** |
|
19 | + * @return string |
|
20 | + */ |
|
21 | + public function getName(); |
|
22 | + |
|
23 | + /** |
|
24 | + * @return string |
|
25 | + */ |
|
26 | + public function getType(); |
|
27 | + |
|
28 | + /** |
|
29 | + * @return int |
|
30 | + */ |
|
31 | + public function getSize(); |
|
32 | + |
|
33 | + /** |
|
34 | + * @return string |
|
35 | + */ |
|
36 | + public function getTmpFile(); |
|
37 | + |
|
38 | + /** |
|
39 | + * Should just return the filename. |
|
40 | + * @since 4.9.80.p |
|
41 | + * @return string |
|
42 | + */ |
|
43 | + public function __toString(); |
|
44 | + |
|
45 | + /** |
|
46 | + * @return string |
|
47 | + */ |
|
48 | + public function getErrorCode(); |
|
49 | 49 | } |
50 | 50 | // End of file FileSubmissionInterface.php |
51 | 51 | // Location: EventEspresso\core\services\request\files/FileSubmissionInterface.php |
@@ -16,39 +16,39 @@ |
||
16 | 16 | */ |
17 | 17 | class JsonWpOptionManager |
18 | 18 | { |
19 | - /** |
|
20 | - * Updates the object with what's in the DB (specifically, the wp_options table). If nothing is in the DB, leaves |
|
21 | - * the object alone and returns false. |
|
22 | - * @since 4.9.80.p |
|
23 | - * @param JsonWpOptionSerializableInterface $obj |
|
24 | - * @return bool |
|
25 | - */ |
|
26 | - public function populateFromDb(JsonWpOptionSerializableInterface $obj) |
|
27 | - { |
|
28 | - $option = get_option($obj->getWpOptionName()); |
|
29 | - if ($option) { |
|
30 | - $json = json_decode($option); |
|
31 | - if (is_array($json) || $json instanceof stdClass) { |
|
32 | - return $obj->fromJsonSerializedData($json); |
|
33 | - } |
|
34 | - } |
|
35 | - return false; |
|
36 | - } |
|
19 | + /** |
|
20 | + * Updates the object with what's in the DB (specifically, the wp_options table). If nothing is in the DB, leaves |
|
21 | + * the object alone and returns false. |
|
22 | + * @since 4.9.80.p |
|
23 | + * @param JsonWpOptionSerializableInterface $obj |
|
24 | + * @return bool |
|
25 | + */ |
|
26 | + public function populateFromDb(JsonWpOptionSerializableInterface $obj) |
|
27 | + { |
|
28 | + $option = get_option($obj->getWpOptionName()); |
|
29 | + if ($option) { |
|
30 | + $json = json_decode($option); |
|
31 | + if (is_array($json) || $json instanceof stdClass) { |
|
32 | + return $obj->fromJsonSerializedData($json); |
|
33 | + } |
|
34 | + } |
|
35 | + return false; |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * Saves the object's data to the wp_options table for later use. |
|
40 | - * @since 4.9.80.p |
|
41 | - * @param JsonWpOptionSerializableInterface $obj |
|
42 | - * @return bool |
|
43 | - */ |
|
44 | - public function saveToDb(JsonWpOptionSerializableInterface $obj) |
|
45 | - { |
|
46 | - return update_option( |
|
47 | - $obj->getWpOptionName(), |
|
48 | - wp_json_encode($obj->toJsonSerializableData()), |
|
49 | - false |
|
50 | - ); |
|
51 | - } |
|
38 | + /** |
|
39 | + * Saves the object's data to the wp_options table for later use. |
|
40 | + * @since 4.9.80.p |
|
41 | + * @param JsonWpOptionSerializableInterface $obj |
|
42 | + * @return bool |
|
43 | + */ |
|
44 | + public function saveToDb(JsonWpOptionSerializableInterface $obj) |
|
45 | + { |
|
46 | + return update_option( |
|
47 | + $obj->getWpOptionName(), |
|
48 | + wp_json_encode($obj->toJsonSerializableData()), |
|
49 | + false |
|
50 | + ); |
|
51 | + } |
|
52 | 52 | } |
53 | 53 | // End of file JsonWpOptionManager.php |
54 | 54 | // Location: EventEspresso\core\services\options/JsonWpOptionManager.php |
@@ -17,13 +17,13 @@ |
||
17 | 17 | */ |
18 | 18 | interface JsonWpOptionSerializableInterface extends JsonSerializableAndUnserializable |
19 | 19 | { |
20 | - /** |
|
21 | - * Gets the value to use for wp_options.option_name. Note this is not static, so it can use object properties to |
|
22 | - * determine what option name to use. |
|
23 | - * @since 4.9.80.p |
|
24 | - * @return string |
|
25 | - */ |
|
26 | - public function getWpOptionName(); |
|
20 | + /** |
|
21 | + * Gets the value to use for wp_options.option_name. Note this is not static, so it can use object properties to |
|
22 | + * determine what option name to use. |
|
23 | + * @since 4.9.80.p |
|
24 | + * @return string |
|
25 | + */ |
|
26 | + public function getWpOptionName(); |
|
27 | 27 | } |
28 | 28 | // End of file JsonWpOptionSerializableInterface.php |
29 | 29 | // Location: EventEspresso\core\services\options/JsonWpOptionSerializableInterface.php |