@@ -25,64 +25,64 @@ |
||
25 | 25 | class AdminRoute extends Route |
26 | 26 | { |
27 | 27 | |
28 | - /** |
|
29 | - * @var EE_Admin_Config $admin_config |
|
30 | - */ |
|
31 | - protected $admin_config; |
|
28 | + /** |
|
29 | + * @var EE_Admin_Config $admin_config |
|
30 | + */ |
|
31 | + protected $admin_config; |
|
32 | 32 | |
33 | 33 | |
34 | - /** |
|
35 | - * Route constructor. |
|
36 | - * |
|
37 | - * @param EE_Admin_Config $admin_config |
|
38 | - * @param EE_Dependency_Map $dependency_map |
|
39 | - * @param LoaderInterface $loader |
|
40 | - * @param RequestInterface $request |
|
41 | - * @param JsonDataNode $data_node |
|
42 | - * @param RouteMatchSpecificationInterface $specification |
|
43 | - */ |
|
44 | - public function __construct( |
|
45 | - EE_Admin_Config $admin_config, |
|
46 | - EE_Dependency_Map $dependency_map, |
|
47 | - LoaderInterface $loader, |
|
48 | - RequestInterface $request, |
|
49 | - JsonDataNode $data_node = null, |
|
50 | - RouteMatchSpecificationInterface $specification = null |
|
51 | - ) { |
|
52 | - $this->admin_config = $admin_config; |
|
53 | - parent::__construct($dependency_map, $loader, $request, $data_node, $specification); |
|
54 | - } |
|
34 | + /** |
|
35 | + * Route constructor. |
|
36 | + * |
|
37 | + * @param EE_Admin_Config $admin_config |
|
38 | + * @param EE_Dependency_Map $dependency_map |
|
39 | + * @param LoaderInterface $loader |
|
40 | + * @param RequestInterface $request |
|
41 | + * @param JsonDataNode $data_node |
|
42 | + * @param RouteMatchSpecificationInterface $specification |
|
43 | + */ |
|
44 | + public function __construct( |
|
45 | + EE_Admin_Config $admin_config, |
|
46 | + EE_Dependency_Map $dependency_map, |
|
47 | + LoaderInterface $loader, |
|
48 | + RequestInterface $request, |
|
49 | + JsonDataNode $data_node = null, |
|
50 | + RouteMatchSpecificationInterface $specification = null |
|
51 | + ) { |
|
52 | + $this->admin_config = $admin_config; |
|
53 | + parent::__construct($dependency_map, $loader, $request, $data_node, $specification); |
|
54 | + } |
|
55 | 55 | |
56 | 56 | |
57 | - /** |
|
58 | - * returns true if the current request matches this route |
|
59 | - * |
|
60 | - * @return bool |
|
61 | - * @since $VID:$ |
|
62 | - */ |
|
63 | - public function matchesCurrentRequest() |
|
64 | - { |
|
65 | - return $this->request->isAdmin() || $this->request->isAdminAjax() || $this->request->isActivation(); |
|
66 | - } |
|
57 | + /** |
|
58 | + * returns true if the current request matches this route |
|
59 | + * |
|
60 | + * @return bool |
|
61 | + * @since $VID:$ |
|
62 | + */ |
|
63 | + public function matchesCurrentRequest() |
|
64 | + { |
|
65 | + return $this->request->isAdmin() || $this->request->isAdminAjax() || $this->request->isActivation(); |
|
66 | + } |
|
67 | 67 | |
68 | 68 | |
69 | - /** |
|
70 | - * @since $VID:$ |
|
71 | - */ |
|
72 | - protected function registerDependencies() |
|
73 | - { |
|
74 | - } |
|
69 | + /** |
|
70 | + * @since $VID:$ |
|
71 | + */ |
|
72 | + protected function registerDependencies() |
|
73 | + { |
|
74 | + } |
|
75 | 75 | |
76 | 76 | |
77 | - /** |
|
78 | - * implements logic required to run during request |
|
79 | - * |
|
80 | - * @return bool |
|
81 | - * @since $VID:$ |
|
82 | - */ |
|
83 | - protected function requestHandler() |
|
84 | - { |
|
85 | - $this->loader->getShared('EE_Admin'); |
|
86 | - return true; |
|
87 | - } |
|
77 | + /** |
|
78 | + * implements logic required to run during request |
|
79 | + * |
|
80 | + * @return bool |
|
81 | + * @since $VID:$ |
|
82 | + */ |
|
83 | + protected function requestHandler() |
|
84 | + { |
|
85 | + $this->loader->getShared('EE_Admin'); |
|
86 | + return true; |
|
87 | + } |
|
88 | 88 | } |
@@ -37,128 +37,128 @@ |
||
37 | 37 | * @since 4.0 |
38 | 38 | */ |
39 | 39 | if (function_exists('espresso_version')) { |
40 | - if (! function_exists('espresso_duplicate_plugin_error')) { |
|
41 | - /** |
|
42 | - * espresso_duplicate_plugin_error |
|
43 | - * displays if more than one version of EE is activated at the same time |
|
44 | - */ |
|
45 | - function espresso_duplicate_plugin_error() |
|
46 | - { |
|
47 | - ?> |
|
40 | + if (! function_exists('espresso_duplicate_plugin_error')) { |
|
41 | + /** |
|
42 | + * espresso_duplicate_plugin_error |
|
43 | + * displays if more than one version of EE is activated at the same time |
|
44 | + */ |
|
45 | + function espresso_duplicate_plugin_error() |
|
46 | + { |
|
47 | + ?> |
|
48 | 48 | <div class="error"> |
49 | 49 | <p> |
50 | 50 | <?php |
51 | - echo esc_html__( |
|
52 | - 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', |
|
53 | - 'event_espresso' |
|
54 | - ); ?> |
|
51 | + echo esc_html__( |
|
52 | + 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', |
|
53 | + 'event_espresso' |
|
54 | + ); ?> |
|
55 | 55 | </p> |
56 | 56 | </div> |
57 | 57 | <?php |
58 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
59 | - } |
|
60 | - } |
|
61 | - add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
58 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
59 | + } |
|
60 | + } |
|
61 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
62 | 62 | } else { |
63 | - define('EE_MIN_PHP_VER_REQUIRED', '5.4.0'); |
|
64 | - if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
65 | - /** |
|
66 | - * espresso_minimum_php_version_error |
|
67 | - * |
|
68 | - * @return void |
|
69 | - */ |
|
70 | - function espresso_minimum_php_version_error() |
|
71 | - { |
|
72 | - ?> |
|
63 | + define('EE_MIN_PHP_VER_REQUIRED', '5.4.0'); |
|
64 | + if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
65 | + /** |
|
66 | + * espresso_minimum_php_version_error |
|
67 | + * |
|
68 | + * @return void |
|
69 | + */ |
|
70 | + function espresso_minimum_php_version_error() |
|
71 | + { |
|
72 | + ?> |
|
73 | 73 | <div class="error"> |
74 | 74 | <p> |
75 | 75 | <?php |
76 | - printf( |
|
77 | - esc_html__( |
|
78 | - 'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', |
|
79 | - 'event_espresso' |
|
80 | - ), |
|
81 | - EE_MIN_PHP_VER_REQUIRED, |
|
82 | - PHP_VERSION, |
|
83 | - '<br/>', |
|
84 | - '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>' |
|
85 | - ); |
|
86 | - ?> |
|
76 | + printf( |
|
77 | + esc_html__( |
|
78 | + 'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', |
|
79 | + 'event_espresso' |
|
80 | + ), |
|
81 | + EE_MIN_PHP_VER_REQUIRED, |
|
82 | + PHP_VERSION, |
|
83 | + '<br/>', |
|
84 | + '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>' |
|
85 | + ); |
|
86 | + ?> |
|
87 | 87 | </p> |
88 | 88 | </div> |
89 | 89 | <?php |
90 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
91 | - } |
|
90 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
91 | + } |
|
92 | 92 | |
93 | - add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
94 | - } else { |
|
95 | - define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
96 | - /** |
|
97 | - * espresso_version |
|
98 | - * Returns the plugin version |
|
99 | - * |
|
100 | - * @return string |
|
101 | - */ |
|
102 | - function espresso_version() |
|
103 | - { |
|
104 | - return apply_filters('FHEE__espresso__espresso_version', '4.10.7.rc.036'); |
|
105 | - } |
|
93 | + add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
94 | + } else { |
|
95 | + define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
96 | + /** |
|
97 | + * espresso_version |
|
98 | + * Returns the plugin version |
|
99 | + * |
|
100 | + * @return string |
|
101 | + */ |
|
102 | + function espresso_version() |
|
103 | + { |
|
104 | + return apply_filters('FHEE__espresso__espresso_version', '4.10.7.rc.036'); |
|
105 | + } |
|
106 | 106 | |
107 | - /** |
|
108 | - * espresso_plugin_activation |
|
109 | - * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
110 | - */ |
|
111 | - function espresso_plugin_activation() |
|
112 | - { |
|
113 | - update_option('ee_espresso_activation', true); |
|
107 | + /** |
|
108 | + * espresso_plugin_activation |
|
109 | + * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
110 | + */ |
|
111 | + function espresso_plugin_activation() |
|
112 | + { |
|
113 | + update_option('ee_espresso_activation', true); |
|
114 | 114 | |
115 | - // Run WP GraphQL activation callback |
|
116 | - if (PHP_VERSION_ID < 70100) { |
|
117 | - return; |
|
118 | - } |
|
119 | - if (! class_exists('WPGraphQL')) { |
|
120 | - require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
121 | - } |
|
122 | - graphql_init()->activate(); |
|
123 | - } |
|
115 | + // Run WP GraphQL activation callback |
|
116 | + if (PHP_VERSION_ID < 70100) { |
|
117 | + return; |
|
118 | + } |
|
119 | + if (! class_exists('WPGraphQL')) { |
|
120 | + require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
121 | + } |
|
122 | + graphql_init()->activate(); |
|
123 | + } |
|
124 | 124 | |
125 | - register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
125 | + register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
126 | 126 | |
127 | - /** |
|
128 | - * espresso_plugin_deactivation |
|
129 | - */ |
|
130 | - function espresso_plugin_deactivation() |
|
131 | - { |
|
132 | - // Run WP GraphQL deactivation callback |
|
133 | - if (PHP_VERSION_ID < 70100) { |
|
134 | - return; |
|
135 | - } |
|
136 | - if (! class_exists('WPGraphQL')) { |
|
137 | - require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
138 | - } |
|
139 | - graphql_init()->deactivate(); |
|
140 | - } |
|
141 | - register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation'); |
|
127 | + /** |
|
128 | + * espresso_plugin_deactivation |
|
129 | + */ |
|
130 | + function espresso_plugin_deactivation() |
|
131 | + { |
|
132 | + // Run WP GraphQL deactivation callback |
|
133 | + if (PHP_VERSION_ID < 70100) { |
|
134 | + return; |
|
135 | + } |
|
136 | + if (! class_exists('WPGraphQL')) { |
|
137 | + require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
138 | + } |
|
139 | + graphql_init()->deactivate(); |
|
140 | + } |
|
141 | + register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation'); |
|
142 | 142 | |
143 | - require_once __DIR__ . '/core/bootstrap_espresso.php'; |
|
144 | - bootstrap_espresso(); |
|
145 | - } |
|
143 | + require_once __DIR__ . '/core/bootstrap_espresso.php'; |
|
144 | + bootstrap_espresso(); |
|
145 | + } |
|
146 | 146 | } |
147 | 147 | if (! function_exists('espresso_deactivate_plugin')) { |
148 | - /** |
|
149 | - * deactivate_plugin |
|
150 | - * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
151 | - * |
|
152 | - * @access public |
|
153 | - * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
154 | - * @return void |
|
155 | - */ |
|
156 | - function espresso_deactivate_plugin($plugin_basename = '') |
|
157 | - { |
|
158 | - if (! function_exists('deactivate_plugins')) { |
|
159 | - require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
160 | - } |
|
161 | - unset($_GET['activate'], $_REQUEST['activate']); |
|
162 | - deactivate_plugins($plugin_basename); |
|
163 | - } |
|
148 | + /** |
|
149 | + * deactivate_plugin |
|
150 | + * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
151 | + * |
|
152 | + * @access public |
|
153 | + * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
154 | + * @return void |
|
155 | + */ |
|
156 | + function espresso_deactivate_plugin($plugin_basename = '') |
|
157 | + { |
|
158 | + if (! function_exists('deactivate_plugins')) { |
|
159 | + require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
160 | + } |
|
161 | + unset($_GET['activate'], $_REQUEST['activate']); |
|
162 | + deactivate_plugins($plugin_basename); |
|
163 | + } |
|
164 | 164 | } |