@@ -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 | } |
@@ -15,12 +15,12 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | function lzf_compress(string $data): string |
| 17 | 17 | { |
| 18 | - error_clear_last(); |
|
| 19 | - $result = \lzf_compress($data); |
|
| 20 | - if ($result === false) { |
|
| 21 | - throw LzfException::createFromPhpError(); |
|
| 22 | - } |
|
| 23 | - return $result; |
|
| 18 | + error_clear_last(); |
|
| 19 | + $result = \lzf_compress($data); |
|
| 20 | + if ($result === false) { |
|
| 21 | + throw LzfException::createFromPhpError(); |
|
| 22 | + } |
|
| 23 | + return $result; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
@@ -35,10 +35,10 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | function lzf_decompress(string $data): string |
| 37 | 37 | { |
| 38 | - error_clear_last(); |
|
| 39 | - $result = \lzf_decompress($data); |
|
| 40 | - if ($result === false) { |
|
| 41 | - throw LzfException::createFromPhpError(); |
|
| 42 | - } |
|
| 43 | - return $result; |
|
| 38 | + error_clear_last(); |
|
| 39 | + $result = \lzf_decompress($data); |
|
| 40 | + if ($result === false) { |
|
| 41 | + throw LzfException::createFromPhpError(); |
|
| 42 | + } |
|
| 43 | + return $result; |
|
| 44 | 44 | } |
@@ -30,11 +30,11 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | function define(string $name, $value, bool $case_insensitive = false): void |
| 32 | 32 | { |
| 33 | - error_clear_last(); |
|
| 34 | - $result = \define($name, $value, $case_insensitive); |
|
| 35 | - if ($result === false) { |
|
| 36 | - throw MiscException::createFromPhpError(); |
|
| 37 | - } |
|
| 33 | + error_clear_last(); |
|
| 34 | + $result = \define($name, $value, $case_insensitive); |
|
| 35 | + if ($result === false) { |
|
| 36 | + throw MiscException::createFromPhpError(); |
|
| 37 | + } |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | function highlight_file(string $filename, bool $return = false) |
| 62 | 62 | { |
| 63 | - error_clear_last(); |
|
| 64 | - $result = \highlight_file($filename, $return); |
|
| 65 | - if ($result === false) { |
|
| 66 | - throw MiscException::createFromPhpError(); |
|
| 67 | - } |
|
| 68 | - return $result; |
|
| 63 | + error_clear_last(); |
|
| 64 | + $result = \highlight_file($filename, $return); |
|
| 65 | + if ($result === false) { |
|
| 66 | + throw MiscException::createFromPhpError(); |
|
| 67 | + } |
|
| 68 | + return $result; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
@@ -83,12 +83,12 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | function highlight_string(string $str, bool $return = false) |
| 85 | 85 | { |
| 86 | - error_clear_last(); |
|
| 87 | - $result = \highlight_string($str, $return); |
|
| 88 | - if ($result === false) { |
|
| 89 | - throw MiscException::createFromPhpError(); |
|
| 90 | - } |
|
| 91 | - return $result; |
|
| 86 | + error_clear_last(); |
|
| 87 | + $result = \highlight_string($str, $return); |
|
| 88 | + if ($result === false) { |
|
| 89 | + throw MiscException::createFromPhpError(); |
|
| 90 | + } |
|
| 91 | + return $result; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
@@ -248,16 +248,16 @@ discard block |
||
| 248 | 248 | */ |
| 249 | 249 | function pack(string $format, ...$params): string |
| 250 | 250 | { |
| 251 | - error_clear_last(); |
|
| 252 | - if ($params !== []) { |
|
| 253 | - $result = \pack($format, ...$params); |
|
| 254 | - } else { |
|
| 255 | - $result = \pack($format); |
|
| 256 | - } |
|
| 257 | - if ($result === false) { |
|
| 258 | - throw MiscException::createFromPhpError(); |
|
| 259 | - } |
|
| 260 | - return $result; |
|
| 251 | + error_clear_last(); |
|
| 252 | + if ($params !== []) { |
|
| 253 | + $result = \pack($format, ...$params); |
|
| 254 | + } else { |
|
| 255 | + $result = \pack($format); |
|
| 256 | + } |
|
| 257 | + if ($result === false) { |
|
| 258 | + throw MiscException::createFromPhpError(); |
|
| 259 | + } |
|
| 260 | + return $result; |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | |
@@ -276,12 +276,12 @@ discard block |
||
| 276 | 276 | */ |
| 277 | 277 | function sapi_windows_cp_conv($in_codepage, $out_codepage, string $subject): string |
| 278 | 278 | { |
| 279 | - error_clear_last(); |
|
| 280 | - $result = \sapi_windows_cp_conv($in_codepage, $out_codepage, $subject); |
|
| 281 | - if ($result === null) { |
|
| 282 | - throw MiscException::createFromPhpError(); |
|
| 283 | - } |
|
| 284 | - return $result; |
|
| 279 | + error_clear_last(); |
|
| 280 | + $result = \sapi_windows_cp_conv($in_codepage, $out_codepage, $subject); |
|
| 281 | + if ($result === null) { |
|
| 282 | + throw MiscException::createFromPhpError(); |
|
| 283 | + } |
|
| 284 | + return $result; |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | |
@@ -294,11 +294,11 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | function sapi_windows_cp_set(int $cp): void |
| 296 | 296 | { |
| 297 | - error_clear_last(); |
|
| 298 | - $result = \sapi_windows_cp_set($cp); |
|
| 299 | - if ($result === false) { |
|
| 300 | - throw MiscException::createFromPhpError(); |
|
| 301 | - } |
|
| 297 | + error_clear_last(); |
|
| 298 | + $result = \sapi_windows_cp_set($cp); |
|
| 299 | + if ($result === false) { |
|
| 300 | + throw MiscException::createFromPhpError(); |
|
| 301 | + } |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | |
@@ -315,11 +315,11 @@ discard block |
||
| 315 | 315 | */ |
| 316 | 316 | function sapi_windows_generate_ctrl_event(int $event, int $pid = 0): void |
| 317 | 317 | { |
| 318 | - error_clear_last(); |
|
| 319 | - $result = \sapi_windows_generate_ctrl_event($event, $pid); |
|
| 320 | - if ($result === false) { |
|
| 321 | - throw MiscException::createFromPhpError(); |
|
| 322 | - } |
|
| 318 | + error_clear_last(); |
|
| 319 | + $result = \sapi_windows_generate_ctrl_event($event, $pid); |
|
| 320 | + if ($result === false) { |
|
| 321 | + throw MiscException::createFromPhpError(); |
|
| 322 | + } |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | |
@@ -341,15 +341,15 @@ discard block |
||
| 341 | 341 | */ |
| 342 | 342 | function sapi_windows_vt100_support($stream, bool $enable = null): void |
| 343 | 343 | { |
| 344 | - error_clear_last(); |
|
| 345 | - if ($enable !== null) { |
|
| 346 | - $result = \sapi_windows_vt100_support($stream, $enable); |
|
| 347 | - } else { |
|
| 348 | - $result = \sapi_windows_vt100_support($stream); |
|
| 349 | - } |
|
| 350 | - if ($result === false) { |
|
| 351 | - throw MiscException::createFromPhpError(); |
|
| 352 | - } |
|
| 344 | + error_clear_last(); |
|
| 345 | + if ($enable !== null) { |
|
| 346 | + $result = \sapi_windows_vt100_support($stream, $enable); |
|
| 347 | + } else { |
|
| 348 | + $result = \sapi_windows_vt100_support($stream); |
|
| 349 | + } |
|
| 350 | + if ($result === false) { |
|
| 351 | + throw MiscException::createFromPhpError(); |
|
| 352 | + } |
|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | |
@@ -370,12 +370,12 @@ discard block |
||
| 370 | 370 | */ |
| 371 | 371 | function sleep(int $seconds): int |
| 372 | 372 | { |
| 373 | - error_clear_last(); |
|
| 374 | - $result = \sleep($seconds); |
|
| 375 | - if ($result === false) { |
|
| 376 | - throw MiscException::createFromPhpError(); |
|
| 377 | - } |
|
| 378 | - return $result; |
|
| 373 | + error_clear_last(); |
|
| 374 | + $result = \sleep($seconds); |
|
| 375 | + if ($result === false) { |
|
| 376 | + throw MiscException::createFromPhpError(); |
|
| 377 | + } |
|
| 378 | + return $result; |
|
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | |
@@ -408,12 +408,12 @@ discard block |
||
| 408 | 408 | */ |
| 409 | 409 | function time_nanosleep(int $seconds, int $nanoseconds) |
| 410 | 410 | { |
| 411 | - error_clear_last(); |
|
| 412 | - $result = \time_nanosleep($seconds, $nanoseconds); |
|
| 413 | - if ($result === false) { |
|
| 414 | - throw MiscException::createFromPhpError(); |
|
| 415 | - } |
|
| 416 | - return $result; |
|
| 411 | + error_clear_last(); |
|
| 412 | + $result = \time_nanosleep($seconds, $nanoseconds); |
|
| 413 | + if ($result === false) { |
|
| 414 | + throw MiscException::createFromPhpError(); |
|
| 415 | + } |
|
| 416 | + return $result; |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | |
@@ -427,11 +427,11 @@ discard block |
||
| 427 | 427 | */ |
| 428 | 428 | function time_sleep_until(float $timestamp): void |
| 429 | 429 | { |
| 430 | - error_clear_last(); |
|
| 431 | - $result = \time_sleep_until($timestamp); |
|
| 432 | - if ($result === false) { |
|
| 433 | - throw MiscException::createFromPhpError(); |
|
| 434 | - } |
|
| 430 | + error_clear_last(); |
|
| 431 | + $result = \time_sleep_until($timestamp); |
|
| 432 | + if ($result === false) { |
|
| 433 | + throw MiscException::createFromPhpError(); |
|
| 434 | + } |
|
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | |
@@ -455,10 +455,10 @@ discard block |
||
| 455 | 455 | */ |
| 456 | 456 | function unpack(string $format, string $data, int $offset = 0): array |
| 457 | 457 | { |
| 458 | - error_clear_last(); |
|
| 459 | - $result = \unpack($format, $data, $offset); |
|
| 460 | - if ($result === false) { |
|
| 461 | - throw MiscException::createFromPhpError(); |
|
| 462 | - } |
|
| 463 | - return $result; |
|
| 458 | + error_clear_last(); |
|
| 459 | + $result = \unpack($format, $data, $offset); |
|
| 460 | + if ($result === false) { |
|
| 461 | + throw MiscException::createFromPhpError(); |
|
| 462 | + } |
|
| 463 | + return $result; |
|
| 464 | 464 | } |
@@ -49,11 +49,11 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | function yaz_ccl_parse($id, string $query, ?array &$result): void |
| 51 | 51 | { |
| 52 | - error_clear_last(); |
|
| 53 | - $result = \yaz_ccl_parse($id, $query, $result); |
|
| 54 | - if ($result === false) { |
|
| 55 | - throw YazException::createFromPhpError(); |
|
| 56 | - } |
|
| 52 | + error_clear_last(); |
|
| 53 | + $result = \yaz_ccl_parse($id, $query, $result); |
|
| 54 | + if ($result === false) { |
|
| 55 | + throw YazException::createFromPhpError(); |
|
| 56 | + } |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
@@ -66,11 +66,11 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | function yaz_close($id): void |
| 68 | 68 | { |
| 69 | - error_clear_last(); |
|
| 70 | - $result = \yaz_close($id); |
|
| 71 | - if ($result === false) { |
|
| 72 | - throw YazException::createFromPhpError(); |
|
| 73 | - } |
|
| 69 | + error_clear_last(); |
|
| 70 | + $result = \yaz_close($id); |
|
| 71 | + if ($result === false) { |
|
| 72 | + throw YazException::createFromPhpError(); |
|
| 73 | + } |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
@@ -267,16 +267,16 @@ discard block |
||
| 267 | 267 | */ |
| 268 | 268 | function yaz_connect(string $zurl, $options = null) |
| 269 | 269 | { |
| 270 | - error_clear_last(); |
|
| 271 | - if ($options !== null) { |
|
| 272 | - $result = \yaz_connect($zurl, $options); |
|
| 273 | - } else { |
|
| 274 | - $result = \yaz_connect($zurl); |
|
| 275 | - } |
|
| 276 | - if ($result === false) { |
|
| 277 | - throw YazException::createFromPhpError(); |
|
| 278 | - } |
|
| 279 | - return $result; |
|
| 270 | + error_clear_last(); |
|
| 271 | + if ($options !== null) { |
|
| 272 | + $result = \yaz_connect($zurl, $options); |
|
| 273 | + } else { |
|
| 274 | + $result = \yaz_connect($zurl); |
|
| 275 | + } |
|
| 276 | + if ($result === false) { |
|
| 277 | + throw YazException::createFromPhpError(); |
|
| 278 | + } |
|
| 279 | + return $result; |
|
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | |
@@ -294,11 +294,11 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | function yaz_database($id, string $databases): void |
| 296 | 296 | { |
| 297 | - error_clear_last(); |
|
| 298 | - $result = \yaz_database($id, $databases); |
|
| 299 | - if ($result === false) { |
|
| 300 | - throw YazException::createFromPhpError(); |
|
| 301 | - } |
|
| 297 | + error_clear_last(); |
|
| 298 | + $result = \yaz_database($id, $databases); |
|
| 299 | + if ($result === false) { |
|
| 300 | + throw YazException::createFromPhpError(); |
|
| 301 | + } |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | |
@@ -317,11 +317,11 @@ discard block |
||
| 317 | 317 | */ |
| 318 | 318 | function yaz_element($id, string $elementset): void |
| 319 | 319 | { |
| 320 | - error_clear_last(); |
|
| 321 | - $result = \yaz_element($id, $elementset); |
|
| 322 | - if ($result === false) { |
|
| 323 | - throw YazException::createFromPhpError(); |
|
| 324 | - } |
|
| 320 | + error_clear_last(); |
|
| 321 | + $result = \yaz_element($id, $elementset); |
|
| 322 | + if ($result === false) { |
|
| 323 | + throw YazException::createFromPhpError(); |
|
| 324 | + } |
|
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | |
@@ -337,11 +337,11 @@ discard block |
||
| 337 | 337 | */ |
| 338 | 338 | function yaz_present($id): void |
| 339 | 339 | { |
| 340 | - error_clear_last(); |
|
| 341 | - $result = \yaz_present($id); |
|
| 342 | - if ($result === false) { |
|
| 343 | - throw YazException::createFromPhpError(); |
|
| 344 | - } |
|
| 340 | + error_clear_last(); |
|
| 341 | + $result = \yaz_present($id); |
|
| 342 | + if ($result === false) { |
|
| 343 | + throw YazException::createFromPhpError(); |
|
| 344 | + } |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | |
@@ -377,11 +377,11 @@ discard block |
||
| 377 | 377 | */ |
| 378 | 378 | function yaz_search($id, string $type, string $query): void |
| 379 | 379 | { |
| 380 | - error_clear_last(); |
|
| 381 | - $result = \yaz_search($id, $type, $query); |
|
| 382 | - if ($result === false) { |
|
| 383 | - throw YazException::createFromPhpError(); |
|
| 384 | - } |
|
| 380 | + error_clear_last(); |
|
| 381 | + $result = \yaz_search($id, $type, $query); |
|
| 382 | + if ($result === false) { |
|
| 383 | + throw YazException::createFromPhpError(); |
|
| 384 | + } |
|
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | |
@@ -429,10 +429,10 @@ discard block |
||
| 429 | 429 | */ |
| 430 | 430 | function yaz_wait(array &$options = null) |
| 431 | 431 | { |
| 432 | - error_clear_last(); |
|
| 433 | - $result = \yaz_wait($options); |
|
| 434 | - if ($result === false) { |
|
| 435 | - throw YazException::createFromPhpError(); |
|
| 436 | - } |
|
| 437 | - return $result; |
|
| 432 | + error_clear_last(); |
|
| 433 | + $result = \yaz_wait($options); |
|
| 434 | + if ($result === false) { |
|
| 435 | + throw YazException::createFromPhpError(); |
|
| 436 | + } |
|
| 437 | + return $result; |
|
| 438 | 438 | } |
@@ -36,12 +36,12 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | function socket_accept($socket) |
| 38 | 38 | { |
| 39 | - error_clear_last(); |
|
| 40 | - $result = \socket_accept($socket); |
|
| 41 | - if ($result === false) { |
|
| 42 | - throw SocketsException::createFromPhpError(); |
|
| 43 | - } |
|
| 44 | - return $result; |
|
| 39 | + error_clear_last(); |
|
| 40 | + $result = \socket_accept($socket); |
|
| 41 | + if ($result === false) { |
|
| 42 | + throw SocketsException::createFromPhpError(); |
|
| 43 | + } |
|
| 44 | + return $result; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
@@ -56,12 +56,12 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | function socket_addrinfo_bind($addr) |
| 58 | 58 | { |
| 59 | - error_clear_last(); |
|
| 60 | - $result = \socket_addrinfo_bind($addr); |
|
| 61 | - if ($result === null) { |
|
| 62 | - throw SocketsException::createFromPhpError(); |
|
| 63 | - } |
|
| 64 | - return $result; |
|
| 59 | + error_clear_last(); |
|
| 60 | + $result = \socket_addrinfo_bind($addr); |
|
| 61 | + if ($result === null) { |
|
| 62 | + throw SocketsException::createFromPhpError(); |
|
| 63 | + } |
|
| 64 | + return $result; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
@@ -76,12 +76,12 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | function socket_addrinfo_connect($addr) |
| 78 | 78 | { |
| 79 | - error_clear_last(); |
|
| 80 | - $result = \socket_addrinfo_connect($addr); |
|
| 81 | - if ($result === null) { |
|
| 82 | - throw SocketsException::createFromPhpError(); |
|
| 83 | - } |
|
| 84 | - return $result; |
|
| 79 | + error_clear_last(); |
|
| 80 | + $result = \socket_addrinfo_connect($addr); |
|
| 81 | + if ($result === null) { |
|
| 82 | + throw SocketsException::createFromPhpError(); |
|
| 83 | + } |
|
| 84 | + return $result; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
@@ -107,11 +107,11 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | function socket_bind($socket, string $address, int $port = 0): void |
| 109 | 109 | { |
| 110 | - error_clear_last(); |
|
| 111 | - $result = \socket_bind($socket, $address, $port); |
|
| 112 | - if ($result === false) { |
|
| 113 | - throw SocketsException::createFromPhpError(); |
|
| 114 | - } |
|
| 110 | + error_clear_last(); |
|
| 111 | + $result = \socket_bind($socket, $address, $port); |
|
| 112 | + if ($result === false) { |
|
| 113 | + throw SocketsException::createFromPhpError(); |
|
| 114 | + } |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
@@ -137,11 +137,11 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | function socket_connect($socket, string $address, int $port = 0): void |
| 139 | 139 | { |
| 140 | - error_clear_last(); |
|
| 141 | - $result = \socket_connect($socket, $address, $port); |
|
| 142 | - if ($result === false) { |
|
| 143 | - throw SocketsException::createFromPhpError(); |
|
| 144 | - } |
|
| 140 | + error_clear_last(); |
|
| 141 | + $result = \socket_connect($socket, $address, $port); |
|
| 142 | + if ($result === false) { |
|
| 143 | + throw SocketsException::createFromPhpError(); |
|
| 144 | + } |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | |
@@ -169,12 +169,12 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | function socket_create_listen(int $port, int $backlog = 128) |
| 171 | 171 | { |
| 172 | - error_clear_last(); |
|
| 173 | - $result = \socket_create_listen($port, $backlog); |
|
| 174 | - if ($result === false) { |
|
| 175 | - throw SocketsException::createFromPhpError(); |
|
| 176 | - } |
|
| 177 | - return $result; |
|
| 172 | + error_clear_last(); |
|
| 173 | + $result = \socket_create_listen($port, $backlog); |
|
| 174 | + if ($result === false) { |
|
| 175 | + throw SocketsException::createFromPhpError(); |
|
| 176 | + } |
|
| 177 | + return $result; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | |
@@ -205,11 +205,11 @@ discard block |
||
| 205 | 205 | */ |
| 206 | 206 | function socket_create_pair(int $domain, int $type, int $protocol, ?iterable &$fd): void |
| 207 | 207 | { |
| 208 | - error_clear_last(); |
|
| 209 | - $result = \socket_create_pair($domain, $type, $protocol, $fd); |
|
| 210 | - if ($result === false) { |
|
| 211 | - throw SocketsException::createFromPhpError(); |
|
| 212 | - } |
|
| 208 | + error_clear_last(); |
|
| 209 | + $result = \socket_create_pair($domain, $type, $protocol, $fd); |
|
| 210 | + if ($result === false) { |
|
| 211 | + throw SocketsException::createFromPhpError(); |
|
| 212 | + } |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | |
@@ -238,12 +238,12 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | function socket_create(int $domain, int $type, int $protocol) |
| 240 | 240 | { |
| 241 | - error_clear_last(); |
|
| 242 | - $result = \socket_create($domain, $type, $protocol); |
|
| 243 | - if ($result === false) { |
|
| 244 | - throw SocketsException::createFromPhpError(); |
|
| 245 | - } |
|
| 246 | - return $result; |
|
| 241 | + error_clear_last(); |
|
| 242 | + $result = \socket_create($domain, $type, $protocol); |
|
| 243 | + if ($result === false) { |
|
| 244 | + throw SocketsException::createFromPhpError(); |
|
| 245 | + } |
|
| 246 | + return $result; |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | |
@@ -257,12 +257,12 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | function socket_export_stream($socket) |
| 259 | 259 | { |
| 260 | - error_clear_last(); |
|
| 261 | - $result = \socket_export_stream($socket); |
|
| 262 | - if ($result === false) { |
|
| 263 | - throw SocketsException::createFromPhpError(); |
|
| 264 | - } |
|
| 265 | - return $result; |
|
| 260 | + error_clear_last(); |
|
| 261 | + $result = \socket_export_stream($socket); |
|
| 262 | + if ($result === false) { |
|
| 263 | + throw SocketsException::createFromPhpError(); |
|
| 264 | + } |
|
| 265 | + return $result; |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | |
@@ -304,12 +304,12 @@ discard block |
||
| 304 | 304 | */ |
| 305 | 305 | function socket_get_option($socket, int $level, int $optname) |
| 306 | 306 | { |
| 307 | - error_clear_last(); |
|
| 308 | - $result = \socket_get_option($socket, $level, $optname); |
|
| 309 | - if ($result === false) { |
|
| 310 | - throw SocketsException::createFromPhpError(); |
|
| 311 | - } |
|
| 312 | - return $result; |
|
| 307 | + error_clear_last(); |
|
| 308 | + $result = \socket_get_option($socket, $level, $optname); |
|
| 309 | + if ($result === false) { |
|
| 310 | + throw SocketsException::createFromPhpError(); |
|
| 311 | + } |
|
| 312 | + return $result; |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | |
@@ -338,11 +338,11 @@ discard block |
||
| 338 | 338 | */ |
| 339 | 339 | function socket_getpeername($socket, string &$address, ?int &$port = null): void |
| 340 | 340 | { |
| 341 | - error_clear_last(); |
|
| 342 | - $result = \socket_getpeername($socket, $address, $port); |
|
| 343 | - if ($result === false) { |
|
| 344 | - throw SocketsException::createFromPhpError(); |
|
| 345 | - } |
|
| 341 | + error_clear_last(); |
|
| 342 | + $result = \socket_getpeername($socket, $address, $port); |
|
| 343 | + if ($result === false) { |
|
| 344 | + throw SocketsException::createFromPhpError(); |
|
| 345 | + } |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | |
@@ -368,11 +368,11 @@ discard block |
||
| 368 | 368 | */ |
| 369 | 369 | function socket_getsockname($socket, ?string &$addr, ?int &$port = null): void |
| 370 | 370 | { |
| 371 | - error_clear_last(); |
|
| 372 | - $result = \socket_getsockname($socket, $addr, $port); |
|
| 373 | - if ($result === false) { |
|
| 374 | - throw SocketsException::createFromPhpError(); |
|
| 375 | - } |
|
| 371 | + error_clear_last(); |
|
| 372 | + $result = \socket_getsockname($socket, $addr, $port); |
|
| 373 | + if ($result === false) { |
|
| 374 | + throw SocketsException::createFromPhpError(); |
|
| 375 | + } |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | |
@@ -386,12 +386,12 @@ discard block |
||
| 386 | 386 | */ |
| 387 | 387 | function socket_import_stream($stream) |
| 388 | 388 | { |
| 389 | - error_clear_last(); |
|
| 390 | - $result = \socket_import_stream($stream); |
|
| 391 | - if ($result === null) { |
|
| 392 | - throw SocketsException::createFromPhpError(); |
|
| 393 | - } |
|
| 394 | - return $result; |
|
| 389 | + error_clear_last(); |
|
| 390 | + $result = \socket_import_stream($stream); |
|
| 391 | + if ($result === null) { |
|
| 392 | + throw SocketsException::createFromPhpError(); |
|
| 393 | + } |
|
| 394 | + return $result; |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | |
@@ -425,11 +425,11 @@ discard block |
||
| 425 | 425 | */ |
| 426 | 426 | function socket_listen($socket, int $backlog = 0): void |
| 427 | 427 | { |
| 428 | - error_clear_last(); |
|
| 429 | - $result = \socket_listen($socket, $backlog); |
|
| 430 | - if ($result === false) { |
|
| 431 | - throw SocketsException::createFromPhpError(); |
|
| 432 | - } |
|
| 428 | + error_clear_last(); |
|
| 429 | + $result = \socket_listen($socket, $backlog); |
|
| 430 | + if ($result === false) { |
|
| 431 | + throw SocketsException::createFromPhpError(); |
|
| 432 | + } |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | |
@@ -471,12 +471,12 @@ discard block |
||
| 471 | 471 | */ |
| 472 | 472 | function socket_read($socket, int $length, int $type = PHP_BINARY_READ): string |
| 473 | 473 | { |
| 474 | - error_clear_last(); |
|
| 475 | - $result = \socket_read($socket, $length, $type); |
|
| 476 | - if ($result === false) { |
|
| 477 | - throw SocketsException::createFromPhpError(); |
|
| 478 | - } |
|
| 479 | - return $result; |
|
| 474 | + error_clear_last(); |
|
| 475 | + $result = \socket_read($socket, $length, $type); |
|
| 476 | + if ($result === false) { |
|
| 477 | + throw SocketsException::createFromPhpError(); |
|
| 478 | + } |
|
| 479 | + return $result; |
|
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | |
@@ -532,12 +532,12 @@ discard block |
||
| 532 | 532 | */ |
| 533 | 533 | function socket_send($socket, string $buf, int $len, int $flags): int |
| 534 | 534 | { |
| 535 | - error_clear_last(); |
|
| 536 | - $result = \socket_send($socket, $buf, $len, $flags); |
|
| 537 | - if ($result === false) { |
|
| 538 | - throw SocketsException::createFromPhpError(); |
|
| 539 | - } |
|
| 540 | - return $result; |
|
| 535 | + error_clear_last(); |
|
| 536 | + $result = \socket_send($socket, $buf, $len, $flags); |
|
| 537 | + if ($result === false) { |
|
| 538 | + throw SocketsException::createFromPhpError(); |
|
| 539 | + } |
|
| 540 | + return $result; |
|
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | |
@@ -553,12 +553,12 @@ discard block |
||
| 553 | 553 | */ |
| 554 | 554 | function socket_sendmsg($socket, array $message, int $flags = 0): int |
| 555 | 555 | { |
| 556 | - error_clear_last(); |
|
| 557 | - $result = \socket_sendmsg($socket, $message, $flags); |
|
| 558 | - if ($result === false) { |
|
| 559 | - throw SocketsException::createFromPhpError(); |
|
| 560 | - } |
|
| 561 | - return $result; |
|
| 556 | + error_clear_last(); |
|
| 557 | + $result = \socket_sendmsg($socket, $message, $flags); |
|
| 558 | + if ($result === false) { |
|
| 559 | + throw SocketsException::createFromPhpError(); |
|
| 560 | + } |
|
| 561 | + return $result; |
|
| 562 | 562 | } |
| 563 | 563 | |
| 564 | 564 | |
@@ -618,12 +618,12 @@ discard block |
||
| 618 | 618 | */ |
| 619 | 619 | function socket_sendto($socket, string $buf, int $len, int $flags, string $addr, int $port = 0): int |
| 620 | 620 | { |
| 621 | - error_clear_last(); |
|
| 622 | - $result = \socket_sendto($socket, $buf, $len, $flags, $addr, $port); |
|
| 623 | - if ($result === false) { |
|
| 624 | - throw SocketsException::createFromPhpError(); |
|
| 625 | - } |
|
| 626 | - return $result; |
|
| 621 | + error_clear_last(); |
|
| 622 | + $result = \socket_sendto($socket, $buf, $len, $flags, $addr, $port); |
|
| 623 | + if ($result === false) { |
|
| 624 | + throw SocketsException::createFromPhpError(); |
|
| 625 | + } |
|
| 626 | + return $result; |
|
| 627 | 627 | } |
| 628 | 628 | |
| 629 | 629 | |
@@ -643,11 +643,11 @@ discard block |
||
| 643 | 643 | */ |
| 644 | 644 | function socket_set_block($socket): void |
| 645 | 645 | { |
| 646 | - error_clear_last(); |
|
| 647 | - $result = \socket_set_block($socket); |
|
| 648 | - if ($result === false) { |
|
| 649 | - throw SocketsException::createFromPhpError(); |
|
| 650 | - } |
|
| 646 | + error_clear_last(); |
|
| 647 | + $result = \socket_set_block($socket); |
|
| 648 | + if ($result === false) { |
|
| 649 | + throw SocketsException::createFromPhpError(); |
|
| 650 | + } |
|
| 651 | 651 | } |
| 652 | 652 | |
| 653 | 653 | |
@@ -668,11 +668,11 @@ discard block |
||
| 668 | 668 | */ |
| 669 | 669 | function socket_set_nonblock($socket): void |
| 670 | 670 | { |
| 671 | - error_clear_last(); |
|
| 672 | - $result = \socket_set_nonblock($socket); |
|
| 673 | - if ($result === false) { |
|
| 674 | - throw SocketsException::createFromPhpError(); |
|
| 675 | - } |
|
| 671 | + error_clear_last(); |
|
| 672 | + $result = \socket_set_nonblock($socket); |
|
| 673 | + if ($result === false) { |
|
| 674 | + throw SocketsException::createFromPhpError(); |
|
| 675 | + } |
|
| 676 | 676 | } |
| 677 | 677 | |
| 678 | 678 | |
@@ -700,11 +700,11 @@ discard block |
||
| 700 | 700 | */ |
| 701 | 701 | function socket_set_option($socket, int $level, int $optname, $optval): void |
| 702 | 702 | { |
| 703 | - error_clear_last(); |
|
| 704 | - $result = \socket_set_option($socket, $level, $optname, $optval); |
|
| 705 | - if ($result === false) { |
|
| 706 | - throw SocketsException::createFromPhpError(); |
|
| 707 | - } |
|
| 703 | + error_clear_last(); |
|
| 704 | + $result = \socket_set_option($socket, $level, $optname, $optval); |
|
| 705 | + if ($result === false) { |
|
| 706 | + throw SocketsException::createFromPhpError(); |
|
| 707 | + } |
|
| 708 | 708 | } |
| 709 | 709 | |
| 710 | 710 | |
@@ -745,11 +745,11 @@ discard block |
||
| 745 | 745 | */ |
| 746 | 746 | function socket_shutdown($socket, int $how = 2): void |
| 747 | 747 | { |
| 748 | - error_clear_last(); |
|
| 749 | - $result = \socket_shutdown($socket, $how); |
|
| 750 | - if ($result === false) { |
|
| 751 | - throw SocketsException::createFromPhpError(); |
|
| 752 | - } |
|
| 748 | + error_clear_last(); |
|
| 749 | + $result = \socket_shutdown($socket, $how); |
|
| 750 | + if ($result === false) { |
|
| 751 | + throw SocketsException::createFromPhpError(); |
|
| 752 | + } |
|
| 753 | 753 | } |
| 754 | 754 | |
| 755 | 755 | |
@@ -766,12 +766,12 @@ discard block |
||
| 766 | 766 | */ |
| 767 | 767 | function socket_wsaprotocol_info_export($socket, int $target_pid): string |
| 768 | 768 | { |
| 769 | - error_clear_last(); |
|
| 770 | - $result = \socket_wsaprotocol_info_export($socket, $target_pid); |
|
| 771 | - if ($result === false) { |
|
| 772 | - throw SocketsException::createFromPhpError(); |
|
| 773 | - } |
|
| 774 | - return $result; |
|
| 769 | + error_clear_last(); |
|
| 770 | + $result = \socket_wsaprotocol_info_export($socket, $target_pid); |
|
| 771 | + if ($result === false) { |
|
| 772 | + throw SocketsException::createFromPhpError(); |
|
| 773 | + } |
|
| 774 | + return $result; |
|
| 775 | 775 | } |
| 776 | 776 | |
| 777 | 777 | |
@@ -786,12 +786,12 @@ discard block |
||
| 786 | 786 | */ |
| 787 | 787 | function socket_wsaprotocol_info_import(string $info_id) |
| 788 | 788 | { |
| 789 | - error_clear_last(); |
|
| 790 | - $result = \socket_wsaprotocol_info_import($info_id); |
|
| 791 | - if ($result === false) { |
|
| 792 | - throw SocketsException::createFromPhpError(); |
|
| 793 | - } |
|
| 794 | - return $result; |
|
| 789 | + error_clear_last(); |
|
| 790 | + $result = \socket_wsaprotocol_info_import($info_id); |
|
| 791 | + if ($result === false) { |
|
| 792 | + throw SocketsException::createFromPhpError(); |
|
| 793 | + } |
|
| 794 | + return $result; |
|
| 795 | 795 | } |
| 796 | 796 | |
| 797 | 797 | |
@@ -805,9 +805,9 @@ discard block |
||
| 805 | 805 | */ |
| 806 | 806 | function socket_wsaprotocol_info_release(string $info_id): void |
| 807 | 807 | { |
| 808 | - error_clear_last(); |
|
| 809 | - $result = \socket_wsaprotocol_info_release($info_id); |
|
| 810 | - if ($result === false) { |
|
| 811 | - throw SocketsException::createFromPhpError(); |
|
| 812 | - } |
|
| 808 | + error_clear_last(); |
|
| 809 | + $result = \socket_wsaprotocol_info_release($info_id); |
|
| 810 | + if ($result === false) { |
|
| 811 | + throw SocketsException::createFromPhpError(); |
|
| 812 | + } |
|
| 813 | 813 | } |
@@ -24,18 +24,18 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | function xml_parser_create_ns(string $encoding = null, string $separator = ":") |
| 26 | 26 | { |
| 27 | - error_clear_last(); |
|
| 28 | - if ($separator !== ":") { |
|
| 29 | - $result = \xml_parser_create_ns($encoding, $separator); |
|
| 30 | - } elseif ($encoding !== null) { |
|
| 31 | - $result = \xml_parser_create_ns($encoding); |
|
| 32 | - } else { |
|
| 33 | - $result = \xml_parser_create_ns(); |
|
| 34 | - } |
|
| 35 | - if ($result === false) { |
|
| 36 | - throw XmlException::createFromPhpError(); |
|
| 37 | - } |
|
| 38 | - return $result; |
|
| 27 | + error_clear_last(); |
|
| 28 | + if ($separator !== ":") { |
|
| 29 | + $result = \xml_parser_create_ns($encoding, $separator); |
|
| 30 | + } elseif ($encoding !== null) { |
|
| 31 | + $result = \xml_parser_create_ns($encoding); |
|
| 32 | + } else { |
|
| 33 | + $result = \xml_parser_create_ns(); |
|
| 34 | + } |
|
| 35 | + if ($result === false) { |
|
| 36 | + throw XmlException::createFromPhpError(); |
|
| 37 | + } |
|
| 38 | + return $result; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
@@ -61,16 +61,16 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | function xml_parser_create(string $encoding = null) |
| 63 | 63 | { |
| 64 | - error_clear_last(); |
|
| 65 | - if ($encoding !== null) { |
|
| 66 | - $result = \xml_parser_create($encoding); |
|
| 67 | - } else { |
|
| 68 | - $result = \xml_parser_create(); |
|
| 69 | - } |
|
| 70 | - if ($result === false) { |
|
| 71 | - throw XmlException::createFromPhpError(); |
|
| 72 | - } |
|
| 73 | - return $result; |
|
| 64 | + error_clear_last(); |
|
| 65 | + if ($encoding !== null) { |
|
| 66 | + $result = \xml_parser_create($encoding); |
|
| 67 | + } else { |
|
| 68 | + $result = \xml_parser_create(); |
|
| 69 | + } |
|
| 70 | + if ($result === false) { |
|
| 71 | + throw XmlException::createFromPhpError(); |
|
| 72 | + } |
|
| 73 | + return $result; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | function xml_set_object($parser, object &$object): void |
| 89 | 89 | { |
| 90 | - error_clear_last(); |
|
| 91 | - $result = \xml_set_object($parser, $object); |
|
| 92 | - if ($result === false) { |
|
| 93 | - throw XmlException::createFromPhpError(); |
|
| 94 | - } |
|
| 90 | + error_clear_last(); |
|
| 91 | + $result = \xml_set_object($parser, $object); |
|
| 92 | + if ($result === false) { |
|
| 93 | + throw XmlException::createFromPhpError(); |
|
| 94 | + } |
|
| 95 | 95 | } |
@@ -28,15 +28,15 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | function com_event_sink(object $comobject, object $sinkobject, $sinkinterface = null): void |
| 30 | 30 | { |
| 31 | - error_clear_last(); |
|
| 32 | - if ($sinkinterface !== null) { |
|
| 33 | - $result = \com_event_sink($comobject, $sinkobject, $sinkinterface); |
|
| 34 | - } else { |
|
| 35 | - $result = \com_event_sink($comobject, $sinkobject); |
|
| 36 | - } |
|
| 37 | - if ($result === false) { |
|
| 38 | - throw ComException::createFromPhpError(); |
|
| 39 | - } |
|
| 31 | + error_clear_last(); |
|
| 32 | + if ($sinkinterface !== null) { |
|
| 33 | + $result = \com_event_sink($comobject, $sinkobject, $sinkinterface); |
|
| 34 | + } else { |
|
| 35 | + $result = \com_event_sink($comobject, $sinkobject); |
|
| 36 | + } |
|
| 37 | + if ($result === false) { |
|
| 38 | + throw ComException::createFromPhpError(); |
|
| 39 | + } |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
@@ -94,11 +94,11 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | function com_load_typelib(string $typelib_name, bool $case_sensitive = true): void |
| 96 | 96 | { |
| 97 | - error_clear_last(); |
|
| 98 | - $result = \com_load_typelib($typelib_name, $case_sensitive); |
|
| 99 | - if ($result === false) { |
|
| 100 | - throw ComException::createFromPhpError(); |
|
| 101 | - } |
|
| 97 | + error_clear_last(); |
|
| 98 | + $result = \com_load_typelib($typelib_name, $case_sensitive); |
|
| 99 | + if ($result === false) { |
|
| 100 | + throw ComException::createFromPhpError(); |
|
| 101 | + } |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
@@ -119,9 +119,9 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | function com_print_typeinfo(object $comobject, string $dispinterface = null, bool $wantsink = false): void |
| 121 | 121 | { |
| 122 | - error_clear_last(); |
|
| 123 | - $result = \com_print_typeinfo($comobject, $dispinterface, $wantsink); |
|
| 124 | - if ($result === false) { |
|
| 125 | - throw ComException::createFromPhpError(); |
|
| 126 | - } |
|
| 122 | + error_clear_last(); |
|
| 123 | + $result = \com_print_typeinfo($comobject, $dispinterface, $wantsink); |
|
| 124 | + if ($result === false) { |
|
| 125 | + throw ComException::createFromPhpError(); |
|
| 126 | + } |
|
| 127 | 127 | } |
@@ -16,12 +16,12 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | function apcu_cache_info(bool $limited = false): array |
| 18 | 18 | { |
| 19 | - error_clear_last(); |
|
| 20 | - $result = \apcu_cache_info($limited); |
|
| 21 | - if ($result === false) { |
|
| 22 | - throw ApcuException::createFromPhpError(); |
|
| 23 | - } |
|
| 24 | - return $result; |
|
| 19 | + error_clear_last(); |
|
| 20 | + $result = \apcu_cache_info($limited); |
|
| 21 | + if ($result === false) { |
|
| 22 | + throw ApcuException::createFromPhpError(); |
|
| 23 | + } |
|
| 24 | + return $result; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
@@ -38,11 +38,11 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | function apcu_cas(string $key, int $old, int $new): void |
| 40 | 40 | { |
| 41 | - error_clear_last(); |
|
| 42 | - $result = \apcu_cas($key, $old, $new); |
|
| 43 | - if ($result === false) { |
|
| 44 | - throw ApcuException::createFromPhpError(); |
|
| 45 | - } |
|
| 41 | + error_clear_last(); |
|
| 42 | + $result = \apcu_cas($key, $old, $new); |
|
| 43 | + if ($result === false) { |
|
| 44 | + throw ApcuException::createFromPhpError(); |
|
| 45 | + } |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | function apcu_dec(string $key, int $step = 1, ?bool &$success = null, int $ttl = 0): int |
| 62 | 62 | { |
| 63 | - error_clear_last(); |
|
| 64 | - $result = \apcu_dec($key, $step, $success, $ttl); |
|
| 65 | - if ($result === false) { |
|
| 66 | - throw ApcuException::createFromPhpError(); |
|
| 67 | - } |
|
| 68 | - return $result; |
|
| 63 | + error_clear_last(); |
|
| 64 | + $result = \apcu_dec($key, $step, $success, $ttl); |
|
| 65 | + if ($result === false) { |
|
| 66 | + throw ApcuException::createFromPhpError(); |
|
| 67 | + } |
|
| 68 | + return $result; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
@@ -83,12 +83,12 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | function apcu_inc(string $key, int $step = 1, ?bool &$success = null, int $ttl = 0): int |
| 85 | 85 | { |
| 86 | - error_clear_last(); |
|
| 87 | - $result = \apcu_inc($key, $step, $success, $ttl); |
|
| 88 | - if ($result === false) { |
|
| 89 | - throw ApcuException::createFromPhpError(); |
|
| 90 | - } |
|
| 91 | - return $result; |
|
| 86 | + error_clear_last(); |
|
| 87 | + $result = \apcu_inc($key, $step, $success, $ttl); |
|
| 88 | + if ($result === false) { |
|
| 89 | + throw ApcuException::createFromPhpError(); |
|
| 90 | + } |
|
| 91 | + return $result; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
@@ -103,10 +103,10 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | function apcu_sma_info(bool $limited = false): array |
| 105 | 105 | { |
| 106 | - error_clear_last(); |
|
| 107 | - $result = \apcu_sma_info($limited); |
|
| 108 | - if ($result === false) { |
|
| 109 | - throw ApcuException::createFromPhpError(); |
|
| 110 | - } |
|
| 111 | - return $result; |
|
| 106 | + error_clear_last(); |
|
| 107 | + $result = \apcu_sma_info($limited); |
|
| 108 | + if ($result === false) { |
|
| 109 | + throw ApcuException::createFromPhpError(); |
|
| 110 | + } |
|
| 111 | + return $result; |
|
| 112 | 112 | } |
@@ -13,11 +13,11 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | function session_abort(): void |
| 15 | 15 | { |
| 16 | - error_clear_last(); |
|
| 17 | - $result = \session_abort(); |
|
| 18 | - if ($result === false) { |
|
| 19 | - throw SessionException::createFromPhpError(); |
|
| 20 | - } |
|
| 16 | + error_clear_last(); |
|
| 17 | + $result = \session_abort(); |
|
| 18 | + if ($result === false) { |
|
| 19 | + throw SessionException::createFromPhpError(); |
|
| 20 | + } |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
@@ -35,11 +35,11 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | function session_decode(string $data): void |
| 37 | 37 | { |
| 38 | - error_clear_last(); |
|
| 39 | - $result = \session_decode($data); |
|
| 40 | - if ($result === false) { |
|
| 41 | - throw SessionException::createFromPhpError(); |
|
| 42 | - } |
|
| 38 | + error_clear_last(); |
|
| 39 | + $result = \session_decode($data); |
|
| 40 | + if ($result === false) { |
|
| 41 | + throw SessionException::createFromPhpError(); |
|
| 42 | + } |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
@@ -61,11 +61,11 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | function session_destroy(): void |
| 63 | 63 | { |
| 64 | - error_clear_last(); |
|
| 65 | - $result = \session_destroy(); |
|
| 66 | - if ($result === false) { |
|
| 67 | - throw SessionException::createFromPhpError(); |
|
| 68 | - } |
|
| 64 | + error_clear_last(); |
|
| 65 | + $result = \session_destroy(); |
|
| 66 | + if ($result === false) { |
|
| 67 | + throw SessionException::createFromPhpError(); |
|
| 68 | + } |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
@@ -86,11 +86,11 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | function session_regenerate_id(bool $delete_old_session = false): void |
| 88 | 88 | { |
| 89 | - error_clear_last(); |
|
| 90 | - $result = \session_regenerate_id($delete_old_session); |
|
| 91 | - if ($result === false) { |
|
| 92 | - throw SessionException::createFromPhpError(); |
|
| 93 | - } |
|
| 89 | + error_clear_last(); |
|
| 90 | + $result = \session_regenerate_id($delete_old_session); |
|
| 91 | + if ($result === false) { |
|
| 92 | + throw SessionException::createFromPhpError(); |
|
| 93 | + } |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
@@ -104,11 +104,11 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | function session_reset(): void |
| 106 | 106 | { |
| 107 | - error_clear_last(); |
|
| 108 | - $result = \session_reset(); |
|
| 109 | - if ($result === false) { |
|
| 110 | - throw SessionException::createFromPhpError(); |
|
| 111 | - } |
|
| 107 | + error_clear_last(); |
|
| 108 | + $result = \session_reset(); |
|
| 109 | + if ($result === false) { |
|
| 110 | + throw SessionException::createFromPhpError(); |
|
| 111 | + } |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | |
@@ -121,11 +121,11 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | function session_unset(): void |
| 123 | 123 | { |
| 124 | - error_clear_last(); |
|
| 125 | - $result = \session_unset(); |
|
| 126 | - if ($result === false) { |
|
| 127 | - throw SessionException::createFromPhpError(); |
|
| 128 | - } |
|
| 124 | + error_clear_last(); |
|
| 125 | + $result = \session_unset(); |
|
| 126 | + if ($result === false) { |
|
| 127 | + throw SessionException::createFromPhpError(); |
|
| 128 | + } |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | |
@@ -145,9 +145,9 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | function session_write_close(): void |
| 147 | 147 | { |
| 148 | - error_clear_last(); |
|
| 149 | - $result = \session_write_close(); |
|
| 150 | - if ($result === false) { |
|
| 151 | - throw SessionException::createFromPhpError(); |
|
| 152 | - } |
|
| 148 | + error_clear_last(); |
|
| 149 | + $result = \session_write_close(); |
|
| 150 | + if ($result === false) { |
|
| 151 | + throw SessionException::createFromPhpError(); |
|
| 152 | + } |
|
| 153 | 153 | } |