| 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 $database The database name. Must follow the syntax: |
| 99 |
* |
| 100 |
* [vnode::]dbname[/svr_class] |
| 101 |
* @param string $username The Ingres user name |
| 102 |
* @param string $password The password associated with username |
| 103 |
* @param array $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 $params An array of parameter values to be used with the query |
| 361 |
* @param string $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 |
* @throws IngresiiException |
| 365 |
* |
| 366 |
*/ |
| 367 |
function ingres_execute($result, array $params = null, string $types = null): void |
| 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 |
} |
| 380 |
} |
| 381 |
|
| 382 |
|
| 383 |
/** |
| 384 |
* ingres_field_name returns the name of a field |
| 385 |
* in a query result. |
| 386 |
* |
| 387 |
* @param resource $result The query result identifier |
| 388 |
* @param int $index index is the field whose name will be |
| 389 |
* retrieved. |
| 390 |
* |
| 391 |
* The possible values of index depend upon |
| 392 |
* the value |
| 393 |
* of ingres.array_index_start. |
| 394 |
* If ingres.array_index_start |
| 395 |
* is 1 (the default) |
| 396 |
* then index must be |
| 397 |
* between 1 and the value returned |
| 398 |
* by ingres_num_fields. If ingres.array_index_start |
| 399 |
* is 0 then index must |
| 400 |
* be between 0 |
| 401 |
* and ingres_num_fields - |
| 402 |
* 1. |
| 403 |
* @return string Returns the name of a field |
| 404 |
* in a query result |
| 405 |
* @throws IngresiiException |
| 406 |
* |
| 407 |
*/ |
| 408 |
function ingres_field_name($result, int $index): string |
| 409 |
{ |
| 410 |
error_clear_last(); |
| 411 |
$result = \ingres_field_name($result, $index); |
| 412 |
if ($result === false) { |
| 413 |
throw IngresiiException::createFromPhpError(); |
| 414 |
} |
| 415 |
return $result; |
| 416 |
} |
| 417 |
|
| 418 |
|
| 419 |
/** |
| 420 |
* Get the type of a field in a query result. |
| 421 |
* |
| 422 |
* @param resource $result The query result identifier |
| 423 |
* @param int $index index is the field whose type will be |
| 424 |
* retrieved. |
| 425 |
* |
| 426 |
* The possible values of index depend upon |
| 427 |
* the value |
| 428 |
* of ingres.array_index_start. |
| 429 |
* If ingres.array_index_start |
| 430 |
* is 1 (the default) |
| 431 |
* then index must be |
| 432 |
* between 1 and the value returned |
| 433 |
* by ingres_num_fields. If ingres.array_index_start |
| 434 |
* is 0 then index must |
| 435 |
* be between 0 |
| 436 |
* and ingres_num_fields - |
| 437 |
* 1. |
| 438 |
* @return string ingres_field_type returns the type of a |
| 439 |
* field in a query result. Examples of |
| 440 |
* types returned are IIAPI_BYTE_TYPE, |
| 441 |
* IIAPI_CHA_TYPE, IIAPI_DTE_TYPE, |
| 442 |
* IIAPI_FLT_TYPE, IIAPI_INT_TYPE, |
| 443 |
* IIAPI_VCH_TYPE. Some of these types can map to more |
| 444 |
* than one SQL type depending on the length of the field (see |
| 445 |
* ingres_field_length). For example |
| 446 |
* IIAPI_FLT_TYPE can be a float4 or a float8. For detailed |
| 447 |
* information, see the Ingres OpenAPI User Guide, Appendix |
| 448 |
* "Data Types" in the Ingres documentation. |
| 449 |
* @throws IngresiiException |
| 450 |
* |
| 451 |
*/ |
| 452 |
function ingres_field_type($result, int $index): string |
| 453 |
{ |
| 454 |
error_clear_last(); |
| 455 |
$result = \ingres_field_type($result, $index); |
| 456 |
if ($result === false) { |
| 457 |
throw IngresiiException::createFromPhpError(); |
| 458 |
} |
| 459 |
return $result; |
| 460 |
} |
| 461 |
|
| 462 |
|
| 463 |
/** |
| 464 |
* |
| 465 |
* |
| 466 |
* @param resource $result The query result identifier |
| 467 |
* @throws IngresiiException |
| 468 |
* |
| 469 |
*/ |
| 470 |
function ingres_free_result($result): void |
| 471 |
{ |
| 472 |
error_clear_last(); |
| 473 |
$result = \ingres_free_result($result); |
| 474 |
if ($result === false) { |
| 475 |
throw IngresiiException::createFromPhpError(); |
| 476 |
} |
| 477 |
} |
| 478 |
|
| 479 |
|
| 480 |
/** |
| 481 |
* Open a persistent connection to an Ingres database. |
| 482 |
* |
| 483 |
* There are only two differences between this function and |
| 484 |
* ingres_connect: First, when connecting, the |
| 485 |
* function will initially try to find a (persistent) link that is |
| 486 |
* already opened with the same parameters. If one is found, an |
| 487 |
* identifier for it will be returned instead of opening a new |
| 488 |
* connection. Second, the connection to the Ingres server will not |
| 489 |
* be closed when the execution of the script ends. Instead, the |
| 490 |
* link will remain open for future use |
| 491 |
* (ingres_close will not close links |
| 492 |
* established by ingres_pconnect). This type |
| 493 |
* of link is therefore called "persistent". |
| 494 |
* |
| 495 |
* @param string $database The database name. Must follow the syntax: |
| 496 |
* |
| 497 |
* [vnode::]dbname[/svr_class] |
| 498 |
* @param string $username The Ingres user name |
| 499 |
* @param string $password The password associated with username |
| 500 |
* @param array $options See ingres_connect for the list of options that |
| 501 |
* can be passed |
| 502 |
* @return resource Returns an Ingres link resource on success |
| 503 |
* @throws IngresiiException |
| 504 |
* |
| 505 |
*/ |
| 506 |
function ingres_pconnect(string $database = null, string $username = null, string $password = null, array $options = null) |
| 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; |
| 524 |
} |
| 525 |
|
| 526 |
|
| 527 |
/** |
| 528 |
* This function is used to position the cursor associated with the result |
| 529 |
* resource before issuing a fetch. If ingres.array_index_start |
| 530 |
* is set to 0 then the first row is 0 else it is 1. |
| 531 |
* ingres_result_seek can be used only with queries that |
| 532 |
* make use of scrollable |
| 533 |
* cursors. It cannot be used with |
| 534 |
* ingres_unbuffered_query. |
| 535 |
* |
| 536 |
* @param resource $result The result identifier for a query |
| 537 |
* @param int $position The row to position the cursor on. If ingres.array_index_start |
| 538 |
* is set to 0, then the first row is 0, else it is 1 |
| 539 |
* @throws IngresiiException |
| 540 |
* |
| 541 |
*/ |
| 542 |
function ingres_result_seek($result, int $position): void |
| 543 |
{ |
| 544 |
error_clear_last(); |
| 545 |
$result = \ingres_result_seek($result, $position); |
| 546 |
if ($result === false) { |
| 547 |
throw IngresiiException::createFromPhpError(); |
| 548 |
} |
| 549 |
} |
| 550 |
|
| 551 |
|
| 552 |
/** |
| 553 |
* ingres_rollback rolls back the currently |
| 554 |
* open transaction, actually cancelling all changes made to the |
| 555 |
* database during the transaction. |
| 556 |
* |
| 557 |
* This closes the transaction. A new transaction can be opened by sending a |
| 558 |
* query with ingres_query. |
| 559 |
* |
| 560 |
* @param resource $link The connection link identifier |
| 561 |
* @throws IngresiiException |
| 562 |
* |
| 563 |
*/ |
| 564 |
function ingres_rollback($link): void |
| 565 |
{ |
| 566 |
error_clear_last(); |
| 567 |
$result = \ingres_rollback($link); |
| 568 |
if ($result === false) { |
| 569 |
throw IngresiiException::createFromPhpError(); |
| 570 |
} |
| 571 |
} |
| 572 |
|
| 573 |
|
| 574 |
/** |
| 575 |
* ingres_set_environment is called to set environmental |
| 576 |
* options that affect the output of certain values from Ingres, such as the |
| 577 |
* timezone, date format, decimal character separator, and float precision. |
| 578 |
* |
| 579 |
* @param resource $link The connection link identifier |
| 580 |
* @param array $options An enumerated array of option name/value pairs. The following table |
| 581 |
* lists the option name and the expected type |
| 582 |
* |
| 583 |
* |
| 584 |
* |
| 585 |
* |
| 586 |
* |
| 587 |
* Option name |
| 588 |
* Option type |
| 589 |
* Description |
| 590 |
* Example |
| 591 |
* |
| 592 |
* |
| 593 |
* |
| 594 |
* |
| 595 |
* date_century_boundary |
| 596 |
* integer |
| 597 |
* The threshold by which a 2-digit year is determined to be in |
| 598 |
* the current century or in the next century. Equivalent to II_DATE_CENTURY_BOUNDARY |
| 599 |
* 50 |
| 600 |
* |
| 601 |
* |
| 602 |
* timezone |
| 603 |
* string |
| 604 |
* Controls the timezone of the session. If not set, it will |
| 605 |
* default the value defined by II_TIMEZONE_NAME. If |
| 606 |
* II_TIMEZONE_NAME is not defined, NA-PACIFIC (GMT-8 with Daylight |
| 607 |
* Savings) is used. |
| 608 |
* UNITED-KINGDOM |
| 609 |
* |
| 610 |
* |
| 611 |
* date_format |
| 612 |
* integer |
| 613 |
* Sets the allowable input and output format for Ingres dates. |
| 614 |
* Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is |
| 615 |
* not set, the default date format is US, for example mm/dd/yy. Valid values |
| 616 |
* for date_format are: |
| 617 |
* |
| 618 |
* INGRES_DATE_DMY |
| 619 |
* INGRES_DATE_FINISH |
| 620 |
* INGRES_DATE_GERMAN |
| 621 |
* INGRES_DATE_ISO |
| 622 |
* INGRES_DATE_ISO4 |
| 623 |
* INGRES_DATE_MDY |
| 624 |
* INGRES_DATE_MULTINATIONAL |
| 625 |
* INGRES_DATE_MULTINATIONAL4 |
| 626 |
* INGRES_DATE_YMD |
| 627 |
* INGRES_DATE_US |
| 628 |
* |
| 629 |
* |
| 630 |
* |
| 631 |
* INGRES_DATE_ISO4 |
| 632 |
* |
| 633 |
* |
| 634 |
* decimal_separator |
| 635 |
* string |
| 636 |
* The character identifier for decimal data |
| 637 |
* "," |
| 638 |
* |
| 639 |
* |
| 640 |
* money_lort |
| 641 |
* integer |
| 642 |
* Leading or trailing currency sign. Valid values for money_lort |
| 643 |
* are: |
| 644 |
* |
| 645 |
* INGRES_MONEY_LEADING |
| 646 |
* INGRES_MONEY_TRAILING |
| 647 |
* |
| 648 |
* |
| 649 |
* |
| 650 |
* INGRES_MONEY_LEADING |
| 651 |
* |
| 652 |
* |
| 653 |
* money_sign |
| 654 |
* string |
| 655 |
* The currency symbol to be used with the MONEY datatype |
| 656 |
* € |
| 657 |
* |
| 658 |
* |
| 659 |
* money_precision |
| 660 |
* integer |
| 661 |
* The precision of the MONEY datatype |
| 662 |
* 2 |
| 663 |
* |
| 664 |
* |
| 665 |
* float4_precision |
| 666 |
* integer |
| 667 |
* Precision of the FLOAT4 datatype |
| 668 |
* 10 |
| 669 |
* |
| 670 |
* |
| 671 |
* float8_precision |
| 672 |
* integer |
| 673 |
* Precision of the FLOAT8 data |
| 674 |
* 10 |
| 675 |
* |
| 676 |
* |
| 677 |
* blob_segment_length |
| 678 |
* integer |
| 679 |
* The amount of data in bytes to fetch at a time when retrieving |
| 680 |
* BLOB or CLOB data. Defaults to 4096 bytes when not set explicitly |
| 681 |
* 8192 |
| 682 |
* |
| 683 |
* |
| 684 |
* |
| 685 |
* |
| 686 |
* |
| 687 |
* Sets the allowable input and output format for Ingres dates. |
| 688 |
* Defaults to the value defined by II_DATE_FORMAT. If II_DATE_FORMAT is |
| 689 |
* not set, the default date format is US, for example mm/dd/yy. Valid values |
| 690 |
* for date_format are: |
| 691 |
* |
| 692 |
* INGRES_DATE_DMY |
| 693 |
* INGRES_DATE_FINISH |
| 694 |
* INGRES_DATE_GERMAN |
| 695 |
* INGRES_DATE_ISO |
| 696 |
* INGRES_DATE_ISO4 |
| 697 |
* INGRES_DATE_MDY |
| 698 |
* INGRES_DATE_MULTINATIONAL |
| 699 |
* INGRES_DATE_MULTINATIONAL4 |
| 700 |
* INGRES_DATE_YMD |
| 701 |
* INGRES_DATE_US |
| 702 |
* |
| 703 |
* |
| 704 |
* Leading or trailing currency sign. Valid values for money_lort |
| 705 |
* are: |
| 706 |
* |
| 707 |
* INGRES_MONEY_LEADING |
| 708 |
* INGRES_MONEY_TRAILING |
| 709 |
* |
| 710 |
* @throws IngresiiException |
| 711 |
* |
| 712 |
*/ |
| 713 |
function ingres_set_environment($link, array $options): void |
| 714 |
{ |
| 715 |
error_clear_last(); |
| 716 |
$result = \ingres_set_environment($link, $options); |
| 717 |
if ($result === false) { |
| 718 |
throw IngresiiException::createFromPhpError(); |
| 719 |
} |
| 720 |
} |
| 721 |
|