Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | /** |
3 | * |
4 | * This file is part of the phpBB Forum Software package. |
5 | * |
6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
7 | * @license GNU General Public License, version 2 (GPL-2.0) |
8 | * |
9 | * For full copyright and license information, please see |
10 | * the docs/CREDITS.txt file. |
11 | * |
12 | */ |
13 | |
14 | namespace phpbb\install\helper\iohandler; |
15 | |
16 | /** |
17 | * Input-Output handler interface for the installer |
18 | */ |
19 | interface iohandler_interface |
20 | { |
21 | /** |
22 | * Renders or returns response message |
23 | * |
24 | * @param bool $no_more_output Whether or not there will be more output in this output unit |
25 | */ |
26 | public function send_response($no_more_output = false); |
27 | |
28 | /** |
29 | * Returns input variable |
30 | * |
31 | * @param string $name Name of the input variable to obtain |
32 | * @param mixed $default A default value that is returned if the variable was not set. |
33 | * This function will always return a value of the same type as the default. |
34 | * @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters |
35 | * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks |
36 | * |
37 | * @return mixed Value of the input variable |
38 | */ |
39 | public function get_input($name, $default, $multibyte = false); |
40 | |
41 | /** |
42 | * Returns raw input variable |
43 | * |
44 | * @param string $name Name of the input variable to obtain |
45 | * @param mixed $default A default value that is returned if the variable was not set. |
46 | * This function will always return a value of the same type as the default. |
47 | * |
48 | * @return mixed Value of the raw input variable |
49 | */ |
50 | public function get_raw_input($name, $default); |
51 | |
52 | /** |
53 | * Returns server variable |
54 | * |
55 | * This function should work the same as request_interface::server(). |
56 | * |
57 | * @param string $name Name of the server variable |
58 | * @param mixed $default Default value to return when the requested variable does not exist |
59 | * |
60 | * @return mixed Value of the server variable |
61 | */ |
62 | public function get_server_variable($name, $default = ''); |
63 | |
64 | /** |
65 | * Wrapper function for request_interface::header() |
66 | * |
67 | * @param string $name Name of the request header variable |
68 | * @param mixed $default Default value to return when the requested variable does not exist |
69 | * |
70 | * @return mixed |
71 | */ |
72 | public function get_header_variable($name, $default = ''); |
73 | |
74 | /** |
75 | * Returns true if the connection is encrypted |
76 | * |
77 | * @return bool |
78 | */ |
79 | public function is_secure(); |
80 | |
81 | /** |
82 | * Adds an error message to the rendering queue |
83 | * |
84 | * Note: When an array is passed into the parameters below, it will be |
85 | * resolved as printf($param[0], $param[1], ...). |
86 | * |
87 | * @param string|array $error_title Title of the error message. |
88 | * @param string|bool|array $error_description Description of the error (and possibly guidelines to resolve it), |
89 | * or false if the error description is not available. |
90 | */ |
91 | public function add_error_message($error_title, $error_description = false); |
92 | |
93 | /** |
94 | * Adds a warning message to the rendering queue |
95 | * |
96 | * Note: When an array is passed into the parameters below, it will be |
97 | * resolved as printf($param[0], $param[1], ...). |
98 | * |
99 | * @param string|array $warning_title Title of the warning message |
100 | * @param string|bool|array $warning_description Description of the warning (and possibly guidelines to resolve it), |
101 | * or false if the warning description is not available |
102 | */ |
103 | public function add_warning_message($warning_title, $warning_description = false); |
104 | |
105 | /** |
106 | * Adds a log message to the rendering queue |
107 | * |
108 | * Note: When an array is passed into the parameters below, it will be |
109 | * resolved as printf($param[0], $param[1], ...). |
110 | * |
111 | * @param string|array $log_title Title of the log message |
112 | * @param string|bool|array $log_description Description of the log, |
113 | * or false if the log description is not available |
114 | */ |
115 | public function add_log_message($log_title, $log_description = false); |
116 | |
117 | /** |
118 | * Adds a success message to the rendering queue |
119 | * |
120 | * Note: When an array is passed into the parameters below, it will be |
121 | * resolved as printf($param[0], $param[1], ...). |
122 | * |
123 | * @param string|array $success_title Title of the success message |
124 | * @param string|bool|array $success_description Description of the success, |
125 | * or false if the success description is not available |
126 | * |
127 | * @return null |
128 | */ |
129 | public function add_success_message($success_title, $success_description = false); |
130 | |
131 | /** |
132 | * Adds a requested data group to the rendering queue |
133 | * |
134 | * @param string $title Language variable with the title of the form |
135 | * @param array $form An array describing the required data (options etc) |
136 | */ |
137 | public function add_user_form_group($title, $form); |
138 | |
139 | /** |
140 | * Returns the rendering information for the form |
141 | * |
142 | * @param string $title Language variable with the title of the form |
143 | * @param array $form An array describing the required data (options etc) |
144 | * |
145 | * @return string Information to render the form |
146 | */ |
147 | public function generate_form_render_data($title, $form); |
148 | |
149 | /** |
150 | * Sets the number of tasks belonging to the installer in the current mode. |
151 | * |
152 | * @param int $task_count Number of tasks |
153 | * @param bool $restart Whether or not to restart the progress bar, false by default |
154 | */ |
155 | public function set_task_count($task_count, $restart = false); |
156 | |
157 | /** |
158 | * Sets the progress information |
159 | * |
160 | * @param string $task_lang_key Language key for the name of the task |
161 | * @param int $task_number Position of the current task in the task queue |
162 | */ |
163 | public function set_progress($task_lang_key, $task_number); |
164 | |
165 | /** |
166 | * Sends refresh request to the client |
167 | */ |
168 | public function request_refresh(); |
169 | |
170 | /** |
171 | * Marks stage as active in the navigation bar |
172 | * |
173 | * @param array $menu_path Array to the navigation elem |
174 | */ |
175 | public function set_active_stage_menu($menu_path); |
176 | |
177 | /** |
178 | * Marks stage as completed in the navigation bar |
179 | * |
180 | * @param array $menu_path Array to the navigation elem |
181 | */ |
182 | public function set_finished_stage_menu($menu_path); |
183 | |
184 | /** |
185 | * Finish the progress bar |
186 | * |
187 | * @param string $message_lang_key Language key for the message |
188 | */ |
189 | public function finish_progress($message_lang_key); |
190 | |
191 | /** |
192 | * Adds a download link |
193 | * |
194 | * @param string $route Route for the link |
195 | * @param string $title Language key for the title |
196 | * @param string|null|array $msg Language key for the message |
197 | */ |
198 | public function add_download_link($route, $title, $msg = null); |
199 | |
200 | /** |
201 | * Redirects the user to a new page |
202 | * |
203 | * @param string $url URL to redirect to |
204 | * @param bool $use_ajax Whether or not to use AJAX redirect |
205 | */ |
206 | public function redirect($url, $use_ajax = false); |
207 | |
208 | /** |
209 | * Renders the status of update files |
210 | * |
211 | * @param array $status_array Array containing files in groups to render |
212 | */ |
213 | public function render_update_file_status($status_array); |
214 | |
215 | /** |
216 | * Sends and sets cookies |
217 | * |
218 | * @param string $cookie_name Name of the cookie to set |
219 | * @param string $cookie_value Value of the cookie to set |
220 | */ |
221 | public function set_cookie($cookie_name, $cookie_value); |
222 | } |