@@ -13,10 +13,10 @@ |
||
13 | 13 | */ |
14 | 14 | function solr_get_version(): string |
15 | 15 | { |
16 | - error_clear_last(); |
|
17 | - $result = \solr_get_version(); |
|
18 | - if ($result === false) { |
|
19 | - throw SolrException::createFromPhpError(); |
|
20 | - } |
|
21 | - return $result; |
|
16 | + error_clear_last(); |
|
17 | + $result = \solr_get_version(); |
|
18 | + if ($result === false) { |
|
19 | + throw SolrException::createFromPhpError(); |
|
20 | + } |
|
21 | + return $result; |
|
22 | 22 | } |
@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | */ |
16 | 16 | function cli_set_process_title(string $title): void |
17 | 17 | { |
18 | - error_clear_last(); |
|
19 | - $result = \cli_set_process_title($title); |
|
20 | - if ($result === false) { |
|
21 | - throw InfoException::createFromPhpError(); |
|
22 | - } |
|
18 | + error_clear_last(); |
|
19 | + $result = \cli_set_process_title($title); |
|
20 | + if ($result === false) { |
|
21 | + throw InfoException::createFromPhpError(); |
|
22 | + } |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | */ |
80 | 80 | function dl(string $library): void |
81 | 81 | { |
82 | - error_clear_last(); |
|
83 | - $result = \dl($library); |
|
84 | - if ($result === false) { |
|
85 | - throw InfoException::createFromPhpError(); |
|
86 | - } |
|
82 | + error_clear_last(); |
|
83 | + $result = \dl($library); |
|
84 | + if ($result === false) { |
|
85 | + throw InfoException::createFromPhpError(); |
|
86 | + } |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | |
@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | */ |
102 | 102 | function getlastmod(): int |
103 | 103 | { |
104 | - error_clear_last(); |
|
105 | - $result = \getlastmod(); |
|
106 | - if ($result === false) { |
|
107 | - throw InfoException::createFromPhpError(); |
|
108 | - } |
|
109 | - return $result; |
|
104 | + error_clear_last(); |
|
105 | + $result = \getlastmod(); |
|
106 | + if ($result === false) { |
|
107 | + throw InfoException::createFromPhpError(); |
|
108 | + } |
|
109 | + return $result; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | |
@@ -119,12 +119,12 @@ discard block |
||
119 | 119 | */ |
120 | 120 | function getmygid(): int |
121 | 121 | { |
122 | - error_clear_last(); |
|
123 | - $result = \getmygid(); |
|
124 | - if ($result === false) { |
|
125 | - throw InfoException::createFromPhpError(); |
|
126 | - } |
|
127 | - return $result; |
|
122 | + error_clear_last(); |
|
123 | + $result = \getmygid(); |
|
124 | + if ($result === false) { |
|
125 | + throw InfoException::createFromPhpError(); |
|
126 | + } |
|
127 | + return $result; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | |
@@ -137,12 +137,12 @@ discard block |
||
137 | 137 | */ |
138 | 138 | function getmyinode(): int |
139 | 139 | { |
140 | - error_clear_last(); |
|
141 | - $result = \getmyinode(); |
|
142 | - if ($result === false) { |
|
143 | - throw InfoException::createFromPhpError(); |
|
144 | - } |
|
145 | - return $result; |
|
140 | + error_clear_last(); |
|
141 | + $result = \getmyinode(); |
|
142 | + if ($result === false) { |
|
143 | + throw InfoException::createFromPhpError(); |
|
144 | + } |
|
145 | + return $result; |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | |
@@ -155,12 +155,12 @@ discard block |
||
155 | 155 | */ |
156 | 156 | function getmypid(): int |
157 | 157 | { |
158 | - error_clear_last(); |
|
159 | - $result = \getmypid(); |
|
160 | - if ($result === false) { |
|
161 | - throw InfoException::createFromPhpError(); |
|
162 | - } |
|
163 | - return $result; |
|
158 | + error_clear_last(); |
|
159 | + $result = \getmypid(); |
|
160 | + if ($result === false) { |
|
161 | + throw InfoException::createFromPhpError(); |
|
162 | + } |
|
163 | + return $result; |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | |
@@ -173,12 +173,12 @@ discard block |
||
173 | 173 | */ |
174 | 174 | function getmyuid(): int |
175 | 175 | { |
176 | - error_clear_last(); |
|
177 | - $result = \getmyuid(); |
|
178 | - if ($result === false) { |
|
179 | - throw InfoException::createFromPhpError(); |
|
180 | - } |
|
181 | - return $result; |
|
176 | + error_clear_last(); |
|
177 | + $result = \getmyuid(); |
|
178 | + if ($result === false) { |
|
179 | + throw InfoException::createFromPhpError(); |
|
180 | + } |
|
181 | + return $result; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | |
@@ -194,18 +194,18 @@ discard block |
||
194 | 194 | */ |
195 | 195 | function getopt(string $options, array $longopts = null, ?int &$optind = null): array |
196 | 196 | { |
197 | - error_clear_last(); |
|
198 | - if ($optind !== null) { |
|
199 | - $result = \getopt($options, $longopts, $optind); |
|
200 | - } elseif ($longopts !== null) { |
|
201 | - $result = \getopt($options, $longopts); |
|
202 | - } else { |
|
203 | - $result = \getopt($options); |
|
204 | - } |
|
205 | - if ($result === false) { |
|
206 | - throw InfoException::createFromPhpError(); |
|
207 | - } |
|
208 | - return $result; |
|
197 | + error_clear_last(); |
|
198 | + if ($optind !== null) { |
|
199 | + $result = \getopt($options, $longopts, $optind); |
|
200 | + } elseif ($longopts !== null) { |
|
201 | + $result = \getopt($options, $longopts); |
|
202 | + } else { |
|
203 | + $result = \getopt($options); |
|
204 | + } |
|
205 | + if ($result === false) { |
|
206 | + throw InfoException::createFromPhpError(); |
|
207 | + } |
|
208 | + return $result; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | |
@@ -221,12 +221,12 @@ discard block |
||
221 | 221 | */ |
222 | 222 | function ini_get(string $varname): string |
223 | 223 | { |
224 | - error_clear_last(); |
|
225 | - $result = \ini_get($varname); |
|
226 | - if ($result === false) { |
|
227 | - throw InfoException::createFromPhpError(); |
|
228 | - } |
|
229 | - return $result; |
|
224 | + error_clear_last(); |
|
225 | + $result = \ini_get($varname); |
|
226 | + if ($result === false) { |
|
227 | + throw InfoException::createFromPhpError(); |
|
228 | + } |
|
229 | + return $result; |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | |
@@ -245,12 +245,12 @@ discard block |
||
245 | 245 | */ |
246 | 246 | function ini_set(string $varname, $newvalue): string |
247 | 247 | { |
248 | - error_clear_last(); |
|
249 | - $result = \ini_set($varname, $newvalue); |
|
250 | - if ($result === false) { |
|
251 | - throw InfoException::createFromPhpError(); |
|
252 | - } |
|
253 | - return $result; |
|
248 | + error_clear_last(); |
|
249 | + $result = \ini_set($varname, $newvalue); |
|
250 | + if ($result === false) { |
|
251 | + throw InfoException::createFromPhpError(); |
|
252 | + } |
|
253 | + return $result; |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | |
@@ -325,11 +325,11 @@ discard block |
||
325 | 325 | */ |
326 | 326 | function phpcredits(int $flag = CREDITS_ALL): void |
327 | 327 | { |
328 | - error_clear_last(); |
|
329 | - $result = \phpcredits($flag); |
|
330 | - if ($result === false) { |
|
331 | - throw InfoException::createFromPhpError(); |
|
332 | - } |
|
328 | + error_clear_last(); |
|
329 | + $result = \phpcredits($flag); |
|
330 | + if ($result === false) { |
|
331 | + throw InfoException::createFromPhpError(); |
|
332 | + } |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | |
@@ -435,11 +435,11 @@ discard block |
||
435 | 435 | */ |
436 | 436 | function phpinfo(int $what = INFO_ALL): void |
437 | 437 | { |
438 | - error_clear_last(); |
|
439 | - $result = \phpinfo($what); |
|
440 | - if ($result === false) { |
|
441 | - throw InfoException::createFromPhpError(); |
|
442 | - } |
|
438 | + error_clear_last(); |
|
439 | + $result = \phpinfo($what); |
|
440 | + if ($result === false) { |
|
441 | + throw InfoException::createFromPhpError(); |
|
442 | + } |
|
443 | 443 | } |
444 | 444 | |
445 | 445 | |
@@ -455,11 +455,11 @@ discard block |
||
455 | 455 | */ |
456 | 456 | function putenv(string $setting): void |
457 | 457 | { |
458 | - error_clear_last(); |
|
459 | - $result = \putenv($setting); |
|
460 | - if ($result === false) { |
|
461 | - throw InfoException::createFromPhpError(); |
|
462 | - } |
|
458 | + error_clear_last(); |
|
459 | + $result = \putenv($setting); |
|
460 | + if ($result === false) { |
|
461 | + throw InfoException::createFromPhpError(); |
|
462 | + } |
|
463 | 463 | } |
464 | 464 | |
465 | 465 | |
@@ -475,12 +475,12 @@ discard block |
||
475 | 475 | */ |
476 | 476 | function set_include_path(string $new_include_path): string |
477 | 477 | { |
478 | - error_clear_last(); |
|
479 | - $result = \set_include_path($new_include_path); |
|
480 | - if ($result === false) { |
|
481 | - throw InfoException::createFromPhpError(); |
|
482 | - } |
|
483 | - return $result; |
|
478 | + error_clear_last(); |
|
479 | + $result = \set_include_path($new_include_path); |
|
480 | + if ($result === false) { |
|
481 | + throw InfoException::createFromPhpError(); |
|
482 | + } |
|
483 | + return $result; |
|
484 | 484 | } |
485 | 485 | |
486 | 486 | |
@@ -503,9 +503,9 @@ discard block |
||
503 | 503 | */ |
504 | 504 | function set_time_limit(int $seconds): void |
505 | 505 | { |
506 | - error_clear_last(); |
|
507 | - $result = \set_time_limit($seconds); |
|
508 | - if ($result === false) { |
|
509 | - throw InfoException::createFromPhpError(); |
|
510 | - } |
|
506 | + error_clear_last(); |
|
507 | + $result = \set_time_limit($seconds); |
|
508 | + if ($result === false) { |
|
509 | + throw InfoException::createFromPhpError(); |
|
510 | + } |
|
511 | 511 | } |
@@ -14,11 +14,11 @@ discard block |
||
14 | 14 | */ |
15 | 15 | function fbird_blob_cancel($blob_handle): void |
16 | 16 | { |
17 | - error_clear_last(); |
|
18 | - $result = \fbird_blob_cancel($blob_handle); |
|
19 | - if ($result === false) { |
|
20 | - throw IbaseException::createFromPhpError(); |
|
21 | - } |
|
17 | + error_clear_last(); |
|
18 | + $result = \fbird_blob_cancel($blob_handle); |
|
19 | + if ($result === false) { |
|
20 | + throw IbaseException::createFromPhpError(); |
|
21 | + } |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
@@ -36,19 +36,19 @@ discard block |
||
36 | 36 | */ |
37 | 37 | function ibase_add_user($service_handle, string $user_name, string $password, string $first_name = null, string $middle_name = null, string $last_name = null): void |
38 | 38 | { |
39 | - error_clear_last(); |
|
40 | - if ($last_name !== null) { |
|
41 | - $result = \ibase_add_user($service_handle, $user_name, $password, $first_name, $middle_name, $last_name); |
|
42 | - } elseif ($middle_name !== null) { |
|
43 | - $result = \ibase_add_user($service_handle, $user_name, $password, $first_name, $middle_name); |
|
44 | - } elseif ($first_name !== null) { |
|
45 | - $result = \ibase_add_user($service_handle, $user_name, $password, $first_name); |
|
46 | - } else { |
|
47 | - $result = \ibase_add_user($service_handle, $user_name, $password); |
|
48 | - } |
|
49 | - if ($result === false) { |
|
50 | - throw IbaseException::createFromPhpError(); |
|
51 | - } |
|
39 | + error_clear_last(); |
|
40 | + if ($last_name !== null) { |
|
41 | + $result = \ibase_add_user($service_handle, $user_name, $password, $first_name, $middle_name, $last_name); |
|
42 | + } elseif ($middle_name !== null) { |
|
43 | + $result = \ibase_add_user($service_handle, $user_name, $password, $first_name, $middle_name); |
|
44 | + } elseif ($first_name !== null) { |
|
45 | + $result = \ibase_add_user($service_handle, $user_name, $password, $first_name); |
|
46 | + } else { |
|
47 | + $result = \ibase_add_user($service_handle, $user_name, $password); |
|
48 | + } |
|
49 | + if ($result === false) { |
|
50 | + throw IbaseException::createFromPhpError(); |
|
51 | + } |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
@@ -81,12 +81,12 @@ discard block |
||
81 | 81 | */ |
82 | 82 | function ibase_backup($service_handle, string $source_db, string $dest_file, int $options = 0, bool $verbose = false) |
83 | 83 | { |
84 | - error_clear_last(); |
|
85 | - $result = \ibase_backup($service_handle, $source_db, $dest_file, $options, $verbose); |
|
86 | - if ($result === false) { |
|
87 | - throw IbaseException::createFromPhpError(); |
|
88 | - } |
|
89 | - return $result; |
|
84 | + error_clear_last(); |
|
85 | + $result = \ibase_backup($service_handle, $source_db, $dest_file, $options, $verbose); |
|
86 | + if ($result === false) { |
|
87 | + throw IbaseException::createFromPhpError(); |
|
88 | + } |
|
89 | + return $result; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | */ |
101 | 101 | function ibase_blob_cancel($blob_handle): void |
102 | 102 | { |
103 | - error_clear_last(); |
|
104 | - $result = \ibase_blob_cancel($blob_handle); |
|
105 | - if ($result === false) { |
|
106 | - throw IbaseException::createFromPhpError(); |
|
107 | - } |
|
103 | + error_clear_last(); |
|
104 | + $result = \ibase_blob_cancel($blob_handle); |
|
105 | + if ($result === false) { |
|
106 | + throw IbaseException::createFromPhpError(); |
|
107 | + } |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | |
@@ -121,12 +121,12 @@ discard block |
||
121 | 121 | */ |
122 | 122 | function ibase_blob_create($link_identifier = null) |
123 | 123 | { |
124 | - error_clear_last(); |
|
125 | - $result = \ibase_blob_create($link_identifier); |
|
126 | - if ($result === false) { |
|
127 | - throw IbaseException::createFromPhpError(); |
|
128 | - } |
|
129 | - return $result; |
|
124 | + error_clear_last(); |
|
125 | + $result = \ibase_blob_create($link_identifier); |
|
126 | + if ($result === false) { |
|
127 | + throw IbaseException::createFromPhpError(); |
|
128 | + } |
|
129 | + return $result; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | |
@@ -142,12 +142,12 @@ discard block |
||
142 | 142 | */ |
143 | 143 | function ibase_blob_get($blob_handle, int $len): string |
144 | 144 | { |
145 | - error_clear_last(); |
|
146 | - $result = \ibase_blob_get($blob_handle, $len); |
|
147 | - if ($result === false) { |
|
148 | - throw IbaseException::createFromPhpError(); |
|
149 | - } |
|
150 | - return $result; |
|
145 | + error_clear_last(); |
|
146 | + $result = \ibase_blob_get($blob_handle, $len); |
|
147 | + if ($result === false) { |
|
148 | + throw IbaseException::createFromPhpError(); |
|
149 | + } |
|
150 | + return $result; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | |
@@ -165,11 +165,11 @@ discard block |
||
165 | 165 | */ |
166 | 166 | function ibase_close($connection_id = null): void |
167 | 167 | { |
168 | - error_clear_last(); |
|
169 | - $result = \ibase_close($connection_id); |
|
170 | - if ($result === false) { |
|
171 | - throw IbaseException::createFromPhpError(); |
|
172 | - } |
|
168 | + error_clear_last(); |
|
169 | + $result = \ibase_close($connection_id); |
|
170 | + if ($result === false) { |
|
171 | + throw IbaseException::createFromPhpError(); |
|
172 | + } |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | |
@@ -188,11 +188,11 @@ discard block |
||
188 | 188 | */ |
189 | 189 | function ibase_commit_ret($link_or_trans_identifier = null): void |
190 | 190 | { |
191 | - error_clear_last(); |
|
192 | - $result = \ibase_commit_ret($link_or_trans_identifier); |
|
193 | - if ($result === false) { |
|
194 | - throw IbaseException::createFromPhpError(); |
|
195 | - } |
|
191 | + error_clear_last(); |
|
192 | + $result = \ibase_commit_ret($link_or_trans_identifier); |
|
193 | + if ($result === false) { |
|
194 | + throw IbaseException::createFromPhpError(); |
|
195 | + } |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | |
@@ -209,11 +209,11 @@ discard block |
||
209 | 209 | */ |
210 | 210 | function ibase_commit($link_or_trans_identifier = null): void |
211 | 211 | { |
212 | - error_clear_last(); |
|
213 | - $result = \ibase_commit($link_or_trans_identifier); |
|
214 | - if ($result === false) { |
|
215 | - throw IbaseException::createFromPhpError(); |
|
216 | - } |
|
212 | + error_clear_last(); |
|
213 | + $result = \ibase_commit($link_or_trans_identifier); |
|
214 | + if ($result === false) { |
|
215 | + throw IbaseException::createFromPhpError(); |
|
216 | + } |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | |
@@ -252,30 +252,30 @@ discard block |
||
252 | 252 | */ |
253 | 253 | function ibase_connect(string $database = null, string $username = null, string $password = null, string $charset = null, int $buffers = null, int $dialect = null, string $role = null, int $sync = null) |
254 | 254 | { |
255 | - error_clear_last(); |
|
256 | - if ($sync !== null) { |
|
257 | - $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect, $role, $sync); |
|
258 | - } elseif ($role !== null) { |
|
259 | - $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect, $role); |
|
260 | - } elseif ($dialect !== null) { |
|
261 | - $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect); |
|
262 | - } elseif ($buffers !== null) { |
|
263 | - $result = \ibase_connect($database, $username, $password, $charset, $buffers); |
|
264 | - } elseif ($charset !== null) { |
|
265 | - $result = \ibase_connect($database, $username, $password, $charset); |
|
266 | - } elseif ($password !== null) { |
|
267 | - $result = \ibase_connect($database, $username, $password); |
|
268 | - } elseif ($username !== null) { |
|
269 | - $result = \ibase_connect($database, $username); |
|
270 | - } elseif ($database !== null) { |
|
271 | - $result = \ibase_connect($database); |
|
272 | - } else { |
|
273 | - $result = \ibase_connect(); |
|
274 | - } |
|
275 | - if ($result === false) { |
|
276 | - throw IbaseException::createFromPhpError(); |
|
277 | - } |
|
278 | - return $result; |
|
255 | + error_clear_last(); |
|
256 | + if ($sync !== null) { |
|
257 | + $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect, $role, $sync); |
|
258 | + } elseif ($role !== null) { |
|
259 | + $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect, $role); |
|
260 | + } elseif ($dialect !== null) { |
|
261 | + $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect); |
|
262 | + } elseif ($buffers !== null) { |
|
263 | + $result = \ibase_connect($database, $username, $password, $charset, $buffers); |
|
264 | + } elseif ($charset !== null) { |
|
265 | + $result = \ibase_connect($database, $username, $password, $charset); |
|
266 | + } elseif ($password !== null) { |
|
267 | + $result = \ibase_connect($database, $username, $password); |
|
268 | + } elseif ($username !== null) { |
|
269 | + $result = \ibase_connect($database, $username); |
|
270 | + } elseif ($database !== null) { |
|
271 | + $result = \ibase_connect($database); |
|
272 | + } else { |
|
273 | + $result = \ibase_connect(); |
|
274 | + } |
|
275 | + if ($result === false) { |
|
276 | + throw IbaseException::createFromPhpError(); |
|
277 | + } |
|
278 | + return $result; |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | |
@@ -289,11 +289,11 @@ discard block |
||
289 | 289 | */ |
290 | 290 | function ibase_delete_user($service_handle, string $user_name): void |
291 | 291 | { |
292 | - error_clear_last(); |
|
293 | - $result = \ibase_delete_user($service_handle, $user_name); |
|
294 | - if ($result === false) { |
|
295 | - throw IbaseException::createFromPhpError(); |
|
296 | - } |
|
292 | + error_clear_last(); |
|
293 | + $result = \ibase_delete_user($service_handle, $user_name); |
|
294 | + if ($result === false) { |
|
295 | + throw IbaseException::createFromPhpError(); |
|
296 | + } |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | |
@@ -308,11 +308,11 @@ discard block |
||
308 | 308 | */ |
309 | 309 | function ibase_drop_db($connection = null): void |
310 | 310 | { |
311 | - error_clear_last(); |
|
312 | - $result = \ibase_drop_db($connection); |
|
313 | - if ($result === false) { |
|
314 | - throw IbaseException::createFromPhpError(); |
|
315 | - } |
|
311 | + error_clear_last(); |
|
312 | + $result = \ibase_drop_db($connection); |
|
313 | + if ($result === false) { |
|
314 | + throw IbaseException::createFromPhpError(); |
|
315 | + } |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | |
@@ -328,11 +328,11 @@ discard block |
||
328 | 328 | */ |
329 | 329 | function ibase_free_event_handler($event): void |
330 | 330 | { |
331 | - error_clear_last(); |
|
332 | - $result = \ibase_free_event_handler($event); |
|
333 | - if ($result === false) { |
|
334 | - throw IbaseException::createFromPhpError(); |
|
335 | - } |
|
331 | + error_clear_last(); |
|
332 | + $result = \ibase_free_event_handler($event); |
|
333 | + if ($result === false) { |
|
334 | + throw IbaseException::createFromPhpError(); |
|
335 | + } |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | |
@@ -345,11 +345,11 @@ discard block |
||
345 | 345 | */ |
346 | 346 | function ibase_free_query($query): void |
347 | 347 | { |
348 | - error_clear_last(); |
|
349 | - $result = \ibase_free_query($query); |
|
350 | - if ($result === false) { |
|
351 | - throw IbaseException::createFromPhpError(); |
|
352 | - } |
|
348 | + error_clear_last(); |
|
349 | + $result = \ibase_free_query($query); |
|
350 | + if ($result === false) { |
|
351 | + throw IbaseException::createFromPhpError(); |
|
352 | + } |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | |
@@ -363,11 +363,11 @@ discard block |
||
363 | 363 | */ |
364 | 364 | function ibase_free_result($result_identifier): void |
365 | 365 | { |
366 | - error_clear_last(); |
|
367 | - $result = \ibase_free_result($result_identifier); |
|
368 | - if ($result === false) { |
|
369 | - throw IbaseException::createFromPhpError(); |
|
370 | - } |
|
366 | + error_clear_last(); |
|
367 | + $result = \ibase_free_result($result_identifier); |
|
368 | + if ($result === false) { |
|
369 | + throw IbaseException::createFromPhpError(); |
|
370 | + } |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | |
@@ -383,11 +383,11 @@ discard block |
||
383 | 383 | */ |
384 | 384 | function ibase_maintain_db($service_handle, string $db, int $action, int $argument = 0): void |
385 | 385 | { |
386 | - error_clear_last(); |
|
387 | - $result = \ibase_maintain_db($service_handle, $db, $action, $argument); |
|
388 | - if ($result === false) { |
|
389 | - throw IbaseException::createFromPhpError(); |
|
390 | - } |
|
386 | + error_clear_last(); |
|
387 | + $result = \ibase_maintain_db($service_handle, $db, $action, $argument); |
|
388 | + if ($result === false) { |
|
389 | + throw IbaseException::createFromPhpError(); |
|
390 | + } |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | |
@@ -405,19 +405,19 @@ discard block |
||
405 | 405 | */ |
406 | 406 | function ibase_modify_user($service_handle, string $user_name, string $password, string $first_name = null, string $middle_name = null, string $last_name = null): void |
407 | 407 | { |
408 | - error_clear_last(); |
|
409 | - if ($last_name !== null) { |
|
410 | - $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name, $middle_name, $last_name); |
|
411 | - } elseif ($middle_name !== null) { |
|
412 | - $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name, $middle_name); |
|
413 | - } elseif ($first_name !== null) { |
|
414 | - $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name); |
|
415 | - } else { |
|
416 | - $result = \ibase_modify_user($service_handle, $user_name, $password); |
|
417 | - } |
|
418 | - if ($result === false) { |
|
419 | - throw IbaseException::createFromPhpError(); |
|
420 | - } |
|
408 | + error_clear_last(); |
|
409 | + if ($last_name !== null) { |
|
410 | + $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name, $middle_name, $last_name); |
|
411 | + } elseif ($middle_name !== null) { |
|
412 | + $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name, $middle_name); |
|
413 | + } elseif ($first_name !== null) { |
|
414 | + $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name); |
|
415 | + } else { |
|
416 | + $result = \ibase_modify_user($service_handle, $user_name, $password); |
|
417 | + } |
|
418 | + if ($result === false) { |
|
419 | + throw IbaseException::createFromPhpError(); |
|
420 | + } |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | |
@@ -432,11 +432,11 @@ discard block |
||
432 | 432 | */ |
433 | 433 | function ibase_name_result($result, string $name): void |
434 | 434 | { |
435 | - error_clear_last(); |
|
436 | - $result = \ibase_name_result($result, $name); |
|
437 | - if ($result === false) { |
|
438 | - throw IbaseException::createFromPhpError(); |
|
439 | - } |
|
435 | + error_clear_last(); |
|
436 | + $result = \ibase_name_result($result, $name); |
|
437 | + if ($result === false) { |
|
438 | + throw IbaseException::createFromPhpError(); |
|
439 | + } |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | |
@@ -482,30 +482,30 @@ discard block |
||
482 | 482 | */ |
483 | 483 | function ibase_pconnect(string $database = null, string $username = null, string $password = null, string $charset = null, int $buffers = null, int $dialect = null, string $role = null, int $sync = null) |
484 | 484 | { |
485 | - error_clear_last(); |
|
486 | - if ($sync !== null) { |
|
487 | - $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect, $role, $sync); |
|
488 | - } elseif ($role !== null) { |
|
489 | - $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect, $role); |
|
490 | - } elseif ($dialect !== null) { |
|
491 | - $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect); |
|
492 | - } elseif ($buffers !== null) { |
|
493 | - $result = \ibase_pconnect($database, $username, $password, $charset, $buffers); |
|
494 | - } elseif ($charset !== null) { |
|
495 | - $result = \ibase_pconnect($database, $username, $password, $charset); |
|
496 | - } elseif ($password !== null) { |
|
497 | - $result = \ibase_pconnect($database, $username, $password); |
|
498 | - } elseif ($username !== null) { |
|
499 | - $result = \ibase_pconnect($database, $username); |
|
500 | - } elseif ($database !== null) { |
|
501 | - $result = \ibase_pconnect($database); |
|
502 | - } else { |
|
503 | - $result = \ibase_pconnect(); |
|
504 | - } |
|
505 | - if ($result === false) { |
|
506 | - throw IbaseException::createFromPhpError(); |
|
507 | - } |
|
508 | - return $result; |
|
485 | + error_clear_last(); |
|
486 | + if ($sync !== null) { |
|
487 | + $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect, $role, $sync); |
|
488 | + } elseif ($role !== null) { |
|
489 | + $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect, $role); |
|
490 | + } elseif ($dialect !== null) { |
|
491 | + $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect); |
|
492 | + } elseif ($buffers !== null) { |
|
493 | + $result = \ibase_pconnect($database, $username, $password, $charset, $buffers); |
|
494 | + } elseif ($charset !== null) { |
|
495 | + $result = \ibase_pconnect($database, $username, $password, $charset); |
|
496 | + } elseif ($password !== null) { |
|
497 | + $result = \ibase_pconnect($database, $username, $password); |
|
498 | + } elseif ($username !== null) { |
|
499 | + $result = \ibase_pconnect($database, $username); |
|
500 | + } elseif ($database !== null) { |
|
501 | + $result = \ibase_pconnect($database); |
|
502 | + } else { |
|
503 | + $result = \ibase_pconnect(); |
|
504 | + } |
|
505 | + if ($result === false) { |
|
506 | + throw IbaseException::createFromPhpError(); |
|
507 | + } |
|
508 | + return $result; |
|
509 | 509 | } |
510 | 510 | |
511 | 511 | |
@@ -541,12 +541,12 @@ discard block |
||
541 | 541 | */ |
542 | 542 | function ibase_restore($service_handle, string $source_file, string $dest_db, int $options = 0, bool $verbose = false) |
543 | 543 | { |
544 | - error_clear_last(); |
|
545 | - $result = \ibase_restore($service_handle, $source_file, $dest_db, $options, $verbose); |
|
546 | - if ($result === false) { |
|
547 | - throw IbaseException::createFromPhpError(); |
|
548 | - } |
|
549 | - return $result; |
|
544 | + error_clear_last(); |
|
545 | + $result = \ibase_restore($service_handle, $source_file, $dest_db, $options, $verbose); |
|
546 | + if ($result === false) { |
|
547 | + throw IbaseException::createFromPhpError(); |
|
548 | + } |
|
549 | + return $result; |
|
550 | 550 | } |
551 | 551 | |
552 | 552 | |
@@ -565,11 +565,11 @@ discard block |
||
565 | 565 | */ |
566 | 566 | function ibase_rollback_ret($link_or_trans_identifier = null): void |
567 | 567 | { |
568 | - error_clear_last(); |
|
569 | - $result = \ibase_rollback_ret($link_or_trans_identifier); |
|
570 | - if ($result === false) { |
|
571 | - throw IbaseException::createFromPhpError(); |
|
572 | - } |
|
568 | + error_clear_last(); |
|
569 | + $result = \ibase_rollback_ret($link_or_trans_identifier); |
|
570 | + if ($result === false) { |
|
571 | + throw IbaseException::createFromPhpError(); |
|
572 | + } |
|
573 | 573 | } |
574 | 574 | |
575 | 575 | |
@@ -586,11 +586,11 @@ discard block |
||
586 | 586 | */ |
587 | 587 | function ibase_rollback($link_or_trans_identifier = null): void |
588 | 588 | { |
589 | - error_clear_last(); |
|
590 | - $result = \ibase_rollback($link_or_trans_identifier); |
|
591 | - if ($result === false) { |
|
592 | - throw IbaseException::createFromPhpError(); |
|
593 | - } |
|
589 | + error_clear_last(); |
|
590 | + $result = \ibase_rollback($link_or_trans_identifier); |
|
591 | + if ($result === false) { |
|
592 | + throw IbaseException::createFromPhpError(); |
|
593 | + } |
|
594 | 594 | } |
595 | 595 | |
596 | 596 | |
@@ -607,12 +607,12 @@ discard block |
||
607 | 607 | */ |
608 | 608 | function ibase_service_attach(string $host, string $dba_username, string $dba_password) |
609 | 609 | { |
610 | - error_clear_last(); |
|
611 | - $result = \ibase_service_attach($host, $dba_username, $dba_password); |
|
612 | - if ($result === false) { |
|
613 | - throw IbaseException::createFromPhpError(); |
|
614 | - } |
|
615 | - return $result; |
|
610 | + error_clear_last(); |
|
611 | + $result = \ibase_service_attach($host, $dba_username, $dba_password); |
|
612 | + if ($result === false) { |
|
613 | + throw IbaseException::createFromPhpError(); |
|
614 | + } |
|
615 | + return $result; |
|
616 | 616 | } |
617 | 617 | |
618 | 618 | |
@@ -625,9 +625,9 @@ discard block |
||
625 | 625 | */ |
626 | 626 | function ibase_service_detach($service_handle): void |
627 | 627 | { |
628 | - error_clear_last(); |
|
629 | - $result = \ibase_service_detach($service_handle); |
|
630 | - if ($result === false) { |
|
631 | - throw IbaseException::createFromPhpError(); |
|
632 | - } |
|
628 | + error_clear_last(); |
|
629 | + $result = \ibase_service_detach($service_handle); |
|
630 | + if ($result === false) { |
|
631 | + throw IbaseException::createFromPhpError(); |
|
632 | + } |
|
633 | 633 | } |
@@ -14,12 +14,12 @@ discard block |
||
14 | 14 | */ |
15 | 15 | function libxml_get_last_error(): \LibXMLError |
16 | 16 | { |
17 | - error_clear_last(); |
|
18 | - $result = \libxml_get_last_error(); |
|
19 | - if ($result === false) { |
|
20 | - throw LibxmlException::createFromPhpError(); |
|
21 | - } |
|
22 | - return $result; |
|
17 | + error_clear_last(); |
|
18 | + $result = \libxml_get_last_error(); |
|
19 | + if ($result === false) { |
|
20 | + throw LibxmlException::createFromPhpError(); |
|
21 | + } |
|
22 | + return $result; |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | */ |
36 | 36 | function libxml_set_external_entity_loader(callable $resolver_function): void |
37 | 37 | { |
38 | - error_clear_last(); |
|
39 | - $result = \libxml_set_external_entity_loader($resolver_function); |
|
40 | - if ($result === false) { |
|
41 | - throw LibxmlException::createFromPhpError(); |
|
42 | - } |
|
38 | + error_clear_last(); |
|
39 | + $result = \libxml_set_external_entity_loader($resolver_function); |
|
40 | + if ($result === false) { |
|
41 | + throw LibxmlException::createFromPhpError(); |
|
42 | + } |
|
43 | 43 | } |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | */ |
34 | 34 | function hash_hkdf(string $algo, string $ikm, int $length = 0, string $info = '', string $salt = ''): string |
35 | 35 | { |
36 | - error_clear_last(); |
|
37 | - $result = \hash_hkdf($algo, $ikm, $length, $info, $salt); |
|
38 | - if ($result === false) { |
|
39 | - throw HashException::createFromPhpError(); |
|
40 | - } |
|
41 | - return $result; |
|
36 | + error_clear_last(); |
|
37 | + $result = \hash_hkdf($algo, $ikm, $length, $info, $salt); |
|
38 | + if ($result === false) { |
|
39 | + throw HashException::createFromPhpError(); |
|
40 | + } |
|
41 | + return $result; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | */ |
54 | 54 | function hash_update_file(\HashContext $hcontext, string $filename, ?\HashContext $scontext = null): void |
55 | 55 | { |
56 | - error_clear_last(); |
|
57 | - $result = \hash_update_file($hcontext, $filename, $scontext); |
|
58 | - if ($result === false) { |
|
59 | - throw HashException::createFromPhpError(); |
|
60 | - } |
|
56 | + error_clear_last(); |
|
57 | + $result = \hash_update_file($hcontext, $filename, $scontext); |
|
58 | + if ($result === false) { |
|
59 | + throw HashException::createFromPhpError(); |
|
60 | + } |
|
61 | 61 | } |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | */ |
29 | 29 | function mysql_close($link_identifier = null): void |
30 | 30 | { |
31 | - error_clear_last(); |
|
32 | - $result = \mysql_close($link_identifier); |
|
33 | - if ($result === false) { |
|
34 | - throw MysqlException::createFromPhpError(); |
|
35 | - } |
|
31 | + error_clear_last(); |
|
32 | + $result = \mysql_close($link_identifier); |
|
33 | + if ($result === false) { |
|
34 | + throw MysqlException::createFromPhpError(); |
|
35 | + } |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -75,24 +75,24 @@ discard block |
||
75 | 75 | */ |
76 | 76 | function mysql_connect(string $server = null, string $username = null, string $password = null, bool $new_link = false, int $client_flags = 0) |
77 | 77 | { |
78 | - error_clear_last(); |
|
79 | - if ($client_flags !== 0) { |
|
80 | - $result = \mysql_connect($server, $username, $password, $new_link, $client_flags); |
|
81 | - } elseif ($new_link !== false) { |
|
82 | - $result = \mysql_connect($server, $username, $password, $new_link); |
|
83 | - } elseif ($password !== null) { |
|
84 | - $result = \mysql_connect($server, $username, $password); |
|
85 | - } elseif ($username !== null) { |
|
86 | - $result = \mysql_connect($server, $username); |
|
87 | - } elseif ($server !== null) { |
|
88 | - $result = \mysql_connect($server); |
|
89 | - } else { |
|
90 | - $result = \mysql_connect(); |
|
91 | - } |
|
92 | - if ($result === false) { |
|
93 | - throw MysqlException::createFromPhpError(); |
|
94 | - } |
|
95 | - return $result; |
|
78 | + error_clear_last(); |
|
79 | + if ($client_flags !== 0) { |
|
80 | + $result = \mysql_connect($server, $username, $password, $new_link, $client_flags); |
|
81 | + } elseif ($new_link !== false) { |
|
82 | + $result = \mysql_connect($server, $username, $password, $new_link); |
|
83 | + } elseif ($password !== null) { |
|
84 | + $result = \mysql_connect($server, $username, $password); |
|
85 | + } elseif ($username !== null) { |
|
86 | + $result = \mysql_connect($server, $username); |
|
87 | + } elseif ($server !== null) { |
|
88 | + $result = \mysql_connect($server); |
|
89 | + } else { |
|
90 | + $result = \mysql_connect(); |
|
91 | + } |
|
92 | + if ($result === false) { |
|
93 | + throw MysqlException::createFromPhpError(); |
|
94 | + } |
|
95 | + return $result; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | |
@@ -113,11 +113,11 @@ discard block |
||
113 | 113 | */ |
114 | 114 | function mysql_create_db(string $database_name, $link_identifier = null): void |
115 | 115 | { |
116 | - error_clear_last(); |
|
117 | - $result = \mysql_create_db($database_name, $link_identifier); |
|
118 | - if ($result === false) { |
|
119 | - throw MysqlException::createFromPhpError(); |
|
120 | - } |
|
116 | + error_clear_last(); |
|
117 | + $result = \mysql_create_db($database_name, $link_identifier); |
|
118 | + if ($result === false) { |
|
119 | + throw MysqlException::createFromPhpError(); |
|
120 | + } |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | */ |
145 | 145 | function mysql_data_seek($result, int $row_number): void |
146 | 146 | { |
147 | - error_clear_last(); |
|
148 | - $result = \mysql_data_seek($result, $row_number); |
|
149 | - if ($result === false) { |
|
150 | - throw MysqlException::createFromPhpError(); |
|
151 | - } |
|
147 | + error_clear_last(); |
|
148 | + $result = \mysql_data_seek($result, $row_number); |
|
149 | + if ($result === false) { |
|
150 | + throw MysqlException::createFromPhpError(); |
|
151 | + } |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | |
@@ -167,12 +167,12 @@ discard block |
||
167 | 167 | */ |
168 | 168 | function mysql_db_name($result, int $row, $field = null): string |
169 | 169 | { |
170 | - error_clear_last(); |
|
171 | - $result = \mysql_db_name($result, $row, $field); |
|
172 | - if ($result === false) { |
|
173 | - throw MysqlException::createFromPhpError(); |
|
174 | - } |
|
175 | - return $result; |
|
170 | + error_clear_last(); |
|
171 | + $result = \mysql_db_name($result, $row, $field); |
|
172 | + if ($result === false) { |
|
173 | + throw MysqlException::createFromPhpError(); |
|
174 | + } |
|
175 | + return $result; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | |
@@ -198,12 +198,12 @@ discard block |
||
198 | 198 | */ |
199 | 199 | function mysql_db_query(string $database, string $query, $link_identifier = null) |
200 | 200 | { |
201 | - error_clear_last(); |
|
202 | - $result = \mysql_db_query($database, $query, $link_identifier); |
|
203 | - if ($result === false) { |
|
204 | - throw MysqlException::createFromPhpError(); |
|
205 | - } |
|
206 | - return $result; |
|
201 | + error_clear_last(); |
|
202 | + $result = \mysql_db_query($database, $query, $link_identifier); |
|
203 | + if ($result === false) { |
|
204 | + throw MysqlException::createFromPhpError(); |
|
205 | + } |
|
206 | + return $result; |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | |
@@ -226,11 +226,11 @@ discard block |
||
226 | 226 | */ |
227 | 227 | function mysql_drop_db(string $database_name, $link_identifier = null): void |
228 | 228 | { |
229 | - error_clear_last(); |
|
230 | - $result = \mysql_drop_db($database_name, $link_identifier); |
|
231 | - if ($result === false) { |
|
232 | - throw MysqlException::createFromPhpError(); |
|
233 | - } |
|
229 | + error_clear_last(); |
|
230 | + $result = \mysql_drop_db($database_name, $link_identifier); |
|
231 | + if ($result === false) { |
|
232 | + throw MysqlException::createFromPhpError(); |
|
233 | + } |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | |
@@ -255,12 +255,12 @@ discard block |
||
255 | 255 | */ |
256 | 256 | function mysql_fetch_lengths($result): array |
257 | 257 | { |
258 | - error_clear_last(); |
|
259 | - $result = \mysql_fetch_lengths($result); |
|
260 | - if ($result === false) { |
|
261 | - throw MysqlException::createFromPhpError(); |
|
262 | - } |
|
263 | - return $result; |
|
258 | + error_clear_last(); |
|
259 | + $result = \mysql_fetch_lengths($result); |
|
260 | + if ($result === false) { |
|
261 | + throw MysqlException::createFromPhpError(); |
|
262 | + } |
|
263 | + return $result; |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | |
@@ -291,12 +291,12 @@ discard block |
||
291 | 291 | */ |
292 | 292 | function mysql_field_flags($result, int $field_offset): string |
293 | 293 | { |
294 | - error_clear_last(); |
|
295 | - $result = \mysql_field_flags($result, $field_offset); |
|
296 | - if ($result === false) { |
|
297 | - throw MysqlException::createFromPhpError(); |
|
298 | - } |
|
299 | - return $result; |
|
294 | + error_clear_last(); |
|
295 | + $result = \mysql_field_flags($result, $field_offset); |
|
296 | + if ($result === false) { |
|
297 | + throw MysqlException::createFromPhpError(); |
|
298 | + } |
|
299 | + return $result; |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | |
@@ -317,12 +317,12 @@ discard block |
||
317 | 317 | */ |
318 | 318 | function mysql_field_len($result, int $field_offset): int |
319 | 319 | { |
320 | - error_clear_last(); |
|
321 | - $result = \mysql_field_len($result, $field_offset); |
|
322 | - if ($result === false) { |
|
323 | - throw MysqlException::createFromPhpError(); |
|
324 | - } |
|
325 | - return $result; |
|
320 | + error_clear_last(); |
|
321 | + $result = \mysql_field_len($result, $field_offset); |
|
322 | + if ($result === false) { |
|
323 | + throw MysqlException::createFromPhpError(); |
|
324 | + } |
|
325 | + return $result; |
|
326 | 326 | } |
327 | 327 | |
328 | 328 | |
@@ -343,12 +343,12 @@ discard block |
||
343 | 343 | */ |
344 | 344 | function mysql_field_name($result, int $field_offset): string |
345 | 345 | { |
346 | - error_clear_last(); |
|
347 | - $result = \mysql_field_name($result, $field_offset); |
|
348 | - if ($result === false) { |
|
349 | - throw MysqlException::createFromPhpError(); |
|
350 | - } |
|
351 | - return $result; |
|
346 | + error_clear_last(); |
|
347 | + $result = \mysql_field_name($result, $field_offset); |
|
348 | + if ($result === false) { |
|
349 | + throw MysqlException::createFromPhpError(); |
|
350 | + } |
|
351 | + return $result; |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | |
@@ -370,11 +370,11 @@ discard block |
||
370 | 370 | */ |
371 | 371 | function mysql_field_seek($result, int $field_offset): void |
372 | 372 | { |
373 | - error_clear_last(); |
|
374 | - $result = \mysql_field_seek($result, $field_offset); |
|
375 | - if ($result === false) { |
|
376 | - throw MysqlException::createFromPhpError(); |
|
377 | - } |
|
373 | + error_clear_last(); |
|
374 | + $result = \mysql_field_seek($result, $field_offset); |
|
375 | + if ($result === false) { |
|
376 | + throw MysqlException::createFromPhpError(); |
|
377 | + } |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | |
@@ -395,11 +395,11 @@ discard block |
||
395 | 395 | */ |
396 | 396 | function mysql_free_result($result): void |
397 | 397 | { |
398 | - error_clear_last(); |
|
399 | - $result = \mysql_free_result($result); |
|
400 | - if ($result === false) { |
|
401 | - throw MysqlException::createFromPhpError(); |
|
402 | - } |
|
398 | + error_clear_last(); |
|
399 | + $result = \mysql_free_result($result); |
|
400 | + if ($result === false) { |
|
401 | + throw MysqlException::createFromPhpError(); |
|
402 | + } |
|
403 | 403 | } |
404 | 404 | |
405 | 405 | |
@@ -420,12 +420,12 @@ discard block |
||
420 | 420 | */ |
421 | 421 | function mysql_get_host_info($link_identifier = null): string |
422 | 422 | { |
423 | - error_clear_last(); |
|
424 | - $result = \mysql_get_host_info($link_identifier); |
|
425 | - if ($result === false) { |
|
426 | - throw MysqlException::createFromPhpError(); |
|
427 | - } |
|
428 | - return $result; |
|
423 | + error_clear_last(); |
|
424 | + $result = \mysql_get_host_info($link_identifier); |
|
425 | + if ($result === false) { |
|
426 | + throw MysqlException::createFromPhpError(); |
|
427 | + } |
|
428 | + return $result; |
|
429 | 429 | } |
430 | 430 | |
431 | 431 | |
@@ -444,12 +444,12 @@ discard block |
||
444 | 444 | */ |
445 | 445 | function mysql_get_proto_info($link_identifier = null): int |
446 | 446 | { |
447 | - error_clear_last(); |
|
448 | - $result = \mysql_get_proto_info($link_identifier); |
|
449 | - if ($result === false) { |
|
450 | - throw MysqlException::createFromPhpError(); |
|
451 | - } |
|
452 | - return $result; |
|
447 | + error_clear_last(); |
|
448 | + $result = \mysql_get_proto_info($link_identifier); |
|
449 | + if ($result === false) { |
|
450 | + throw MysqlException::createFromPhpError(); |
|
451 | + } |
|
452 | + return $result; |
|
453 | 453 | } |
454 | 454 | |
455 | 455 | |
@@ -468,12 +468,12 @@ discard block |
||
468 | 468 | */ |
469 | 469 | function mysql_get_server_info($link_identifier = null): string |
470 | 470 | { |
471 | - error_clear_last(); |
|
472 | - $result = \mysql_get_server_info($link_identifier); |
|
473 | - if ($result === false) { |
|
474 | - throw MysqlException::createFromPhpError(); |
|
475 | - } |
|
476 | - return $result; |
|
471 | + error_clear_last(); |
|
472 | + $result = \mysql_get_server_info($link_identifier); |
|
473 | + if ($result === false) { |
|
474 | + throw MysqlException::createFromPhpError(); |
|
475 | + } |
|
476 | + return $result; |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | |
@@ -494,12 +494,12 @@ discard block |
||
494 | 494 | */ |
495 | 495 | function mysql_info($link_identifier = null): string |
496 | 496 | { |
497 | - error_clear_last(); |
|
498 | - $result = \mysql_info($link_identifier); |
|
499 | - if ($result === false) { |
|
500 | - throw MysqlException::createFromPhpError(); |
|
501 | - } |
|
502 | - return $result; |
|
497 | + error_clear_last(); |
|
498 | + $result = \mysql_info($link_identifier); |
|
499 | + if ($result === false) { |
|
500 | + throw MysqlException::createFromPhpError(); |
|
501 | + } |
|
502 | + return $result; |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | |
@@ -521,12 +521,12 @@ discard block |
||
521 | 521 | */ |
522 | 522 | function mysql_list_dbs($link_identifier = null) |
523 | 523 | { |
524 | - error_clear_last(); |
|
525 | - $result = \mysql_list_dbs($link_identifier); |
|
526 | - if ($result === false) { |
|
527 | - throw MysqlException::createFromPhpError(); |
|
528 | - } |
|
529 | - return $result; |
|
524 | + error_clear_last(); |
|
525 | + $result = \mysql_list_dbs($link_identifier); |
|
526 | + if ($result === false) { |
|
527 | + throw MysqlException::createFromPhpError(); |
|
528 | + } |
|
529 | + return $result; |
|
530 | 530 | } |
531 | 531 | |
532 | 532 | |
@@ -556,12 +556,12 @@ discard block |
||
556 | 556 | */ |
557 | 557 | function mysql_list_fields(string $database_name, string $table_name, $link_identifier = null) |
558 | 558 | { |
559 | - error_clear_last(); |
|
560 | - $result = \mysql_list_fields($database_name, $table_name, $link_identifier); |
|
561 | - if ($result === false) { |
|
562 | - throw MysqlException::createFromPhpError(); |
|
563 | - } |
|
564 | - return $result; |
|
559 | + error_clear_last(); |
|
560 | + $result = \mysql_list_fields($database_name, $table_name, $link_identifier); |
|
561 | + if ($result === false) { |
|
562 | + throw MysqlException::createFromPhpError(); |
|
563 | + } |
|
564 | + return $result; |
|
565 | 565 | } |
566 | 566 | |
567 | 567 | |
@@ -580,12 +580,12 @@ discard block |
||
580 | 580 | */ |
581 | 581 | function mysql_list_processes($link_identifier = null) |
582 | 582 | { |
583 | - error_clear_last(); |
|
584 | - $result = \mysql_list_processes($link_identifier); |
|
585 | - if ($result === false) { |
|
586 | - throw MysqlException::createFromPhpError(); |
|
587 | - } |
|
588 | - return $result; |
|
583 | + error_clear_last(); |
|
584 | + $result = \mysql_list_processes($link_identifier); |
|
585 | + if ($result === false) { |
|
586 | + throw MysqlException::createFromPhpError(); |
|
587 | + } |
|
588 | + return $result; |
|
589 | 589 | } |
590 | 590 | |
591 | 591 | |
@@ -613,12 +613,12 @@ discard block |
||
613 | 613 | */ |
614 | 614 | function mysql_list_tables(string $database, $link_identifier = null) |
615 | 615 | { |
616 | - error_clear_last(); |
|
617 | - $result = \mysql_list_tables($database, $link_identifier); |
|
618 | - if ($result === false) { |
|
619 | - throw MysqlException::createFromPhpError(); |
|
620 | - } |
|
621 | - return $result; |
|
616 | + error_clear_last(); |
|
617 | + $result = \mysql_list_tables($database, $link_identifier); |
|
618 | + if ($result === false) { |
|
619 | + throw MysqlException::createFromPhpError(); |
|
620 | + } |
|
621 | + return $result; |
|
622 | 622 | } |
623 | 623 | |
624 | 624 | |
@@ -635,12 +635,12 @@ discard block |
||
635 | 635 | */ |
636 | 636 | function mysql_num_fields($result): int |
637 | 637 | { |
638 | - error_clear_last(); |
|
639 | - $result = \mysql_num_fields($result); |
|
640 | - if ($result === false) { |
|
641 | - throw MysqlException::createFromPhpError(); |
|
642 | - } |
|
643 | - return $result; |
|
638 | + error_clear_last(); |
|
639 | + $result = \mysql_num_fields($result); |
|
640 | + if ($result === false) { |
|
641 | + throw MysqlException::createFromPhpError(); |
|
642 | + } |
|
643 | + return $result; |
|
644 | 644 | } |
645 | 645 | |
646 | 646 | |
@@ -659,12 +659,12 @@ discard block |
||
659 | 659 | */ |
660 | 660 | function mysql_num_rows($result): int |
661 | 661 | { |
662 | - error_clear_last(); |
|
663 | - $result = \mysql_num_rows($result); |
|
664 | - if ($result === false) { |
|
665 | - throw MysqlException::createFromPhpError(); |
|
666 | - } |
|
667 | - return $result; |
|
662 | + error_clear_last(); |
|
663 | + $result = \mysql_num_rows($result); |
|
664 | + if ($result === false) { |
|
665 | + throw MysqlException::createFromPhpError(); |
|
666 | + } |
|
667 | + return $result; |
|
668 | 668 | } |
669 | 669 | |
670 | 670 | |
@@ -709,12 +709,12 @@ discard block |
||
709 | 709 | */ |
710 | 710 | function mysql_query(string $query, $link_identifier = null) |
711 | 711 | { |
712 | - error_clear_last(); |
|
713 | - $result = \mysql_query($query, $link_identifier); |
|
714 | - if ($result === false) { |
|
715 | - throw MysqlException::createFromPhpError(); |
|
716 | - } |
|
717 | - return $result; |
|
712 | + error_clear_last(); |
|
713 | + $result = \mysql_query($query, $link_identifier); |
|
714 | + if ($result === false) { |
|
715 | + throw MysqlException::createFromPhpError(); |
|
716 | + } |
|
717 | + return $result; |
|
718 | 718 | } |
719 | 719 | |
720 | 720 | |
@@ -746,12 +746,12 @@ discard block |
||
746 | 746 | */ |
747 | 747 | function mysql_real_escape_string(string $unescaped_string, $link_identifier = null): string |
748 | 748 | { |
749 | - error_clear_last(); |
|
750 | - $result = \mysql_real_escape_string($unescaped_string, $link_identifier); |
|
751 | - if ($result === false) { |
|
752 | - throw MysqlException::createFromPhpError(); |
|
753 | - } |
|
754 | - return $result; |
|
749 | + error_clear_last(); |
|
750 | + $result = \mysql_real_escape_string($unescaped_string, $link_identifier); |
|
751 | + if ($result === false) { |
|
752 | + throw MysqlException::createFromPhpError(); |
|
753 | + } |
|
754 | + return $result; |
|
755 | 755 | } |
756 | 756 | |
757 | 757 | |
@@ -783,12 +783,12 @@ discard block |
||
783 | 783 | */ |
784 | 784 | function mysql_result($result, int $row, $field = 0): string |
785 | 785 | { |
786 | - error_clear_last(); |
|
787 | - $result = \mysql_result($result, $row, $field); |
|
788 | - if ($result === false) { |
|
789 | - throw MysqlException::createFromPhpError(); |
|
790 | - } |
|
791 | - return $result; |
|
786 | + error_clear_last(); |
|
787 | + $result = \mysql_result($result, $row, $field); |
|
788 | + if ($result === false) { |
|
789 | + throw MysqlException::createFromPhpError(); |
|
790 | + } |
|
791 | + return $result; |
|
792 | 792 | } |
793 | 793 | |
794 | 794 | |
@@ -809,11 +809,11 @@ discard block |
||
809 | 809 | */ |
810 | 810 | function mysql_select_db(string $database_name, $link_identifier = null): void |
811 | 811 | { |
812 | - error_clear_last(); |
|
813 | - $result = \mysql_select_db($database_name, $link_identifier); |
|
814 | - if ($result === false) { |
|
815 | - throw MysqlException::createFromPhpError(); |
|
816 | - } |
|
812 | + error_clear_last(); |
|
813 | + $result = \mysql_select_db($database_name, $link_identifier); |
|
814 | + if ($result === false) { |
|
815 | + throw MysqlException::createFromPhpError(); |
|
816 | + } |
|
817 | 817 | } |
818 | 818 | |
819 | 819 | |
@@ -832,11 +832,11 @@ discard block |
||
832 | 832 | */ |
833 | 833 | function mysql_set_charset(string $charset, $link_identifier = null): void |
834 | 834 | { |
835 | - error_clear_last(); |
|
836 | - $result = \mysql_set_charset($charset, $link_identifier); |
|
837 | - if ($result === false) { |
|
838 | - throw MysqlException::createFromPhpError(); |
|
839 | - } |
|
835 | + error_clear_last(); |
|
836 | + $result = \mysql_set_charset($charset, $link_identifier); |
|
837 | + if ($result === false) { |
|
838 | + throw MysqlException::createFromPhpError(); |
|
839 | + } |
|
840 | 840 | } |
841 | 841 | |
842 | 842 | |
@@ -860,12 +860,12 @@ discard block |
||
860 | 860 | */ |
861 | 861 | function mysql_tablename($result, int $i): string |
862 | 862 | { |
863 | - error_clear_last(); |
|
864 | - $result = \mysql_tablename($result, $i); |
|
865 | - if ($result === false) { |
|
866 | - throw MysqlException::createFromPhpError(); |
|
867 | - } |
|
868 | - return $result; |
|
863 | + error_clear_last(); |
|
864 | + $result = \mysql_tablename($result, $i); |
|
865 | + if ($result === false) { |
|
866 | + throw MysqlException::createFromPhpError(); |
|
867 | + } |
|
868 | + return $result; |
|
869 | 869 | } |
870 | 870 | |
871 | 871 | |
@@ -886,12 +886,12 @@ discard block |
||
886 | 886 | */ |
887 | 887 | function mysql_thread_id($link_identifier = null): int |
888 | 888 | { |
889 | - error_clear_last(); |
|
890 | - $result = \mysql_thread_id($link_identifier); |
|
891 | - if ($result === false) { |
|
892 | - throw MysqlException::createFromPhpError(); |
|
893 | - } |
|
894 | - return $result; |
|
889 | + error_clear_last(); |
|
890 | + $result = \mysql_thread_id($link_identifier); |
|
891 | + if ($result === false) { |
|
892 | + throw MysqlException::createFromPhpError(); |
|
893 | + } |
|
894 | + return $result; |
|
895 | 895 | } |
896 | 896 | |
897 | 897 | |
@@ -929,10 +929,10 @@ discard block |
||
929 | 929 | */ |
930 | 930 | function mysql_unbuffered_query(string $query, $link_identifier = null) |
931 | 931 | { |
932 | - error_clear_last(); |
|
933 | - $result = \mysql_unbuffered_query($query, $link_identifier); |
|
934 | - if ($result === false) { |
|
935 | - throw MysqlException::createFromPhpError(); |
|
936 | - } |
|
937 | - return $result; |
|
932 | + error_clear_last(); |
|
933 | + $result = \mysql_unbuffered_query($query, $link_identifier); |
|
934 | + if ($result === false) { |
|
935 | + throw MysqlException::createFromPhpError(); |
|
936 | + } |
|
937 | + return $result; |
|
938 | 938 | } |
@@ -17,12 +17,12 @@ discard block |
||
17 | 17 | */ |
18 | 18 | function ldap_add_ext($link_identifier, string $dn, array $entry, array $serverctrls = null) |
19 | 19 | { |
20 | - error_clear_last(); |
|
21 | - $result = \ldap_add_ext($link_identifier, $dn, $entry, $serverctrls); |
|
22 | - if ($result === false) { |
|
23 | - throw LdapException::createFromPhpError(); |
|
24 | - } |
|
25 | - return $result; |
|
20 | + error_clear_last(); |
|
21 | + $result = \ldap_add_ext($link_identifier, $dn, $entry, $serverctrls); |
|
22 | + if ($result === false) { |
|
23 | + throw LdapException::createFromPhpError(); |
|
24 | + } |
|
25 | + return $result; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | */ |
48 | 48 | function ldap_add($link_identifier, string $dn, array $entry, array $serverctrls = null): void |
49 | 49 | { |
50 | - error_clear_last(); |
|
51 | - $result = \ldap_add($link_identifier, $dn, $entry, $serverctrls); |
|
52 | - if ($result === false) { |
|
53 | - throw LdapException::createFromPhpError(); |
|
54 | - } |
|
50 | + error_clear_last(); |
|
51 | + $result = \ldap_add($link_identifier, $dn, $entry, $serverctrls); |
|
52 | + if ($result === false) { |
|
53 | + throw LdapException::createFromPhpError(); |
|
54 | + } |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | */ |
69 | 69 | function ldap_bind_ext($link_identifier, ?string $bind_rdn = null, ?string $bind_password = null, array $serverctrls = null) |
70 | 70 | { |
71 | - error_clear_last(); |
|
72 | - $result = \ldap_bind_ext($link_identifier, $bind_rdn, $bind_password, $serverctrls); |
|
73 | - if ($result === false) { |
|
74 | - throw LdapException::createFromPhpError(); |
|
75 | - } |
|
76 | - return $result; |
|
71 | + error_clear_last(); |
|
72 | + $result = \ldap_bind_ext($link_identifier, $bind_rdn, $bind_password, $serverctrls); |
|
73 | + if ($result === false) { |
|
74 | + throw LdapException::createFromPhpError(); |
|
75 | + } |
|
76 | + return $result; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | */ |
89 | 89 | function ldap_bind($link_identifier, ?string $bind_rdn = null, ?string $bind_password = null): void |
90 | 90 | { |
91 | - error_clear_last(); |
|
92 | - $result = \ldap_bind($link_identifier, $bind_rdn, $bind_password); |
|
93 | - if ($result === false) { |
|
94 | - throw LdapException::createFromPhpError(); |
|
95 | - } |
|
91 | + error_clear_last(); |
|
92 | + $result = \ldap_bind($link_identifier, $bind_rdn, $bind_password); |
|
93 | + if ($result === false) { |
|
94 | + throw LdapException::createFromPhpError(); |
|
95 | + } |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | |
@@ -108,11 +108,11 @@ discard block |
||
108 | 108 | */ |
109 | 109 | function ldap_control_paged_result_response($link, $result, ?string &$cookie = null, ?int &$estimated = null): void |
110 | 110 | { |
111 | - error_clear_last(); |
|
112 | - $result = \ldap_control_paged_result_response($link, $result, $cookie, $estimated); |
|
113 | - if ($result === false) { |
|
114 | - throw LdapException::createFromPhpError(); |
|
115 | - } |
|
111 | + error_clear_last(); |
|
112 | + $result = \ldap_control_paged_result_response($link, $result, $cookie, $estimated); |
|
113 | + if ($result === false) { |
|
114 | + throw LdapException::createFromPhpError(); |
|
115 | + } |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -131,11 +131,11 @@ discard block |
||
131 | 131 | */ |
132 | 132 | function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): void |
133 | 133 | { |
134 | - error_clear_last(); |
|
135 | - $result = \ldap_control_paged_result($link, $pagesize, $iscritical, $cookie); |
|
136 | - if ($result === false) { |
|
137 | - throw LdapException::createFromPhpError(); |
|
138 | - } |
|
134 | + error_clear_last(); |
|
135 | + $result = \ldap_control_paged_result($link, $pagesize, $iscritical, $cookie); |
|
136 | + if ($result === false) { |
|
137 | + throw LdapException::createFromPhpError(); |
|
138 | + } |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | |
@@ -151,12 +151,12 @@ discard block |
||
151 | 151 | */ |
152 | 152 | function ldap_count_entries($link_identifier, $result_identifier): int |
153 | 153 | { |
154 | - error_clear_last(); |
|
155 | - $result = \ldap_count_entries($link_identifier, $result_identifier); |
|
156 | - if ($result === false) { |
|
157 | - throw LdapException::createFromPhpError(); |
|
158 | - } |
|
159 | - return $result; |
|
154 | + error_clear_last(); |
|
155 | + $result = \ldap_count_entries($link_identifier, $result_identifier); |
|
156 | + if ($result === false) { |
|
157 | + throw LdapException::createFromPhpError(); |
|
158 | + } |
|
159 | + return $result; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | |
@@ -172,12 +172,12 @@ discard block |
||
172 | 172 | */ |
173 | 173 | function ldap_delete_ext($link_identifier, string $dn, array $serverctrls = null) |
174 | 174 | { |
175 | - error_clear_last(); |
|
176 | - $result = \ldap_delete_ext($link_identifier, $dn, $serverctrls); |
|
177 | - if ($result === false) { |
|
178 | - throw LdapException::createFromPhpError(); |
|
179 | - } |
|
180 | - return $result; |
|
175 | + error_clear_last(); |
|
176 | + $result = \ldap_delete_ext($link_identifier, $dn, $serverctrls); |
|
177 | + if ($result === false) { |
|
178 | + throw LdapException::createFromPhpError(); |
|
179 | + } |
|
180 | + return $result; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | */ |
193 | 193 | function ldap_delete($link_identifier, string $dn, array $serverctrls = null): void |
194 | 194 | { |
195 | - error_clear_last(); |
|
196 | - $result = \ldap_delete($link_identifier, $dn, $serverctrls); |
|
197 | - if ($result === false) { |
|
198 | - throw LdapException::createFromPhpError(); |
|
199 | - } |
|
195 | + error_clear_last(); |
|
196 | + $result = \ldap_delete($link_identifier, $dn, $serverctrls); |
|
197 | + if ($result === false) { |
|
198 | + throw LdapException::createFromPhpError(); |
|
199 | + } |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | |
@@ -217,12 +217,12 @@ discard block |
||
217 | 217 | */ |
218 | 218 | function ldap_exop_passwd($link, string $user = "", string $oldpw = "", string $newpw = "", array &$serverctrls = null) |
219 | 219 | { |
220 | - error_clear_last(); |
|
221 | - $result = \ldap_exop_passwd($link, $user, $oldpw, $newpw, $serverctrls); |
|
222 | - if ($result === false) { |
|
223 | - throw LdapException::createFromPhpError(); |
|
224 | - } |
|
225 | - return $result; |
|
220 | + error_clear_last(); |
|
221 | + $result = \ldap_exop_passwd($link, $user, $oldpw, $newpw, $serverctrls); |
|
222 | + if ($result === false) { |
|
223 | + throw LdapException::createFromPhpError(); |
|
224 | + } |
|
225 | + return $result; |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | |
@@ -236,12 +236,12 @@ discard block |
||
236 | 236 | */ |
237 | 237 | function ldap_exop_whoami($link): string |
238 | 238 | { |
239 | - error_clear_last(); |
|
240 | - $result = \ldap_exop_whoami($link); |
|
241 | - if ($result === false) { |
|
242 | - throw LdapException::createFromPhpError(); |
|
243 | - } |
|
244 | - return $result; |
|
239 | + error_clear_last(); |
|
240 | + $result = \ldap_exop_whoami($link); |
|
241 | + if ($result === false) { |
|
242 | + throw LdapException::createFromPhpError(); |
|
243 | + } |
|
244 | + return $result; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | |
@@ -265,12 +265,12 @@ discard block |
||
265 | 265 | */ |
266 | 266 | function ldap_exop($link, string $reqoid, string $reqdata = null, ?array $serverctrls = null, ?string &$retdata = null, ?string &$retoid = null) |
267 | 267 | { |
268 | - error_clear_last(); |
|
269 | - $result = \ldap_exop($link, $reqoid, $reqdata, $serverctrls, $retdata, $retoid); |
|
270 | - if ($result === false) { |
|
271 | - throw LdapException::createFromPhpError(); |
|
272 | - } |
|
273 | - return $result; |
|
268 | + error_clear_last(); |
|
269 | + $result = \ldap_exop($link, $reqoid, $reqdata, $serverctrls, $retdata, $retoid); |
|
270 | + if ($result === false) { |
|
271 | + throw LdapException::createFromPhpError(); |
|
272 | + } |
|
273 | + return $result; |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | |
@@ -293,12 +293,12 @@ discard block |
||
293 | 293 | */ |
294 | 294 | function ldap_explode_dn(string $dn, int $with_attrib): array |
295 | 295 | { |
296 | - error_clear_last(); |
|
297 | - $result = \ldap_explode_dn($dn, $with_attrib); |
|
298 | - if ($result === false) { |
|
299 | - throw LdapException::createFromPhpError(); |
|
300 | - } |
|
301 | - return $result; |
|
296 | + error_clear_last(); |
|
297 | + $result = \ldap_explode_dn($dn, $with_attrib); |
|
298 | + if ($result === false) { |
|
299 | + throw LdapException::createFromPhpError(); |
|
300 | + } |
|
301 | + return $result; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | |
@@ -318,12 +318,12 @@ discard block |
||
318 | 318 | */ |
319 | 319 | function ldap_first_attribute($link_identifier, $result_entry_identifier): string |
320 | 320 | { |
321 | - error_clear_last(); |
|
322 | - $result = \ldap_first_attribute($link_identifier, $result_entry_identifier); |
|
323 | - if ($result === false) { |
|
324 | - throw LdapException::createFromPhpError(); |
|
325 | - } |
|
326 | - return $result; |
|
321 | + error_clear_last(); |
|
322 | + $result = \ldap_first_attribute($link_identifier, $result_entry_identifier); |
|
323 | + if ($result === false) { |
|
324 | + throw LdapException::createFromPhpError(); |
|
325 | + } |
|
326 | + return $result; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | |
@@ -345,12 +345,12 @@ discard block |
||
345 | 345 | */ |
346 | 346 | function ldap_first_entry($link_identifier, $result_identifier) |
347 | 347 | { |
348 | - error_clear_last(); |
|
349 | - $result = \ldap_first_entry($link_identifier, $result_identifier); |
|
350 | - if ($result === false) { |
|
351 | - throw LdapException::createFromPhpError(); |
|
352 | - } |
|
353 | - return $result; |
|
348 | + error_clear_last(); |
|
349 | + $result = \ldap_first_entry($link_identifier, $result_identifier); |
|
350 | + if ($result === false) { |
|
351 | + throw LdapException::createFromPhpError(); |
|
352 | + } |
|
353 | + return $result; |
|
354 | 354 | } |
355 | 355 | |
356 | 356 | |
@@ -369,11 +369,11 @@ discard block |
||
369 | 369 | */ |
370 | 370 | function ldap_free_result($result_identifier): void |
371 | 371 | { |
372 | - error_clear_last(); |
|
373 | - $result = \ldap_free_result($result_identifier); |
|
374 | - if ($result === false) { |
|
375 | - throw LdapException::createFromPhpError(); |
|
376 | - } |
|
372 | + error_clear_last(); |
|
373 | + $result = \ldap_free_result($result_identifier); |
|
374 | + if ($result === false) { |
|
375 | + throw LdapException::createFromPhpError(); |
|
376 | + } |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | |
@@ -401,12 +401,12 @@ discard block |
||
401 | 401 | */ |
402 | 402 | function ldap_get_attributes($link_identifier, $result_entry_identifier): array |
403 | 403 | { |
404 | - error_clear_last(); |
|
405 | - $result = \ldap_get_attributes($link_identifier, $result_entry_identifier); |
|
406 | - if ($result === false) { |
|
407 | - throw LdapException::createFromPhpError(); |
|
408 | - } |
|
409 | - return $result; |
|
404 | + error_clear_last(); |
|
405 | + $result = \ldap_get_attributes($link_identifier, $result_entry_identifier); |
|
406 | + if ($result === false) { |
|
407 | + throw LdapException::createFromPhpError(); |
|
408 | + } |
|
409 | + return $result; |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | |
@@ -421,12 +421,12 @@ discard block |
||
421 | 421 | */ |
422 | 422 | function ldap_get_dn($link_identifier, $result_entry_identifier): string |
423 | 423 | { |
424 | - error_clear_last(); |
|
425 | - $result = \ldap_get_dn($link_identifier, $result_entry_identifier); |
|
426 | - if ($result === false) { |
|
427 | - throw LdapException::createFromPhpError(); |
|
428 | - } |
|
429 | - return $result; |
|
424 | + error_clear_last(); |
|
425 | + $result = \ldap_get_dn($link_identifier, $result_entry_identifier); |
|
426 | + if ($result === false) { |
|
427 | + throw LdapException::createFromPhpError(); |
|
428 | + } |
|
429 | + return $result; |
|
430 | 430 | } |
431 | 431 | |
432 | 432 | |
@@ -453,12 +453,12 @@ discard block |
||
453 | 453 | */ |
454 | 454 | function ldap_get_entries($link_identifier, $result_identifier): array |
455 | 455 | { |
456 | - error_clear_last(); |
|
457 | - $result = \ldap_get_entries($link_identifier, $result_identifier); |
|
458 | - if ($result === false) { |
|
459 | - throw LdapException::createFromPhpError(); |
|
460 | - } |
|
461 | - return $result; |
|
456 | + error_clear_last(); |
|
457 | + $result = \ldap_get_entries($link_identifier, $result_identifier); |
|
458 | + if ($result === false) { |
|
459 | + throw LdapException::createFromPhpError(); |
|
460 | + } |
|
461 | + return $result; |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | |
@@ -646,11 +646,11 @@ discard block |
||
646 | 646 | */ |
647 | 647 | function ldap_get_option($link_identifier, int $option, &$retval): void |
648 | 648 | { |
649 | - error_clear_last(); |
|
650 | - $result = \ldap_get_option($link_identifier, $option, $retval); |
|
651 | - if ($result === false) { |
|
652 | - throw LdapException::createFromPhpError(); |
|
653 | - } |
|
649 | + error_clear_last(); |
|
650 | + $result = \ldap_get_option($link_identifier, $option, $retval); |
|
651 | + if ($result === false) { |
|
652 | + throw LdapException::createFromPhpError(); |
|
653 | + } |
|
654 | 654 | } |
655 | 655 | |
656 | 656 | |
@@ -672,12 +672,12 @@ discard block |
||
672 | 672 | */ |
673 | 673 | function ldap_get_values_len($link_identifier, $result_entry_identifier, string $attribute): array |
674 | 674 | { |
675 | - error_clear_last(); |
|
676 | - $result = \ldap_get_values_len($link_identifier, $result_entry_identifier, $attribute); |
|
677 | - if ($result === false) { |
|
678 | - throw LdapException::createFromPhpError(); |
|
679 | - } |
|
680 | - return $result; |
|
675 | + error_clear_last(); |
|
676 | + $result = \ldap_get_values_len($link_identifier, $result_entry_identifier, $attribute); |
|
677 | + if ($result === false) { |
|
678 | + throw LdapException::createFromPhpError(); |
|
679 | + } |
|
680 | + return $result; |
|
681 | 681 | } |
682 | 682 | |
683 | 683 | |
@@ -716,12 +716,12 @@ discard block |
||
716 | 716 | */ |
717 | 717 | function ldap_get_values($link_identifier, $result_entry_identifier, string $attribute): array |
718 | 718 | { |
719 | - error_clear_last(); |
|
720 | - $result = \ldap_get_values($link_identifier, $result_entry_identifier, $attribute); |
|
721 | - if ($result === false) { |
|
722 | - throw LdapException::createFromPhpError(); |
|
723 | - } |
|
724 | - return $result; |
|
719 | + error_clear_last(); |
|
720 | + $result = \ldap_get_values($link_identifier, $result_entry_identifier, $attribute); |
|
721 | + if ($result === false) { |
|
722 | + throw LdapException::createFromPhpError(); |
|
723 | + } |
|
724 | + return $result; |
|
725 | 725 | } |
726 | 726 | |
727 | 727 | |
@@ -800,26 +800,26 @@ discard block |
||
800 | 800 | */ |
801 | 801 | function ldap_list($link_identifier, string $base_dn, string $filter, array $attributes = null, int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $serverctrls = null) |
802 | 802 | { |
803 | - error_clear_last(); |
|
804 | - if ($serverctrls !== null) { |
|
805 | - $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls); |
|
806 | - } elseif ($deref !== LDAP_DEREF_NEVER) { |
|
807 | - $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); |
|
808 | - } elseif ($timelimit !== -1) { |
|
809 | - $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit); |
|
810 | - } elseif ($sizelimit !== -1) { |
|
811 | - $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit); |
|
812 | - } elseif ($attrsonly !== 0) { |
|
813 | - $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly); |
|
814 | - } elseif ($attributes !== null) { |
|
815 | - $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes); |
|
816 | - } else { |
|
817 | - $result = \ldap_list($link_identifier, $base_dn, $filter); |
|
818 | - } |
|
819 | - if ($result === false) { |
|
820 | - throw LdapException::createFromPhpError(); |
|
821 | - } |
|
822 | - return $result; |
|
803 | + error_clear_last(); |
|
804 | + if ($serverctrls !== null) { |
|
805 | + $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls); |
|
806 | + } elseif ($deref !== LDAP_DEREF_NEVER) { |
|
807 | + $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); |
|
808 | + } elseif ($timelimit !== -1) { |
|
809 | + $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit); |
|
810 | + } elseif ($sizelimit !== -1) { |
|
811 | + $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit); |
|
812 | + } elseif ($attrsonly !== 0) { |
|
813 | + $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes, $attrsonly); |
|
814 | + } elseif ($attributes !== null) { |
|
815 | + $result = \ldap_list($link_identifier, $base_dn, $filter, $attributes); |
|
816 | + } else { |
|
817 | + $result = \ldap_list($link_identifier, $base_dn, $filter); |
|
818 | + } |
|
819 | + if ($result === false) { |
|
820 | + throw LdapException::createFromPhpError(); |
|
821 | + } |
|
822 | + return $result; |
|
823 | 823 | } |
824 | 824 | |
825 | 825 | |
@@ -836,12 +836,12 @@ discard block |
||
836 | 836 | */ |
837 | 837 | function ldap_mod_add_ext($link_identifier, string $dn, array $entry, array $serverctrls = null) |
838 | 838 | { |
839 | - error_clear_last(); |
|
840 | - $result = \ldap_mod_add_ext($link_identifier, $dn, $entry, $serverctrls); |
|
841 | - if ($result === false) { |
|
842 | - throw LdapException::createFromPhpError(); |
|
843 | - } |
|
844 | - return $result; |
|
839 | + error_clear_last(); |
|
840 | + $result = \ldap_mod_add_ext($link_identifier, $dn, $entry, $serverctrls); |
|
841 | + if ($result === false) { |
|
842 | + throw LdapException::createFromPhpError(); |
|
843 | + } |
|
844 | + return $result; |
|
845 | 845 | } |
846 | 846 | |
847 | 847 | |
@@ -858,11 +858,11 @@ discard block |
||
858 | 858 | */ |
859 | 859 | function ldap_mod_add($link_identifier, string $dn, array $entry, array $serverctrls = null): void |
860 | 860 | { |
861 | - error_clear_last(); |
|
862 | - $result = \ldap_mod_add($link_identifier, $dn, $entry, $serverctrls); |
|
863 | - if ($result === false) { |
|
864 | - throw LdapException::createFromPhpError(); |
|
865 | - } |
|
861 | + error_clear_last(); |
|
862 | + $result = \ldap_mod_add($link_identifier, $dn, $entry, $serverctrls); |
|
863 | + if ($result === false) { |
|
864 | + throw LdapException::createFromPhpError(); |
|
865 | + } |
|
866 | 866 | } |
867 | 867 | |
868 | 868 | |
@@ -879,12 +879,12 @@ discard block |
||
879 | 879 | */ |
880 | 880 | function ldap_mod_del_ext($link_identifier, string $dn, array $entry, array $serverctrls = null) |
881 | 881 | { |
882 | - error_clear_last(); |
|
883 | - $result = \ldap_mod_del_ext($link_identifier, $dn, $entry, $serverctrls); |
|
884 | - if ($result === false) { |
|
885 | - throw LdapException::createFromPhpError(); |
|
886 | - } |
|
887 | - return $result; |
|
882 | + error_clear_last(); |
|
883 | + $result = \ldap_mod_del_ext($link_identifier, $dn, $entry, $serverctrls); |
|
884 | + if ($result === false) { |
|
885 | + throw LdapException::createFromPhpError(); |
|
886 | + } |
|
887 | + return $result; |
|
888 | 888 | } |
889 | 889 | |
890 | 890 | |
@@ -902,11 +902,11 @@ discard block |
||
902 | 902 | */ |
903 | 903 | function ldap_mod_del($link_identifier, string $dn, array $entry, array $serverctrls = null): void |
904 | 904 | { |
905 | - error_clear_last(); |
|
906 | - $result = \ldap_mod_del($link_identifier, $dn, $entry, $serverctrls); |
|
907 | - if ($result === false) { |
|
908 | - throw LdapException::createFromPhpError(); |
|
909 | - } |
|
905 | + error_clear_last(); |
|
906 | + $result = \ldap_mod_del($link_identifier, $dn, $entry, $serverctrls); |
|
907 | + if ($result === false) { |
|
908 | + throw LdapException::createFromPhpError(); |
|
909 | + } |
|
910 | 910 | } |
911 | 911 | |
912 | 912 | |
@@ -923,12 +923,12 @@ discard block |
||
923 | 923 | */ |
924 | 924 | function ldap_mod_replace_ext($link_identifier, string $dn, array $entry, array $serverctrls = null) |
925 | 925 | { |
926 | - error_clear_last(); |
|
927 | - $result = \ldap_mod_replace_ext($link_identifier, $dn, $entry, $serverctrls); |
|
928 | - if ($result === false) { |
|
929 | - throw LdapException::createFromPhpError(); |
|
930 | - } |
|
931 | - return $result; |
|
926 | + error_clear_last(); |
|
927 | + $result = \ldap_mod_replace_ext($link_identifier, $dn, $entry, $serverctrls); |
|
928 | + if ($result === false) { |
|
929 | + throw LdapException::createFromPhpError(); |
|
930 | + } |
|
931 | + return $result; |
|
932 | 932 | } |
933 | 933 | |
934 | 934 | |
@@ -945,11 +945,11 @@ discard block |
||
945 | 945 | */ |
946 | 946 | function ldap_mod_replace($link_identifier, string $dn, array $entry, array $serverctrls = null): void |
947 | 947 | { |
948 | - error_clear_last(); |
|
949 | - $result = \ldap_mod_replace($link_identifier, $dn, $entry, $serverctrls); |
|
950 | - if ($result === false) { |
|
951 | - throw LdapException::createFromPhpError(); |
|
952 | - } |
|
948 | + error_clear_last(); |
|
949 | + $result = \ldap_mod_replace($link_identifier, $dn, $entry, $serverctrls); |
|
950 | + if ($result === false) { |
|
951 | + throw LdapException::createFromPhpError(); |
|
952 | + } |
|
953 | 953 | } |
954 | 954 | |
955 | 955 | |
@@ -1040,11 +1040,11 @@ discard block |
||
1040 | 1040 | */ |
1041 | 1041 | function ldap_modify_batch($link_identifier, string $dn, array $entry, array $serverctrls = null): void |
1042 | 1042 | { |
1043 | - error_clear_last(); |
|
1044 | - $result = \ldap_modify_batch($link_identifier, $dn, $entry, $serverctrls); |
|
1045 | - if ($result === false) { |
|
1046 | - throw LdapException::createFromPhpError(); |
|
1047 | - } |
|
1043 | + error_clear_last(); |
|
1044 | + $result = \ldap_modify_batch($link_identifier, $dn, $entry, $serverctrls); |
|
1045 | + if ($result === false) { |
|
1046 | + throw LdapException::createFromPhpError(); |
|
1047 | + } |
|
1048 | 1048 | } |
1049 | 1049 | |
1050 | 1050 | |
@@ -1063,12 +1063,12 @@ discard block |
||
1063 | 1063 | */ |
1064 | 1064 | function ldap_next_attribute($link_identifier, $result_entry_identifier): string |
1065 | 1065 | { |
1066 | - error_clear_last(); |
|
1067 | - $result = \ldap_next_attribute($link_identifier, $result_entry_identifier); |
|
1068 | - if ($result === false) { |
|
1069 | - throw LdapException::createFromPhpError(); |
|
1070 | - } |
|
1071 | - return $result; |
|
1066 | + error_clear_last(); |
|
1067 | + $result = \ldap_next_attribute($link_identifier, $result_entry_identifier); |
|
1068 | + if ($result === false) { |
|
1069 | + throw LdapException::createFromPhpError(); |
|
1070 | + } |
|
1071 | + return $result; |
|
1072 | 1072 | } |
1073 | 1073 | |
1074 | 1074 | |
@@ -1084,11 +1084,11 @@ discard block |
||
1084 | 1084 | */ |
1085 | 1085 | function ldap_parse_exop($link, $result, ?string &$retdata = null, ?string &$retoid = null): void |
1086 | 1086 | { |
1087 | - error_clear_last(); |
|
1088 | - $result = \ldap_parse_exop($link, $result, $retdata, $retoid); |
|
1089 | - if ($result === false) { |
|
1090 | - throw LdapException::createFromPhpError(); |
|
1091 | - } |
|
1087 | + error_clear_last(); |
|
1088 | + $result = \ldap_parse_exop($link, $result, $retdata, $retoid); |
|
1089 | + if ($result === false) { |
|
1090 | + throw LdapException::createFromPhpError(); |
|
1091 | + } |
|
1092 | 1092 | } |
1093 | 1093 | |
1094 | 1094 | |
@@ -1113,11 +1113,11 @@ discard block |
||
1113 | 1113 | */ |
1114 | 1114 | function ldap_parse_result($link, $result, ?int &$errcode, ?string &$matcheddn = null, ?string &$errmsg = null, ?array &$referrals = null, ?array &$serverctrls = null): void |
1115 | 1115 | { |
1116 | - error_clear_last(); |
|
1117 | - $result = \ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $serverctrls); |
|
1118 | - if ($result === false) { |
|
1119 | - throw LdapException::createFromPhpError(); |
|
1120 | - } |
|
1116 | + error_clear_last(); |
|
1117 | + $result = \ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $serverctrls); |
|
1118 | + if ($result === false) { |
|
1119 | + throw LdapException::createFromPhpError(); |
|
1120 | + } |
|
1121 | 1121 | } |
1122 | 1122 | |
1123 | 1123 | |
@@ -1195,26 +1195,26 @@ discard block |
||
1195 | 1195 | */ |
1196 | 1196 | function ldap_read($link_identifier, string $base_dn, string $filter, array $attributes = null, int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $serverctrls = null) |
1197 | 1197 | { |
1198 | - error_clear_last(); |
|
1199 | - if ($serverctrls !== null) { |
|
1200 | - $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls); |
|
1201 | - } elseif ($deref !== LDAP_DEREF_NEVER) { |
|
1202 | - $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); |
|
1203 | - } elseif ($timelimit !== -1) { |
|
1204 | - $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit); |
|
1205 | - } elseif ($sizelimit !== -1) { |
|
1206 | - $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit); |
|
1207 | - } elseif ($attrsonly !== 0) { |
|
1208 | - $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly); |
|
1209 | - } elseif ($attributes !== null) { |
|
1210 | - $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes); |
|
1211 | - } else { |
|
1212 | - $result = \ldap_read($link_identifier, $base_dn, $filter); |
|
1213 | - } |
|
1214 | - if ($result === false) { |
|
1215 | - throw LdapException::createFromPhpError(); |
|
1216 | - } |
|
1217 | - return $result; |
|
1198 | + error_clear_last(); |
|
1199 | + if ($serverctrls !== null) { |
|
1200 | + $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls); |
|
1201 | + } elseif ($deref !== LDAP_DEREF_NEVER) { |
|
1202 | + $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); |
|
1203 | + } elseif ($timelimit !== -1) { |
|
1204 | + $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit); |
|
1205 | + } elseif ($sizelimit !== -1) { |
|
1206 | + $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit); |
|
1207 | + } elseif ($attrsonly !== 0) { |
|
1208 | + $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes, $attrsonly); |
|
1209 | + } elseif ($attributes !== null) { |
|
1210 | + $result = \ldap_read($link_identifier, $base_dn, $filter, $attributes); |
|
1211 | + } else { |
|
1212 | + $result = \ldap_read($link_identifier, $base_dn, $filter); |
|
1213 | + } |
|
1214 | + if ($result === false) { |
|
1215 | + throw LdapException::createFromPhpError(); |
|
1216 | + } |
|
1217 | + return $result; |
|
1218 | 1218 | } |
1219 | 1219 | |
1220 | 1220 | |
@@ -1233,12 +1233,12 @@ discard block |
||
1233 | 1233 | */ |
1234 | 1234 | function ldap_rename_ext($link_identifier, string $dn, string $newrdn, string $newparent, bool $deleteoldrdn, array $serverctrls = null) |
1235 | 1235 | { |
1236 | - error_clear_last(); |
|
1237 | - $result = \ldap_rename_ext($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn, $serverctrls); |
|
1238 | - if ($result === false) { |
|
1239 | - throw LdapException::createFromPhpError(); |
|
1240 | - } |
|
1241 | - return $result; |
|
1236 | + error_clear_last(); |
|
1237 | + $result = \ldap_rename_ext($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn, $serverctrls); |
|
1238 | + if ($result === false) { |
|
1239 | + throw LdapException::createFromPhpError(); |
|
1240 | + } |
|
1241 | + return $result; |
|
1242 | 1242 | } |
1243 | 1243 | |
1244 | 1244 | |
@@ -1257,11 +1257,11 @@ discard block |
||
1257 | 1257 | */ |
1258 | 1258 | function ldap_rename($link_identifier, string $dn, string $newrdn, string $newparent, bool $deleteoldrdn, array $serverctrls = null): void |
1259 | 1259 | { |
1260 | - error_clear_last(); |
|
1261 | - $result = \ldap_rename($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn, $serverctrls); |
|
1262 | - if ($result === false) { |
|
1263 | - throw LdapException::createFromPhpError(); |
|
1264 | - } |
|
1260 | + error_clear_last(); |
|
1261 | + $result = \ldap_rename($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn, $serverctrls); |
|
1262 | + if ($result === false) { |
|
1263 | + throw LdapException::createFromPhpError(); |
|
1264 | + } |
|
1265 | 1265 | } |
1266 | 1266 | |
1267 | 1267 | |
@@ -1281,11 +1281,11 @@ discard block |
||
1281 | 1281 | */ |
1282 | 1282 | function ldap_sasl_bind($link, string $binddn = null, string $password = null, string $sasl_mech = null, string $sasl_realm = null, string $sasl_authc_id = null, string $sasl_authz_id = null, string $props = null): void |
1283 | 1283 | { |
1284 | - error_clear_last(); |
|
1285 | - $result = \ldap_sasl_bind($link, $binddn, $password, $sasl_mech, $sasl_realm, $sasl_authc_id, $sasl_authz_id, $props); |
|
1286 | - if ($result === false) { |
|
1287 | - throw LdapException::createFromPhpError(); |
|
1288 | - } |
|
1284 | + error_clear_last(); |
|
1285 | + $result = \ldap_sasl_bind($link, $binddn, $password, $sasl_mech, $sasl_realm, $sasl_authc_id, $sasl_authz_id, $props); |
|
1286 | + if ($result === false) { |
|
1287 | + throw LdapException::createFromPhpError(); |
|
1288 | + } |
|
1289 | 1289 | } |
1290 | 1290 | |
1291 | 1291 | |
@@ -1377,26 +1377,26 @@ discard block |
||
1377 | 1377 | */ |
1378 | 1378 | function ldap_search($link_identifier, string $base_dn, string $filter, array $attributes = null, int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $serverctrls = null) |
1379 | 1379 | { |
1380 | - error_clear_last(); |
|
1381 | - if ($serverctrls !== null) { |
|
1382 | - $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls); |
|
1383 | - } elseif ($deref !== LDAP_DEREF_NEVER) { |
|
1384 | - $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); |
|
1385 | - } elseif ($timelimit !== -1) { |
|
1386 | - $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit); |
|
1387 | - } elseif ($sizelimit !== -1) { |
|
1388 | - $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit); |
|
1389 | - } elseif ($attrsonly !== 0) { |
|
1390 | - $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly); |
|
1391 | - } elseif ($attributes !== null) { |
|
1392 | - $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes); |
|
1393 | - } else { |
|
1394 | - $result = \ldap_search($link_identifier, $base_dn, $filter); |
|
1395 | - } |
|
1396 | - if ($result === false) { |
|
1397 | - throw LdapException::createFromPhpError(); |
|
1398 | - } |
|
1399 | - return $result; |
|
1380 | + error_clear_last(); |
|
1381 | + if ($serverctrls !== null) { |
|
1382 | + $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref, $serverctrls); |
|
1383 | + } elseif ($deref !== LDAP_DEREF_NEVER) { |
|
1384 | + $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit, $deref); |
|
1385 | + } elseif ($timelimit !== -1) { |
|
1386 | + $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit, $timelimit); |
|
1387 | + } elseif ($sizelimit !== -1) { |
|
1388 | + $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly, $sizelimit); |
|
1389 | + } elseif ($attrsonly !== 0) { |
|
1390 | + $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes, $attrsonly); |
|
1391 | + } elseif ($attributes !== null) { |
|
1392 | + $result = \ldap_search($link_identifier, $base_dn, $filter, $attributes); |
|
1393 | + } else { |
|
1394 | + $result = \ldap_search($link_identifier, $base_dn, $filter); |
|
1395 | + } |
|
1396 | + if ($result === false) { |
|
1397 | + throw LdapException::createFromPhpError(); |
|
1398 | + } |
|
1399 | + return $result; |
|
1400 | 1400 | } |
1401 | 1401 | |
1402 | 1402 | |
@@ -1578,11 +1578,11 @@ discard block |
||
1578 | 1578 | */ |
1579 | 1579 | function ldap_set_option($link_identifier, int $option, $newval): void |
1580 | 1580 | { |
1581 | - error_clear_last(); |
|
1582 | - $result = \ldap_set_option($link_identifier, $option, $newval); |
|
1583 | - if ($result === false) { |
|
1584 | - throw LdapException::createFromPhpError(); |
|
1585 | - } |
|
1581 | + error_clear_last(); |
|
1582 | + $result = \ldap_set_option($link_identifier, $option, $newval); |
|
1583 | + if ($result === false) { |
|
1584 | + throw LdapException::createFromPhpError(); |
|
1585 | + } |
|
1586 | 1586 | } |
1587 | 1587 | |
1588 | 1588 | |
@@ -1595,9 +1595,9 @@ discard block |
||
1595 | 1595 | */ |
1596 | 1596 | function ldap_unbind($link_identifier): void |
1597 | 1597 | { |
1598 | - error_clear_last(); |
|
1599 | - $result = \ldap_unbind($link_identifier); |
|
1600 | - if ($result === false) { |
|
1601 | - throw LdapException::createFromPhpError(); |
|
1602 | - } |
|
1598 | + error_clear_last(); |
|
1599 | + $result = \ldap_unbind($link_identifier); |
|
1600 | + if ($result === false) { |
|
1601 | + throw LdapException::createFromPhpError(); |
|
1602 | + } |
|
1603 | 1603 | } |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | */ |
30 | 30 | function ingres_autocommit($link): void |
31 | 31 | { |
32 | - error_clear_last(); |
|
33 | - $result = \ingres_autocommit($link); |
|
34 | - if ($result === false) { |
|
35 | - throw IngresiiException::createFromPhpError(); |
|
36 | - } |
|
32 | + error_clear_last(); |
|
33 | + $result = \ingres_autocommit($link); |
|
34 | + if ($result === false) { |
|
35 | + throw IngresiiException::createFromPhpError(); |
|
36 | + } |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | */ |
52 | 52 | function ingres_close($link): void |
53 | 53 | { |
54 | - error_clear_last(); |
|
55 | - $result = \ingres_close($link); |
|
56 | - if ($result === false) { |
|
57 | - throw IngresiiException::createFromPhpError(); |
|
58 | - } |
|
54 | + error_clear_last(); |
|
55 | + $result = \ingres_close($link); |
|
56 | + if ($result === false) { |
|
57 | + throw IngresiiException::createFromPhpError(); |
|
58 | + } |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | */ |
81 | 81 | function ingres_commit($link): void |
82 | 82 | { |
83 | - error_clear_last(); |
|
84 | - $result = \ingres_commit($link); |
|
85 | - if ($result === false) { |
|
86 | - throw IngresiiException::createFromPhpError(); |
|
87 | - } |
|
83 | + error_clear_last(); |
|
84 | + $result = \ingres_commit($link); |
|
85 | + if ($result === false) { |
|
86 | + throw IngresiiException::createFromPhpError(); |
|
87 | + } |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | |
@@ -334,22 +334,22 @@ discard block |
||
334 | 334 | */ |
335 | 335 | function ingres_connect(string $database = null, string $username = null, string $password = null, array $options = null) |
336 | 336 | { |
337 | - error_clear_last(); |
|
338 | - if ($options !== null) { |
|
339 | - $result = \ingres_connect($database, $username, $password, $options); |
|
340 | - } elseif ($password !== null) { |
|
341 | - $result = \ingres_connect($database, $username, $password); |
|
342 | - } elseif ($username !== null) { |
|
343 | - $result = \ingres_connect($database, $username); |
|
344 | - } elseif ($database !== null) { |
|
345 | - $result = \ingres_connect($database); |
|
346 | - } else { |
|
347 | - $result = \ingres_connect(); |
|
348 | - } |
|
349 | - if ($result === false) { |
|
350 | - throw IngresiiException::createFromPhpError(); |
|
351 | - } |
|
352 | - return $result; |
|
337 | + error_clear_last(); |
|
338 | + if ($options !== null) { |
|
339 | + $result = \ingres_connect($database, $username, $password, $options); |
|
340 | + } elseif ($password !== null) { |
|
341 | + $result = \ingres_connect($database, $username, $password); |
|
342 | + } elseif ($username !== null) { |
|
343 | + $result = \ingres_connect($database, $username); |
|
344 | + } elseif ($database !== null) { |
|
345 | + $result = \ingres_connect($database); |
|
346 | + } else { |
|
347 | + $result = \ingres_connect(); |
|
348 | + } |
|
349 | + if ($result === false) { |
|
350 | + throw IngresiiException::createFromPhpError(); |
|
351 | + } |
|
352 | + return $result; |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | |
@@ -366,17 +366,17 @@ discard block |
||
366 | 366 | */ |
367 | 367 | function ingres_execute($result, array $params = null, string $types = null): void |
368 | 368 | { |
369 | - error_clear_last(); |
|
370 | - if ($types !== null) { |
|
371 | - $result = \ingres_execute($result, $params, $types); |
|
372 | - } elseif ($params !== null) { |
|
373 | - $result = \ingres_execute($result, $params); |
|
374 | - } else { |
|
375 | - $result = \ingres_execute($result); |
|
376 | - } |
|
377 | - if ($result === false) { |
|
378 | - throw IngresiiException::createFromPhpError(); |
|
379 | - } |
|
369 | + error_clear_last(); |
|
370 | + if ($types !== null) { |
|
371 | + $result = \ingres_execute($result, $params, $types); |
|
372 | + } elseif ($params !== null) { |
|
373 | + $result = \ingres_execute($result, $params); |
|
374 | + } else { |
|
375 | + $result = \ingres_execute($result); |
|
376 | + } |
|
377 | + if ($result === false) { |
|
378 | + throw IngresiiException::createFromPhpError(); |
|
379 | + } |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | |
@@ -407,12 +407,12 @@ discard block |
||
407 | 407 | */ |
408 | 408 | function ingres_field_name($result, int $index): string |
409 | 409 | { |
410 | - error_clear_last(); |
|
411 | - $result = \ingres_field_name($result, $index); |
|
412 | - if ($result === false) { |
|
413 | - throw IngresiiException::createFromPhpError(); |
|
414 | - } |
|
415 | - return $result; |
|
410 | + error_clear_last(); |
|
411 | + $result = \ingres_field_name($result, $index); |
|
412 | + if ($result === false) { |
|
413 | + throw IngresiiException::createFromPhpError(); |
|
414 | + } |
|
415 | + return $result; |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -451,12 +451,12 @@ discard block |
||
451 | 451 | */ |
452 | 452 | function ingres_field_type($result, int $index): string |
453 | 453 | { |
454 | - error_clear_last(); |
|
455 | - $result = \ingres_field_type($result, $index); |
|
456 | - if ($result === false) { |
|
457 | - throw IngresiiException::createFromPhpError(); |
|
458 | - } |
|
459 | - return $result; |
|
454 | + error_clear_last(); |
|
455 | + $result = \ingres_field_type($result, $index); |
|
456 | + if ($result === false) { |
|
457 | + throw IngresiiException::createFromPhpError(); |
|
458 | + } |
|
459 | + return $result; |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | |
@@ -469,11 +469,11 @@ discard block |
||
469 | 469 | */ |
470 | 470 | function ingres_free_result($result): void |
471 | 471 | { |
472 | - error_clear_last(); |
|
473 | - $result = \ingres_free_result($result); |
|
474 | - if ($result === false) { |
|
475 | - throw IngresiiException::createFromPhpError(); |
|
476 | - } |
|
472 | + error_clear_last(); |
|
473 | + $result = \ingres_free_result($result); |
|
474 | + if ($result === false) { |
|
475 | + throw IngresiiException::createFromPhpError(); |
|
476 | + } |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | |
@@ -505,22 +505,22 @@ discard block |
||
505 | 505 | */ |
506 | 506 | function ingres_pconnect(string $database = null, string $username = null, string $password = null, array $options = null) |
507 | 507 | { |
508 | - error_clear_last(); |
|
509 | - if ($options !== null) { |
|
510 | - $result = \ingres_pconnect($database, $username, $password, $options); |
|
511 | - } elseif ($password !== null) { |
|
512 | - $result = \ingres_pconnect($database, $username, $password); |
|
513 | - } elseif ($username !== null) { |
|
514 | - $result = \ingres_pconnect($database, $username); |
|
515 | - } elseif ($database !== null) { |
|
516 | - $result = \ingres_pconnect($database); |
|
517 | - } else { |
|
518 | - $result = \ingres_pconnect(); |
|
519 | - } |
|
520 | - if ($result === false) { |
|
521 | - throw IngresiiException::createFromPhpError(); |
|
522 | - } |
|
523 | - return $result; |
|
508 | + error_clear_last(); |
|
509 | + if ($options !== null) { |
|
510 | + $result = \ingres_pconnect($database, $username, $password, $options); |
|
511 | + } elseif ($password !== null) { |
|
512 | + $result = \ingres_pconnect($database, $username, $password); |
|
513 | + } elseif ($username !== null) { |
|
514 | + $result = \ingres_pconnect($database, $username); |
|
515 | + } elseif ($database !== null) { |
|
516 | + $result = \ingres_pconnect($database); |
|
517 | + } else { |
|
518 | + $result = \ingres_pconnect(); |
|
519 | + } |
|
520 | + if ($result === false) { |
|
521 | + throw IngresiiException::createFromPhpError(); |
|
522 | + } |
|
523 | + return $result; |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | |
@@ -541,11 +541,11 @@ discard block |
||
541 | 541 | */ |
542 | 542 | function ingres_result_seek($result, int $position): void |
543 | 543 | { |
544 | - error_clear_last(); |
|
545 | - $result = \ingres_result_seek($result, $position); |
|
546 | - if ($result === false) { |
|
547 | - throw IngresiiException::createFromPhpError(); |
|
548 | - } |
|
544 | + error_clear_last(); |
|
545 | + $result = \ingres_result_seek($result, $position); |
|
546 | + if ($result === false) { |
|
547 | + throw IngresiiException::createFromPhpError(); |
|
548 | + } |
|
549 | 549 | } |
550 | 550 | |
551 | 551 | |
@@ -563,11 +563,11 @@ discard block |
||
563 | 563 | */ |
564 | 564 | function ingres_rollback($link): void |
565 | 565 | { |
566 | - error_clear_last(); |
|
567 | - $result = \ingres_rollback($link); |
|
568 | - if ($result === false) { |
|
569 | - throw IngresiiException::createFromPhpError(); |
|
570 | - } |
|
566 | + error_clear_last(); |
|
567 | + $result = \ingres_rollback($link); |
|
568 | + if ($result === false) { |
|
569 | + throw IngresiiException::createFromPhpError(); |
|
570 | + } |
|
571 | 571 | } |
572 | 572 | |
573 | 573 | |
@@ -712,9 +712,9 @@ discard block |
||
712 | 712 | */ |
713 | 713 | function ingres_set_environment($link, array $options): void |
714 | 714 | { |
715 | - error_clear_last(); |
|
716 | - $result = \ingres_set_environment($link, $options); |
|
717 | - if ($result === false) { |
|
718 | - throw IngresiiException::createFromPhpError(); |
|
719 | - } |
|
715 | + error_clear_last(); |
|
716 | + $result = \ingres_set_environment($link, $options); |
|
717 | + if ($result === false) { |
|
718 | + throw IngresiiException::createFromPhpError(); |
|
719 | + } |
|
720 | 720 | } |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | */ |
17 | 17 | function pg_cancel_query($connection): void |
18 | 18 | { |
19 | - error_clear_last(); |
|
20 | - $result = \pg_cancel_query($connection); |
|
21 | - if ($result === false) { |
|
22 | - throw PgsqlException::createFromPhpError(); |
|
23 | - } |
|
19 | + error_clear_last(); |
|
20 | + $result = \pg_cancel_query($connection); |
|
21 | + if ($result === false) { |
|
22 | + throw PgsqlException::createFromPhpError(); |
|
23 | + } |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
@@ -41,16 +41,16 @@ discard block |
||
41 | 41 | */ |
42 | 42 | function pg_client_encoding($connection = null): string |
43 | 43 | { |
44 | - error_clear_last(); |
|
45 | - if ($connection !== null) { |
|
46 | - $result = \pg_client_encoding($connection); |
|
47 | - } else { |
|
48 | - $result = \pg_client_encoding(); |
|
49 | - } |
|
50 | - if ($result === false) { |
|
51 | - throw PgsqlException::createFromPhpError(); |
|
52 | - } |
|
53 | - return $result; |
|
44 | + error_clear_last(); |
|
45 | + if ($connection !== null) { |
|
46 | + $result = \pg_client_encoding($connection); |
|
47 | + } else { |
|
48 | + $result = \pg_client_encoding(); |
|
49 | + } |
|
50 | + if ($result === false) { |
|
51 | + throw PgsqlException::createFromPhpError(); |
|
52 | + } |
|
53 | + return $result; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -71,15 +71,15 @@ discard block |
||
71 | 71 | */ |
72 | 72 | function pg_close($connection = null): void |
73 | 73 | { |
74 | - error_clear_last(); |
|
75 | - if ($connection !== null) { |
|
76 | - $result = \pg_close($connection); |
|
77 | - } else { |
|
78 | - $result = \pg_close(); |
|
79 | - } |
|
80 | - if ($result === false) { |
|
81 | - throw PgsqlException::createFromPhpError(); |
|
82 | - } |
|
74 | + error_clear_last(); |
|
75 | + if ($connection !== null) { |
|
76 | + $result = \pg_close($connection); |
|
77 | + } else { |
|
78 | + $result = \pg_close(); |
|
79 | + } |
|
80 | + if ($result === false) { |
|
81 | + throw PgsqlException::createFromPhpError(); |
|
82 | + } |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -132,16 +132,16 @@ discard block |
||
132 | 132 | */ |
133 | 133 | function pg_connect(string $connection_string, int $connect_type = null) |
134 | 134 | { |
135 | - error_clear_last(); |
|
136 | - if ($connect_type !== null) { |
|
137 | - $result = \pg_connect($connection_string, $connect_type); |
|
138 | - } else { |
|
139 | - $result = \pg_connect($connection_string); |
|
140 | - } |
|
141 | - if ($result === false) { |
|
142 | - throw PgsqlException::createFromPhpError(); |
|
143 | - } |
|
144 | - return $result; |
|
135 | + error_clear_last(); |
|
136 | + if ($connect_type !== null) { |
|
137 | + $result = \pg_connect($connection_string, $connect_type); |
|
138 | + } else { |
|
139 | + $result = \pg_connect($connection_string); |
|
140 | + } |
|
141 | + if ($result === false) { |
|
142 | + throw PgsqlException::createFromPhpError(); |
|
143 | + } |
|
144 | + return $result; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | |
@@ -155,11 +155,11 @@ discard block |
||
155 | 155 | */ |
156 | 156 | function pg_connection_reset($connection): void |
157 | 157 | { |
158 | - error_clear_last(); |
|
159 | - $result = \pg_connection_reset($connection); |
|
160 | - if ($result === false) { |
|
161 | - throw PgsqlException::createFromPhpError(); |
|
162 | - } |
|
158 | + error_clear_last(); |
|
159 | + $result = \pg_connection_reset($connection); |
|
160 | + if ($result === false) { |
|
161 | + throw PgsqlException::createFromPhpError(); |
|
162 | + } |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | |
@@ -186,12 +186,12 @@ discard block |
||
186 | 186 | */ |
187 | 187 | function pg_convert($connection, string $table_name, array $assoc_array, int $options = 0): array |
188 | 188 | { |
189 | - error_clear_last(); |
|
190 | - $result = \pg_convert($connection, $table_name, $assoc_array, $options); |
|
191 | - if ($result === false) { |
|
192 | - throw PgsqlException::createFromPhpError(); |
|
193 | - } |
|
194 | - return $result; |
|
189 | + error_clear_last(); |
|
190 | + $result = \pg_convert($connection, $table_name, $assoc_array, $options); |
|
191 | + if ($result === false) { |
|
192 | + throw PgsqlException::createFromPhpError(); |
|
193 | + } |
|
194 | + return $result; |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | |
@@ -215,17 +215,17 @@ discard block |
||
215 | 215 | */ |
216 | 216 | function pg_copy_from($connection, string $table_name, array $rows, string $delimiter = null, string $null_as = null): void |
217 | 217 | { |
218 | - error_clear_last(); |
|
219 | - if ($null_as !== null) { |
|
220 | - $result = \pg_copy_from($connection, $table_name, $rows, $delimiter, $null_as); |
|
221 | - } elseif ($delimiter !== null) { |
|
222 | - $result = \pg_copy_from($connection, $table_name, $rows, $delimiter); |
|
223 | - } else { |
|
224 | - $result = \pg_copy_from($connection, $table_name, $rows); |
|
225 | - } |
|
226 | - if ($result === false) { |
|
227 | - throw PgsqlException::createFromPhpError(); |
|
228 | - } |
|
218 | + error_clear_last(); |
|
219 | + if ($null_as !== null) { |
|
220 | + $result = \pg_copy_from($connection, $table_name, $rows, $delimiter, $null_as); |
|
221 | + } elseif ($delimiter !== null) { |
|
222 | + $result = \pg_copy_from($connection, $table_name, $rows, $delimiter); |
|
223 | + } else { |
|
224 | + $result = \pg_copy_from($connection, $table_name, $rows); |
|
225 | + } |
|
226 | + if ($result === false) { |
|
227 | + throw PgsqlException::createFromPhpError(); |
|
228 | + } |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | |
@@ -247,18 +247,18 @@ discard block |
||
247 | 247 | */ |
248 | 248 | function pg_copy_to($connection, string $table_name, string $delimiter = null, string $null_as = null): array |
249 | 249 | { |
250 | - error_clear_last(); |
|
251 | - if ($null_as !== null) { |
|
252 | - $result = \pg_copy_to($connection, $table_name, $delimiter, $null_as); |
|
253 | - } elseif ($delimiter !== null) { |
|
254 | - $result = \pg_copy_to($connection, $table_name, $delimiter); |
|
255 | - } else { |
|
256 | - $result = \pg_copy_to($connection, $table_name); |
|
257 | - } |
|
258 | - if ($result === false) { |
|
259 | - throw PgsqlException::createFromPhpError(); |
|
260 | - } |
|
261 | - return $result; |
|
250 | + error_clear_last(); |
|
251 | + if ($null_as !== null) { |
|
252 | + $result = \pg_copy_to($connection, $table_name, $delimiter, $null_as); |
|
253 | + } elseif ($delimiter !== null) { |
|
254 | + $result = \pg_copy_to($connection, $table_name, $delimiter); |
|
255 | + } else { |
|
256 | + $result = \pg_copy_to($connection, $table_name); |
|
257 | + } |
|
258 | + if ($result === false) { |
|
259 | + throw PgsqlException::createFromPhpError(); |
|
260 | + } |
|
261 | + return $result; |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | |
@@ -278,16 +278,16 @@ discard block |
||
278 | 278 | */ |
279 | 279 | function pg_dbname($connection = null): string |
280 | 280 | { |
281 | - error_clear_last(); |
|
282 | - if ($connection !== null) { |
|
283 | - $result = \pg_dbname($connection); |
|
284 | - } else { |
|
285 | - $result = \pg_dbname(); |
|
286 | - } |
|
287 | - if ($result === false) { |
|
288 | - throw PgsqlException::createFromPhpError(); |
|
289 | - } |
|
290 | - return $result; |
|
281 | + error_clear_last(); |
|
282 | + if ($connection !== null) { |
|
283 | + $result = \pg_dbname($connection); |
|
284 | + } else { |
|
285 | + $result = \pg_dbname(); |
|
286 | + } |
|
287 | + if ($result === false) { |
|
288 | + throw PgsqlException::createFromPhpError(); |
|
289 | + } |
|
290 | + return $result; |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | |
@@ -331,12 +331,12 @@ discard block |
||
331 | 331 | */ |
332 | 332 | function pg_delete($connection, string $table_name, array $assoc_array, int $options = PGSQL_DML_EXEC) |
333 | 333 | { |
334 | - error_clear_last(); |
|
335 | - $result = \pg_delete($connection, $table_name, $assoc_array, $options); |
|
336 | - if ($result === false) { |
|
337 | - throw PgsqlException::createFromPhpError(); |
|
338 | - } |
|
339 | - return $result; |
|
334 | + error_clear_last(); |
|
335 | + $result = \pg_delete($connection, $table_name, $assoc_array, $options); |
|
336 | + if ($result === false) { |
|
337 | + throw PgsqlException::createFromPhpError(); |
|
338 | + } |
|
339 | + return $result; |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | |
@@ -357,15 +357,15 @@ discard block |
||
357 | 357 | */ |
358 | 358 | function pg_end_copy($connection = null): void |
359 | 359 | { |
360 | - error_clear_last(); |
|
361 | - if ($connection !== null) { |
|
362 | - $result = \pg_end_copy($connection); |
|
363 | - } else { |
|
364 | - $result = \pg_end_copy(); |
|
365 | - } |
|
366 | - if ($result === false) { |
|
367 | - throw PgsqlException::createFromPhpError(); |
|
368 | - } |
|
360 | + error_clear_last(); |
|
361 | + if ($connection !== null) { |
|
362 | + $result = \pg_end_copy($connection); |
|
363 | + } else { |
|
364 | + $result = \pg_end_copy(); |
|
365 | + } |
|
366 | + if ($result === false) { |
|
367 | + throw PgsqlException::createFromPhpError(); |
|
368 | + } |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | |
@@ -405,20 +405,20 @@ discard block |
||
405 | 405 | */ |
406 | 406 | function pg_execute($connection = null, string $stmtname = null, array $params = null) |
407 | 407 | { |
408 | - error_clear_last(); |
|
409 | - if ($params !== null) { |
|
410 | - $result = \pg_execute($connection, $stmtname, $params); |
|
411 | - } elseif ($stmtname !== null) { |
|
412 | - $result = \pg_execute($connection, $stmtname); |
|
413 | - } elseif ($connection !== null) { |
|
414 | - $result = \pg_execute($connection); |
|
415 | - } else { |
|
416 | - $result = \pg_execute(); |
|
417 | - } |
|
418 | - if ($result === false) { |
|
419 | - throw PgsqlException::createFromPhpError(); |
|
420 | - } |
|
421 | - return $result; |
|
408 | + error_clear_last(); |
|
409 | + if ($params !== null) { |
|
410 | + $result = \pg_execute($connection, $stmtname, $params); |
|
411 | + } elseif ($stmtname !== null) { |
|
412 | + $result = \pg_execute($connection, $stmtname); |
|
413 | + } elseif ($connection !== null) { |
|
414 | + $result = \pg_execute($connection); |
|
415 | + } else { |
|
416 | + $result = \pg_execute(); |
|
417 | + } |
|
418 | + if ($result === false) { |
|
419 | + throw PgsqlException::createFromPhpError(); |
|
420 | + } |
|
421 | + return $result; |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | |
@@ -438,12 +438,12 @@ discard block |
||
438 | 438 | */ |
439 | 439 | function pg_field_name($result, int $field_number): string |
440 | 440 | { |
441 | - error_clear_last(); |
|
442 | - $result = \pg_field_name($result, $field_number); |
|
443 | - if ($result === false) { |
|
444 | - throw PgsqlException::createFromPhpError(); |
|
445 | - } |
|
446 | - return $result; |
|
441 | + error_clear_last(); |
|
442 | + $result = \pg_field_name($result, $field_number); |
|
443 | + if ($result === false) { |
|
444 | + throw PgsqlException::createFromPhpError(); |
|
445 | + } |
|
446 | + return $result; |
|
447 | 447 | } |
448 | 448 | |
449 | 449 | |
@@ -464,12 +464,12 @@ discard block |
||
464 | 464 | */ |
465 | 465 | function pg_field_table($result, int $field_number, bool $oid_only = false) |
466 | 466 | { |
467 | - error_clear_last(); |
|
468 | - $result = \pg_field_table($result, $field_number, $oid_only); |
|
469 | - if ($result === false) { |
|
470 | - throw PgsqlException::createFromPhpError(); |
|
471 | - } |
|
472 | - return $result; |
|
467 | + error_clear_last(); |
|
468 | + $result = \pg_field_table($result, $field_number, $oid_only); |
|
469 | + if ($result === false) { |
|
470 | + throw PgsqlException::createFromPhpError(); |
|
471 | + } |
|
472 | + return $result; |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | |
@@ -488,12 +488,12 @@ discard block |
||
488 | 488 | */ |
489 | 489 | function pg_field_type($result, int $field_number): string |
490 | 490 | { |
491 | - error_clear_last(); |
|
492 | - $result = \pg_field_type($result, $field_number); |
|
493 | - if ($result === false) { |
|
494 | - throw PgsqlException::createFromPhpError(); |
|
495 | - } |
|
496 | - return $result; |
|
491 | + error_clear_last(); |
|
492 | + $result = \pg_field_type($result, $field_number); |
|
493 | + if ($result === false) { |
|
494 | + throw PgsqlException::createFromPhpError(); |
|
495 | + } |
|
496 | + return $result; |
|
497 | 497 | } |
498 | 498 | |
499 | 499 | |
@@ -510,12 +510,12 @@ discard block |
||
510 | 510 | */ |
511 | 511 | function pg_flush($connection) |
512 | 512 | { |
513 | - error_clear_last(); |
|
514 | - $result = \pg_flush($connection); |
|
515 | - if ($result === false) { |
|
516 | - throw PgsqlException::createFromPhpError(); |
|
517 | - } |
|
518 | - return $result; |
|
513 | + error_clear_last(); |
|
514 | + $result = \pg_flush($connection); |
|
515 | + if ($result === false) { |
|
516 | + throw PgsqlException::createFromPhpError(); |
|
517 | + } |
|
518 | + return $result; |
|
519 | 519 | } |
520 | 520 | |
521 | 521 | |
@@ -535,11 +535,11 @@ discard block |
||
535 | 535 | */ |
536 | 536 | function pg_free_result($result): void |
537 | 537 | { |
538 | - error_clear_last(); |
|
539 | - $result = \pg_free_result($result); |
|
540 | - if ($result === false) { |
|
541 | - throw PgsqlException::createFromPhpError(); |
|
542 | - } |
|
538 | + error_clear_last(); |
|
539 | + $result = \pg_free_result($result); |
|
540 | + if ($result === false) { |
|
541 | + throw PgsqlException::createFromPhpError(); |
|
542 | + } |
|
543 | 543 | } |
544 | 544 | |
545 | 545 | |
@@ -559,16 +559,16 @@ discard block |
||
559 | 559 | */ |
560 | 560 | function pg_host($connection = null): string |
561 | 561 | { |
562 | - error_clear_last(); |
|
563 | - if ($connection !== null) { |
|
564 | - $result = \pg_host($connection); |
|
565 | - } else { |
|
566 | - $result = \pg_host(); |
|
567 | - } |
|
568 | - if ($result === false) { |
|
569 | - throw PgsqlException::createFromPhpError(); |
|
570 | - } |
|
571 | - return $result; |
|
562 | + error_clear_last(); |
|
563 | + if ($connection !== null) { |
|
564 | + $result = \pg_host($connection); |
|
565 | + } else { |
|
566 | + $result = \pg_host(); |
|
567 | + } |
|
568 | + if ($result === false) { |
|
569 | + throw PgsqlException::createFromPhpError(); |
|
570 | + } |
|
571 | + return $result; |
|
572 | 572 | } |
573 | 573 | |
574 | 574 | |
@@ -613,12 +613,12 @@ discard block |
||
613 | 613 | */ |
614 | 614 | function pg_insert($connection, string $table_name, array $assoc_array, int $options = PGSQL_DML_EXEC) |
615 | 615 | { |
616 | - error_clear_last(); |
|
617 | - $result = \pg_insert($connection, $table_name, $assoc_array, $options); |
|
618 | - if ($result === false) { |
|
619 | - throw PgsqlException::createFromPhpError(); |
|
620 | - } |
|
621 | - return $result; |
|
616 | + error_clear_last(); |
|
617 | + $result = \pg_insert($connection, $table_name, $assoc_array, $options); |
|
618 | + if ($result === false) { |
|
619 | + throw PgsqlException::createFromPhpError(); |
|
620 | + } |
|
621 | + return $result; |
|
622 | 622 | } |
623 | 623 | |
624 | 624 | |
@@ -645,16 +645,16 @@ discard block |
||
645 | 645 | */ |
646 | 646 | function pg_last_error($connection = null): string |
647 | 647 | { |
648 | - error_clear_last(); |
|
649 | - if ($connection !== null) { |
|
650 | - $result = \pg_last_error($connection); |
|
651 | - } else { |
|
652 | - $result = \pg_last_error(); |
|
653 | - } |
|
654 | - if ($result === false) { |
|
655 | - throw PgsqlException::createFromPhpError(); |
|
656 | - } |
|
657 | - return $result; |
|
648 | + error_clear_last(); |
|
649 | + if ($connection !== null) { |
|
650 | + $result = \pg_last_error($connection); |
|
651 | + } else { |
|
652 | + $result = \pg_last_error(); |
|
653 | + } |
|
654 | + if ($result === false) { |
|
655 | + throw PgsqlException::createFromPhpError(); |
|
656 | + } |
|
657 | + return $result; |
|
658 | 658 | } |
659 | 659 | |
660 | 660 | |
@@ -690,12 +690,12 @@ discard block |
||
690 | 690 | */ |
691 | 691 | function pg_last_notice($connection, int $option = PGSQL_NOTICE_LAST): string |
692 | 692 | { |
693 | - error_clear_last(); |
|
694 | - $result = \pg_last_notice($connection, $option); |
|
695 | - if ($result === false) { |
|
696 | - throw PgsqlException::createFromPhpError(); |
|
697 | - } |
|
698 | - return $result; |
|
693 | + error_clear_last(); |
|
694 | + $result = \pg_last_notice($connection, $option); |
|
695 | + if ($result === false) { |
|
696 | + throw PgsqlException::createFromPhpError(); |
|
697 | + } |
|
698 | + return $result; |
|
699 | 699 | } |
700 | 700 | |
701 | 701 | |
@@ -730,12 +730,12 @@ discard block |
||
730 | 730 | */ |
731 | 731 | function pg_last_oid($result): string |
732 | 732 | { |
733 | - error_clear_last(); |
|
734 | - $result = \pg_last_oid($result); |
|
735 | - if ($result === false) { |
|
736 | - throw PgsqlException::createFromPhpError(); |
|
737 | - } |
|
738 | - return $result; |
|
733 | + error_clear_last(); |
|
734 | + $result = \pg_last_oid($result); |
|
735 | + if ($result === false) { |
|
736 | + throw PgsqlException::createFromPhpError(); |
|
737 | + } |
|
738 | + return $result; |
|
739 | 739 | } |
740 | 740 | |
741 | 741 | |
@@ -753,11 +753,11 @@ discard block |
||
753 | 753 | */ |
754 | 754 | function pg_lo_close($large_object): void |
755 | 755 | { |
756 | - error_clear_last(); |
|
757 | - $result = \pg_lo_close($large_object); |
|
758 | - if ($result === false) { |
|
759 | - throw PgsqlException::createFromPhpError(); |
|
760 | - } |
|
756 | + error_clear_last(); |
|
757 | + $result = \pg_lo_close($large_object); |
|
758 | + if ($result === false) { |
|
759 | + throw PgsqlException::createFromPhpError(); |
|
760 | + } |
|
761 | 761 | } |
762 | 762 | |
763 | 763 | |
@@ -781,19 +781,19 @@ discard block |
||
781 | 781 | */ |
782 | 782 | function pg_lo_export($connection = null, int $oid = null, string $pathname = null): void |
783 | 783 | { |
784 | - error_clear_last(); |
|
785 | - if ($pathname !== null) { |
|
786 | - $result = \pg_lo_export($connection, $oid, $pathname); |
|
787 | - } elseif ($oid !== null) { |
|
788 | - $result = \pg_lo_export($connection, $oid); |
|
789 | - } elseif ($connection !== null) { |
|
790 | - $result = \pg_lo_export($connection); |
|
791 | - } else { |
|
792 | - $result = \pg_lo_export(); |
|
793 | - } |
|
794 | - if ($result === false) { |
|
795 | - throw PgsqlException::createFromPhpError(); |
|
796 | - } |
|
784 | + error_clear_last(); |
|
785 | + if ($pathname !== null) { |
|
786 | + $result = \pg_lo_export($connection, $oid, $pathname); |
|
787 | + } elseif ($oid !== null) { |
|
788 | + $result = \pg_lo_export($connection, $oid); |
|
789 | + } elseif ($connection !== null) { |
|
790 | + $result = \pg_lo_export($connection); |
|
791 | + } else { |
|
792 | + $result = \pg_lo_export(); |
|
793 | + } |
|
794 | + if ($result === false) { |
|
795 | + throw PgsqlException::createFromPhpError(); |
|
796 | + } |
|
797 | 797 | } |
798 | 798 | |
799 | 799 | |
@@ -822,20 +822,20 @@ discard block |
||
822 | 822 | */ |
823 | 823 | function pg_lo_import($connection = null, string $pathname = null, $object_id = null): int |
824 | 824 | { |
825 | - error_clear_last(); |
|
826 | - if ($object_id !== null) { |
|
827 | - $result = \pg_lo_import($connection, $pathname, $object_id); |
|
828 | - } elseif ($pathname !== null) { |
|
829 | - $result = \pg_lo_import($connection, $pathname); |
|
830 | - } elseif ($connection !== null) { |
|
831 | - $result = \pg_lo_import($connection); |
|
832 | - } else { |
|
833 | - $result = \pg_lo_import(); |
|
834 | - } |
|
835 | - if ($result === false) { |
|
836 | - throw PgsqlException::createFromPhpError(); |
|
837 | - } |
|
838 | - return $result; |
|
825 | + error_clear_last(); |
|
826 | + if ($object_id !== null) { |
|
827 | + $result = \pg_lo_import($connection, $pathname, $object_id); |
|
828 | + } elseif ($pathname !== null) { |
|
829 | + $result = \pg_lo_import($connection, $pathname); |
|
830 | + } elseif ($connection !== null) { |
|
831 | + $result = \pg_lo_import($connection); |
|
832 | + } else { |
|
833 | + $result = \pg_lo_import(); |
|
834 | + } |
|
835 | + if ($result === false) { |
|
836 | + throw PgsqlException::createFromPhpError(); |
|
837 | + } |
|
838 | + return $result; |
|
839 | 839 | } |
840 | 840 | |
841 | 841 | |
@@ -859,12 +859,12 @@ discard block |
||
859 | 859 | */ |
860 | 860 | function pg_lo_open($connection, int $oid, string $mode) |
861 | 861 | { |
862 | - error_clear_last(); |
|
863 | - $result = \pg_lo_open($connection, $oid, $mode); |
|
864 | - if ($result === false) { |
|
865 | - throw PgsqlException::createFromPhpError(); |
|
866 | - } |
|
867 | - return $result; |
|
862 | + error_clear_last(); |
|
863 | + $result = \pg_lo_open($connection, $oid, $mode); |
|
864 | + if ($result === false) { |
|
865 | + throw PgsqlException::createFromPhpError(); |
|
866 | + } |
|
867 | + return $result; |
|
868 | 868 | } |
869 | 869 | |
870 | 870 | |
@@ -884,12 +884,12 @@ discard block |
||
884 | 884 | */ |
885 | 885 | function pg_lo_read_all($large_object): int |
886 | 886 | { |
887 | - error_clear_last(); |
|
888 | - $result = \pg_lo_read_all($large_object); |
|
889 | - if ($result === false) { |
|
890 | - throw PgsqlException::createFromPhpError(); |
|
891 | - } |
|
892 | - return $result; |
|
887 | + error_clear_last(); |
|
888 | + $result = \pg_lo_read_all($large_object); |
|
889 | + if ($result === false) { |
|
890 | + throw PgsqlException::createFromPhpError(); |
|
891 | + } |
|
892 | + return $result; |
|
893 | 893 | } |
894 | 894 | |
895 | 895 | |
@@ -910,12 +910,12 @@ discard block |
||
910 | 910 | */ |
911 | 911 | function pg_lo_read($large_object, int $len = 8192): string |
912 | 912 | { |
913 | - error_clear_last(); |
|
914 | - $result = \pg_lo_read($large_object, $len); |
|
915 | - if ($result === false) { |
|
916 | - throw PgsqlException::createFromPhpError(); |
|
917 | - } |
|
918 | - return $result; |
|
913 | + error_clear_last(); |
|
914 | + $result = \pg_lo_read($large_object, $len); |
|
915 | + if ($result === false) { |
|
916 | + throw PgsqlException::createFromPhpError(); |
|
917 | + } |
|
918 | + return $result; |
|
919 | 919 | } |
920 | 920 | |
921 | 921 | |
@@ -936,11 +936,11 @@ discard block |
||
936 | 936 | */ |
937 | 937 | function pg_lo_seek($large_object, int $offset, int $whence = PGSQL_SEEK_CUR): void |
938 | 938 | { |
939 | - error_clear_last(); |
|
940 | - $result = \pg_lo_seek($large_object, $offset, $whence); |
|
941 | - if ($result === false) { |
|
942 | - throw PgsqlException::createFromPhpError(); |
|
943 | - } |
|
939 | + error_clear_last(); |
|
940 | + $result = \pg_lo_seek($large_object, $offset, $whence); |
|
941 | + if ($result === false) { |
|
942 | + throw PgsqlException::createFromPhpError(); |
|
943 | + } |
|
944 | 944 | } |
945 | 945 | |
946 | 946 | |
@@ -958,11 +958,11 @@ discard block |
||
958 | 958 | */ |
959 | 959 | function pg_lo_truncate($large_object, int $size): void |
960 | 960 | { |
961 | - error_clear_last(); |
|
962 | - $result = \pg_lo_truncate($large_object, $size); |
|
963 | - if ($result === false) { |
|
964 | - throw PgsqlException::createFromPhpError(); |
|
965 | - } |
|
961 | + error_clear_last(); |
|
962 | + $result = \pg_lo_truncate($large_object, $size); |
|
963 | + if ($result === false) { |
|
964 | + throw PgsqlException::createFromPhpError(); |
|
965 | + } |
|
966 | 966 | } |
967 | 967 | |
968 | 968 | |
@@ -983,11 +983,11 @@ discard block |
||
983 | 983 | */ |
984 | 984 | function pg_lo_unlink($connection, int $oid): void |
985 | 985 | { |
986 | - error_clear_last(); |
|
987 | - $result = \pg_lo_unlink($connection, $oid); |
|
988 | - if ($result === false) { |
|
989 | - throw PgsqlException::createFromPhpError(); |
|
990 | - } |
|
986 | + error_clear_last(); |
|
987 | + $result = \pg_lo_unlink($connection, $oid); |
|
988 | + if ($result === false) { |
|
989 | + throw PgsqlException::createFromPhpError(); |
|
990 | + } |
|
991 | 991 | } |
992 | 992 | |
993 | 993 | |
@@ -1011,16 +1011,16 @@ discard block |
||
1011 | 1011 | */ |
1012 | 1012 | function pg_lo_write($large_object, string $data, int $len = null): int |
1013 | 1013 | { |
1014 | - error_clear_last(); |
|
1015 | - if ($len !== null) { |
|
1016 | - $result = \pg_lo_write($large_object, $data, $len); |
|
1017 | - } else { |
|
1018 | - $result = \pg_lo_write($large_object, $data); |
|
1019 | - } |
|
1020 | - if ($result === false) { |
|
1021 | - throw PgsqlException::createFromPhpError(); |
|
1022 | - } |
|
1023 | - return $result; |
|
1014 | + error_clear_last(); |
|
1015 | + if ($len !== null) { |
|
1016 | + $result = \pg_lo_write($large_object, $data, $len); |
|
1017 | + } else { |
|
1018 | + $result = \pg_lo_write($large_object, $data); |
|
1019 | + } |
|
1020 | + if ($result === false) { |
|
1021 | + throw PgsqlException::createFromPhpError(); |
|
1022 | + } |
|
1023 | + return $result; |
|
1024 | 1024 | } |
1025 | 1025 | |
1026 | 1026 | |
@@ -1037,12 +1037,12 @@ discard block |
||
1037 | 1037 | */ |
1038 | 1038 | function pg_meta_data($connection, string $table_name, bool $extended = false): array |
1039 | 1039 | { |
1040 | - error_clear_last(); |
|
1041 | - $result = \pg_meta_data($connection, $table_name, $extended); |
|
1042 | - if ($result === false) { |
|
1043 | - throw PgsqlException::createFromPhpError(); |
|
1044 | - } |
|
1045 | - return $result; |
|
1040 | + error_clear_last(); |
|
1041 | + $result = \pg_meta_data($connection, $table_name, $extended); |
|
1042 | + if ($result === false) { |
|
1043 | + throw PgsqlException::createFromPhpError(); |
|
1044 | + } |
|
1045 | + return $result; |
|
1046 | 1046 | } |
1047 | 1047 | |
1048 | 1048 | |
@@ -1062,16 +1062,16 @@ discard block |
||
1062 | 1062 | */ |
1063 | 1063 | function pg_options($connection = null): string |
1064 | 1064 | { |
1065 | - error_clear_last(); |
|
1066 | - if ($connection !== null) { |
|
1067 | - $result = \pg_options($connection); |
|
1068 | - } else { |
|
1069 | - $result = \pg_options(); |
|
1070 | - } |
|
1071 | - if ($result === false) { |
|
1072 | - throw PgsqlException::createFromPhpError(); |
|
1073 | - } |
|
1074 | - return $result; |
|
1065 | + error_clear_last(); |
|
1066 | + if ($connection !== null) { |
|
1067 | + $result = \pg_options($connection); |
|
1068 | + } else { |
|
1069 | + $result = \pg_options(); |
|
1070 | + } |
|
1071 | + if ($result === false) { |
|
1072 | + throw PgsqlException::createFromPhpError(); |
|
1073 | + } |
|
1074 | + return $result; |
|
1075 | 1075 | } |
1076 | 1076 | |
1077 | 1077 | |
@@ -1115,18 +1115,18 @@ discard block |
||
1115 | 1115 | */ |
1116 | 1116 | function pg_parameter_status($connection = null, string $param_name = null): string |
1117 | 1117 | { |
1118 | - error_clear_last(); |
|
1119 | - if ($param_name !== null) { |
|
1120 | - $result = \pg_parameter_status($connection, $param_name); |
|
1121 | - } elseif ($connection !== null) { |
|
1122 | - $result = \pg_parameter_status($connection); |
|
1123 | - } else { |
|
1124 | - $result = \pg_parameter_status(); |
|
1125 | - } |
|
1126 | - if ($result === false) { |
|
1127 | - throw PgsqlException::createFromPhpError(); |
|
1128 | - } |
|
1129 | - return $result; |
|
1118 | + error_clear_last(); |
|
1119 | + if ($param_name !== null) { |
|
1120 | + $result = \pg_parameter_status($connection, $param_name); |
|
1121 | + } elseif ($connection !== null) { |
|
1122 | + $result = \pg_parameter_status($connection); |
|
1123 | + } else { |
|
1124 | + $result = \pg_parameter_status(); |
|
1125 | + } |
|
1126 | + if ($result === false) { |
|
1127 | + throw PgsqlException::createFromPhpError(); |
|
1128 | + } |
|
1129 | + return $result; |
|
1130 | 1130 | } |
1131 | 1131 | |
1132 | 1132 | |
@@ -1176,16 +1176,16 @@ discard block |
||
1176 | 1176 | */ |
1177 | 1177 | function pg_pconnect(string $connection_string, int $connect_type = null) |
1178 | 1178 | { |
1179 | - error_clear_last(); |
|
1180 | - if ($connect_type !== null) { |
|
1181 | - $result = \pg_pconnect($connection_string, $connect_type); |
|
1182 | - } else { |
|
1183 | - $result = \pg_pconnect($connection_string); |
|
1184 | - } |
|
1185 | - if ($result === false) { |
|
1186 | - throw PgsqlException::createFromPhpError(); |
|
1187 | - } |
|
1188 | - return $result; |
|
1179 | + error_clear_last(); |
|
1180 | + if ($connect_type !== null) { |
|
1181 | + $result = \pg_pconnect($connection_string, $connect_type); |
|
1182 | + } else { |
|
1183 | + $result = \pg_pconnect($connection_string); |
|
1184 | + } |
|
1185 | + if ($result === false) { |
|
1186 | + throw PgsqlException::createFromPhpError(); |
|
1187 | + } |
|
1188 | + return $result; |
|
1189 | 1189 | } |
1190 | 1190 | |
1191 | 1191 | |
@@ -1202,15 +1202,15 @@ discard block |
||
1202 | 1202 | */ |
1203 | 1203 | function pg_ping($connection = null): void |
1204 | 1204 | { |
1205 | - error_clear_last(); |
|
1206 | - if ($connection !== null) { |
|
1207 | - $result = \pg_ping($connection); |
|
1208 | - } else { |
|
1209 | - $result = \pg_ping(); |
|
1210 | - } |
|
1211 | - if ($result === false) { |
|
1212 | - throw PgsqlException::createFromPhpError(); |
|
1213 | - } |
|
1205 | + error_clear_last(); |
|
1206 | + if ($connection !== null) { |
|
1207 | + $result = \pg_ping($connection); |
|
1208 | + } else { |
|
1209 | + $result = \pg_ping(); |
|
1210 | + } |
|
1211 | + if ($result === false) { |
|
1212 | + throw PgsqlException::createFromPhpError(); |
|
1213 | + } |
|
1214 | 1214 | } |
1215 | 1215 | |
1216 | 1216 | |
@@ -1230,16 +1230,16 @@ discard block |
||
1230 | 1230 | */ |
1231 | 1231 | function pg_port($connection = null): int |
1232 | 1232 | { |
1233 | - error_clear_last(); |
|
1234 | - if ($connection !== null) { |
|
1235 | - $result = \pg_port($connection); |
|
1236 | - } else { |
|
1237 | - $result = \pg_port(); |
|
1238 | - } |
|
1239 | - if ($result === false) { |
|
1240 | - throw PgsqlException::createFromPhpError(); |
|
1241 | - } |
|
1242 | - return $result; |
|
1233 | + error_clear_last(); |
|
1234 | + if ($connection !== null) { |
|
1235 | + $result = \pg_port($connection); |
|
1236 | + } else { |
|
1237 | + $result = \pg_port(); |
|
1238 | + } |
|
1239 | + if ($result === false) { |
|
1240 | + throw PgsqlException::createFromPhpError(); |
|
1241 | + } |
|
1242 | + return $result; |
|
1243 | 1243 | } |
1244 | 1244 | |
1245 | 1245 | |
@@ -1280,20 +1280,20 @@ discard block |
||
1280 | 1280 | */ |
1281 | 1281 | function pg_prepare($connection = null, string $stmtname = null, string $query = null) |
1282 | 1282 | { |
1283 | - error_clear_last(); |
|
1284 | - if ($query !== null) { |
|
1285 | - $result = \pg_prepare($connection, $stmtname, $query); |
|
1286 | - } elseif ($stmtname !== null) { |
|
1287 | - $result = \pg_prepare($connection, $stmtname); |
|
1288 | - } elseif ($connection !== null) { |
|
1289 | - $result = \pg_prepare($connection); |
|
1290 | - } else { |
|
1291 | - $result = \pg_prepare(); |
|
1292 | - } |
|
1293 | - if ($result === false) { |
|
1294 | - throw PgsqlException::createFromPhpError(); |
|
1295 | - } |
|
1296 | - return $result; |
|
1283 | + error_clear_last(); |
|
1284 | + if ($query !== null) { |
|
1285 | + $result = \pg_prepare($connection, $stmtname, $query); |
|
1286 | + } elseif ($stmtname !== null) { |
|
1287 | + $result = \pg_prepare($connection, $stmtname); |
|
1288 | + } elseif ($connection !== null) { |
|
1289 | + $result = \pg_prepare($connection); |
|
1290 | + } else { |
|
1291 | + $result = \pg_prepare(); |
|
1292 | + } |
|
1293 | + if ($result === false) { |
|
1294 | + throw PgsqlException::createFromPhpError(); |
|
1295 | + } |
|
1296 | + return $result; |
|
1297 | 1297 | } |
1298 | 1298 | |
1299 | 1299 | |
@@ -1321,17 +1321,17 @@ discard block |
||
1321 | 1321 | */ |
1322 | 1322 | function pg_put_line($connection = null, string $data = null): void |
1323 | 1323 | { |
1324 | - error_clear_last(); |
|
1325 | - if ($data !== null) { |
|
1326 | - $result = \pg_put_line($connection, $data); |
|
1327 | - } elseif ($connection !== null) { |
|
1328 | - $result = \pg_put_line($connection); |
|
1329 | - } else { |
|
1330 | - $result = \pg_put_line(); |
|
1331 | - } |
|
1332 | - if ($result === false) { |
|
1333 | - throw PgsqlException::createFromPhpError(); |
|
1334 | - } |
|
1324 | + error_clear_last(); |
|
1325 | + if ($data !== null) { |
|
1326 | + $result = \pg_put_line($connection, $data); |
|
1327 | + } elseif ($connection !== null) { |
|
1328 | + $result = \pg_put_line($connection); |
|
1329 | + } else { |
|
1330 | + $result = \pg_put_line(); |
|
1331 | + } |
|
1332 | + if ($result === false) { |
|
1333 | + throw PgsqlException::createFromPhpError(); |
|
1334 | + } |
|
1335 | 1335 | } |
1336 | 1336 | |
1337 | 1337 | |
@@ -1387,20 +1387,20 @@ discard block |
||
1387 | 1387 | */ |
1388 | 1388 | function pg_query_params($connection = null, string $query = null, array $params = null) |
1389 | 1389 | { |
1390 | - error_clear_last(); |
|
1391 | - if ($params !== null) { |
|
1392 | - $result = \pg_query_params($connection, $query, $params); |
|
1393 | - } elseif ($query !== null) { |
|
1394 | - $result = \pg_query_params($connection, $query); |
|
1395 | - } elseif ($connection !== null) { |
|
1396 | - $result = \pg_query_params($connection); |
|
1397 | - } else { |
|
1398 | - $result = \pg_query_params(); |
|
1399 | - } |
|
1400 | - if ($result === false) { |
|
1401 | - throw PgsqlException::createFromPhpError(); |
|
1402 | - } |
|
1403 | - return $result; |
|
1390 | + error_clear_last(); |
|
1391 | + if ($params !== null) { |
|
1392 | + $result = \pg_query_params($connection, $query, $params); |
|
1393 | + } elseif ($query !== null) { |
|
1394 | + $result = \pg_query_params($connection, $query); |
|
1395 | + } elseif ($connection !== null) { |
|
1396 | + $result = \pg_query_params($connection); |
|
1397 | + } else { |
|
1398 | + $result = \pg_query_params(); |
|
1399 | + } |
|
1400 | + if ($result === false) { |
|
1401 | + throw PgsqlException::createFromPhpError(); |
|
1402 | + } |
|
1403 | + return $result; |
|
1404 | 1404 | } |
1405 | 1405 | |
1406 | 1406 | |
@@ -1445,18 +1445,18 @@ discard block |
||
1445 | 1445 | */ |
1446 | 1446 | function pg_query($connection = null, string $query = null) |
1447 | 1447 | { |
1448 | - error_clear_last(); |
|
1449 | - if ($query !== null) { |
|
1450 | - $result = \pg_query($connection, $query); |
|
1451 | - } elseif ($connection !== null) { |
|
1452 | - $result = \pg_query($connection); |
|
1453 | - } else { |
|
1454 | - $result = \pg_query(); |
|
1455 | - } |
|
1456 | - if ($result === false) { |
|
1457 | - throw PgsqlException::createFromPhpError(); |
|
1458 | - } |
|
1459 | - return $result; |
|
1448 | + error_clear_last(); |
|
1449 | + if ($query !== null) { |
|
1450 | + $result = \pg_query($connection, $query); |
|
1451 | + } elseif ($connection !== null) { |
|
1452 | + $result = \pg_query($connection); |
|
1453 | + } else { |
|
1454 | + $result = \pg_query(); |
|
1455 | + } |
|
1456 | + if ($result === false) { |
|
1457 | + throw PgsqlException::createFromPhpError(); |
|
1458 | + } |
|
1459 | + return $result; |
|
1460 | 1460 | } |
1461 | 1461 | |
1462 | 1462 | |
@@ -1491,12 +1491,12 @@ discard block |
||
1491 | 1491 | */ |
1492 | 1492 | function pg_result_error_field($result, int $fieldcode): ?string |
1493 | 1493 | { |
1494 | - error_clear_last(); |
|
1495 | - $result = \pg_result_error_field($result, $fieldcode); |
|
1496 | - if ($result === false) { |
|
1497 | - throw PgsqlException::createFromPhpError(); |
|
1498 | - } |
|
1499 | - return $result; |
|
1494 | + error_clear_last(); |
|
1495 | + $result = \pg_result_error_field($result, $fieldcode); |
|
1496 | + if ($result === false) { |
|
1497 | + throw PgsqlException::createFromPhpError(); |
|
1498 | + } |
|
1499 | + return $result; |
|
1500 | 1500 | } |
1501 | 1501 | |
1502 | 1502 | |
@@ -1514,11 +1514,11 @@ discard block |
||
1514 | 1514 | */ |
1515 | 1515 | function pg_result_seek($result, int $offset): void |
1516 | 1516 | { |
1517 | - error_clear_last(); |
|
1518 | - $result = \pg_result_seek($result, $offset); |
|
1519 | - if ($result === false) { |
|
1520 | - throw PgsqlException::createFromPhpError(); |
|
1521 | - } |
|
1517 | + error_clear_last(); |
|
1518 | + $result = \pg_result_seek($result, $offset); |
|
1519 | + if ($result === false) { |
|
1520 | + throw PgsqlException::createFromPhpError(); |
|
1521 | + } |
|
1522 | 1522 | } |
1523 | 1523 | |
1524 | 1524 | |
@@ -1563,12 +1563,12 @@ discard block |
||
1563 | 1563 | */ |
1564 | 1564 | function pg_select($connection, string $table_name, array $assoc_array, int $options = PGSQL_DML_EXEC, int $result_type = PGSQL_ASSOC) |
1565 | 1565 | { |
1566 | - error_clear_last(); |
|
1567 | - $result = \pg_select($connection, $table_name, $assoc_array, $options, $result_type); |
|
1568 | - if ($result === false) { |
|
1569 | - throw PgsqlException::createFromPhpError(); |
|
1570 | - } |
|
1571 | - return $result; |
|
1566 | + error_clear_last(); |
|
1567 | + $result = \pg_select($connection, $table_name, $assoc_array, $options, $result_type); |
|
1568 | + if ($result === false) { |
|
1569 | + throw PgsqlException::createFromPhpError(); |
|
1570 | + } |
|
1571 | + return $result; |
|
1572 | 1572 | } |
1573 | 1573 | |
1574 | 1574 | |
@@ -1599,11 +1599,11 @@ discard block |
||
1599 | 1599 | */ |
1600 | 1600 | function pg_send_execute($connection, string $stmtname, array $params): void |
1601 | 1601 | { |
1602 | - error_clear_last(); |
|
1603 | - $result = \pg_send_execute($connection, $stmtname, $params); |
|
1604 | - if ($result === false) { |
|
1605 | - throw PgsqlException::createFromPhpError(); |
|
1606 | - } |
|
1602 | + error_clear_last(); |
|
1603 | + $result = \pg_send_execute($connection, $stmtname, $params); |
|
1604 | + if ($result === false) { |
|
1605 | + throw PgsqlException::createFromPhpError(); |
|
1606 | + } |
|
1607 | 1607 | } |
1608 | 1608 | |
1609 | 1609 | |
@@ -1633,11 +1633,11 @@ discard block |
||
1633 | 1633 | */ |
1634 | 1634 | function pg_send_prepare($connection, string $stmtname, string $query): void |
1635 | 1635 | { |
1636 | - error_clear_last(); |
|
1637 | - $result = \pg_send_prepare($connection, $stmtname, $query); |
|
1638 | - if ($result === false) { |
|
1639 | - throw PgsqlException::createFromPhpError(); |
|
1640 | - } |
|
1636 | + error_clear_last(); |
|
1637 | + $result = \pg_send_prepare($connection, $stmtname, $query); |
|
1638 | + if ($result === false) { |
|
1639 | + throw PgsqlException::createFromPhpError(); |
|
1640 | + } |
|
1641 | 1641 | } |
1642 | 1642 | |
1643 | 1643 | |
@@ -1664,11 +1664,11 @@ discard block |
||
1664 | 1664 | */ |
1665 | 1665 | function pg_send_query_params($connection, string $query, array $params): void |
1666 | 1666 | { |
1667 | - error_clear_last(); |
|
1668 | - $result = \pg_send_query_params($connection, $query, $params); |
|
1669 | - if ($result === false) { |
|
1670 | - throw PgsqlException::createFromPhpError(); |
|
1671 | - } |
|
1667 | + error_clear_last(); |
|
1668 | + $result = \pg_send_query_params($connection, $query, $params); |
|
1669 | + if ($result === false) { |
|
1670 | + throw PgsqlException::createFromPhpError(); |
|
1671 | + } |
|
1672 | 1672 | } |
1673 | 1673 | |
1674 | 1674 | |
@@ -1698,11 +1698,11 @@ discard block |
||
1698 | 1698 | */ |
1699 | 1699 | function pg_send_query($connection, string $query): void |
1700 | 1700 | { |
1701 | - error_clear_last(); |
|
1702 | - $result = \pg_send_query($connection, $query); |
|
1703 | - if ($result === false) { |
|
1704 | - throw PgsqlException::createFromPhpError(); |
|
1705 | - } |
|
1701 | + error_clear_last(); |
|
1702 | + $result = \pg_send_query($connection, $query); |
|
1703 | + if ($result === false) { |
|
1704 | + throw PgsqlException::createFromPhpError(); |
|
1705 | + } |
|
1706 | 1706 | } |
1707 | 1707 | |
1708 | 1708 | |
@@ -1717,12 +1717,12 @@ discard block |
||
1717 | 1717 | */ |
1718 | 1718 | function pg_socket($connection) |
1719 | 1719 | { |
1720 | - error_clear_last(); |
|
1721 | - $result = \pg_socket($connection); |
|
1722 | - if ($result === false) { |
|
1723 | - throw PgsqlException::createFromPhpError(); |
|
1724 | - } |
|
1725 | - return $result; |
|
1720 | + error_clear_last(); |
|
1721 | + $result = \pg_socket($connection); |
|
1722 | + if ($result === false) { |
|
1723 | + throw PgsqlException::createFromPhpError(); |
|
1724 | + } |
|
1725 | + return $result; |
|
1726 | 1726 | } |
1727 | 1727 | |
1728 | 1728 | |
@@ -1751,15 +1751,15 @@ discard block |
||
1751 | 1751 | */ |
1752 | 1752 | function pg_trace(string $pathname, string $mode = "w", $connection = null): void |
1753 | 1753 | { |
1754 | - error_clear_last(); |
|
1755 | - if ($connection !== null) { |
|
1756 | - $result = \pg_trace($pathname, $mode, $connection); |
|
1757 | - } else { |
|
1758 | - $result = \pg_trace($pathname, $mode); |
|
1759 | - } |
|
1760 | - if ($result === false) { |
|
1761 | - throw PgsqlException::createFromPhpError(); |
|
1762 | - } |
|
1754 | + error_clear_last(); |
|
1755 | + if ($connection !== null) { |
|
1756 | + $result = \pg_trace($pathname, $mode, $connection); |
|
1757 | + } else { |
|
1758 | + $result = \pg_trace($pathname, $mode); |
|
1759 | + } |
|
1760 | + if ($result === false) { |
|
1761 | + throw PgsqlException::createFromPhpError(); |
|
1762 | + } |
|
1763 | 1763 | } |
1764 | 1764 | |
1765 | 1765 | |
@@ -1779,16 +1779,16 @@ discard block |
||
1779 | 1779 | */ |
1780 | 1780 | function pg_tty($connection = null): string |
1781 | 1781 | { |
1782 | - error_clear_last(); |
|
1783 | - if ($connection !== null) { |
|
1784 | - $result = \pg_tty($connection); |
|
1785 | - } else { |
|
1786 | - $result = \pg_tty(); |
|
1787 | - } |
|
1788 | - if ($result === false) { |
|
1789 | - throw PgsqlException::createFromPhpError(); |
|
1790 | - } |
|
1791 | - return $result; |
|
1782 | + error_clear_last(); |
|
1783 | + if ($connection !== null) { |
|
1784 | + $result = \pg_tty($connection); |
|
1785 | + } else { |
|
1786 | + $result = \pg_tty(); |
|
1787 | + } |
|
1788 | + if ($result === false) { |
|
1789 | + throw PgsqlException::createFromPhpError(); |
|
1790 | + } |
|
1791 | + return $result; |
|
1792 | 1792 | } |
1793 | 1793 | |
1794 | 1794 | |
@@ -1838,12 +1838,12 @@ discard block |
||
1838 | 1838 | */ |
1839 | 1839 | function pg_update($connection, string $table_name, array $data, array $condition, int $options = PGSQL_DML_EXEC) |
1840 | 1840 | { |
1841 | - error_clear_last(); |
|
1842 | - $result = \pg_update($connection, $table_name, $data, $condition, $options); |
|
1843 | - if ($result === false) { |
|
1844 | - throw PgsqlException::createFromPhpError(); |
|
1845 | - } |
|
1846 | - return $result; |
|
1841 | + error_clear_last(); |
|
1842 | + $result = \pg_update($connection, $table_name, $data, $condition, $options); |
|
1843 | + if ($result === false) { |
|
1844 | + throw PgsqlException::createFromPhpError(); |
|
1845 | + } |
|
1846 | + return $result; |
|
1847 | 1847 | } |
1848 | 1848 | |
1849 | 1849 | |
@@ -1865,14 +1865,14 @@ discard block |
||
1865 | 1865 | */ |
1866 | 1866 | function pg_version($connection = null): array |
1867 | 1867 | { |
1868 | - error_clear_last(); |
|
1869 | - if ($connection !== null) { |
|
1870 | - $result = \pg_version($connection); |
|
1871 | - } else { |
|
1872 | - $result = \pg_version(); |
|
1873 | - } |
|
1874 | - if ($result === false) { |
|
1875 | - throw PgsqlException::createFromPhpError(); |
|
1876 | - } |
|
1877 | - return $result; |
|
1868 | + error_clear_last(); |
|
1869 | + if ($connection !== null) { |
|
1870 | + $result = \pg_version($connection); |
|
1871 | + } else { |
|
1872 | + $result = \pg_version(); |
|
1873 | + } |
|
1874 | + if ($result === false) { |
|
1875 | + throw PgsqlException::createFromPhpError(); |
|
1876 | + } |
|
1877 | + return $result; |
|
1878 | 1878 | } |