PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.0.1
Defender Security – Malware Scanner, Login Security & Firewall v6.0.1
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / vendor / thecodingmachine / safe / generated / ibase.php

ibase.php in Defender Security – Malware Scanner, Login Security & Firewall 6.0.1, at vendor/thecodingmachine/safe/generated/ibase.php

638 lines 21.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Safe;
4
5 use Safe\Exceptions\IbaseException;
6
7 /**
8 * This function will discard a BLOB if it has not yet been closed by
9 * fbird_blob_close.
10 *
11 * @param resource $blob_handle A BLOB handle opened with fbird_blob_create.
12 * @throws IbaseException
13 *
14 */
15 function fbird_blob_cancel($blob_handle): void
16 {
17 error_clear_last();
18 $result = \fbird_blob_cancel($blob_handle);
19 if ($result === false) {
20 throw IbaseException::createFromPhpError();
21 }
22 }
23
24
25 /**
26 *
27 *
28 * @param resource $service_handle The handle on the database server service.
29 * @param string $user_name The login name of the new database user.
30 * @param string $password The password of the new user.
31 * @param string|null $first_name The first name of the new database user.
32 * @param string|null $middle_name The middle name of the new database user.
33 * @param string|null $last_name The last name of the new database user.
34 *
35 * @throws IbaseException
36 *
37 */
38 function ibase_add_user($service_handle, string $user_name, string $password, ?string $first_name = null, ?string $middle_name = null, ?string $last_name = null): void
39 {
40 error_clear_last();
41 if ($last_name !== null) {
42 $result = \ibase_add_user($service_handle, $user_name, $password, $first_name, $middle_name, $last_name);
43 } elseif ($middle_name !== null) {
44 $result = \ibase_add_user($service_handle, $user_name, $password, $first_name, $middle_name);
45 } elseif ($first_name !== null) {
46 $result = \ibase_add_user($service_handle, $user_name, $password, $first_name);
47 } else {
48 $result = \ibase_add_user($service_handle, $user_name, $password);
49 }
50 if ($result === false) {
51 throw IbaseException::createFromPhpError();
52 }
53 }
54
55
56 /**
57 * This function passes the arguments to the (remote) database server. There it starts a new backup process. Therefore you
58 * won't get any responses.
59 *
60 * @param resource $service_handle A previously opened connection to the database server.
61 * @param string $source_db The absolute file path to the database on the database server. You can also use a database alias.
62 * @param string $dest_file The path to the backup file on the database server.
63 * @param int $options Additional options to pass to the database server for backup.
64 * The options parameter can be a combination
65 * of the following constants:
66 * IBASE_BKP_IGNORE_CHECKSUMS,
67 * IBASE_BKP_IGNORE_LIMBO,
68 * IBASE_BKP_METADATA_ONLY,
69 * IBASE_BKP_NO_GARBAGE_COLLECT,
70 * IBASE_BKP_OLD_DESCRIPTIONS,
71 * IBASE_BKP_NON_TRANSPORTABLE or
72 * IBASE_BKP_CONVERT.
73 * Read the section about for further information.
74 * @param bool $verbose Since the backup process is done on the database server, you don't have any chance
75 * to get its output. This argument is useless.
76 * @return mixed Returns TRUE on success.
77 *
78 * Since the backup process is done on the (remote) server, this function just passes the arguments to it.
79 * While the arguments are legal, you won't get FALSE.
80 * @throws IbaseException
81 *
82 */
83 function ibase_backup($service_handle, string $source_db, string $dest_file, int $options = 0, bool $verbose = false)
84 {
85 error_clear_last();
86 $result = \ibase_backup($service_handle, $source_db, $dest_file, $options, $verbose);
87 if ($result === false) {
88 throw IbaseException::createFromPhpError();
89 }
90 return $result;
91 }
92
93
94 /**
95 * This function will discard a BLOB if it has not yet been closed by
96 * ibase_blob_close.
97 *
98 * @param resource $blob_handle A BLOB handle opened with ibase_blob_create.
99 * @throws IbaseException
100 *
101 */
102 function ibase_blob_cancel($blob_handle): void
103 {
104 error_clear_last();
105 $result = \ibase_blob_cancel($blob_handle);
106 if ($result === false) {
107 throw IbaseException::createFromPhpError();
108 }
109 }
110
111
112 /**
113 * ibase_blob_create creates a new BLOB for filling with
114 * data.
115 *
116 * @param resource $link_identifier An InterBase link identifier. If omitted, the last opened link is
117 * assumed.
118 * @return resource Returns a BLOB handle for later use with
119 * ibase_blob_add.
120 * @throws IbaseException
121 *
122 */
123 function ibase_blob_create($link_identifier = null)
124 {
125 error_clear_last();
126 $result = \ibase_blob_create($link_identifier);
127 if ($result === false) {
128 throw IbaseException::createFromPhpError();
129 }
130 return $result;
131 }
132
133
134 /**
135 * This function returns at most len bytes from a BLOB
136 * that has been opened for reading by ibase_blob_open.
137 *
138 * @param resource $blob_handle A BLOB handle opened with ibase_blob_open.
139 * @param int $len Size of returned data.
140 * @return string Returns at most len bytes from the BLOB.
141 * @throws IbaseException
142 *
143 */
144 function ibase_blob_get($blob_handle, int $len): string
145 {
146 error_clear_last();
147 $result = \ibase_blob_get($blob_handle, $len);
148 if ($result === false) {
149 throw IbaseException::createFromPhpError();
150 }
151 return $result;
152 }
153
154
155 /**
156 * Closes the link to an InterBase database that's associated with
157 * a connection id returned from ibase_connect.
158 * Default transaction on link is committed, other transactions are
159 * rolled back.
160 *
161 * @param resource $connection_id An InterBase link identifier returned from
162 * ibase_connect. If omitted, the last opened link
163 * is assumed.
164 * @throws IbaseException
165 *
166 */
167 function ibase_close($connection_id = null): void
168 {
169 error_clear_last();
170 $result = \ibase_close($connection_id);
171 if ($result === false) {
172 throw IbaseException::createFromPhpError();
173 }
174 }
175
176
177 /**
178 * Commits a transaction without closing it.
179 *
180 * @param resource $link_or_trans_identifier If called without an argument, this function commits the default
181 * transaction of the default link. If the argument is a connection
182 * identifier, the default transaction of the corresponding connection
183 * will be committed. If the argument is a transaction identifier, the
184 * corresponding transaction will be committed. The transaction context
185 * will be retained, so statements executed from within this transaction
186 * will not be invalidated.
187 * @throws IbaseException
188 *
189 */
190 function ibase_commit_ret($link_or_trans_identifier = null): void
191 {
192 error_clear_last();
193 $result = \ibase_commit_ret($link_or_trans_identifier);
194 if ($result === false) {
195 throw IbaseException::createFromPhpError();
196 }
197 }
198
199
200 /**
201 * Commits a transaction.
202 *
203 * @param resource $link_or_trans_identifier If called without an argument, this function commits the default
204 * transaction of the default link. If the argument is a connection
205 * identifier, the default transaction of the corresponding connection
206 * will be committed. If the argument is a transaction identifier, the
207 * corresponding transaction will be committed.
208 * @throws IbaseException
209 *
210 */
211 function ibase_commit($link_or_trans_identifier = null): void
212 {
213 error_clear_last();
214 $result = \ibase_commit($link_or_trans_identifier);
215 if ($result === false) {
216 throw IbaseException::createFromPhpError();
217 }
218 }
219
220
221 /**
222 * Establishes a connection to an Firebird/InterBase server.
223 *
224 * In case a second call is made to ibase_connect with
225 * the same arguments, no new link will be established, but instead, the link
226 * identifier of the already opened link will be returned. The link to the
227 * server will be closed as soon as the execution of the script ends, unless
228 * it's closed earlier by explicitly calling ibase_close.
229 *
230 * @param string|null $database The database argument has to be a valid path to
231 * database file on the server it resides on. If the server is not local,
232 * it must be prefixed with either 'hostname:' (TCP/IP), 'hostname/port:'
233 * (TCP/IP with interbase server on custom TCP port), '//hostname/'
234 * (NetBEUI), depending on the connection
235 * protocol used.
236 * @param string|null $username The user name. Can be set with the
237 * ibase.default_user php.ini directive.
238 * @param string|null $password The password for username. Can be set with the
239 * ibase.default_password php.ini directive.
240 * @param string|null $charset charset is the default character set for a
241 * database.
242 * @param int|null $buffers buffers is the number of database buffers to
243 * allocate for the server-side cache. If 0 or omitted, server chooses
244 * its own default.
245 * @param int|null $dialect dialect selects the default SQL dialect for any
246 * statement executed within a connection, and it defaults to the highest
247 * one supported by client libraries.
248 * @param string|null $role Functional only with InterBase 5 and up.
249 * @param int|null $sync
250 *
251 * @return resource Returns an Firebird/InterBase link identifier on success.
252 * @throws IbaseException
253 *
254 */
255 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)
256 {
257 error_clear_last();
258 if ($sync !== null) {
259 $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect, $role, $sync);
260 } elseif ($role !== null) {
261 $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect, $role);
262 } elseif ($dialect !== null) {
263 $result = \ibase_connect($database, $username, $password, $charset, $buffers, $dialect);
264 } elseif ($buffers !== null) {
265 $result = \ibase_connect($database, $username, $password, $charset, $buffers);
266 } elseif ($charset !== null) {
267 $result = \ibase_connect($database, $username, $password, $charset);
268 } elseif ($password !== null) {
269 $result = \ibase_connect($database, $username, $password);
270 } elseif ($username !== null) {
271 $result = \ibase_connect($database, $username);
272 } elseif ($database !== null) {
273 $result = \ibase_connect($database);
274 } else {
275 $result = \ibase_connect();
276 }
277 if ($result === false) {
278 throw IbaseException::createFromPhpError();
279 }
280 return $result;
281 }
282
283
284 /**
285 *
286 *
287 * @param resource $service_handle The handle on the database server service.
288 * @param string $user_name The login name of the user you want to delete from the database.
289 * @throws IbaseException
290 *
291 */
292 function ibase_delete_user($service_handle, string $user_name): void
293 {
294 error_clear_last();
295 $result = \ibase_delete_user($service_handle, $user_name);
296 if ($result === false) {
297 throw IbaseException::createFromPhpError();
298 }
299 }
300
301
302 /**
303 * This functions drops a database that was opened by either ibase_connect
304 * or ibase_pconnect. The database is closed and deleted from the server.
305 *
306 * @param resource $connection An InterBase link identifier. If omitted, the last opened link is
307 * assumed.
308 * @throws IbaseException
309 *
310 */
311 function ibase_drop_db($connection = null): void
312 {
313 error_clear_last();
314 $result = \ibase_drop_db($connection);
315 if ($result === false) {
316 throw IbaseException::createFromPhpError();
317 }
318 }
319
320
321 /**
322 * This function causes the registered event handler specified by
323 * event to be cancelled. The callback function will
324 * no longer be called for the events it was registered to handle.
325 *
326 * @param resource $event An event resource, created by
327 * ibase_set_event_handler.
328 * @throws IbaseException
329 *
330 */
331 function ibase_free_event_handler($event): void
332 {
333 error_clear_last();
334 $result = \ibase_free_event_handler($event);
335 if ($result === false) {
336 throw IbaseException::createFromPhpError();
337 }
338 }
339
340
341 /**
342 * Frees a prepared query.
343 *
344 * @param resource $query A query prepared with ibase_prepare.
345 * @throws IbaseException
346 *
347 */
348 function ibase_free_query($query): void
349 {
350 error_clear_last();
351 $result = \ibase_free_query($query);
352 if ($result === false) {
353 throw IbaseException::createFromPhpError();
354 }
355 }
356
357
358 /**
359 * Frees a result set.
360 *
361 * @param resource $result_identifier A result set created by ibase_query or
362 * ibase_execute.
363 * @throws IbaseException
364 *
365 */
366 function ibase_free_result($result_identifier): void
367 {
368 error_clear_last();
369 $result = \ibase_free_result($result_identifier);
370 if ($result === false) {
371 throw IbaseException::createFromPhpError();
372 }
373 }
374
375
376 /**
377 *
378 *
379 * @param resource $service_handle
380 * @param string $db
381 * @param int $action
382 * @param int $argument
383 * @throws IbaseException
384 *
385 */
386 function ibase_maintain_db($service_handle, string $db, int $action, int $argument = 0): void
387 {
388 error_clear_last();
389 $result = \ibase_maintain_db($service_handle, $db, $action, $argument);
390 if ($result === false) {
391 throw IbaseException::createFromPhpError();
392 }
393 }
394
395
396 /**
397 *
398 *
399 * @param resource $service_handle The handle on the database server service.
400 * @param string $user_name The login name of the database user to modify.
401 * @param string $password The user's new password.
402 * @param string|null $first_name The user's new first name.
403 * @param string|null $middle_name The user's new middle name.
404 * @param string|null $last_name The user's new last name.
405 *
406 * @throws IbaseException
407 *
408 */
409 function ibase_modify_user($service_handle, string $user_name, string $password, ?string $first_name = null, ?string $middle_name = null, ?string $last_name = null): void
410 {
411 error_clear_last();
412 if ($last_name !== null) {
413 $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name, $middle_name, $last_name);
414 } elseif ($middle_name !== null) {
415 $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name, $middle_name);
416 } elseif ($first_name !== null) {
417 $result = \ibase_modify_user($service_handle, $user_name, $password, $first_name);
418 } else {
419 $result = \ibase_modify_user($service_handle, $user_name, $password);
420 }
421 if ($result === false) {
422 throw IbaseException::createFromPhpError();
423 }
424 }
425
426
427 /**
428 * This function assigns a name to a result set. This name can be used later in
429 * UPDATE|DELETE ... WHERE CURRENT OF name statements.
430 *
431 * @param resource $result An InterBase result set.
432 * @param string $name The name to be assigned.
433 * @throws IbaseException
434 *
435 */
436 function ibase_name_result($result, string $name): void
437 {
438 error_clear_last();
439 $result = \ibase_name_result($result, $name);
440 if ($result === false) {
441 throw IbaseException::createFromPhpError();
442 }
443 }
444
445
446 /**
447 * Opens a persistent connection to an InterBase database.
448 *
449 * ibase_pconnect acts very much like
450 * ibase_connect with two major differences.
451 *
452 * First, when connecting, the function will first try to find a (persistent)
453 * link that's already opened with the same parameters. If one is found, an
454 * identifier for it will be returned instead of opening a new connection.
455 *
456 * Second, the connection to the InterBase server will not be closed when the
457 * execution of the script ends. Instead, the link will remain open for
458 * future use (ibase_close will not close links
459 * established by ibase_pconnect). This type of link is
460 * therefore called 'persistent'.
461 *
462 * @param string|null $database The database argument has to be a valid path to
463 * database file on the server it resides on. If the server is not local,
464 * it must be prefixed with either 'hostname:' (TCP/IP), '//hostname/'
465 * (NetBEUI) or 'hostname@' (IPX/SPX), depending on the connection
466 * protocol used.
467 * @param string|null $username The user name. Can be set with the
468 * ibase.default_user php.ini directive.
469 * @param string|null $password The password for username. Can be set with the
470 * ibase.default_password php.ini directive.
471 * @param string|null $charset charset is the default character set for a
472 * database.
473 * @param int|null $buffers buffers is the number of database buffers to
474 * allocate for the server-side cache. If 0 or omitted, server chooses
475 * its own default.
476 * @param int|null $dialect dialect selects the default SQL dialect for any
477 * statement executed within a connection, and it defaults to the highest
478 * one supported by client libraries. Functional only with InterBase 6
479 * and up.
480 * @param string|null $role Functional only with InterBase 5 and up.
481 * @param int|null $sync
482 *
483 * @return resource Returns an InterBase link identifier on success.
484 * @throws IbaseException
485 *
486 */
487 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)
488 {
489 error_clear_last();
490 if ($sync !== null) {
491 $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect, $role, $sync);
492 } elseif ($role !== null) {
493 $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect, $role);
494 } elseif ($dialect !== null) {
495 $result = \ibase_pconnect($database, $username, $password, $charset, $buffers, $dialect);
496 } elseif ($buffers !== null) {
497 $result = \ibase_pconnect($database, $username, $password, $charset, $buffers);
498 } elseif ($charset !== null) {
499 $result = \ibase_pconnect($database, $username, $password, $charset);
500 } elseif ($password !== null) {
501 $result = \ibase_pconnect($database, $username, $password);
502 } elseif ($username !== null) {
503 $result = \ibase_pconnect($database, $username);
504 } elseif ($database !== null) {
505 $result = \ibase_pconnect($database);
506 } else {
507 $result = \ibase_pconnect();
508 }
509 if ($result === false) {
510 throw IbaseException::createFromPhpError();
511 }
512 return $result;
513 }
514
515
516 /**
517 * This function passes the arguments to the (remote) database server. There it starts a new restore process. Therefore you
518 * won't get any responses.
519 *
520 * @param resource $service_handle A previously opened connection to the database server.
521 * @param string $source_file The absolute path on the server where the backup file is located.
522 * @param string $dest_db The path to create the new database on the server. You can also use database alias.
523 * @param int $options Additional options to pass to the database server for restore.
524 * The options parameter can be a combination
525 * of the following constants:
526 * IBASE_RES_DEACTIVATE_IDX,
527 * IBASE_RES_NO_SHADOW,
528 * IBASE_RES_NO_VALIDITY,
529 * IBASE_RES_ONE_AT_A_TIME,
530 * IBASE_RES_REPLACE,
531 * IBASE_RES_CREATE,
532 * IBASE_RES_USE_ALL_SPACE,
533 * IBASE_PRP_PAGE_BUFFERS,
534 * IBASE_PRP_SWEEP_INTERVAL,
535 * IBASE_RES_CREATE.
536 * Read the section about for further information.
537 * @param bool $verbose Since the restore process is done on the database server, you don't have any chance
538 * to get its output. This argument is useless.
539 * @return mixed Returns TRUE on success.
540 *
541 * Since the restore process is done on the (remote) server, this function just passes the arguments to it.
542 * While the arguments are legal, you won't get FALSE.
543 * @throws IbaseException
544 *
545 */
546 function ibase_restore($service_handle, string $source_file, string $dest_db, int $options = 0, bool $verbose = false)
547 {
548 error_clear_last();
549 $result = \ibase_restore($service_handle, $source_file, $dest_db, $options, $verbose);
550 if ($result === false) {
551 throw IbaseException::createFromPhpError();
552 }
553 return $result;
554 }
555
556
557 /**
558 * Rolls back a transaction without closing it.
559 *
560 * @param resource $link_or_trans_identifier If called without an argument, this function rolls back the default
561 * transaction of the default link. If the argument is a connection
562 * identifier, the default transaction of the corresponding connection
563 * will be rolled back. If the argument is a transaction identifier, the
564 * corresponding transaction will be rolled back. The transaction context
565 * will be retained, so statements executed from within this transaction
566 * will not be invalidated.
567 * @throws IbaseException
568 *
569 */
570 function ibase_rollback_ret($link_or_trans_identifier = null): void
571 {
572 error_clear_last();
573 $result = \ibase_rollback_ret($link_or_trans_identifier);
574 if ($result === false) {
575 throw IbaseException::createFromPhpError();
576 }
577 }
578
579
580 /**
581 * Rolls back a transaction.
582 *
583 * @param resource $link_or_trans_identifier If called without an argument, this function rolls back the default
584 * transaction of the default link. If the argument is a connection
585 * identifier, the default transaction of the corresponding connection
586 * will be rolled back. If the argument is a transaction identifier, the
587 * corresponding transaction will be rolled back.
588 * @throws IbaseException
589 *
590 */
591 function ibase_rollback($link_or_trans_identifier = null): void
592 {
593 error_clear_last();
594 $result = \ibase_rollback($link_or_trans_identifier);
595 if ($result === false) {
596 throw IbaseException::createFromPhpError();
597 }
598 }
599
600
601 /**
602 *
603 *
604 * @param string $host The name or ip address of the database host. You can define the port by adding
605 * '/' and port number. If no port is specified, port 3050 will be used.
606 * @param string $dba_username The name of any valid user.
607 * @param string $dba_password The user's password.
608 * @return resource Returns a Interbase / Firebird link identifier on success.
609 * @throws IbaseException
610 *
611 */
612 function ibase_service_attach(string $host, string $dba_username, string $dba_password)
613 {
614 error_clear_last();
615 $result = \ibase_service_attach($host, $dba_username, $dba_password);
616 if ($result === false) {
617 throw IbaseException::createFromPhpError();
618 }
619 return $result;
620 }
621
622
623 /**
624 *
625 *
626 * @param resource $service_handle A previously created connection to the database server.
627 * @throws IbaseException
628 *
629 */
630 function ibase_service_detach($service_handle): void
631 {
632 error_clear_last();
633 $result = \ibase_service_detach($service_handle);
634 if ($result === false) {
635 throw IbaseException::createFromPhpError();
636 }
637 }
638