1 | <?php |
||
20 | class EE_Recommended_Versions extends EE_Middleware |
||
21 | { |
||
22 | |||
23 | |||
24 | /** |
||
25 | * converts a Request to a Response |
||
26 | * |
||
27 | * @param EE_Request $request |
||
28 | * @param EE_Response $response |
||
29 | * @return EE_Response |
||
30 | * @throws InvalidDataTypeException |
||
31 | */ |
||
32 | public function handle_request(EE_Request $request, EE_Response $response) |
||
59 | |||
60 | |||
61 | /** |
||
62 | * Helper method to assess installed wp version against given values. |
||
63 | * By default this compares the required minimum version of WP for EE against the installed version of WP |
||
64 | * Note, $wp_version is the first parameter sent into the PHP version_compare function (what is being checked |
||
65 | * against) so consider that when sending in your values. |
||
66 | * |
||
67 | * @param string $version_to_check |
||
68 | * @param string $operator |
||
69 | * @return bool |
||
70 | */ |
||
71 | public static function check_wp_version($version_to_check = EE_MIN_WP_VER_REQUIRED, $operator = '>=') |
||
84 | |||
85 | |||
86 | |||
87 | /** |
||
88 | * _minimum_wp_version_required |
||
89 | * |
||
90 | * @access private |
||
91 | * @return boolean |
||
92 | */ |
||
93 | private function _minimum_wp_version_required() |
||
97 | |||
98 | |||
99 | |||
100 | /** |
||
101 | * _check_php_version |
||
102 | * |
||
103 | * @access private |
||
104 | * @param string $min_version |
||
105 | * @return boolean |
||
106 | */ |
||
107 | private function _check_php_version($min_version = EE_MIN_PHP_VER_RECOMMENDED) |
||
111 | |||
112 | |||
113 | |||
114 | /** |
||
115 | * _minimum_php_version_recommended |
||
116 | * |
||
117 | * @access private |
||
118 | * @return boolean |
||
119 | */ |
||
120 | private function _minimum_php_version_recommended() |
||
124 | |||
125 | |||
126 | /** |
||
127 | * Returns whether the provided php version number is greater than the current version of php installed on the server. |
||
128 | * @param string $version_required |
||
129 | * @return bool |
||
130 | */ |
||
131 | private function upcomingRequiredPhpVersion($version_required = '5.5') |
||
135 | |||
136 | |||
137 | |||
138 | /** |
||
139 | * minimum_wp_version_error |
||
140 | * |
||
141 | * @return void |
||
142 | */ |
||
143 | public function minimum_wp_version_error() |
||
163 | |||
164 | |||
165 | |||
166 | /** |
||
167 | * _display_minimum_recommended_php_version_notice |
||
168 | * |
||
169 | * @access private |
||
170 | * @return void |
||
171 | * @throws InvalidDataTypeException |
||
172 | */ |
||
173 | private function _display_minimum_recommended_php_version_notice() |
||
191 | |||
192 | |||
193 | /** |
||
194 | * Sets a notice for an upcoming required version of PHP in the next update of EE core. |
||
195 | */ |
||
196 | private function displayUpcomingRequiredVersion() |
||
219 | } |
||
220 |