PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.8.0
Defender Security – Malware Scanner, Login Security & Firewall v5.8.0
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 / ingres-ii.php

ingres-ii.php in Defender Security – Malware Scanner, Login Security & Firewall 5.8.0, at vendor/thecodingmachine/safe/generated/ingres-ii.php

723 lines 17.8 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\IngresiiException;
6
7 /**
8 * ingres_autocommit is called before opening a
9 * transaction (before the first call to
10 * ingres_query or just after a call to
11 * ingres_rollback or
12 * ingres_commit) to switch the
13 * autocommit mode of the server on or off (when the script begins
14 * the autocommit mode is off).
15 *
16 * When autocommit mode is on, every query is automatically
17 * committed by the server, as if ingres_commit
18 * was called after every call to ingres_query.
19 * To see if autocommit is enabled use,
20 * ingres_autocommit_state.
21 *
22 * By default Ingres will rollback any uncommitted transactions at the end of
23 * a request. Use this function or ingres_commit to
24 * ensure your data is committed to the database.
25 *
26 * @param resource $link The connection link identifier
27 * @throws IngresiiException
28 *
29 */
30 function ingres_autocommit($link): void
31 {
32 error_clear_last();
33 $result = \ingres_autocommit($link);
34 if ($result === false) {
35 throw IngresiiException::createFromPhpError();
36 }
37 }
38
39
40 /**
41 * ingres_close closes the connection to
42 * the Ingres server that is associated with the specified link.
43 *
44 * ingres_close is usually unnecessary, as it
45 * will not close persistent connections and all non-persistent connections
46 * are automatically closed at the end of the script.
47 *
48 * @param resource $link The connection link identifier
49 * @throws IngresiiException
50 *
51 */
52 function ingres_close($link): void
53 {
54 error_clear_last();
55 $result = \ingres_close($link);
56 if ($result === false) {
57 throw IngresiiException::createFromPhpError();
58 }
59 }
60
61
62 /**
63 * ingres_commit commits the currently open
64 * transaction, making all changes made to the database permanent.
65 *
66 * This closes the transaction. A new transaction can be opened by sending a
67 * query with ingres_query.
68 *
69 * You can also have the server commit automatically after every
70 * query by calling ingres_autocommit before
71 * opening the transaction.
72 *
73 * By default Ingres will roll back any uncommitted transactions at the end of
74 * a request. Use this function or ingres_autocommit to
75 * ensure your that data is committed to the database.
76 *
77 * @param resource $link The connection link identifier
78 * @throws IngresiiException
79 *
80 */
81 function ingres_commit($link): void
82 {
83 error_clear_last();
84 $result = \ingres_commit($link);
85 if ($result === false) {
86 throw IngresiiException::createFromPhpError();
87 }
88 }
89
90
91 /**
92 * ingres_connect opens a connection with the
93 * given Ingres database.
94 *
95 * The connection is closed when the script ends or when
96 * ingres_close is called on this link.
97 *
98 * @param string|null $database The database name. Must follow the syntax:
99 *
100 * [vnode::]dbname[/svr_class]
101 * @param string|null $username The Ingres user name
102 * @param string|null $password The password associated with username
103 * @param array|null $options ingres_connect options
104 *
105 *
106 *
107 *
108 * Option name
109 * Option type
110 * Description
111 * Example
112 *
113 *
114 *
115 *
116 * date_century_boundary
117 * integer
118 * The threshold by which a 2-digit year is determined to be in
119 * the current century or in the next century. Equivalent to II_DATE_CENTURY_BOUNDARY.
120 * 50
121 *
122 *
123 * group
124 * string
125 * Specifies the group ID of the user, equivalent to the "-G"
126 * flag
127 * payroll
128 *
129 *
130 * role
131 * string
132 * The role ID of the application. If a role password is
133 * required, the parameter value should be specified as "role/password"
134 *
135 *
136 * effective_user
137 * string
138 * The ingres user account being impersonated, equivalent to the "-u" flag
139 * another_user
140 *
141 *
142 * dbms_password
143 * string
144 * The internal database password for the user connecting to Ingres
145 * s3cr3t
146 *
147 *
148 * table_structure
149 * string
150 *
151 * The default structure for new tables.
152 * Valid values for table_structure are:
153 *
154 * INGRES_STRUCTURE_BTREE
155 * INGRES_STRUCTURE_HASH
156 * INGRES_STRUCTURE_HEAP
157 * INGRES_STRUCTURE_ISAM
158 * INGRES_STRUCTURE_CBTREE
159 * INGRES_STRUCTURE_CISAM
160 * INGRES_STRUCTURE_CHASH
161 * INGRES_STRUCTURE_CHEAP
162 *
163 *
164 *
165 * INGRES_STRUCTURE_BTREE
166 *
167 *
168 * index_structure
169 * string
170 *
171 * The default structure for new secondary indexes. Valid values
172 * for index_structure are:
173 *
174 * INGRES_STRUCTURE_CBTREE
175 * INGRES_STRUCTURE_CISAM
176 * INGRES_STRUCTURE_CHASH
177 * INGRES_STRUCTURE_BTREE
178 * INGRES_STRUCTURE_HASH
179 * INGRES_STRUCTURE_ISAM
180 *
181 *
182 *
183 * INGRES_STRUCTURE_HASH
184 *
185 *
186 * login_local
187 * boolean
188 * Determines how the connection user ID and password are
189 * used when a VNODE is included in the target database string.
190 * If set to TRUE, the user ID and password are used to locally access
191 * the VNODE, and the VNODE login information is used to establish the DBMS
192 * connection. If set to FALSE, the process user ID is used to access
193 * the VNODE, and the connection user ID and password are used in place
194 * of the VNODE login information to establish the DBMS connection.
195 * This parameter is ignored if no VNODE is included in the target
196 * database string. The default is FALSE.
197 * TRUE
198 *
199 *
200 * timezone
201 * string
202 * Controls the timezone of the session. If not set it will
203 * default to the value defined by II_TIMEZONE_NAME. If
204 * II_TIMEZONE_NAME is not defined, NA-PACIFIC (GMT-8 with Daylight
205 * Savings) is used.
206 *
207 *
208 * date_format
209 * integer
210 * Sets the allowable input and output format for Ingres dates.
211 * Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is
212 * not set the default date format is US, e.g. mm/dd/yy. Valid values
213 * for date_format are:
214 *
215 * INGRES_DATE_DMY
216 * INGRES_DATE_FINISH
217 * INGRES_DATE_GERMAN
218 * INGRES_DATE_ISO
219 * INGRES_DATE_ISO4
220 * INGRES_DATE_MDY
221 * INGRES_DATE_MULTINATIONAL
222 * INGRES_DATE_MULTINATIONAL4
223 * INGRES_DATE_YMD
224 * INGRES_DATE_US
225 *
226 *
227 *
228 * INGRES_DATE_MULTINATIONAL4
229 *
230 *
231 * decimal_separator
232 * string
233 * The character identifier for decimal data
234 * ","
235 *
236 *
237 * money_lort
238 * integer
239 * Leading or trailing currency sign. Valid values for money_lort
240 * are:
241 *
242 * INGRES_MONEY_LEADING
243 * INGRES_MONEY_TRAILING
244 *
245 *
246 *
247 * INGRES_MONEY_TRAILING
248 *
249 *
250 * money_sign
251 * string
252 * The currency symbol to be used with the MONEY datatype
253 * €
254 *
255 *
256 * money_precision
257 * integer
258 * The precision of the MONEY datatype
259 * 3
260 *
261 *
262 * float4_precision
263 * integer
264 * Precision of the FLOAT4 datatype
265 * 10
266 *
267 *
268 * float8_precision
269 * integer
270 * Precision of the FLOAT8 data
271 * 10
272 *
273 *
274 * blob_segment_length
275 * integer
276 * The amount of data in bytes to fetch at a time when retrieving
277 * BLOB or CLOB data, defaults to 4096 bytes when not explicitly set
278 * 8192
279 *
280 *
281 *
282 *
283 *
284 * The default structure for new tables.
285 * Valid values for table_structure are:
286 *
287 * INGRES_STRUCTURE_BTREE
288 * INGRES_STRUCTURE_HASH
289 * INGRES_STRUCTURE_HEAP
290 * INGRES_STRUCTURE_ISAM
291 * INGRES_STRUCTURE_CBTREE
292 * INGRES_STRUCTURE_CISAM
293 * INGRES_STRUCTURE_CHASH
294 * INGRES_STRUCTURE_CHEAP
295 *
296 *
297 * The default structure for new secondary indexes. Valid values
298 * for index_structure are:
299 *
300 * INGRES_STRUCTURE_CBTREE
301 * INGRES_STRUCTURE_CISAM
302 * INGRES_STRUCTURE_CHASH
303 * INGRES_STRUCTURE_BTREE
304 * INGRES_STRUCTURE_HASH
305 * INGRES_STRUCTURE_ISAM
306 *
307 *
308 * Sets the allowable input and output format for Ingres dates.
309 * Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is
310 * not set the default date format is US, e.g. mm/dd/yy. Valid values
311 * for date_format are:
312 *
313 * INGRES_DATE_DMY
314 * INGRES_DATE_FINISH
315 * INGRES_DATE_GERMAN
316 * INGRES_DATE_ISO
317 * INGRES_DATE_ISO4
318 * INGRES_DATE_MDY
319 * INGRES_DATE_MULTINATIONAL
320 * INGRES_DATE_MULTINATIONAL4
321 * INGRES_DATE_YMD
322 * INGRES_DATE_US
323 *
324 *
325 * Leading or trailing currency sign. Valid values for money_lort
326 * are:
327 *
328 * INGRES_MONEY_LEADING
329 * INGRES_MONEY_TRAILING
330 *
331 * @return resource Returns a Ingres link resource on success
332 * @throws IngresiiException
333 *
334 */
335 function ingres_connect( ?string $database = null, ?string $username = null, ?string $password = null, ?array $options = null)
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;
353 }
354
355
356 /**
357 * Execute a query prepared using ingres_prepare.
358 *
359 * @param resource $result The result query identifier
360 * @param array|null $params An array of parameter values to be used with the query
361 * @param string|null $types A string containing a sequence of types for the parameter values
362 * passed. See the types parameter in
363 * ingres_query for the list of type codes.
364 *
365 * @throws IngresiiException
366 *
367 */
368 function ingres_execute($result, ?array $params = null, ?string $types = null): void
369 {
370 error_clear_last();
371 if ($types !== null) {
372 $result = \ingres_execute($result, $params, $types);
373 } elseif ($params !== null) {
374 $result = \ingres_execute($result, $params);
375 } else {
376 $result = \ingres_execute($result);
377 }
378 if ($result === false) {
379 throw IngresiiException::createFromPhpError();
380 }
381 }
382
383
384 /**
385 * ingres_field_name returns the name of a field
386 * in a query result.
387 *
388 * @param resource $result The query result identifier
389 * @param int $index index is the field whose name will be
390 * retrieved.
391 *
392 * The possible values of index depend upon
393 * the value
394 * of ingres.array_index_start.
395 * If ingres.array_index_start
396 * is 1 (the default)
397 * then index must be
398 * between 1 and the value returned
399 * by ingres_num_fields. If ingres.array_index_start
400 * is 0 then index must
401 * be between 0
402 * and ingres_num_fields -
403 * 1.
404 * @return string Returns the name of a field
405 * in a query result
406 * @throws IngresiiException
407 *
408 */
409 function ingres_field_name($result, int $index): string
410 {
411 error_clear_last();
412 $result = \ingres_field_name($result, $index);
413 if ($result === false) {
414 throw IngresiiException::createFromPhpError();
415 }
416 return $result;
417 }
418
419
420 /**
421 * Get the type of a field in a query result.
422 *
423 * @param resource $result The query result identifier
424 * @param int $index index is the field whose type will be
425 * retrieved.
426 *
427 * The possible values of index depend upon
428 * the value
429 * of ingres.array_index_start.
430 * If ingres.array_index_start
431 * is 1 (the default)
432 * then index must be
433 * between 1 and the value returned
434 * by ingres_num_fields. If ingres.array_index_start
435 * is 0 then index must
436 * be between 0
437 * and ingres_num_fields -
438 * 1.
439 * @return string ingres_field_type returns the type of a
440 * field in a query result. Examples of
441 * types returned are IIAPI_BYTE_TYPE,
442 * IIAPI_CHA_TYPE, IIAPI_DTE_TYPE,
443 * IIAPI_FLT_TYPE, IIAPI_INT_TYPE,
444 * IIAPI_VCH_TYPE. Some of these types can map to more
445 * than one SQL type depending on the length of the field (see
446 * ingres_field_length). For example
447 * IIAPI_FLT_TYPE can be a float4 or a float8. For detailed
448 * information, see the Ingres OpenAPI User Guide, Appendix
449 * "Data Types" in the Ingres documentation.
450 * @throws IngresiiException
451 *
452 */
453 function ingres_field_type($result, int $index): string
454 {
455 error_clear_last();
456 $result = \ingres_field_type($result, $index);
457 if ($result === false) {
458 throw IngresiiException::createFromPhpError();
459 }
460 return $result;
461 }
462
463
464 /**
465 *
466 *
467 * @param resource $result The query result identifier
468 * @throws IngresiiException
469 *
470 */
471 function ingres_free_result($result): void
472 {
473 error_clear_last();
474 $result = \ingres_free_result($result);
475 if ($result === false) {
476 throw IngresiiException::createFromPhpError();
477 }
478 }
479
480
481 /**
482 * Open a persistent connection to an Ingres database.
483 *
484 * There are only two differences between this function and
485 * ingres_connect: First, when connecting, the
486 * function will initially try to find a (persistent) link that is
487 * already opened with the same parameters. If one is found, an
488 * identifier for it will be returned instead of opening a new
489 * connection. Second, the connection to the Ingres server will not
490 * be closed when the execution of the script ends. Instead, the
491 * link will remain open for future use
492 * (ingres_close will not close links
493 * established by ingres_pconnect). This type
494 * of link is therefore called "persistent".
495 *
496 * @param string|null $database The database name. Must follow the syntax:
497 *
498 * [vnode::]dbname[/svr_class]
499 * @param string|null $username The Ingres user name
500 * @param string|null $password The password associated with username
501 * @param array|null $options See ingres_connect for the list of options that
502 * can be passed
503 *
504 * @return resource Returns an Ingres link resource on success
505 * @throws IngresiiException
506 *
507 */
508 function ingres_pconnect( ?string $database = null, ?string $username = null, ?string $password = null, ?array $options = null)
509 {
510 error_clear_last();
511 if ($options !== null) {
512 $result = \ingres_pconnect($database, $username, $password, $options);
513 } elseif ($password !== null) {
514 $result = \ingres_pconnect($database, $username, $password);
515 } elseif ($username !== null) {
516 $result = \ingres_pconnect($database, $username);
517 } elseif ($database !== null) {
518 $result = \ingres_pconnect($database);
519 } else {
520 $result = \ingres_pconnect();
521 }
522 if ($result === false) {
523 throw IngresiiException::createFromPhpError();
524 }
525 return $result;
526 }
527
528
529 /**
530 * This function is used to position the cursor associated with the result
531 * resource before issuing a fetch. If ingres.array_index_start
532 * is set to 0 then the first row is 0 else it is 1.
533 * ingres_result_seek can be used only with queries that
534 * make use of scrollable
535 * cursors. It cannot be used with
536 * ingres_unbuffered_query.
537 *
538 * @param resource $result The result identifier for a query
539 * @param int $position The row to position the cursor on. If ingres.array_index_start
540 * is set to 0, then the first row is 0, else it is 1
541 * @throws IngresiiException
542 *
543 */
544 function ingres_result_seek($result, int $position): void
545 {
546 error_clear_last();
547 $result = \ingres_result_seek($result, $position);
548 if ($result === false) {
549 throw IngresiiException::createFromPhpError();
550 }
551 }
552
553
554 /**
555 * ingres_rollback rolls back the currently
556 * open transaction, actually cancelling all changes made to the
557 * database during the transaction.
558 *
559 * This closes the transaction. A new transaction can be opened by sending a
560 * query with ingres_query.
561 *
562 * @param resource $link The connection link identifier
563 * @throws IngresiiException
564 *
565 */
566 function ingres_rollback($link): void
567 {
568 error_clear_last();
569 $result = \ingres_rollback($link);
570 if ($result === false) {
571 throw IngresiiException::createFromPhpError();
572 }
573 }
574
575
576 /**
577 * ingres_set_environment is called to set environmental
578 * options that affect the output of certain values from Ingres, such as the
579 * timezone, date format, decimal character separator, and float precision.
580 *
581 * @param resource $link The connection link identifier
582 * @param array $options An enumerated array of option name/value pairs. The following table
583 * lists the option name and the expected type
584 *
585 *
586 *
587 *
588 *
589 * Option name
590 * Option type
591 * Description
592 * Example
593 *
594 *
595 *
596 *
597 * date_century_boundary
598 * integer
599 * The threshold by which a 2-digit year is determined to be in
600 * the current century or in the next century. Equivalent to II_DATE_CENTURY_BOUNDARY
601 * 50
602 *
603 *
604 * timezone
605 * string
606 * Controls the timezone of the session. If not set, it will
607 * default the value defined by II_TIMEZONE_NAME. If
608 * II_TIMEZONE_NAME is not defined, NA-PACIFIC (GMT-8 with Daylight
609 * Savings) is used.
610 * UNITED-KINGDOM
611 *
612 *
613 * date_format
614 * integer
615 * Sets the allowable input and output format for Ingres dates.
616 * Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is
617 * not set, the default date format is US, for example mm/dd/yy. Valid values
618 * for date_format are:
619 *
620 * INGRES_DATE_DMY
621 * INGRES_DATE_FINISH
622 * INGRES_DATE_GERMAN
623 * INGRES_DATE_ISO
624 * INGRES_DATE_ISO4
625 * INGRES_DATE_MDY
626 * INGRES_DATE_MULTINATIONAL
627 * INGRES_DATE_MULTINATIONAL4
628 * INGRES_DATE_YMD
629 * INGRES_DATE_US
630 *
631 *
632 *
633 * INGRES_DATE_ISO4
634 *
635 *
636 * decimal_separator
637 * string
638 * The character identifier for decimal data
639 * ","
640 *
641 *
642 * money_lort
643 * integer
644 * Leading or trailing currency sign. Valid values for money_lort
645 * are:
646 *
647 * INGRES_MONEY_LEADING
648 * INGRES_MONEY_TRAILING
649 *
650 *
651 *
652 * INGRES_MONEY_LEADING
653 *
654 *
655 * money_sign
656 * string
657 * The currency symbol to be used with the MONEY datatype
658 * €
659 *
660 *
661 * money_precision
662 * integer
663 * The precision of the MONEY datatype
664 * 2
665 *
666 *
667 * float4_precision
668 * integer
669 * Precision of the FLOAT4 datatype
670 * 10
671 *
672 *
673 * float8_precision
674 * integer
675 * Precision of the FLOAT8 data
676 * 10
677 *
678 *
679 * blob_segment_length
680 * integer
681 * The amount of data in bytes to fetch at a time when retrieving
682 * BLOB or CLOB data. Defaults to 4096 bytes when not set explicitly
683 * 8192
684 *
685 *
686 *
687 *
688 *
689 * Sets the allowable input and output format for Ingres dates.
690 * Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is
691 * not set, the default date format is US, for example mm/dd/yy. Valid values
692 * for date_format are:
693 *
694 * INGRES_DATE_DMY
695 * INGRES_DATE_FINISH
696 * INGRES_DATE_GERMAN
697 * INGRES_DATE_ISO
698 * INGRES_DATE_ISO4
699 * INGRES_DATE_MDY
700 * INGRES_DATE_MULTINATIONAL
701 * INGRES_DATE_MULTINATIONAL4
702 * INGRES_DATE_YMD
703 * INGRES_DATE_US
704 *
705 *
706 * Leading or trailing currency sign. Valid values for money_lort
707 * are:
708 *
709 * INGRES_MONEY_LEADING
710 * INGRES_MONEY_TRAILING
711 *
712 * @throws IngresiiException
713 *
714 */
715 function ingres_set_environment($link, array $options): void
716 {
717 error_clear_last();
718 $result = \ingres_set_environment($link, $options);
719 if ($result === false) {
720 throw IngresiiException::createFromPhpError();
721 }
722 }
723