@@ -22,15 +22,15 @@ |
||
22 | 22 | { |
23 | 23 | |
24 | 24 | do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
25 | - if (! defined('TXN_PG_SLUG')) { |
|
25 | + if ( ! defined('TXN_PG_SLUG')) { |
|
26 | 26 | define('TXN_PG_SLUG', 'espresso_transactions'); |
27 | 27 | define('TXN_PG_NAME', ucwords(str_replace('_', '', TXN_PG_SLUG))); |
28 | - define('TXN_ADMIN', EE_ADMIN_PAGES . 'transactions/'); |
|
29 | - define('TXN_ADMIN_URL', admin_url('admin.php?page=' . TXN_PG_SLUG)); |
|
30 | - define('TXN_ASSETS_PATH', TXN_ADMIN . 'assets/'); |
|
31 | - define('TXN_ASSETS_URL', str_replace('\\', '/', EE_ADMIN_PAGES_URL . 'transactions/assets/')); |
|
32 | - define('TXN_TEMPLATE_PATH', TXN_ADMIN . 'templates/'); |
|
33 | - define('TXN_TEMPLATE_URL', str_replace('\\', '/', EE_ADMIN_PAGES_URL . 'transactions/templates/')); |
|
28 | + define('TXN_ADMIN', EE_ADMIN_PAGES.'transactions/'); |
|
29 | + define('TXN_ADMIN_URL', admin_url('admin.php?page='.TXN_PG_SLUG)); |
|
30 | + define('TXN_ASSETS_PATH', TXN_ADMIN.'assets/'); |
|
31 | + define('TXN_ASSETS_URL', str_replace('\\', '/', EE_ADMIN_PAGES_URL.'transactions/assets/')); |
|
32 | + define('TXN_TEMPLATE_PATH', TXN_ADMIN.'templates/'); |
|
33 | + define('TXN_TEMPLATE_URL', str_replace('\\', '/', EE_ADMIN_PAGES_URL.'transactions/templates/')); |
|
34 | 34 | } |
35 | 35 | parent::__construct(); |
36 | 36 | } |
@@ -11,58 +11,58 @@ |
||
11 | 11 | */ |
12 | 12 | class Transactions_Admin_Page_Init extends EE_Admin_Page_Init |
13 | 13 | { |
14 | - /** |
|
15 | - * @Constructor |
|
16 | - * @access public |
|
17 | - * @return Transactions_Admin_Page_Init |
|
18 | - */ |
|
19 | - public function __construct() |
|
20 | - { |
|
14 | + /** |
|
15 | + * @Constructor |
|
16 | + * @access public |
|
17 | + * @return Transactions_Admin_Page_Init |
|
18 | + */ |
|
19 | + public function __construct() |
|
20 | + { |
|
21 | 21 | |
22 | - do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
23 | - if (! defined('TXN_PG_SLUG')) { |
|
24 | - define('TXN_PG_SLUG', 'espresso_transactions'); |
|
25 | - define('TXN_PG_NAME', ucwords(str_replace('_', '', TXN_PG_SLUG))); |
|
26 | - define('TXN_ADMIN', EE_ADMIN_PAGES . 'transactions/'); |
|
27 | - define('TXN_ADMIN_URL', admin_url('admin.php?page=' . TXN_PG_SLUG)); |
|
28 | - define('TXN_ASSETS_PATH', TXN_ADMIN . 'assets/'); |
|
29 | - define('TXN_ASSETS_URL', str_replace('\\', '/', EE_ADMIN_PAGES_URL . 'transactions/assets/')); |
|
30 | - define('TXN_TEMPLATE_PATH', TXN_ADMIN . 'templates/'); |
|
31 | - define('TXN_TEMPLATE_URL', str_replace('\\', '/', EE_ADMIN_PAGES_URL . 'transactions/templates/')); |
|
32 | - } |
|
33 | - parent::__construct(); |
|
34 | - } |
|
22 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
23 | + if (! defined('TXN_PG_SLUG')) { |
|
24 | + define('TXN_PG_SLUG', 'espresso_transactions'); |
|
25 | + define('TXN_PG_NAME', ucwords(str_replace('_', '', TXN_PG_SLUG))); |
|
26 | + define('TXN_ADMIN', EE_ADMIN_PAGES . 'transactions/'); |
|
27 | + define('TXN_ADMIN_URL', admin_url('admin.php?page=' . TXN_PG_SLUG)); |
|
28 | + define('TXN_ASSETS_PATH', TXN_ADMIN . 'assets/'); |
|
29 | + define('TXN_ASSETS_URL', str_replace('\\', '/', EE_ADMIN_PAGES_URL . 'transactions/assets/')); |
|
30 | + define('TXN_TEMPLATE_PATH', TXN_ADMIN . 'templates/'); |
|
31 | + define('TXN_TEMPLATE_URL', str_replace('\\', '/', EE_ADMIN_PAGES_URL . 'transactions/templates/')); |
|
32 | + } |
|
33 | + parent::__construct(); |
|
34 | + } |
|
35 | 35 | |
36 | 36 | |
37 | - /** |
|
38 | - * _set_init_properties |
|
39 | - * |
|
40 | - * @return void |
|
41 | - */ |
|
42 | - protected function _set_init_properties() |
|
43 | - { |
|
44 | - $this->label = esc_html__('Transactions Overview', 'event_espresso'); |
|
45 | - } |
|
37 | + /** |
|
38 | + * _set_init_properties |
|
39 | + * |
|
40 | + * @return void |
|
41 | + */ |
|
42 | + protected function _set_init_properties() |
|
43 | + { |
|
44 | + $this->label = esc_html__('Transactions Overview', 'event_espresso'); |
|
45 | + } |
|
46 | 46 | |
47 | 47 | |
48 | - /** |
|
49 | - * _set_menu_map |
|
50 | - * |
|
51 | - * @return void |
|
52 | - */ |
|
53 | - protected function _set_menu_map() |
|
54 | - { |
|
55 | - $this->_menu_map = new EE_Admin_Page_Sub_Menu( |
|
56 | - array( |
|
57 | - 'menu_group' => 'main', |
|
58 | - 'menu_order' => 50, |
|
59 | - 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |
|
60 | - 'parent_slug' => 'espresso_events', |
|
61 | - 'menu_slug' => TXN_PG_SLUG, |
|
62 | - 'menu_label' => esc_html__('Transactions', 'event_espresso'), |
|
63 | - 'capability' => 'ee_read_transactions', |
|
64 | - 'admin_init_page' => $this, |
|
65 | - ) |
|
66 | - ); |
|
67 | - } |
|
48 | + /** |
|
49 | + * _set_menu_map |
|
50 | + * |
|
51 | + * @return void |
|
52 | + */ |
|
53 | + protected function _set_menu_map() |
|
54 | + { |
|
55 | + $this->_menu_map = new EE_Admin_Page_Sub_Menu( |
|
56 | + array( |
|
57 | + 'menu_group' => 'main', |
|
58 | + 'menu_order' => 50, |
|
59 | + 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |
|
60 | + 'parent_slug' => 'espresso_events', |
|
61 | + 'menu_slug' => TXN_PG_SLUG, |
|
62 | + 'menu_label' => esc_html__('Transactions', 'event_espresso'), |
|
63 | + 'capability' => 'ee_read_transactions', |
|
64 | + 'admin_init_page' => $this, |
|
65 | + ) |
|
66 | + ); |
|
67 | + } |
|
68 | 68 | } |
@@ -21,12 +21,12 @@ |
||
21 | 21 | { |
22 | 22 | // define some event categories related constants |
23 | 23 | define('EE_VENUES_PG_SLUG', 'espresso_venues'); |
24 | - define('EE_VENUES_ADMIN_URL', admin_url('admin.php?page=' . EE_VENUES_PG_SLUG)); |
|
25 | - define('EE_VENUES_ASSETS_URL', EE_ADMIN_PAGES_URL . 'venues/assets/'); |
|
26 | - define('EE_VENUES_TEMPLATE_PATH', EE_ADMIN_PAGES . 'venues/templates/'); |
|
24 | + define('EE_VENUES_ADMIN_URL', admin_url('admin.php?page='.EE_VENUES_PG_SLUG)); |
|
25 | + define('EE_VENUES_ASSETS_URL', EE_ADMIN_PAGES_URL.'venues/assets/'); |
|
26 | + define('EE_VENUES_TEMPLATE_PATH', EE_ADMIN_PAGES.'venues/templates/'); |
|
27 | 27 | |
28 | 28 | parent::__construct(); |
29 | - $this->_folder_path = EE_ADMIN_PAGES . $this->_folder_name . '/'; |
|
29 | + $this->_folder_path = EE_ADMIN_PAGES.$this->_folder_name.'/'; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | protected function _set_init_properties() |
@@ -15,39 +15,39 @@ |
||
15 | 15 | */ |
16 | 16 | class Venues_Admin_Page_Init extends EE_Admin_Page_CPT_Init |
17 | 17 | { |
18 | - public function __construct() |
|
19 | - { |
|
20 | - // define some event categories related constants |
|
21 | - define('EE_VENUES_PG_SLUG', 'espresso_venues'); |
|
22 | - define('EE_VENUES_ADMIN_URL', admin_url('admin.php?page=' . EE_VENUES_PG_SLUG)); |
|
23 | - define('EE_VENUES_ASSETS_URL', EE_ADMIN_PAGES_URL . 'venues/assets/'); |
|
24 | - define('EE_VENUES_TEMPLATE_PATH', EE_ADMIN_PAGES . 'venues/templates/'); |
|
18 | + public function __construct() |
|
19 | + { |
|
20 | + // define some event categories related constants |
|
21 | + define('EE_VENUES_PG_SLUG', 'espresso_venues'); |
|
22 | + define('EE_VENUES_ADMIN_URL', admin_url('admin.php?page=' . EE_VENUES_PG_SLUG)); |
|
23 | + define('EE_VENUES_ASSETS_URL', EE_ADMIN_PAGES_URL . 'venues/assets/'); |
|
24 | + define('EE_VENUES_TEMPLATE_PATH', EE_ADMIN_PAGES . 'venues/templates/'); |
|
25 | 25 | |
26 | - parent::__construct(); |
|
27 | - $this->_folder_path = EE_ADMIN_PAGES . $this->_folder_name . '/'; |
|
28 | - } |
|
26 | + parent::__construct(); |
|
27 | + $this->_folder_path = EE_ADMIN_PAGES . $this->_folder_name . '/'; |
|
28 | + } |
|
29 | 29 | |
30 | - protected function _set_init_properties() |
|
31 | - { |
|
32 | - $this->label = esc_html__('Event Venues', 'event_espresso'); |
|
33 | - $this->menu_label = esc_html__('Venues', 'event_espresso'); |
|
34 | - $this->menu_slug = EE_VENUES_PG_SLUG; |
|
35 | - } |
|
30 | + protected function _set_init_properties() |
|
31 | + { |
|
32 | + $this->label = esc_html__('Event Venues', 'event_espresso'); |
|
33 | + $this->menu_label = esc_html__('Venues', 'event_espresso'); |
|
34 | + $this->menu_slug = EE_VENUES_PG_SLUG; |
|
35 | + } |
|
36 | 36 | |
37 | 37 | |
38 | - protected function _set_menu_map() |
|
39 | - { |
|
40 | - $this->_menu_map = new EE_Admin_Page_Sub_Menu( |
|
41 | - array( |
|
42 | - 'menu_group' => 'management', |
|
43 | - 'menu_order' => 40, |
|
44 | - 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |
|
45 | - 'parent_slug' => 'espresso_events', |
|
46 | - 'menu_slug' => EE_VENUES_PG_SLUG, |
|
47 | - 'menu_label' => esc_html__('Venues', 'event_espresso'), |
|
48 | - 'capability' => 'ee_read_venues', |
|
49 | - 'admin_init_page' => $this, |
|
50 | - ) |
|
51 | - ); |
|
52 | - } |
|
38 | + protected function _set_menu_map() |
|
39 | + { |
|
40 | + $this->_menu_map = new EE_Admin_Page_Sub_Menu( |
|
41 | + array( |
|
42 | + 'menu_group' => 'management', |
|
43 | + 'menu_order' => 40, |
|
44 | + 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |
|
45 | + 'parent_slug' => 'espresso_events', |
|
46 | + 'menu_slug' => EE_VENUES_PG_SLUG, |
|
47 | + 'menu_label' => esc_html__('Venues', 'event_espresso'), |
|
48 | + 'capability' => 'ee_read_venues', |
|
49 | + 'admin_init_page' => $this, |
|
50 | + ) |
|
51 | + ); |
|
52 | + } |
|
53 | 53 | } |
@@ -24,15 +24,15 @@ |
||
24 | 24 | |
25 | 25 | do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
26 | 26 | |
27 | - if (! defined('EE_MSG_PG_SLUG')) { |
|
27 | + if ( ! defined('EE_MSG_PG_SLUG')) { |
|
28 | 28 | define('EE_MSG_PG_SLUG', 'espresso_messages'); |
29 | 29 | define('EE_MSG_PG_NAME', ucwords(str_replace('_', '', EE_MSG_PG_SLUG))); |
30 | - define('EE_MSG_ADMIN', EE_ADMIN_PAGES . 'messages/'); |
|
31 | - define('EE_MSG_ADMIN_URL', admin_url('admin.php?page=' . EE_MSG_PG_SLUG)); |
|
32 | - define('EE_MSG_ASSETS_PATH', EE_MSG_ADMIN . 'assets/'); |
|
33 | - define('EE_MSG_ASSETS_URL', EE_ADMIN_PAGES_URL . 'messages/assets/'); |
|
34 | - define('EE_MSG_TEMPLATE_PATH', EE_MSG_ADMIN . 'templates/'); |
|
35 | - define('EE_MSG_TEMPLATE_URL', EE_ADMIN_PAGES_URL . 'messages/templates/'); |
|
30 | + define('EE_MSG_ADMIN', EE_ADMIN_PAGES.'messages/'); |
|
31 | + define('EE_MSG_ADMIN_URL', admin_url('admin.php?page='.EE_MSG_PG_SLUG)); |
|
32 | + define('EE_MSG_ASSETS_PATH', EE_MSG_ADMIN.'assets/'); |
|
33 | + define('EE_MSG_ASSETS_URL', EE_ADMIN_PAGES_URL.'messages/assets/'); |
|
34 | + define('EE_MSG_TEMPLATE_PATH', EE_MSG_ADMIN.'templates/'); |
|
35 | + define('EE_MSG_TEMPLATE_URL', EE_ADMIN_PAGES_URL.'messages/templates/'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | parent::__construct(); |
@@ -13,52 +13,52 @@ |
||
13 | 13 | */ |
14 | 14 | class Messages_Admin_Page_Init extends EE_Admin_Page_Init |
15 | 15 | { |
16 | - /** |
|
17 | - *constructor |
|
18 | - * |
|
19 | - * @Constructor |
|
20 | - * @access public |
|
21 | - * @return void |
|
22 | - */ |
|
23 | - public function __construct() |
|
24 | - { |
|
16 | + /** |
|
17 | + *constructor |
|
18 | + * |
|
19 | + * @Constructor |
|
20 | + * @access public |
|
21 | + * @return void |
|
22 | + */ |
|
23 | + public function __construct() |
|
24 | + { |
|
25 | 25 | |
26 | - do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
26 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
27 | 27 | |
28 | - if (! defined('EE_MSG_PG_SLUG')) { |
|
29 | - define('EE_MSG_PG_SLUG', 'espresso_messages'); |
|
30 | - define('EE_MSG_PG_NAME', ucwords(str_replace('_', '', EE_MSG_PG_SLUG))); |
|
31 | - define('EE_MSG_ADMIN', EE_ADMIN_PAGES . 'messages/'); |
|
32 | - define('EE_MSG_ADMIN_URL', admin_url('admin.php?page=' . EE_MSG_PG_SLUG)); |
|
33 | - define('EE_MSG_ASSETS_PATH', EE_MSG_ADMIN . 'assets/'); |
|
34 | - define('EE_MSG_ASSETS_URL', EE_ADMIN_PAGES_URL . 'messages/assets/'); |
|
35 | - define('EE_MSG_TEMPLATE_PATH', EE_MSG_ADMIN . 'templates/'); |
|
36 | - define('EE_MSG_TEMPLATE_URL', EE_ADMIN_PAGES_URL . 'messages/templates/'); |
|
37 | - } |
|
28 | + if (! defined('EE_MSG_PG_SLUG')) { |
|
29 | + define('EE_MSG_PG_SLUG', 'espresso_messages'); |
|
30 | + define('EE_MSG_PG_NAME', ucwords(str_replace('_', '', EE_MSG_PG_SLUG))); |
|
31 | + define('EE_MSG_ADMIN', EE_ADMIN_PAGES . 'messages/'); |
|
32 | + define('EE_MSG_ADMIN_URL', admin_url('admin.php?page=' . EE_MSG_PG_SLUG)); |
|
33 | + define('EE_MSG_ASSETS_PATH', EE_MSG_ADMIN . 'assets/'); |
|
34 | + define('EE_MSG_ASSETS_URL', EE_ADMIN_PAGES_URL . 'messages/assets/'); |
|
35 | + define('EE_MSG_TEMPLATE_PATH', EE_MSG_ADMIN . 'templates/'); |
|
36 | + define('EE_MSG_TEMPLATE_URL', EE_ADMIN_PAGES_URL . 'messages/templates/'); |
|
37 | + } |
|
38 | 38 | |
39 | - parent::__construct(); |
|
40 | - } |
|
39 | + parent::__construct(); |
|
40 | + } |
|
41 | 41 | |
42 | 42 | |
43 | - protected function _set_init_properties() |
|
44 | - { |
|
45 | - $this->label = esc_html__('Messages System', 'event_espresso'); |
|
46 | - } |
|
43 | + protected function _set_init_properties() |
|
44 | + { |
|
45 | + $this->label = esc_html__('Messages System', 'event_espresso'); |
|
46 | + } |
|
47 | 47 | |
48 | 48 | |
49 | - protected function _set_menu_map() |
|
50 | - { |
|
51 | - $this->_menu_map = new EE_Admin_Page_Sub_Menu( |
|
52 | - array( |
|
53 | - 'menu_group' => 'management', |
|
54 | - 'menu_order' => 10, |
|
55 | - 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |
|
56 | - 'parent_slug' => 'espresso_events', |
|
57 | - 'menu_slug' => EE_MSG_PG_SLUG, |
|
58 | - 'menu_label' => esc_html__('Messages', 'event_espresso'), |
|
59 | - 'capability' => 'ee_read_global_messages', |
|
60 | - 'admin_init_page' => $this, |
|
61 | - ) |
|
62 | - ); |
|
63 | - } |
|
49 | + protected function _set_menu_map() |
|
50 | + { |
|
51 | + $this->_menu_map = new EE_Admin_Page_Sub_Menu( |
|
52 | + array( |
|
53 | + 'menu_group' => 'management', |
|
54 | + 'menu_order' => 10, |
|
55 | + 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |
|
56 | + 'parent_slug' => 'espresso_events', |
|
57 | + 'menu_slug' => EE_MSG_PG_SLUG, |
|
58 | + 'menu_label' => esc_html__('Messages', 'event_espresso'), |
|
59 | + 'capability' => 'ee_read_global_messages', |
|
60 | + 'admin_init_page' => $this, |
|
61 | + ) |
|
62 | + ); |
|
63 | + } |
|
64 | 64 | } |
@@ -23,15 +23,15 @@ |
||
23 | 23 | public function __construct() |
24 | 24 | { |
25 | 25 | do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
26 | - if (! defined('REG_PG_SLUG')) { |
|
26 | + if ( ! defined('REG_PG_SLUG')) { |
|
27 | 27 | define('REG_PG_SLUG', 'espresso_registrations'); |
28 | 28 | define('REG_PG_NAME', ucwords(str_replace('_', '', REG_PG_SLUG))); |
29 | - define('REG_ADMIN', EE_ADMIN_PAGES . 'registrations/'); |
|
30 | - define('REG_ADMIN_URL', admin_url('admin.php?page=' . REG_PG_SLUG)); |
|
31 | - define('REG_ASSETS_PATH', REG_ADMIN . 'assets/'); |
|
32 | - define('REG_ASSETS_URL', EE_ADMIN_PAGES_URL . 'registrations/assets/'); |
|
33 | - define('REG_TEMPLATE_PATH', REG_ADMIN . 'templates/'); |
|
34 | - define('REG_TEMPLATE_URL', EE_ADMIN_PAGES_URL . 'registrations/templates/'); |
|
29 | + define('REG_ADMIN', EE_ADMIN_PAGES.'registrations/'); |
|
30 | + define('REG_ADMIN_URL', admin_url('admin.php?page='.REG_PG_SLUG)); |
|
31 | + define('REG_ASSETS_PATH', REG_ADMIN.'assets/'); |
|
32 | + define('REG_ASSETS_URL', EE_ADMIN_PAGES_URL.'registrations/assets/'); |
|
33 | + define('REG_TEMPLATE_PATH', REG_ADMIN.'templates/'); |
|
34 | + define('REG_TEMPLATE_URL', EE_ADMIN_PAGES_URL.'registrations/templates/'); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | parent::__construct(); |
@@ -11,50 +11,50 @@ |
||
11 | 11 | */ |
12 | 12 | class Registrations_Admin_Page_Init extends EE_Admin_Page_CPT_Init |
13 | 13 | { |
14 | - /** |
|
15 | - * constructor |
|
16 | - * |
|
17 | - * @Constructor |
|
18 | - * @access public |
|
19 | - * @return void |
|
20 | - */ |
|
21 | - public function __construct() |
|
22 | - { |
|
23 | - do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
24 | - if (! defined('REG_PG_SLUG')) { |
|
25 | - define('REG_PG_SLUG', 'espresso_registrations'); |
|
26 | - define('REG_PG_NAME', ucwords(str_replace('_', '', REG_PG_SLUG))); |
|
27 | - define('REG_ADMIN', EE_ADMIN_PAGES . 'registrations/'); |
|
28 | - define('REG_ADMIN_URL', admin_url('admin.php?page=' . REG_PG_SLUG)); |
|
29 | - define('REG_ASSETS_PATH', REG_ADMIN . 'assets/'); |
|
30 | - define('REG_ASSETS_URL', EE_ADMIN_PAGES_URL . 'registrations/assets/'); |
|
31 | - define('REG_TEMPLATE_PATH', REG_ADMIN . 'templates/'); |
|
32 | - define('REG_TEMPLATE_URL', EE_ADMIN_PAGES_URL . 'registrations/templates/'); |
|
33 | - } |
|
14 | + /** |
|
15 | + * constructor |
|
16 | + * |
|
17 | + * @Constructor |
|
18 | + * @access public |
|
19 | + * @return void |
|
20 | + */ |
|
21 | + public function __construct() |
|
22 | + { |
|
23 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
24 | + if (! defined('REG_PG_SLUG')) { |
|
25 | + define('REG_PG_SLUG', 'espresso_registrations'); |
|
26 | + define('REG_PG_NAME', ucwords(str_replace('_', '', REG_PG_SLUG))); |
|
27 | + define('REG_ADMIN', EE_ADMIN_PAGES . 'registrations/'); |
|
28 | + define('REG_ADMIN_URL', admin_url('admin.php?page=' . REG_PG_SLUG)); |
|
29 | + define('REG_ASSETS_PATH', REG_ADMIN . 'assets/'); |
|
30 | + define('REG_ASSETS_URL', EE_ADMIN_PAGES_URL . 'registrations/assets/'); |
|
31 | + define('REG_TEMPLATE_PATH', REG_ADMIN . 'templates/'); |
|
32 | + define('REG_TEMPLATE_URL', EE_ADMIN_PAGES_URL . 'registrations/templates/'); |
|
33 | + } |
|
34 | 34 | |
35 | - parent::__construct(); |
|
36 | - } |
|
35 | + parent::__construct(); |
|
36 | + } |
|
37 | 37 | |
38 | 38 | |
39 | - protected function _set_init_properties() |
|
40 | - { |
|
41 | - $this->label = esc_html__('Registrations Overview', 'event_espresso'); |
|
42 | - } |
|
39 | + protected function _set_init_properties() |
|
40 | + { |
|
41 | + $this->label = esc_html__('Registrations Overview', 'event_espresso'); |
|
42 | + } |
|
43 | 43 | |
44 | 44 | |
45 | - protected function _set_menu_map() |
|
46 | - { |
|
47 | - $this->_menu_map = new EE_Admin_Page_Sub_Menu( |
|
48 | - array( |
|
49 | - 'menu_group' => 'main', |
|
50 | - 'menu_order' => 40, |
|
51 | - 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |
|
52 | - 'parent_slug' => 'espresso_events', |
|
53 | - 'menu_slug' => REG_PG_SLUG, |
|
54 | - 'menu_label' => esc_html__('Registrations', 'event_espresso'), |
|
55 | - 'capability' => 'ee_read_registrations', |
|
56 | - 'admin_init_page' => $this, |
|
57 | - ) |
|
58 | - ); |
|
59 | - } |
|
45 | + protected function _set_menu_map() |
|
46 | + { |
|
47 | + $this->_menu_map = new EE_Admin_Page_Sub_Menu( |
|
48 | + array( |
|
49 | + 'menu_group' => 'main', |
|
50 | + 'menu_order' => 40, |
|
51 | + 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |
|
52 | + 'parent_slug' => 'espresso_events', |
|
53 | + 'menu_slug' => REG_PG_SLUG, |
|
54 | + 'menu_label' => esc_html__('Registrations', 'event_espresso'), |
|
55 | + 'capability' => 'ee_read_registrations', |
|
56 | + 'admin_init_page' => $this, |
|
57 | + ) |
|
58 | + ); |
|
59 | + } |
|
60 | 60 | } |
@@ -20,18 +20,18 @@ |
||
20 | 20 | */ |
21 | 21 | public function __construct($pm_instance = null) |
22 | 22 | { |
23 | - require_once($this->file_folder() . 'EEG_Paypal_Express.gateway.php'); |
|
23 | + require_once($this->file_folder().'EEG_Paypal_Express.gateway.php'); |
|
24 | 24 | $this->_gateway = new EEG_Paypal_Express(); |
25 | 25 | |
26 | 26 | $this->_pretty_name = esc_html__('PayPal Express', 'event_espresso'); |
27 | - $this->_template_path = $this->file_folder() . 'templates/'; |
|
27 | + $this->_template_path = $this->file_folder().'templates/'; |
|
28 | 28 | $this->_default_description = esc_html__( |
29 | 29 | // @codingStandardsIgnoreStart |
30 | 30 | 'After clicking \'Finalize Registration\', you will be forwarded to PayPal website to Login and make your payment.', |
31 | 31 | // @codingStandardsIgnoreEnd |
32 | 32 | 'event_espresso' |
33 | 33 | ); |
34 | - $this->_default_button_url = $this->file_url() . 'lib/paypal-express-checkout-logo-gold-160.png'; |
|
34 | + $this->_default_button_url = $this->file_url().'lib/paypal-express-checkout-logo-gold-160.png'; |
|
35 | 35 | |
36 | 36 | parent::__construct($pm_instance); |
37 | 37 | } |
@@ -14,89 +14,89 @@ |
||
14 | 14 | */ |
15 | 15 | class EE_PMT_Paypal_Express extends EE_PMT_Base |
16 | 16 | { |
17 | - /** |
|
18 | - * EE_PMT_Paypal_Express constructor. |
|
19 | - */ |
|
20 | - public function __construct($pm_instance = null) |
|
21 | - { |
|
22 | - require_once($this->file_folder() . 'EEG_Paypal_Express.gateway.php'); |
|
23 | - $this->_gateway = new EEG_Paypal_Express(); |
|
17 | + /** |
|
18 | + * EE_PMT_Paypal_Express constructor. |
|
19 | + */ |
|
20 | + public function __construct($pm_instance = null) |
|
21 | + { |
|
22 | + require_once($this->file_folder() . 'EEG_Paypal_Express.gateway.php'); |
|
23 | + $this->_gateway = new EEG_Paypal_Express(); |
|
24 | 24 | |
25 | - $this->_pretty_name = esc_html__('PayPal Express', 'event_espresso'); |
|
26 | - $this->_template_path = $this->file_folder() . 'templates/'; |
|
27 | - $this->_default_description = esc_html__( |
|
28 | - // @codingStandardsIgnoreStart |
|
29 | - 'After clicking \'Finalize Registration\', you will be forwarded to PayPal website to Login and make your payment.', |
|
30 | - // @codingStandardsIgnoreEnd |
|
31 | - 'event_espresso' |
|
32 | - ); |
|
33 | - $this->_default_button_url = $this->file_url() . 'lib/paypal-express-checkout-logo-gold-160.png'; |
|
25 | + $this->_pretty_name = esc_html__('PayPal Express', 'event_espresso'); |
|
26 | + $this->_template_path = $this->file_folder() . 'templates/'; |
|
27 | + $this->_default_description = esc_html__( |
|
28 | + // @codingStandardsIgnoreStart |
|
29 | + 'After clicking \'Finalize Registration\', you will be forwarded to PayPal website to Login and make your payment.', |
|
30 | + // @codingStandardsIgnoreEnd |
|
31 | + 'event_espresso' |
|
32 | + ); |
|
33 | + $this->_default_button_url = $this->file_url() . 'lib/paypal-express-checkout-logo-gold-160.png'; |
|
34 | 34 | |
35 | - parent::__construct($pm_instance); |
|
36 | - } |
|
35 | + parent::__construct($pm_instance); |
|
36 | + } |
|
37 | 37 | |
38 | 38 | |
39 | - /** |
|
40 | - * Adds the help tab. |
|
41 | - * |
|
42 | - * @see EE_PMT_Base::help_tabs_config() |
|
43 | - * @return array |
|
44 | - */ |
|
45 | - public function help_tabs_config() |
|
46 | - { |
|
47 | - return array( |
|
48 | - $this->get_help_tab_name() => array( |
|
49 | - 'title' => esc_html__('PayPal Express Settings', 'event_espresso'), |
|
50 | - 'filename' => 'payment_methods_overview_paypal_express' |
|
51 | - ) |
|
52 | - ); |
|
53 | - } |
|
39 | + /** |
|
40 | + * Adds the help tab. |
|
41 | + * |
|
42 | + * @see EE_PMT_Base::help_tabs_config() |
|
43 | + * @return array |
|
44 | + */ |
|
45 | + public function help_tabs_config() |
|
46 | + { |
|
47 | + return array( |
|
48 | + $this->get_help_tab_name() => array( |
|
49 | + 'title' => esc_html__('PayPal Express Settings', 'event_espresso'), |
|
50 | + 'filename' => 'payment_methods_overview_paypal_express' |
|
51 | + ) |
|
52 | + ); |
|
53 | + } |
|
54 | 54 | |
55 | 55 | |
56 | - /** |
|
57 | - * Gets the form for all the settings related to this payment method type. |
|
58 | - * |
|
59 | - * @return EE_Payment_Method_Form |
|
60 | - */ |
|
61 | - public function generate_new_settings_form() |
|
62 | - { |
|
63 | - return new SettingsForm(array(), $this->get_help_tab_link()); |
|
64 | - } |
|
56 | + /** |
|
57 | + * Gets the form for all the settings related to this payment method type. |
|
58 | + * |
|
59 | + * @return EE_Payment_Method_Form |
|
60 | + */ |
|
61 | + public function generate_new_settings_form() |
|
62 | + { |
|
63 | + return new SettingsForm(array(), $this->get_help_tab_link()); |
|
64 | + } |
|
65 | 65 | |
66 | 66 | |
67 | - /** |
|
68 | - * Creates a billing form for this payment method type. |
|
69 | - * |
|
70 | - * @param \EE_Transaction $transaction |
|
71 | - * @return \EE_Billing_Info_Form |
|
72 | - */ |
|
73 | - public function generate_new_billing_form(EE_Transaction $transaction = null) |
|
74 | - { |
|
75 | - if ($this->_pm_instance->debug_mode()) { |
|
76 | - $form = new EE_Billing_Info_Form( |
|
77 | - $this->_pm_instance, |
|
78 | - array( |
|
79 | - 'name' => 'paypal_express_Info_Form', |
|
80 | - 'subsections' => array( |
|
81 | - 'paypal_express_debug_info' => new EE_Form_Section_Proper( |
|
82 | - array( |
|
83 | - 'layout_strategy' => new EE_Template_Layout( |
|
84 | - array( |
|
85 | - 'layout_template_file' => $this->_template_path |
|
86 | - . 'paypal_express_debug_info.template.php', |
|
87 | - 'template_args' => array( |
|
88 | - 'debug_mode' => $this->_pm_instance->debug_mode() |
|
89 | - ) |
|
90 | - ) |
|
91 | - ) |
|
92 | - ) |
|
93 | - ) |
|
94 | - ) |
|
95 | - ) |
|
96 | - ); |
|
97 | - return $form; |
|
98 | - } |
|
67 | + /** |
|
68 | + * Creates a billing form for this payment method type. |
|
69 | + * |
|
70 | + * @param \EE_Transaction $transaction |
|
71 | + * @return \EE_Billing_Info_Form |
|
72 | + */ |
|
73 | + public function generate_new_billing_form(EE_Transaction $transaction = null) |
|
74 | + { |
|
75 | + if ($this->_pm_instance->debug_mode()) { |
|
76 | + $form = new EE_Billing_Info_Form( |
|
77 | + $this->_pm_instance, |
|
78 | + array( |
|
79 | + 'name' => 'paypal_express_Info_Form', |
|
80 | + 'subsections' => array( |
|
81 | + 'paypal_express_debug_info' => new EE_Form_Section_Proper( |
|
82 | + array( |
|
83 | + 'layout_strategy' => new EE_Template_Layout( |
|
84 | + array( |
|
85 | + 'layout_template_file' => $this->_template_path |
|
86 | + . 'paypal_express_debug_info.template.php', |
|
87 | + 'template_args' => array( |
|
88 | + 'debug_mode' => $this->_pm_instance->debug_mode() |
|
89 | + ) |
|
90 | + ) |
|
91 | + ) |
|
92 | + ) |
|
93 | + ) |
|
94 | + ) |
|
95 | + ) |
|
96 | + ); |
|
97 | + return $form; |
|
98 | + } |
|
99 | 99 | |
100 | - return false; |
|
101 | - } |
|
100 | + return false; |
|
101 | + } |
|
102 | 102 | } |
@@ -90,7 +90,7 @@ |
||
90 | 90 | { |
91 | 91 | espresso_load_required( |
92 | 92 | 'EE_Request', |
93 | - EE_CORE . 'request_stack/EE_Request.core.php' |
|
93 | + EE_CORE.'request_stack/EE_Request.core.php' |
|
94 | 94 | ); |
95 | 95 | $this->legacy_request = new EE_Request($_GET, $_POST, $_COOKIE, $_SERVER); |
96 | 96 | $this->legacy_request->setRequest($this->request); |
@@ -28,84 +28,84 @@ |
||
28 | 28 | */ |
29 | 29 | class BootstrapRequestResponseObjects |
30 | 30 | { |
31 | - /** |
|
32 | - * @type LegacyRequestInterface $legacy_request |
|
33 | - */ |
|
34 | - protected $legacy_request; |
|
31 | + /** |
|
32 | + * @type LegacyRequestInterface $legacy_request |
|
33 | + */ |
|
34 | + protected $legacy_request; |
|
35 | 35 | |
36 | - /** |
|
37 | - * @type LoaderInterface $loader |
|
38 | - */ |
|
39 | - protected $loader; |
|
36 | + /** |
|
37 | + * @type LoaderInterface $loader |
|
38 | + */ |
|
39 | + protected $loader; |
|
40 | 40 | |
41 | - /** |
|
42 | - * @var RequestInterface $request |
|
43 | - */ |
|
44 | - protected $request; |
|
41 | + /** |
|
42 | + * @var RequestInterface $request |
|
43 | + */ |
|
44 | + protected $request; |
|
45 | 45 | |
46 | - /** |
|
47 | - * @var ResponseInterface $response |
|
48 | - */ |
|
49 | - protected $response; |
|
46 | + /** |
|
47 | + * @var ResponseInterface $response |
|
48 | + */ |
|
49 | + protected $response; |
|
50 | 50 | |
51 | 51 | |
52 | - /** |
|
53 | - * BootstrapRequestResponseObjects constructor. |
|
54 | - * |
|
55 | - * @param LoaderInterface $loader |
|
56 | - */ |
|
57 | - public function __construct(LoaderInterface $loader) |
|
58 | - { |
|
59 | - $this->loader = $loader; |
|
60 | - } |
|
52 | + /** |
|
53 | + * BootstrapRequestResponseObjects constructor. |
|
54 | + * |
|
55 | + * @param LoaderInterface $loader |
|
56 | + */ |
|
57 | + public function __construct(LoaderInterface $loader) |
|
58 | + { |
|
59 | + $this->loader = $loader; |
|
60 | + } |
|
61 | 61 | |
62 | 62 | |
63 | - /** |
|
64 | - * @return void |
|
65 | - */ |
|
66 | - public function buildRequestResponse() |
|
67 | - { |
|
68 | - $request_params = new RequestParams(new RequestSanitizer()); |
|
69 | - $server_params = new ServerParams(new ServerSanitizer()); |
|
70 | - // load our Request and Response objects |
|
71 | - $this->request = new Request($request_params, $server_params); |
|
72 | - $this->response = new Response(); |
|
73 | - $this->loader->share(RequestParams::class, $request_params); |
|
74 | - $this->loader->share(ServerParams::class, $server_params); |
|
75 | - } |
|
63 | + /** |
|
64 | + * @return void |
|
65 | + */ |
|
66 | + public function buildRequestResponse() |
|
67 | + { |
|
68 | + $request_params = new RequestParams(new RequestSanitizer()); |
|
69 | + $server_params = new ServerParams(new ServerSanitizer()); |
|
70 | + // load our Request and Response objects |
|
71 | + $this->request = new Request($request_params, $server_params); |
|
72 | + $this->response = new Response(); |
|
73 | + $this->loader->share(RequestParams::class, $request_params); |
|
74 | + $this->loader->share(ServerParams::class, $server_params); |
|
75 | + } |
|
76 | 76 | |
77 | 77 | |
78 | - /** |
|
79 | - * @return void |
|
80 | - * @throws InvalidArgumentException |
|
81 | - */ |
|
82 | - public function shareRequestResponse() |
|
83 | - { |
|
84 | - $this->loader->share('EventEspresso\core\services\request\Request', $this->request); |
|
85 | - $this->loader->share('EventEspresso\core\services\request\Response', $this->response); |
|
86 | - EE_Dependency_Map::instance()->setRequest($this->request); |
|
87 | - EE_Dependency_Map::instance()->setResponse($this->response); |
|
88 | - } |
|
78 | + /** |
|
79 | + * @return void |
|
80 | + * @throws InvalidArgumentException |
|
81 | + */ |
|
82 | + public function shareRequestResponse() |
|
83 | + { |
|
84 | + $this->loader->share('EventEspresso\core\services\request\Request', $this->request); |
|
85 | + $this->loader->share('EventEspresso\core\services\request\Response', $this->response); |
|
86 | + EE_Dependency_Map::instance()->setRequest($this->request); |
|
87 | + EE_Dependency_Map::instance()->setResponse($this->response); |
|
88 | + } |
|
89 | 89 | |
90 | 90 | |
91 | - /** |
|
92 | - * @return void |
|
93 | - * @throws InvalidArgumentException |
|
94 | - * @throws EE_Error |
|
95 | - */ |
|
96 | - public function setupLegacyRequest() |
|
97 | - { |
|
98 | - espresso_load_required( |
|
99 | - 'EE_Request', |
|
100 | - EE_CORE . 'request_stack/EE_Request.core.php' |
|
101 | - ); |
|
102 | - $this->legacy_request = new EE_Request($_GET, $_POST, $_COOKIE, $_SERVER); |
|
103 | - $this->legacy_request->setRequest($this->request); |
|
104 | - $this->legacy_request->admin = $this->request->isAdmin(); |
|
105 | - $this->legacy_request->ajax = $this->request->isAjax(); |
|
106 | - $this->legacy_request->front_ajax = $this->request->isFrontAjax(); |
|
107 | - EE_Dependency_Map::instance()->setLegacyRequest($this->legacy_request); |
|
108 | - $this->loader->share('EE_Request', $this->legacy_request); |
|
109 | - $this->loader->share('EventEspresso\core\services\request\LegacyRequestInterface', $this->legacy_request); |
|
110 | - } |
|
91 | + /** |
|
92 | + * @return void |
|
93 | + * @throws InvalidArgumentException |
|
94 | + * @throws EE_Error |
|
95 | + */ |
|
96 | + public function setupLegacyRequest() |
|
97 | + { |
|
98 | + espresso_load_required( |
|
99 | + 'EE_Request', |
|
100 | + EE_CORE . 'request_stack/EE_Request.core.php' |
|
101 | + ); |
|
102 | + $this->legacy_request = new EE_Request($_GET, $_POST, $_COOKIE, $_SERVER); |
|
103 | + $this->legacy_request->setRequest($this->request); |
|
104 | + $this->legacy_request->admin = $this->request->isAdmin(); |
|
105 | + $this->legacy_request->ajax = $this->request->isAjax(); |
|
106 | + $this->legacy_request->front_ajax = $this->request->isFrontAjax(); |
|
107 | + EE_Dependency_Map::instance()->setLegacyRequest($this->legacy_request); |
|
108 | + $this->loader->share('EE_Request', $this->legacy_request); |
|
109 | + $this->loader->share('EventEspresso\core\services\request\LegacyRequestInterface', $this->legacy_request); |
|
110 | + } |
|
111 | 111 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | // load interfaces |
200 | 200 | espresso_load_required( |
201 | 201 | 'EEH_Autoloader', |
202 | - EE_CORE . 'helpers/EEH_Autoloader.helper.php' |
|
202 | + EE_CORE.'helpers/EEH_Autoloader.helper.php' |
|
203 | 203 | ); |
204 | 204 | EEH_Autoloader::instance(); |
205 | 205 | } |
@@ -213,13 +213,13 @@ discard block |
||
213 | 213 | protected function setAutoloadersForRequiredFiles() |
214 | 214 | { |
215 | 215 | // load interfaces |
216 | - EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE . 'interfaces', true); |
|
216 | + EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE.'interfaces', true); |
|
217 | 217 | // load helpers |
218 | 218 | EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_HELPERS); |
219 | 219 | // register legacy request stack classes just in case |
220 | - EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE . 'request_stack/'); |
|
220 | + EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE.'request_stack/'); |
|
221 | 221 | // register legacy middleware classes just in case |
222 | - EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE . 'middleware/'); |
|
222 | + EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE.'middleware/'); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 |
@@ -46,225 +46,225 @@ |
||
46 | 46 | */ |
47 | 47 | class BootstrapCore |
48 | 48 | { |
49 | - /** |
|
50 | - * @type LoaderInterface $loader |
|
51 | - */ |
|
52 | - private $loader; |
|
49 | + /** |
|
50 | + * @type LoaderInterface $loader |
|
51 | + */ |
|
52 | + private $loader; |
|
53 | 53 | |
54 | - /** |
|
55 | - * @var RequestInterface $request |
|
56 | - */ |
|
57 | - protected $request; |
|
54 | + /** |
|
55 | + * @var RequestInterface $request |
|
56 | + */ |
|
57 | + protected $request; |
|
58 | 58 | |
59 | - /** |
|
60 | - * @var ResponseInterface $response |
|
61 | - */ |
|
62 | - protected $response; |
|
59 | + /** |
|
60 | + * @var ResponseInterface $response |
|
61 | + */ |
|
62 | + protected $response; |
|
63 | 63 | |
64 | - /** |
|
65 | - * @var RequestStackBuilder $request_stack_builder |
|
66 | - */ |
|
67 | - protected $request_stack_builder; |
|
64 | + /** |
|
65 | + * @var RequestStackBuilder $request_stack_builder |
|
66 | + */ |
|
67 | + protected $request_stack_builder; |
|
68 | 68 | |
69 | - /** |
|
70 | - * @var RequestStack $request_stack |
|
71 | - */ |
|
72 | - protected $request_stack; |
|
69 | + /** |
|
70 | + * @var RequestStack $request_stack |
|
71 | + */ |
|
72 | + protected $request_stack; |
|
73 | 73 | |
74 | 74 | |
75 | - /** |
|
76 | - * BootstrapCore constructor. |
|
77 | - */ |
|
78 | - public function __construct() |
|
79 | - { |
|
80 | - do_action('AHEE__EventEspresso_core_services_bootstrap_BootstrapCore___construct'); |
|
81 | - // construct request stack and run middleware apps as soon as all WP plugins are loaded |
|
82 | - add_action('plugins_loaded', array($this, 'initialize'), 0); |
|
83 | - } |
|
75 | + /** |
|
76 | + * BootstrapCore constructor. |
|
77 | + */ |
|
78 | + public function __construct() |
|
79 | + { |
|
80 | + do_action('AHEE__EventEspresso_core_services_bootstrap_BootstrapCore___construct'); |
|
81 | + // construct request stack and run middleware apps as soon as all WP plugins are loaded |
|
82 | + add_action('plugins_loaded', array($this, 'initialize'), 0); |
|
83 | + } |
|
84 | 84 | |
85 | 85 | |
86 | - /** |
|
87 | - * @throws DomainException |
|
88 | - * @throws EE_Error |
|
89 | - * @throws Exception |
|
90 | - * @throws InvalidArgumentException |
|
91 | - * @throws InvalidClassException |
|
92 | - * @throws InvalidDataTypeException |
|
93 | - * @throws InvalidFilePathException |
|
94 | - * @throws InvalidInterfaceException |
|
95 | - * @throws InvalidRequestStackMiddlewareException |
|
96 | - * @throws OutOfBoundsException |
|
97 | - * @throws ReflectionException |
|
98 | - */ |
|
99 | - public function initialize() |
|
100 | - { |
|
101 | - $this->bootstrapDependencyInjectionContainer(); |
|
102 | - $this->bootstrapDomain(); |
|
103 | - $bootstrap_request = $this->bootstrapRequestResponseObjects(); |
|
104 | - add_action( |
|
105 | - 'EE_Load_Espresso_Core__handle_request__initialize_core_loading', |
|
106 | - array($bootstrap_request, 'setupLegacyRequest') |
|
107 | - ); |
|
108 | - $this->runRequestStack(); |
|
109 | - } |
|
86 | + /** |
|
87 | + * @throws DomainException |
|
88 | + * @throws EE_Error |
|
89 | + * @throws Exception |
|
90 | + * @throws InvalidArgumentException |
|
91 | + * @throws InvalidClassException |
|
92 | + * @throws InvalidDataTypeException |
|
93 | + * @throws InvalidFilePathException |
|
94 | + * @throws InvalidInterfaceException |
|
95 | + * @throws InvalidRequestStackMiddlewareException |
|
96 | + * @throws OutOfBoundsException |
|
97 | + * @throws ReflectionException |
|
98 | + */ |
|
99 | + public function initialize() |
|
100 | + { |
|
101 | + $this->bootstrapDependencyInjectionContainer(); |
|
102 | + $this->bootstrapDomain(); |
|
103 | + $bootstrap_request = $this->bootstrapRequestResponseObjects(); |
|
104 | + add_action( |
|
105 | + 'EE_Load_Espresso_Core__handle_request__initialize_core_loading', |
|
106 | + array($bootstrap_request, 'setupLegacyRequest') |
|
107 | + ); |
|
108 | + $this->runRequestStack(); |
|
109 | + } |
|
110 | 110 | |
111 | 111 | |
112 | - /** |
|
113 | - * @throws ReflectionException |
|
114 | - * @throws EE_Error |
|
115 | - * @throws InvalidArgumentException |
|
116 | - * @throws InvalidDataTypeException |
|
117 | - * @throws InvalidInterfaceException |
|
118 | - * @throws OutOfBoundsException |
|
119 | - */ |
|
120 | - private function bootstrapDependencyInjectionContainer() |
|
121 | - { |
|
122 | - $bootstrap_di = new BootstrapDependencyInjectionContainer(); |
|
123 | - $bootstrap_di->buildLegacyDependencyInjectionContainer(); |
|
124 | - $bootstrap_di->buildLoader(); |
|
125 | - $registry = $bootstrap_di->getRegistry(); |
|
126 | - $dependency_map = $bootstrap_di->getDependencyMap(); |
|
127 | - $dependency_map->initialize(); |
|
128 | - $registry->initialize(); |
|
129 | - $this->loader = $bootstrap_di->getLoader(); |
|
130 | - } |
|
112 | + /** |
|
113 | + * @throws ReflectionException |
|
114 | + * @throws EE_Error |
|
115 | + * @throws InvalidArgumentException |
|
116 | + * @throws InvalidDataTypeException |
|
117 | + * @throws InvalidInterfaceException |
|
118 | + * @throws OutOfBoundsException |
|
119 | + */ |
|
120 | + private function bootstrapDependencyInjectionContainer() |
|
121 | + { |
|
122 | + $bootstrap_di = new BootstrapDependencyInjectionContainer(); |
|
123 | + $bootstrap_di->buildLegacyDependencyInjectionContainer(); |
|
124 | + $bootstrap_di->buildLoader(); |
|
125 | + $registry = $bootstrap_di->getRegistry(); |
|
126 | + $dependency_map = $bootstrap_di->getDependencyMap(); |
|
127 | + $dependency_map->initialize(); |
|
128 | + $registry->initialize(); |
|
129 | + $this->loader = $bootstrap_di->getLoader(); |
|
130 | + } |
|
131 | 131 | |
132 | 132 | |
133 | - /** |
|
134 | - * configures the Domain object for core |
|
135 | - * |
|
136 | - * @return void |
|
137 | - * @throws DomainException |
|
138 | - * @throws InvalidArgumentException |
|
139 | - * @throws InvalidDataTypeException |
|
140 | - * @throws InvalidClassException |
|
141 | - * @throws InvalidFilePathException |
|
142 | - * @throws InvalidInterfaceException |
|
143 | - */ |
|
144 | - private function bootstrapDomain() |
|
145 | - { |
|
146 | - DomainFactory::getEventEspressoCoreDomain(); |
|
147 | - } |
|
133 | + /** |
|
134 | + * configures the Domain object for core |
|
135 | + * |
|
136 | + * @return void |
|
137 | + * @throws DomainException |
|
138 | + * @throws InvalidArgumentException |
|
139 | + * @throws InvalidDataTypeException |
|
140 | + * @throws InvalidClassException |
|
141 | + * @throws InvalidFilePathException |
|
142 | + * @throws InvalidInterfaceException |
|
143 | + */ |
|
144 | + private function bootstrapDomain() |
|
145 | + { |
|
146 | + DomainFactory::getEventEspressoCoreDomain(); |
|
147 | + } |
|
148 | 148 | |
149 | 149 | |
150 | - /** |
|
151 | - * sets up the request and response objects |
|
152 | - * |
|
153 | - * @return BootstrapRequestResponseObjects |
|
154 | - * @throws InvalidArgumentException |
|
155 | - */ |
|
156 | - private function bootstrapRequestResponseObjects() |
|
157 | - { |
|
158 | - /** @var BootstrapRequestResponseObjects $bootstrap_request */ |
|
159 | - $bootstrap_request = $this->loader->getShared( |
|
160 | - 'EventEspresso\core\services\bootstrap\BootstrapRequestResponseObjects', |
|
161 | - array($this->loader) |
|
162 | - ); |
|
163 | - $bootstrap_request->buildRequestResponse(); |
|
164 | - $bootstrap_request->shareRequestResponse(); |
|
165 | - $this->request = $this->loader->getShared('EventEspresso\core\services\request\Request'); |
|
166 | - $this->response = $this->loader->getShared('EventEspresso\core\services\request\Response'); |
|
167 | - return $bootstrap_request; |
|
168 | - } |
|
150 | + /** |
|
151 | + * sets up the request and response objects |
|
152 | + * |
|
153 | + * @return BootstrapRequestResponseObjects |
|
154 | + * @throws InvalidArgumentException |
|
155 | + */ |
|
156 | + private function bootstrapRequestResponseObjects() |
|
157 | + { |
|
158 | + /** @var BootstrapRequestResponseObjects $bootstrap_request */ |
|
159 | + $bootstrap_request = $this->loader->getShared( |
|
160 | + 'EventEspresso\core\services\bootstrap\BootstrapRequestResponseObjects', |
|
161 | + array($this->loader) |
|
162 | + ); |
|
163 | + $bootstrap_request->buildRequestResponse(); |
|
164 | + $bootstrap_request->shareRequestResponse(); |
|
165 | + $this->request = $this->loader->getShared('EventEspresso\core\services\request\Request'); |
|
166 | + $this->response = $this->loader->getShared('EventEspresso\core\services\request\Response'); |
|
167 | + return $bootstrap_request; |
|
168 | + } |
|
169 | 169 | |
170 | 170 | |
171 | - /** |
|
172 | - * run_request_stack |
|
173 | - * construct request stack and run middleware apps |
|
174 | - * |
|
175 | - * @throws EE_Error |
|
176 | - * @throws Exception |
|
177 | - */ |
|
178 | - public function runRequestStack() |
|
179 | - { |
|
180 | - $this->loadAutoloader(); |
|
181 | - $this->setAutoloadersForRequiredFiles(); |
|
182 | - $this->request_stack_builder = $this->buildRequestStack(); |
|
183 | - $this->request_stack = $this->request_stack_builder->resolve( |
|
184 | - new RequestStackCoreApp() |
|
185 | - ); |
|
186 | - $this->request_stack->handleRequest($this->request, $this->response); |
|
187 | - $this->request_stack->handleResponse(); |
|
188 | - } |
|
171 | + /** |
|
172 | + * run_request_stack |
|
173 | + * construct request stack and run middleware apps |
|
174 | + * |
|
175 | + * @throws EE_Error |
|
176 | + * @throws Exception |
|
177 | + */ |
|
178 | + public function runRequestStack() |
|
179 | + { |
|
180 | + $this->loadAutoloader(); |
|
181 | + $this->setAutoloadersForRequiredFiles(); |
|
182 | + $this->request_stack_builder = $this->buildRequestStack(); |
|
183 | + $this->request_stack = $this->request_stack_builder->resolve( |
|
184 | + new RequestStackCoreApp() |
|
185 | + ); |
|
186 | + $this->request_stack->handleRequest($this->request, $this->response); |
|
187 | + $this->request_stack->handleResponse(); |
|
188 | + } |
|
189 | 189 | |
190 | 190 | |
191 | - /** |
|
192 | - * load_autoloader |
|
193 | - * |
|
194 | - * @throws EE_Error |
|
195 | - */ |
|
196 | - protected function loadAutoloader() |
|
197 | - { |
|
198 | - // load interfaces |
|
199 | - espresso_load_required( |
|
200 | - 'EEH_Autoloader', |
|
201 | - EE_CORE . 'helpers/EEH_Autoloader.helper.php' |
|
202 | - ); |
|
203 | - EEH_Autoloader::instance(); |
|
204 | - } |
|
191 | + /** |
|
192 | + * load_autoloader |
|
193 | + * |
|
194 | + * @throws EE_Error |
|
195 | + */ |
|
196 | + protected function loadAutoloader() |
|
197 | + { |
|
198 | + // load interfaces |
|
199 | + espresso_load_required( |
|
200 | + 'EEH_Autoloader', |
|
201 | + EE_CORE . 'helpers/EEH_Autoloader.helper.php' |
|
202 | + ); |
|
203 | + EEH_Autoloader::instance(); |
|
204 | + } |
|
205 | 205 | |
206 | 206 | |
207 | - /** |
|
208 | - * load_required_files |
|
209 | - * |
|
210 | - * @throws EE_Error |
|
211 | - */ |
|
212 | - protected function setAutoloadersForRequiredFiles() |
|
213 | - { |
|
214 | - // load interfaces |
|
215 | - EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE . 'interfaces', true); |
|
216 | - // load helpers |
|
217 | - EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_HELPERS); |
|
218 | - // register legacy request stack classes just in case |
|
219 | - EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE . 'request_stack/'); |
|
220 | - // register legacy middleware classes just in case |
|
221 | - EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE . 'middleware/'); |
|
222 | - } |
|
207 | + /** |
|
208 | + * load_required_files |
|
209 | + * |
|
210 | + * @throws EE_Error |
|
211 | + */ |
|
212 | + protected function setAutoloadersForRequiredFiles() |
|
213 | + { |
|
214 | + // load interfaces |
|
215 | + EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE . 'interfaces', true); |
|
216 | + // load helpers |
|
217 | + EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_HELPERS); |
|
218 | + // register legacy request stack classes just in case |
|
219 | + EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE . 'request_stack/'); |
|
220 | + // register legacy middleware classes just in case |
|
221 | + EEH_Autoloader::register_autoloaders_for_each_file_in_folder(EE_CORE . 'middleware/'); |
|
222 | + } |
|
223 | 223 | |
224 | 224 | |
225 | - /** |
|
226 | - * build_request_stack |
|
227 | - * |
|
228 | - * @return RequestStackBuilder |
|
229 | - */ |
|
230 | - public function buildRequestStack() |
|
231 | - { |
|
232 | - $request_stack_builder = new RequestStackBuilder($this->loader); |
|
233 | - /** |
|
234 | - * ! IMPORTANT ! The middleware stack operates FILO : FIRST IN LAST OUT |
|
235 | - * so items at the beginning of the final middleware stack will run last. |
|
236 | - * First parameter is the middleware classname, second is an array of arguments |
|
237 | - */ |
|
238 | - $stack_apps = apply_filters( |
|
239 | - 'FHEE__EventEspresso_core_services_bootstrap_BootstrapCore__buildRequestStack__stack_apps', |
|
240 | - array( |
|
241 | - // first in last out |
|
242 | - 'EventEspresso\core\services\request\middleware\BotDetector' => array(), |
|
243 | - 'EventEspresso\core\services\request\middleware\DetectFileEditorRequest' => array(), |
|
244 | - 'EventEspresso\core\services\request\middleware\PreProductionVersionWarning' => array(), |
|
245 | - 'EventEspresso\core\services\request\middleware\RecommendedVersions' => array(), |
|
246 | - // last in first out |
|
247 | - 'EventEspresso\core\services\request\middleware\DetectLogin' => array(), |
|
248 | - ) |
|
249 | - ); |
|
250 | - // legacy filter for backwards compatibility |
|
251 | - $stack_apps = apply_filters( |
|
252 | - 'FHEE__EE_Bootstrap__build_request_stack__stack_apps', |
|
253 | - $stack_apps |
|
254 | - ); |
|
255 | - // load middleware onto stack : FILO (First In Last Out) |
|
256 | - // items at the beginning of the $stack_apps array will run last |
|
257 | - foreach ((array) $stack_apps as $stack_app => $stack_app_args) { |
|
258 | - $request_stack_builder->push(array($stack_app, $stack_app_args)); |
|
259 | - } |
|
260 | - // finally, we'll add this on its own because we need it to always be part of the stack |
|
261 | - // and we also need it to always run first because the rest of the system relies on it |
|
262 | - $request_stack_builder->push( |
|
263 | - array('EventEspresso\core\services\request\middleware\SetRequestTypeContextChecker', array()) |
|
264 | - ); |
|
265 | - return apply_filters( |
|
266 | - 'FHEE__EE_Bootstrap__build_request_stack__request_stack_builder', |
|
267 | - $request_stack_builder |
|
268 | - ); |
|
269 | - } |
|
225 | + /** |
|
226 | + * build_request_stack |
|
227 | + * |
|
228 | + * @return RequestStackBuilder |
|
229 | + */ |
|
230 | + public function buildRequestStack() |
|
231 | + { |
|
232 | + $request_stack_builder = new RequestStackBuilder($this->loader); |
|
233 | + /** |
|
234 | + * ! IMPORTANT ! The middleware stack operates FILO : FIRST IN LAST OUT |
|
235 | + * so items at the beginning of the final middleware stack will run last. |
|
236 | + * First parameter is the middleware classname, second is an array of arguments |
|
237 | + */ |
|
238 | + $stack_apps = apply_filters( |
|
239 | + 'FHEE__EventEspresso_core_services_bootstrap_BootstrapCore__buildRequestStack__stack_apps', |
|
240 | + array( |
|
241 | + // first in last out |
|
242 | + 'EventEspresso\core\services\request\middleware\BotDetector' => array(), |
|
243 | + 'EventEspresso\core\services\request\middleware\DetectFileEditorRequest' => array(), |
|
244 | + 'EventEspresso\core\services\request\middleware\PreProductionVersionWarning' => array(), |
|
245 | + 'EventEspresso\core\services\request\middleware\RecommendedVersions' => array(), |
|
246 | + // last in first out |
|
247 | + 'EventEspresso\core\services\request\middleware\DetectLogin' => array(), |
|
248 | + ) |
|
249 | + ); |
|
250 | + // legacy filter for backwards compatibility |
|
251 | + $stack_apps = apply_filters( |
|
252 | + 'FHEE__EE_Bootstrap__build_request_stack__stack_apps', |
|
253 | + $stack_apps |
|
254 | + ); |
|
255 | + // load middleware onto stack : FILO (First In Last Out) |
|
256 | + // items at the beginning of the $stack_apps array will run last |
|
257 | + foreach ((array) $stack_apps as $stack_app => $stack_app_args) { |
|
258 | + $request_stack_builder->push(array($stack_app, $stack_app_args)); |
|
259 | + } |
|
260 | + // finally, we'll add this on its own because we need it to always be part of the stack |
|
261 | + // and we also need it to always run first because the rest of the system relies on it |
|
262 | + $request_stack_builder->push( |
|
263 | + array('EventEspresso\core\services\request\middleware\SetRequestTypeContextChecker', array()) |
|
264 | + ); |
|
265 | + return apply_filters( |
|
266 | + 'FHEE__EE_Bootstrap__build_request_stack__request_stack_builder', |
|
267 | + $request_stack_builder |
|
268 | + ); |
|
269 | + } |
|
270 | 270 | } |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | array(), |
130 | 130 | CoffeeMaker::BREW_LOAD_ONLY, |
131 | 131 | array( |
132 | - EE_INTERFACES . '*.php', |
|
133 | - EE_INTERFACES . '*.interfaces.php', |
|
132 | + EE_INTERFACES.'*.php', |
|
133 | + EE_INTERFACES.'*.interfaces.php', |
|
134 | 134 | ) |
135 | 135 | ) |
136 | 136 | ); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | array(), |
143 | 143 | array(), |
144 | 144 | CoffeeMaker::BREW_SHARED, |
145 | - EE_MODELS . '*.model.php' |
|
145 | + EE_MODELS.'*.model.php' |
|
146 | 146 | ) |
147 | 147 | ); |
148 | 148 | // add a wildcard recipe for loading core classes |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | array(), |
155 | 155 | CoffeeMaker::BREW_SHARED, |
156 | 156 | array( |
157 | - EE_CORE . '*.core.php', |
|
158 | - EE_ADMIN . '*.core.php', |
|
159 | - EE_CPTS . '*.core.php', |
|
160 | - EE_CORE . 'data_migration_scripts/*.core.php', |
|
157 | + EE_CORE.'*.core.php', |
|
158 | + EE_ADMIN.'*.core.php', |
|
159 | + EE_CPTS.'*.core.php', |
|
160 | + EE_CORE.'data_migration_scripts/*.core.php', |
|
161 | 161 | ) |
162 | 162 | ) |
163 | 163 | ); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | array(), |
170 | 170 | array(), |
171 | 171 | CoffeeMaker::BREW_LOAD_ONLY, |
172 | - array(EE_ADMIN . '*.core.php') |
|
172 | + array(EE_ADMIN.'*.core.php') |
|
173 | 173 | ) |
174 | 174 | ); |
175 | 175 | // add a wildcard recipe for loading core classes |
@@ -19,192 +19,192 @@ |
||
19 | 19 | */ |
20 | 20 | class OpenCoffeeShop |
21 | 21 | { |
22 | - /** |
|
23 | - * @var CoffeeShop $CoffeeShop |
|
24 | - */ |
|
25 | - private $CoffeeShop; |
|
22 | + /** |
|
23 | + * @var CoffeeShop $CoffeeShop |
|
24 | + */ |
|
25 | + private $CoffeeShop; |
|
26 | 26 | |
27 | 27 | |
28 | - /** |
|
29 | - * OpenCoffeeShop constructor |
|
30 | - * |
|
31 | - * @throws InvalidInterfaceException |
|
32 | - */ |
|
33 | - public function __construct() |
|
34 | - { |
|
35 | - // instantiate the DI container |
|
36 | - $this->CoffeeShop = new CoffeeShop(); |
|
37 | - } |
|
28 | + /** |
|
29 | + * OpenCoffeeShop constructor |
|
30 | + * |
|
31 | + * @throws InvalidInterfaceException |
|
32 | + */ |
|
33 | + public function __construct() |
|
34 | + { |
|
35 | + // instantiate the DI container |
|
36 | + $this->CoffeeShop = new CoffeeShop(); |
|
37 | + } |
|
38 | 38 | |
39 | 39 | |
40 | - // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
41 | - /** |
|
42 | - * @return CoffeeShop |
|
43 | - */ |
|
44 | - public function CoffeeShop() |
|
45 | - { |
|
46 | - return $this->CoffeeShop; |
|
47 | - } |
|
40 | + // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
41 | + /** |
|
42 | + * @return CoffeeShop |
|
43 | + */ |
|
44 | + public function CoffeeShop() |
|
45 | + { |
|
46 | + return $this->CoffeeShop; |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | - /** |
|
51 | - * configure coffee makers which control the different kinds of brews |
|
52 | - * ( shared services, new factory objects, etc ) |
|
53 | - * |
|
54 | - * @throws InvalidEntityException |
|
55 | - */ |
|
56 | - public function setupCoffeeMakers() |
|
57 | - { |
|
58 | - // create a dependency injector class for resolving class constructor arguments |
|
59 | - $DependencyInjector = new DependencyInjector( |
|
60 | - $this->CoffeeShop, |
|
61 | - new \EEH_Array() |
|
62 | - ); |
|
63 | - // and some coffeemakers, one for creating new instances |
|
64 | - $this->CoffeeShop->addCoffeeMaker( |
|
65 | - new NewCoffeeMaker($this->CoffeeShop, $DependencyInjector), |
|
66 | - CoffeeMaker::BREW_NEW |
|
67 | - ); |
|
68 | - // one for shared services |
|
69 | - $this->CoffeeShop->addCoffeeMaker( |
|
70 | - new SharedCoffeeMaker($this->CoffeeShop, $DependencyInjector), |
|
71 | - CoffeeMaker::BREW_SHARED |
|
72 | - ); |
|
73 | - // and one for classes that only get loaded |
|
74 | - $this->CoffeeShop->addCoffeeMaker( |
|
75 | - new LoadOnlyCoffeeMaker($this->CoffeeShop, $DependencyInjector), |
|
76 | - CoffeeMaker::BREW_LOAD_ONLY |
|
77 | - ); |
|
78 | - } |
|
50 | + /** |
|
51 | + * configure coffee makers which control the different kinds of brews |
|
52 | + * ( shared services, new factory objects, etc ) |
|
53 | + * |
|
54 | + * @throws InvalidEntityException |
|
55 | + */ |
|
56 | + public function setupCoffeeMakers() |
|
57 | + { |
|
58 | + // create a dependency injector class for resolving class constructor arguments |
|
59 | + $DependencyInjector = new DependencyInjector( |
|
60 | + $this->CoffeeShop, |
|
61 | + new \EEH_Array() |
|
62 | + ); |
|
63 | + // and some coffeemakers, one for creating new instances |
|
64 | + $this->CoffeeShop->addCoffeeMaker( |
|
65 | + new NewCoffeeMaker($this->CoffeeShop, $DependencyInjector), |
|
66 | + CoffeeMaker::BREW_NEW |
|
67 | + ); |
|
68 | + // one for shared services |
|
69 | + $this->CoffeeShop->addCoffeeMaker( |
|
70 | + new SharedCoffeeMaker($this->CoffeeShop, $DependencyInjector), |
|
71 | + CoffeeMaker::BREW_SHARED |
|
72 | + ); |
|
73 | + // and one for classes that only get loaded |
|
74 | + $this->CoffeeShop->addCoffeeMaker( |
|
75 | + new LoadOnlyCoffeeMaker($this->CoffeeShop, $DependencyInjector), |
|
76 | + CoffeeMaker::BREW_LOAD_ONLY |
|
77 | + ); |
|
78 | + } |
|
79 | 79 | |
80 | 80 | |
81 | - /** |
|
82 | - * Recipes define how to load legacy classes |
|
83 | - * |
|
84 | - * @throws InvalidIdentifierException |
|
85 | - */ |
|
86 | - public function addRecipes() |
|
87 | - { |
|
88 | - // add default recipe, which should handle loading for most PSR-4 compatible classes |
|
89 | - // as long as they are not type hinting for interfaces |
|
90 | - $this->CoffeeShop->addRecipe( |
|
91 | - new Recipe( |
|
92 | - Recipe::DEFAULT_ID |
|
93 | - ) |
|
94 | - ); |
|
95 | - // PSR-4 compatible class with aliases |
|
96 | - $this->CoffeeShop->addRecipe( |
|
97 | - new Recipe( |
|
98 | - 'CommandHandlerManager', |
|
99 | - 'EventEspresso\core\services\commands\CommandHandlerManager', |
|
100 | - array( |
|
101 | - 'CommandHandlerManagerInterface', |
|
102 | - 'EventEspresso\core\services\commands\CommandHandlerManagerInterface', |
|
103 | - ), |
|
104 | - array(), |
|
105 | - CoffeeMaker::BREW_SHARED |
|
106 | - ) |
|
107 | - ); |
|
108 | - // PSR-4 compatible class with aliases, which dependency on CommandHandlerManager |
|
109 | - $this->CoffeeShop->addRecipe( |
|
110 | - new Recipe( |
|
111 | - 'CommandBus', |
|
112 | - 'EventEspresso\core\services\commands\CommandBus', |
|
113 | - array( |
|
114 | - 'CommandBusInterface', |
|
115 | - 'EventEspresso\core\services\commands\CommandBusInterface', |
|
116 | - ), |
|
117 | - array(), |
|
118 | - CoffeeMaker::BREW_SHARED |
|
119 | - ) |
|
120 | - ); |
|
121 | - // LEGACY classes that are NOT compatible with PSR-4 autoloading, and so must specify a filepath |
|
122 | - // add a wildcard recipe for loading legacy core interfaces |
|
123 | - $this->CoffeeShop->addRecipe( |
|
124 | - new Recipe( |
|
125 | - 'EEI_*', |
|
126 | - '', |
|
127 | - array(), |
|
128 | - array(), |
|
129 | - CoffeeMaker::BREW_LOAD_ONLY, |
|
130 | - array( |
|
131 | - EE_INTERFACES . '*.php', |
|
132 | - EE_INTERFACES . '*.interfaces.php', |
|
133 | - ) |
|
134 | - ) |
|
135 | - ); |
|
136 | - // add a wildcard recipe for loading models |
|
137 | - $this->CoffeeShop->addRecipe( |
|
138 | - new Recipe( |
|
139 | - 'EEM_*', |
|
140 | - '', |
|
141 | - array(), |
|
142 | - array(), |
|
143 | - CoffeeMaker::BREW_SHARED, |
|
144 | - EE_MODELS . '*.model.php' |
|
145 | - ) |
|
146 | - ); |
|
147 | - // add a wildcard recipe for loading core classes |
|
148 | - $this->CoffeeShop->addRecipe( |
|
149 | - new Recipe( |
|
150 | - 'EE_*', |
|
151 | - '', |
|
152 | - array(), |
|
153 | - array(), |
|
154 | - CoffeeMaker::BREW_SHARED, |
|
155 | - array( |
|
156 | - EE_CORE . '*.core.php', |
|
157 | - EE_ADMIN . '*.core.php', |
|
158 | - EE_CPTS . '*.core.php', |
|
159 | - EE_CORE . 'data_migration_scripts/*.core.php', |
|
160 | - ) |
|
161 | - ) |
|
162 | - ); |
|
163 | - // load admin page parent class |
|
164 | - $this->CoffeeShop->addRecipe( |
|
165 | - new Recipe( |
|
166 | - 'EE_Admin_Page*', |
|
167 | - '', |
|
168 | - array(), |
|
169 | - array(), |
|
170 | - CoffeeMaker::BREW_LOAD_ONLY, |
|
171 | - array(EE_ADMIN . '*.core.php') |
|
172 | - ) |
|
173 | - ); |
|
174 | - // add a wildcard recipe for loading core classes |
|
175 | - // $this->CoffeeShop->addRecipe( |
|
176 | - // new Recipe( |
|
177 | - // '*_Admin_Page', |
|
178 | - // '', |
|
179 | - // array(), |
|
180 | - // array(), |
|
181 | - // CoffeeMaker::BREW_SHARED, |
|
182 | - // array( |
|
183 | - // EE_ADMIN_PAGES . 'transactions/*.core.php', |
|
184 | - // ) |
|
185 | - // ) |
|
186 | - // ); |
|
187 | - } |
|
81 | + /** |
|
82 | + * Recipes define how to load legacy classes |
|
83 | + * |
|
84 | + * @throws InvalidIdentifierException |
|
85 | + */ |
|
86 | + public function addRecipes() |
|
87 | + { |
|
88 | + // add default recipe, which should handle loading for most PSR-4 compatible classes |
|
89 | + // as long as they are not type hinting for interfaces |
|
90 | + $this->CoffeeShop->addRecipe( |
|
91 | + new Recipe( |
|
92 | + Recipe::DEFAULT_ID |
|
93 | + ) |
|
94 | + ); |
|
95 | + // PSR-4 compatible class with aliases |
|
96 | + $this->CoffeeShop->addRecipe( |
|
97 | + new Recipe( |
|
98 | + 'CommandHandlerManager', |
|
99 | + 'EventEspresso\core\services\commands\CommandHandlerManager', |
|
100 | + array( |
|
101 | + 'CommandHandlerManagerInterface', |
|
102 | + 'EventEspresso\core\services\commands\CommandHandlerManagerInterface', |
|
103 | + ), |
|
104 | + array(), |
|
105 | + CoffeeMaker::BREW_SHARED |
|
106 | + ) |
|
107 | + ); |
|
108 | + // PSR-4 compatible class with aliases, which dependency on CommandHandlerManager |
|
109 | + $this->CoffeeShop->addRecipe( |
|
110 | + new Recipe( |
|
111 | + 'CommandBus', |
|
112 | + 'EventEspresso\core\services\commands\CommandBus', |
|
113 | + array( |
|
114 | + 'CommandBusInterface', |
|
115 | + 'EventEspresso\core\services\commands\CommandBusInterface', |
|
116 | + ), |
|
117 | + array(), |
|
118 | + CoffeeMaker::BREW_SHARED |
|
119 | + ) |
|
120 | + ); |
|
121 | + // LEGACY classes that are NOT compatible with PSR-4 autoloading, and so must specify a filepath |
|
122 | + // add a wildcard recipe for loading legacy core interfaces |
|
123 | + $this->CoffeeShop->addRecipe( |
|
124 | + new Recipe( |
|
125 | + 'EEI_*', |
|
126 | + '', |
|
127 | + array(), |
|
128 | + array(), |
|
129 | + CoffeeMaker::BREW_LOAD_ONLY, |
|
130 | + array( |
|
131 | + EE_INTERFACES . '*.php', |
|
132 | + EE_INTERFACES . '*.interfaces.php', |
|
133 | + ) |
|
134 | + ) |
|
135 | + ); |
|
136 | + // add a wildcard recipe for loading models |
|
137 | + $this->CoffeeShop->addRecipe( |
|
138 | + new Recipe( |
|
139 | + 'EEM_*', |
|
140 | + '', |
|
141 | + array(), |
|
142 | + array(), |
|
143 | + CoffeeMaker::BREW_SHARED, |
|
144 | + EE_MODELS . '*.model.php' |
|
145 | + ) |
|
146 | + ); |
|
147 | + // add a wildcard recipe for loading core classes |
|
148 | + $this->CoffeeShop->addRecipe( |
|
149 | + new Recipe( |
|
150 | + 'EE_*', |
|
151 | + '', |
|
152 | + array(), |
|
153 | + array(), |
|
154 | + CoffeeMaker::BREW_SHARED, |
|
155 | + array( |
|
156 | + EE_CORE . '*.core.php', |
|
157 | + EE_ADMIN . '*.core.php', |
|
158 | + EE_CPTS . '*.core.php', |
|
159 | + EE_CORE . 'data_migration_scripts/*.core.php', |
|
160 | + ) |
|
161 | + ) |
|
162 | + ); |
|
163 | + // load admin page parent class |
|
164 | + $this->CoffeeShop->addRecipe( |
|
165 | + new Recipe( |
|
166 | + 'EE_Admin_Page*', |
|
167 | + '', |
|
168 | + array(), |
|
169 | + array(), |
|
170 | + CoffeeMaker::BREW_LOAD_ONLY, |
|
171 | + array(EE_ADMIN . '*.core.php') |
|
172 | + ) |
|
173 | + ); |
|
174 | + // add a wildcard recipe for loading core classes |
|
175 | + // $this->CoffeeShop->addRecipe( |
|
176 | + // new Recipe( |
|
177 | + // '*_Admin_Page', |
|
178 | + // '', |
|
179 | + // array(), |
|
180 | + // array(), |
|
181 | + // CoffeeMaker::BREW_SHARED, |
|
182 | + // array( |
|
183 | + // EE_ADMIN_PAGES . 'transactions/*.core.php', |
|
184 | + // ) |
|
185 | + // ) |
|
186 | + // ); |
|
187 | + } |
|
188 | 188 | |
189 | 189 | |
190 | - /** |
|
191 | - * bootstrap EE and the request stack |
|
192 | - * |
|
193 | - * @throws ServiceNotFoundException |
|
194 | - * @throws InvalidClassException |
|
195 | - * @throws InvalidDataTypeException |
|
196 | - * @throws InvalidIdentifierException |
|
197 | - * @throws exceptions\ServiceExistsException |
|
198 | - * @throws OutOfBoundsException |
|
199 | - * @throws exceptions\InstantiationException |
|
200 | - */ |
|
201 | - public function firstBrew() |
|
202 | - { |
|
203 | - $this->CoffeeShop->brew( |
|
204 | - 'EventEspresso\core\services\request\Request', |
|
205 | - array($_GET, $_POST, $_COOKIE, $_SERVER) |
|
206 | - ); |
|
207 | - $this->CoffeeShop->brew('EventEspresso\core\services\request\Response'); |
|
208 | - $this->CoffeeShop->brew('EE_Bootstrap'); |
|
209 | - } |
|
190 | + /** |
|
191 | + * bootstrap EE and the request stack |
|
192 | + * |
|
193 | + * @throws ServiceNotFoundException |
|
194 | + * @throws InvalidClassException |
|
195 | + * @throws InvalidDataTypeException |
|
196 | + * @throws InvalidIdentifierException |
|
197 | + * @throws exceptions\ServiceExistsException |
|
198 | + * @throws OutOfBoundsException |
|
199 | + * @throws exceptions\InstantiationException |
|
200 | + */ |
|
201 | + public function firstBrew() |
|
202 | + { |
|
203 | + $this->CoffeeShop->brew( |
|
204 | + 'EventEspresso\core\services\request\Request', |
|
205 | + array($_GET, $_POST, $_COOKIE, $_SERVER) |
|
206 | + ); |
|
207 | + $this->CoffeeShop->brew('EventEspresso\core\services\request\Response'); |
|
208 | + $this->CoffeeShop->brew('EE_Bootstrap'); |
|
209 | + } |
|
210 | 210 | } |
@@ -15,94 +15,94 @@ |
||
15 | 15 | */ |
16 | 16 | class LicenseService |
17 | 17 | { |
18 | - /** |
|
19 | - * @var Config |
|
20 | - */ |
|
21 | - private $config; |
|
22 | - |
|
23 | - |
|
24 | - /** |
|
25 | - * @var Stats |
|
26 | - */ |
|
27 | - private $stats_collection; |
|
28 | - |
|
29 | - public function __construct(Stats $stats_collection, Config $config) |
|
30 | - { |
|
31 | - $this->config = $config; |
|
32 | - $this->stats_collection = $stats_collection; |
|
33 | - $this->loadPueClient(); |
|
34 | - } |
|
35 | - |
|
36 | - private function loadPueClient() |
|
37 | - { |
|
38 | - // PUE Auto Upgrades stuff |
|
39 | - if (is_readable(EE_THIRD_PARTY . 'pue/pue-client.php')) { // include the file |
|
40 | - require_once(EE_THIRD_PARTY . 'pue/pue-client.php'); |
|
41 | - |
|
42 | - // $options needs to be an array with the included keys as listed. |
|
43 | - $options = array( |
|
44 | - // 'optionName' => '', //(optional) - used as the reference for saving update information in the |
|
45 | - // clients options table. Will be automatically set if left blank. |
|
46 | - 'apikey' => $this->config->siteLicenseKey(), |
|
47 | - // (required), you will need to obtain the apikey that the client gets from your site and |
|
48 | - // then saves in their sites options table (see 'getting an api-key' below) |
|
49 | - 'lang_domain' => $this->config->i18nDomain(), |
|
50 | - // (optional) - put here whatever reference you are using for the localization of your plugin (if it's |
|
51 | - // localized). That way strings in this file will be included in the translation for your plugin. |
|
52 | - 'checkPeriod' => $this->config->checkPeriod(), |
|
53 | - // (optional) - use this parameter to indicate how often you want the client's install to ping your |
|
54 | - // server for update checks. The integer indicates hours. If you don't include this parameter it will |
|
55 | - // default to 12 hours. |
|
56 | - 'option_key' => $this->config->optionKey(), |
|
57 | - // this is what is used to reference the api_key in your plugin options. PUE uses this to trigger |
|
58 | - // updating your information message whenever this option_key is modified. |
|
59 | - 'options_page_slug' => $this->config->optionsPageSlug(), |
|
60 | - 'plugin_basename' => EE_PLUGIN_BASENAME, |
|
61 | - 'use_wp_update' => true, |
|
62 | - // if TRUE then you want FREE versions of the plugin to be updated from WP |
|
63 | - 'extra_stats' => $this->stats_collection->statsCallback(), |
|
64 | - 'turn_on_notices_saved' => true, |
|
65 | - ); |
|
66 | - // initiate the class and start the plugin update engine! |
|
67 | - new PluginUpdateEngineChecker( |
|
68 | - $this->config->hostServerUrl(), |
|
69 | - $this->config->pluginSlug(), |
|
70 | - $options |
|
71 | - ); |
|
72 | - } |
|
73 | - } |
|
74 | - |
|
75 | - |
|
76 | - /** |
|
77 | - * This is a handy helper method for retrieving whether there is an update available for the given plugin. |
|
78 | - * |
|
79 | - * @param string $basename Use the equivalent result from plugin_basename() for this param as WP uses that to |
|
80 | - * identify plugins. Defaults to core update |
|
81 | - * @return boolean True if update available, false if not. |
|
82 | - */ |
|
83 | - public static function isUpdateAvailable($basename = '') |
|
84 | - { |
|
85 | - $basename = ! empty($basename) ? $basename : EE_PLUGIN_BASENAME; |
|
86 | - |
|
87 | - $update = false; |
|
88 | - |
|
89 | - // should take "event-espresso-core/espresso.php" and change to "/event-espresso-core" |
|
90 | - $folder = '/' . dirname($basename); |
|
91 | - |
|
92 | - $plugins = get_plugins($folder); |
|
93 | - $current = get_site_transient('update_plugins'); |
|
94 | - |
|
95 | - foreach ((array) $plugins as $plugin_file => $plugin_data) { |
|
96 | - if (isset($current->response['plugin_file'])) { |
|
97 | - $update = true; |
|
98 | - } |
|
99 | - } |
|
100 | - |
|
101 | - // it's possible that there is an update but an invalid site-license-key is in use |
|
102 | - if (get_site_option('pue_json_error_' . $basename)) { |
|
103 | - $update = true; |
|
104 | - } |
|
105 | - |
|
106 | - return $update; |
|
107 | - } |
|
18 | + /** |
|
19 | + * @var Config |
|
20 | + */ |
|
21 | + private $config; |
|
22 | + |
|
23 | + |
|
24 | + /** |
|
25 | + * @var Stats |
|
26 | + */ |
|
27 | + private $stats_collection; |
|
28 | + |
|
29 | + public function __construct(Stats $stats_collection, Config $config) |
|
30 | + { |
|
31 | + $this->config = $config; |
|
32 | + $this->stats_collection = $stats_collection; |
|
33 | + $this->loadPueClient(); |
|
34 | + } |
|
35 | + |
|
36 | + private function loadPueClient() |
|
37 | + { |
|
38 | + // PUE Auto Upgrades stuff |
|
39 | + if (is_readable(EE_THIRD_PARTY . 'pue/pue-client.php')) { // include the file |
|
40 | + require_once(EE_THIRD_PARTY . 'pue/pue-client.php'); |
|
41 | + |
|
42 | + // $options needs to be an array with the included keys as listed. |
|
43 | + $options = array( |
|
44 | + // 'optionName' => '', //(optional) - used as the reference for saving update information in the |
|
45 | + // clients options table. Will be automatically set if left blank. |
|
46 | + 'apikey' => $this->config->siteLicenseKey(), |
|
47 | + // (required), you will need to obtain the apikey that the client gets from your site and |
|
48 | + // then saves in their sites options table (see 'getting an api-key' below) |
|
49 | + 'lang_domain' => $this->config->i18nDomain(), |
|
50 | + // (optional) - put here whatever reference you are using for the localization of your plugin (if it's |
|
51 | + // localized). That way strings in this file will be included in the translation for your plugin. |
|
52 | + 'checkPeriod' => $this->config->checkPeriod(), |
|
53 | + // (optional) - use this parameter to indicate how often you want the client's install to ping your |
|
54 | + // server for update checks. The integer indicates hours. If you don't include this parameter it will |
|
55 | + // default to 12 hours. |
|
56 | + 'option_key' => $this->config->optionKey(), |
|
57 | + // this is what is used to reference the api_key in your plugin options. PUE uses this to trigger |
|
58 | + // updating your information message whenever this option_key is modified. |
|
59 | + 'options_page_slug' => $this->config->optionsPageSlug(), |
|
60 | + 'plugin_basename' => EE_PLUGIN_BASENAME, |
|
61 | + 'use_wp_update' => true, |
|
62 | + // if TRUE then you want FREE versions of the plugin to be updated from WP |
|
63 | + 'extra_stats' => $this->stats_collection->statsCallback(), |
|
64 | + 'turn_on_notices_saved' => true, |
|
65 | + ); |
|
66 | + // initiate the class and start the plugin update engine! |
|
67 | + new PluginUpdateEngineChecker( |
|
68 | + $this->config->hostServerUrl(), |
|
69 | + $this->config->pluginSlug(), |
|
70 | + $options |
|
71 | + ); |
|
72 | + } |
|
73 | + } |
|
74 | + |
|
75 | + |
|
76 | + /** |
|
77 | + * This is a handy helper method for retrieving whether there is an update available for the given plugin. |
|
78 | + * |
|
79 | + * @param string $basename Use the equivalent result from plugin_basename() for this param as WP uses that to |
|
80 | + * identify plugins. Defaults to core update |
|
81 | + * @return boolean True if update available, false if not. |
|
82 | + */ |
|
83 | + public static function isUpdateAvailable($basename = '') |
|
84 | + { |
|
85 | + $basename = ! empty($basename) ? $basename : EE_PLUGIN_BASENAME; |
|
86 | + |
|
87 | + $update = false; |
|
88 | + |
|
89 | + // should take "event-espresso-core/espresso.php" and change to "/event-espresso-core" |
|
90 | + $folder = '/' . dirname($basename); |
|
91 | + |
|
92 | + $plugins = get_plugins($folder); |
|
93 | + $current = get_site_transient('update_plugins'); |
|
94 | + |
|
95 | + foreach ((array) $plugins as $plugin_file => $plugin_data) { |
|
96 | + if (isset($current->response['plugin_file'])) { |
|
97 | + $update = true; |
|
98 | + } |
|
99 | + } |
|
100 | + |
|
101 | + // it's possible that there is an update but an invalid site-license-key is in use |
|
102 | + if (get_site_option('pue_json_error_' . $basename)) { |
|
103 | + $update = true; |
|
104 | + } |
|
105 | + |
|
106 | + return $update; |
|
107 | + } |
|
108 | 108 | } |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | private function loadPueClient() |
37 | 37 | { |
38 | 38 | // PUE Auto Upgrades stuff |
39 | - if (is_readable(EE_THIRD_PARTY . 'pue/pue-client.php')) { // include the file |
|
40 | - require_once(EE_THIRD_PARTY . 'pue/pue-client.php'); |
|
39 | + if (is_readable(EE_THIRD_PARTY.'pue/pue-client.php')) { // include the file |
|
40 | + require_once(EE_THIRD_PARTY.'pue/pue-client.php'); |
|
41 | 41 | |
42 | 42 | // $options needs to be an array with the included keys as listed. |
43 | 43 | $options = array( |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $update = false; |
88 | 88 | |
89 | 89 | // should take "event-espresso-core/espresso.php" and change to "/event-espresso-core" |
90 | - $folder = '/' . dirname($basename); |
|
90 | + $folder = '/'.dirname($basename); |
|
91 | 91 | |
92 | 92 | $plugins = get_plugins($folder); |
93 | 93 | $current = get_site_transient('update_plugins'); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | // it's possible that there is an update but an invalid site-license-key is in use |
102 | - if (get_site_option('pue_json_error_' . $basename)) { |
|
102 | + if (get_site_option('pue_json_error_'.$basename)) { |
|
103 | 103 | $update = true; |
104 | 104 | } |
105 | 105 |