@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php if (! defined('EVENT_ESPRESSO_VERSION')) { |
| 2 | - exit('No direct script access allowed'); |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | 3 | } |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -13,93 +13,93 @@ discard block |
||
| 13 | 13 | class EE_WP_User extends EE_Base_Class implements EEI_Admin_Links |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * @var WP_User |
|
| 18 | - */ |
|
| 19 | - protected $_wp_user_obj; |
|
| 16 | + /** |
|
| 17 | + * @var WP_User |
|
| 18 | + */ |
|
| 19 | + protected $_wp_user_obj; |
|
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * @param array $props_n_values |
|
| 23 | - * @return EE_WP_User|mixed |
|
| 24 | - */ |
|
| 25 | - public static function new_instance($props_n_values = array()) |
|
| 26 | - { |
|
| 27 | - $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
| 28 | - return $has_object ? $has_object : new self($props_n_values); |
|
| 29 | - } |
|
| 21 | + /** |
|
| 22 | + * @param array $props_n_values |
|
| 23 | + * @return EE_WP_User|mixed |
|
| 24 | + */ |
|
| 25 | + public static function new_instance($props_n_values = array()) |
|
| 26 | + { |
|
| 27 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
| 28 | + return $has_object ? $has_object : new self($props_n_values); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * @param array $props_n_values |
|
| 34 | - * @return EE_WP_User |
|
| 35 | - */ |
|
| 36 | - public static function new_instance_from_db($props_n_values = array()) |
|
| 37 | - { |
|
| 38 | - return new self($props_n_values, true); |
|
| 39 | - } |
|
| 32 | + /** |
|
| 33 | + * @param array $props_n_values |
|
| 34 | + * @return EE_WP_User |
|
| 35 | + */ |
|
| 36 | + public static function new_instance_from_db($props_n_values = array()) |
|
| 37 | + { |
|
| 38 | + return new self($props_n_values, true); |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Return a normal WP_User object (caches the object for future calls) |
|
| 43 | - * |
|
| 44 | - * @return WP_User |
|
| 45 | - */ |
|
| 46 | - public function wp_user_obj() |
|
| 47 | - { |
|
| 48 | - if (! $this->_wp_user_obj) { |
|
| 49 | - $this->_wp_user_obj = get_user_by('ID', $this->ID()); |
|
| 50 | - } |
|
| 51 | - return $this->_wp_user_obj; |
|
| 52 | - } |
|
| 41 | + /** |
|
| 42 | + * Return a normal WP_User object (caches the object for future calls) |
|
| 43 | + * |
|
| 44 | + * @return WP_User |
|
| 45 | + */ |
|
| 46 | + public function wp_user_obj() |
|
| 47 | + { |
|
| 48 | + if (! $this->_wp_user_obj) { |
|
| 49 | + $this->_wp_user_obj = get_user_by('ID', $this->ID()); |
|
| 50 | + } |
|
| 51 | + return $this->_wp_user_obj; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * Return the link to the admin details for the object. |
|
| 56 | - * |
|
| 57 | - * @return string |
|
| 58 | - */ |
|
| 59 | - public function get_admin_details_link() |
|
| 60 | - { |
|
| 61 | - return $this->get_admin_edit_link(); |
|
| 62 | - } |
|
| 54 | + /** |
|
| 55 | + * Return the link to the admin details for the object. |
|
| 56 | + * |
|
| 57 | + * @return string |
|
| 58 | + */ |
|
| 59 | + public function get_admin_details_link() |
|
| 60 | + { |
|
| 61 | + return $this->get_admin_edit_link(); |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * Returns the link to the editor for the object. Sometimes this is the same as the details. |
|
| 66 | - * |
|
| 67 | - * @return string |
|
| 68 | - */ |
|
| 69 | - public function get_admin_edit_link() |
|
| 70 | - { |
|
| 71 | - return esc_url( |
|
| 72 | - add_query_arg( |
|
| 73 | - 'wp_http_referer', |
|
| 74 | - urlencode( |
|
| 75 | - wp_unslash( |
|
| 76 | - $_SERVER['REQUEST_URI'] |
|
| 77 | - ) |
|
| 78 | - ), |
|
| 79 | - get_edit_user_link($this->ID()) |
|
| 80 | - ) |
|
| 81 | - ); |
|
| 82 | - } |
|
| 64 | + /** |
|
| 65 | + * Returns the link to the editor for the object. Sometimes this is the same as the details. |
|
| 66 | + * |
|
| 67 | + * @return string |
|
| 68 | + */ |
|
| 69 | + public function get_admin_edit_link() |
|
| 70 | + { |
|
| 71 | + return esc_url( |
|
| 72 | + add_query_arg( |
|
| 73 | + 'wp_http_referer', |
|
| 74 | + urlencode( |
|
| 75 | + wp_unslash( |
|
| 76 | + $_SERVER['REQUEST_URI'] |
|
| 77 | + ) |
|
| 78 | + ), |
|
| 79 | + get_edit_user_link($this->ID()) |
|
| 80 | + ) |
|
| 81 | + ); |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - /** |
|
| 85 | - * Returns the link to a settings page for the object. |
|
| 86 | - * |
|
| 87 | - * @return string |
|
| 88 | - */ |
|
| 89 | - public function get_admin_settings_link() |
|
| 90 | - { |
|
| 91 | - return $this->get_admin_edit_link(); |
|
| 92 | - } |
|
| 84 | + /** |
|
| 85 | + * Returns the link to a settings page for the object. |
|
| 86 | + * |
|
| 87 | + * @return string |
|
| 88 | + */ |
|
| 89 | + public function get_admin_settings_link() |
|
| 90 | + { |
|
| 91 | + return $this->get_admin_edit_link(); |
|
| 92 | + } |
|
| 93 | 93 | |
| 94 | - /** |
|
| 95 | - * Returns the link to the "overview" for the object (typically the "list table" view). |
|
| 96 | - * |
|
| 97 | - * @return string |
|
| 98 | - */ |
|
| 99 | - public function get_admin_overview_link() |
|
| 100 | - { |
|
| 101 | - return admin_url('users.php'); |
|
| 102 | - } |
|
| 94 | + /** |
|
| 95 | + * Returns the link to the "overview" for the object (typically the "list table" view). |
|
| 96 | + * |
|
| 97 | + * @return string |
|
| 98 | + */ |
|
| 99 | + public function get_admin_overview_link() |
|
| 100 | + { |
|
| 101 | + return admin_url('users.php'); |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | } |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php if (! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 2 | 2 | exit('No direct script access allowed'); |
| 3 | 3 | } |
| 4 | 4 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function wp_user_obj() |
| 47 | 47 | { |
| 48 | - if (! $this->_wp_user_obj) { |
|
| 48 | + if ( ! $this->_wp_user_obj) { |
|
| 49 | 49 | $this->_wp_user_obj = get_user_by('ID', $this->ID()); |
| 50 | 50 | } |
| 51 | 51 | return $this->_wp_user_obj; |
@@ -38,217 +38,217 @@ |
||
| 38 | 38 | * @since 4.0 |
| 39 | 39 | */ |
| 40 | 40 | if (function_exists('espresso_version')) { |
| 41 | - if (! function_exists('espresso_duplicate_plugin_error')) { |
|
| 42 | - /** |
|
| 43 | - * espresso_duplicate_plugin_error |
|
| 44 | - * displays if more than one version of EE is activated at the same time |
|
| 45 | - */ |
|
| 46 | - function espresso_duplicate_plugin_error() |
|
| 47 | - { |
|
| 48 | - ?> |
|
| 41 | + if (! function_exists('espresso_duplicate_plugin_error')) { |
|
| 42 | + /** |
|
| 43 | + * espresso_duplicate_plugin_error |
|
| 44 | + * displays if more than one version of EE is activated at the same time |
|
| 45 | + */ |
|
| 46 | + function espresso_duplicate_plugin_error() |
|
| 47 | + { |
|
| 48 | + ?> |
|
| 49 | 49 | <div class="error"> |
| 50 | 50 | <p> |
| 51 | 51 | <?php |
| 52 | - echo esc_html__( |
|
| 53 | - '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.', |
|
| 54 | - 'event_espresso' |
|
| 55 | - ); ?> |
|
| 52 | + echo esc_html__( |
|
| 53 | + '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.', |
|
| 54 | + 'event_espresso' |
|
| 55 | + ); ?> |
|
| 56 | 56 | </p> |
| 57 | 57 | </div> |
| 58 | 58 | <?php |
| 59 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
| 60 | - } |
|
| 61 | - } |
|
| 62 | - add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
| 59 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
| 60 | + } |
|
| 61 | + } |
|
| 62 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
| 63 | 63 | |
| 64 | 64 | } else { |
| 65 | - define('EE_MIN_PHP_VER_REQUIRED', '5.3.9'); |
|
| 66 | - if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
| 67 | - /** |
|
| 68 | - * espresso_minimum_php_version_error |
|
| 69 | - * |
|
| 70 | - * @return void |
|
| 71 | - */ |
|
| 72 | - function espresso_minimum_php_version_error() |
|
| 73 | - { |
|
| 74 | - ?> |
|
| 65 | + define('EE_MIN_PHP_VER_REQUIRED', '5.3.9'); |
|
| 66 | + if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
| 67 | + /** |
|
| 68 | + * espresso_minimum_php_version_error |
|
| 69 | + * |
|
| 70 | + * @return void |
|
| 71 | + */ |
|
| 72 | + function espresso_minimum_php_version_error() |
|
| 73 | + { |
|
| 74 | + ?> |
|
| 75 | 75 | <div class="error"> |
| 76 | 76 | <p> |
| 77 | 77 | <?php |
| 78 | - printf( |
|
| 79 | - esc_html__( |
|
| 80 | - '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.', |
|
| 81 | - 'event_espresso' |
|
| 82 | - ), |
|
| 83 | - EE_MIN_PHP_VER_REQUIRED, |
|
| 84 | - PHP_VERSION, |
|
| 85 | - '<br/>', |
|
| 86 | - '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>' |
|
| 87 | - ); |
|
| 88 | - ?> |
|
| 78 | + printf( |
|
| 79 | + esc_html__( |
|
| 80 | + '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.', |
|
| 81 | + 'event_espresso' |
|
| 82 | + ), |
|
| 83 | + EE_MIN_PHP_VER_REQUIRED, |
|
| 84 | + PHP_VERSION, |
|
| 85 | + '<br/>', |
|
| 86 | + '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>' |
|
| 87 | + ); |
|
| 88 | + ?> |
|
| 89 | 89 | </p> |
| 90 | 90 | </div> |
| 91 | 91 | <?php |
| 92 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
| 93 | - } |
|
| 92 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
| 93 | + } |
|
| 94 | 94 | |
| 95 | - add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
| 96 | - } else { |
|
| 97 | - define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
| 98 | - /** |
|
| 99 | - * espresso_version |
|
| 100 | - * Returns the plugin version |
|
| 101 | - * |
|
| 102 | - * @return string |
|
| 103 | - */ |
|
| 104 | - function espresso_version() |
|
| 105 | - { |
|
| 106 | - return apply_filters('FHEE__espresso__espresso_version', '4.9.53.rc.006'); |
|
| 107 | - } |
|
| 95 | + add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
| 96 | + } else { |
|
| 97 | + define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
| 98 | + /** |
|
| 99 | + * espresso_version |
|
| 100 | + * Returns the plugin version |
|
| 101 | + * |
|
| 102 | + * @return string |
|
| 103 | + */ |
|
| 104 | + function espresso_version() |
|
| 105 | + { |
|
| 106 | + return apply_filters('FHEE__espresso__espresso_version', '4.9.53.rc.006'); |
|
| 107 | + } |
|
| 108 | 108 | |
| 109 | - /** |
|
| 110 | - * espresso_plugin_activation |
|
| 111 | - * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
| 112 | - */ |
|
| 113 | - function espresso_plugin_activation() |
|
| 114 | - { |
|
| 115 | - update_option('ee_espresso_activation', true); |
|
| 116 | - } |
|
| 109 | + /** |
|
| 110 | + * espresso_plugin_activation |
|
| 111 | + * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
| 112 | + */ |
|
| 113 | + function espresso_plugin_activation() |
|
| 114 | + { |
|
| 115 | + update_option('ee_espresso_activation', true); |
|
| 116 | + } |
|
| 117 | 117 | |
| 118 | - register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
| 119 | - /** |
|
| 120 | - * espresso_load_error_handling |
|
| 121 | - * this function loads EE's class for handling exceptions and errors |
|
| 122 | - */ |
|
| 123 | - function espresso_load_error_handling() |
|
| 124 | - { |
|
| 125 | - static $error_handling_loaded = false; |
|
| 126 | - if ($error_handling_loaded) { |
|
| 127 | - return; |
|
| 128 | - } |
|
| 129 | - // load debugging tools |
|
| 130 | - if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) { |
|
| 131 | - require_once EE_HELPERS . 'EEH_Debug_Tools.helper.php'; |
|
| 132 | - \EEH_Debug_Tools::instance(); |
|
| 133 | - } |
|
| 134 | - // load error handling |
|
| 135 | - if (is_readable(EE_CORE . 'EE_Error.core.php')) { |
|
| 136 | - require_once EE_CORE . 'EE_Error.core.php'; |
|
| 137 | - } else { |
|
| 138 | - wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
| 139 | - } |
|
| 140 | - $error_handling_loaded = true; |
|
| 141 | - } |
|
| 118 | + register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
| 119 | + /** |
|
| 120 | + * espresso_load_error_handling |
|
| 121 | + * this function loads EE's class for handling exceptions and errors |
|
| 122 | + */ |
|
| 123 | + function espresso_load_error_handling() |
|
| 124 | + { |
|
| 125 | + static $error_handling_loaded = false; |
|
| 126 | + if ($error_handling_loaded) { |
|
| 127 | + return; |
|
| 128 | + } |
|
| 129 | + // load debugging tools |
|
| 130 | + if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) { |
|
| 131 | + require_once EE_HELPERS . 'EEH_Debug_Tools.helper.php'; |
|
| 132 | + \EEH_Debug_Tools::instance(); |
|
| 133 | + } |
|
| 134 | + // load error handling |
|
| 135 | + if (is_readable(EE_CORE . 'EE_Error.core.php')) { |
|
| 136 | + require_once EE_CORE . 'EE_Error.core.php'; |
|
| 137 | + } else { |
|
| 138 | + wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
| 139 | + } |
|
| 140 | + $error_handling_loaded = true; |
|
| 141 | + } |
|
| 142 | 142 | |
| 143 | - /** |
|
| 144 | - * espresso_load_required |
|
| 145 | - * given a class name and path, this function will load that file or throw an exception |
|
| 146 | - * |
|
| 147 | - * @param string $classname |
|
| 148 | - * @param string $full_path_to_file |
|
| 149 | - * @throws EE_Error |
|
| 150 | - */ |
|
| 151 | - function espresso_load_required($classname, $full_path_to_file) |
|
| 152 | - { |
|
| 153 | - if (is_readable($full_path_to_file)) { |
|
| 154 | - require_once $full_path_to_file; |
|
| 155 | - } else { |
|
| 156 | - throw new \EE_Error ( |
|
| 157 | - sprintf( |
|
| 158 | - esc_html__( |
|
| 159 | - 'The %s class file could not be located or is not readable due to file permissions.', |
|
| 160 | - 'event_espresso' |
|
| 161 | - ), |
|
| 162 | - $classname |
|
| 163 | - ) |
|
| 164 | - ); |
|
| 165 | - } |
|
| 166 | - } |
|
| 143 | + /** |
|
| 144 | + * espresso_load_required |
|
| 145 | + * given a class name and path, this function will load that file or throw an exception |
|
| 146 | + * |
|
| 147 | + * @param string $classname |
|
| 148 | + * @param string $full_path_to_file |
|
| 149 | + * @throws EE_Error |
|
| 150 | + */ |
|
| 151 | + function espresso_load_required($classname, $full_path_to_file) |
|
| 152 | + { |
|
| 153 | + if (is_readable($full_path_to_file)) { |
|
| 154 | + require_once $full_path_to_file; |
|
| 155 | + } else { |
|
| 156 | + throw new \EE_Error ( |
|
| 157 | + sprintf( |
|
| 158 | + esc_html__( |
|
| 159 | + 'The %s class file could not be located or is not readable due to file permissions.', |
|
| 160 | + 'event_espresso' |
|
| 161 | + ), |
|
| 162 | + $classname |
|
| 163 | + ) |
|
| 164 | + ); |
|
| 165 | + } |
|
| 166 | + } |
|
| 167 | 167 | |
| 168 | - /** |
|
| 169 | - * @since 4.9.27 |
|
| 170 | - * @throws \EE_Error |
|
| 171 | - * @throws \EventEspresso\core\exceptions\InvalidInterfaceException |
|
| 172 | - * @throws \EventEspresso\core\exceptions\InvalidEntityException |
|
| 173 | - * @throws \EventEspresso\core\exceptions\InvalidIdentifierException |
|
| 174 | - * @throws \EventEspresso\core\exceptions\InvalidClassException |
|
| 175 | - * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
|
| 176 | - * @throws \EventEspresso\core\services\container\exceptions\ServiceExistsException |
|
| 177 | - * @throws \EventEspresso\core\services\container\exceptions\ServiceNotFoundException |
|
| 178 | - * @throws \OutOfBoundsException |
|
| 179 | - */ |
|
| 180 | - function bootstrap_espresso() |
|
| 181 | - { |
|
| 182 | - require_once __DIR__ . '/core/espresso_definitions.php'; |
|
| 183 | - try { |
|
| 184 | - espresso_load_error_handling(); |
|
| 185 | - espresso_load_required( |
|
| 186 | - 'EEH_Base', |
|
| 187 | - EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' |
|
| 188 | - ); |
|
| 189 | - espresso_load_required( |
|
| 190 | - 'EEH_File', |
|
| 191 | - EE_CORE . 'interfaces' . DS . 'EEHI_File.interface.php' |
|
| 192 | - ); |
|
| 193 | - espresso_load_required( |
|
| 194 | - 'EEH_File', |
|
| 195 | - EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' |
|
| 196 | - ); |
|
| 197 | - espresso_load_required( |
|
| 198 | - 'EEH_Array', |
|
| 199 | - EE_CORE . 'helpers' . DS . 'EEH_Array.helper.php' |
|
| 200 | - ); |
|
| 201 | - // instantiate and configure PSR4 autoloader |
|
| 202 | - espresso_load_required( |
|
| 203 | - 'Psr4Autoloader', |
|
| 204 | - EE_CORE . 'Psr4Autoloader.php' |
|
| 205 | - ); |
|
| 206 | - espresso_load_required( |
|
| 207 | - 'EE_Psr4AutoloaderInit', |
|
| 208 | - EE_CORE . 'EE_Psr4AutoloaderInit.core.php' |
|
| 209 | - ); |
|
| 210 | - $AutoloaderInit = new EE_Psr4AutoloaderInit(); |
|
| 211 | - $AutoloaderInit->initializeAutoloader(); |
|
| 212 | - espresso_load_required( |
|
| 213 | - 'EE_Request', |
|
| 214 | - EE_CORE . 'request_stack' . DS . 'EE_Request.core.php' |
|
| 215 | - ); |
|
| 216 | - espresso_load_required( |
|
| 217 | - 'EE_Response', |
|
| 218 | - EE_CORE . 'request_stack' . DS . 'EE_Response.core.php' |
|
| 219 | - ); |
|
| 220 | - espresso_load_required( |
|
| 221 | - 'EE_Bootstrap', |
|
| 222 | - EE_CORE . 'EE_Bootstrap.core.php' |
|
| 223 | - ); |
|
| 224 | - // bootstrap EE and the request stack |
|
| 225 | - new EE_Bootstrap( |
|
| 226 | - new EE_Request($_GET, $_POST, $_COOKIE), |
|
| 227 | - new EE_Response() |
|
| 228 | - ); |
|
| 229 | - } catch (Exception $e) { |
|
| 230 | - require_once EE_CORE . 'exceptions' . DS . 'ExceptionStackTraceDisplay.php'; |
|
| 231 | - new EventEspresso\core\exceptions\ExceptionStackTraceDisplay($e); |
|
| 232 | - } |
|
| 233 | - } |
|
| 234 | - bootstrap_espresso(); |
|
| 235 | - } |
|
| 168 | + /** |
|
| 169 | + * @since 4.9.27 |
|
| 170 | + * @throws \EE_Error |
|
| 171 | + * @throws \EventEspresso\core\exceptions\InvalidInterfaceException |
|
| 172 | + * @throws \EventEspresso\core\exceptions\InvalidEntityException |
|
| 173 | + * @throws \EventEspresso\core\exceptions\InvalidIdentifierException |
|
| 174 | + * @throws \EventEspresso\core\exceptions\InvalidClassException |
|
| 175 | + * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
|
| 176 | + * @throws \EventEspresso\core\services\container\exceptions\ServiceExistsException |
|
| 177 | + * @throws \EventEspresso\core\services\container\exceptions\ServiceNotFoundException |
|
| 178 | + * @throws \OutOfBoundsException |
|
| 179 | + */ |
|
| 180 | + function bootstrap_espresso() |
|
| 181 | + { |
|
| 182 | + require_once __DIR__ . '/core/espresso_definitions.php'; |
|
| 183 | + try { |
|
| 184 | + espresso_load_error_handling(); |
|
| 185 | + espresso_load_required( |
|
| 186 | + 'EEH_Base', |
|
| 187 | + EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' |
|
| 188 | + ); |
|
| 189 | + espresso_load_required( |
|
| 190 | + 'EEH_File', |
|
| 191 | + EE_CORE . 'interfaces' . DS . 'EEHI_File.interface.php' |
|
| 192 | + ); |
|
| 193 | + espresso_load_required( |
|
| 194 | + 'EEH_File', |
|
| 195 | + EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' |
|
| 196 | + ); |
|
| 197 | + espresso_load_required( |
|
| 198 | + 'EEH_Array', |
|
| 199 | + EE_CORE . 'helpers' . DS . 'EEH_Array.helper.php' |
|
| 200 | + ); |
|
| 201 | + // instantiate and configure PSR4 autoloader |
|
| 202 | + espresso_load_required( |
|
| 203 | + 'Psr4Autoloader', |
|
| 204 | + EE_CORE . 'Psr4Autoloader.php' |
|
| 205 | + ); |
|
| 206 | + espresso_load_required( |
|
| 207 | + 'EE_Psr4AutoloaderInit', |
|
| 208 | + EE_CORE . 'EE_Psr4AutoloaderInit.core.php' |
|
| 209 | + ); |
|
| 210 | + $AutoloaderInit = new EE_Psr4AutoloaderInit(); |
|
| 211 | + $AutoloaderInit->initializeAutoloader(); |
|
| 212 | + espresso_load_required( |
|
| 213 | + 'EE_Request', |
|
| 214 | + EE_CORE . 'request_stack' . DS . 'EE_Request.core.php' |
|
| 215 | + ); |
|
| 216 | + espresso_load_required( |
|
| 217 | + 'EE_Response', |
|
| 218 | + EE_CORE . 'request_stack' . DS . 'EE_Response.core.php' |
|
| 219 | + ); |
|
| 220 | + espresso_load_required( |
|
| 221 | + 'EE_Bootstrap', |
|
| 222 | + EE_CORE . 'EE_Bootstrap.core.php' |
|
| 223 | + ); |
|
| 224 | + // bootstrap EE and the request stack |
|
| 225 | + new EE_Bootstrap( |
|
| 226 | + new EE_Request($_GET, $_POST, $_COOKIE), |
|
| 227 | + new EE_Response() |
|
| 228 | + ); |
|
| 229 | + } catch (Exception $e) { |
|
| 230 | + require_once EE_CORE . 'exceptions' . DS . 'ExceptionStackTraceDisplay.php'; |
|
| 231 | + new EventEspresso\core\exceptions\ExceptionStackTraceDisplay($e); |
|
| 232 | + } |
|
| 233 | + } |
|
| 234 | + bootstrap_espresso(); |
|
| 235 | + } |
|
| 236 | 236 | } |
| 237 | 237 | if (! function_exists('espresso_deactivate_plugin')) { |
| 238 | - /** |
|
| 239 | - * deactivate_plugin |
|
| 240 | - * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
| 241 | - * |
|
| 242 | - * @access public |
|
| 243 | - * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
| 244 | - * @return void |
|
| 245 | - */ |
|
| 246 | - function espresso_deactivate_plugin($plugin_basename = '') |
|
| 247 | - { |
|
| 248 | - if (! function_exists('deactivate_plugins')) { |
|
| 249 | - require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
| 250 | - } |
|
| 251 | - unset($_GET['activate'], $_REQUEST['activate']); |
|
| 252 | - deactivate_plugins($plugin_basename); |
|
| 253 | - } |
|
| 238 | + /** |
|
| 239 | + * deactivate_plugin |
|
| 240 | + * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
| 241 | + * |
|
| 242 | + * @access public |
|
| 243 | + * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
| 244 | + * @return void |
|
| 245 | + */ |
|
| 246 | + function espresso_deactivate_plugin($plugin_basename = '') |
|
| 247 | + { |
|
| 248 | + if (! function_exists('deactivate_plugins')) { |
|
| 249 | + require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
| 250 | + } |
|
| 251 | + unset($_GET['activate'], $_REQUEST['activate']); |
|
| 252 | + deactivate_plugins($plugin_basename); |
|
| 253 | + } |
|
| 254 | 254 | } |