Skip to content

Commit 14aed3f

Browse files
committed
Fix one more address round and rename namespace to Odbc
1 parent 887b793 commit 14aed3f

11 files changed

+224
-232
lines changed

UPGRADING

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ PHP 8.4 UPGRADE NOTES
6767
- ODBC:
6868
. odbc_fetch_row() returns false when a value less than or equal to 0 is
6969
passed for parameter $row. Now, a warning is emitted in this case.
70+
. odbc_connect() and odbc_pconnect() will now return an Odbc\Connection
71+
object rather than a resource. Return value checks using is_resource()
72+
should be replaced with checks for `false`.
73+
. odbc_prepare(), odbc_exec(), and various other functions will now return
74+
an Odbc\Result object rather than a resource. Return value checks using
75+
is_resource() should be replaced with checks for `false`.
7076

7177
- Opcache:
7278
. The JIT config defaults changed from opcache.jit=tracing and

ext/odbc/odbc.stub.php

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/** @generate-class-entries */
44

5-
namespace ODBC {
5+
namespace Odbc {
66
/**
77
* @strict-properties
88
* @not-serializable
@@ -234,7 +234,7 @@ class Result
234234
*/
235235
const SQL_TIMESTAMP = UNKNOWN;
236236

237-
#if (defined(ODBCVER) && (ODBCVER >= 0x0300))
237+
#if (defined(ODBCVER) && (ODBCVER >= 0x0300))
238238
/**
239239
* @var int
240240
* @cvalue SQL_TYPE_DATE
@@ -327,116 +327,116 @@ class Result
327327
*/
328328
const SQL_QUICK = UNKNOWN;
329329

330-
#endif
330+
#endif
331331

332332
function odbc_close_all(): void {}
333333

334-
function odbc_binmode(ODBC\Result $statement, int $mode): true {}
334+
function odbc_binmode(Odbc\Result $statement, int $mode): true {}
335335

336-
function odbc_longreadlen(ODBC\Result $statement, int $length): true {}
336+
function odbc_longreadlen(Odbc\Result $statement, int $length): true {}
337337

338-
function odbc_prepare(ODBC\Connection $odbc, string $query): ODBC\Result|false {}
338+
function odbc_prepare(Odbc\Connection $odbc, string $query): Odbc\Result|false {}
339339

340-
function odbc_execute(ODBC\Result $statement, array $params = []): bool {}
340+
function odbc_execute(Odbc\Result $statement, array $params = []): bool {}
341341

342-
function odbc_cursor(ODBC\Result $statement): string|false {}
342+
function odbc_cursor(Odbc\Result $statement): string|false {}
343343

344-
#ifdef HAVE_SQLDATASOURCES
345-
function odbc_data_source(ODBC\Connection $odbc, int $fetch_type): array|null|false {}
346-
#endif
344+
#ifdef HAVE_SQLDATASOURCES
345+
function odbc_data_source(Odbc\Connection $odbc, int $fetch_type): array|null|false {}
346+
#endif
347347

348-
function odbc_exec(ODBC\Connection $odbc, string $query): ODBC\Result|false {}
348+
function odbc_exec(Odbc\Connection $odbc, string $query): Odbc\Result|false {}
349349

350350
/** @alias odbc_exec */
351-
function odbc_do(ODBC\Connection $odbc, string $query): ODBC\Result|false {}
351+
function odbc_do(Odbc\Connection $odbc, string $query): Odbc\Result|false {}
352352

353353
#ifdef PHP_ODBC_HAVE_FETCH_HASH
354-
/** @param resource $statement */
355-
function odbc_fetch_object($statement, ?int $row = null): stdClass|false {}
354+
/** @param resource $statement */
355+
function odbc_fetch_object($statement, ?int $row = null): stdClass|false {}
356356

357-
/** @param resource $statement */
358-
function odbc_fetch_array($statement, ?int $row = null): array|false {}
357+
/** @param resource $statement */
358+
function odbc_fetch_array($statement, ?int $row = null): array|false {}
359359
#endif
360360

361-
/**
362-
* @param resource $statement
363-
* @param array $array
364-
*/
365-
function odbc_fetch_into($statement, &$array, ?int $row = null): int|false {}
361+
/**
362+
* @param resource $statement
363+
* @param array $array
364+
*/
365+
function odbc_fetch_into($statement, &$array, ?int $row = null): int|false {}
366366

367-
function odbc_fetch_row(ODBC\Result $statement, ?int $row = null): bool {}
367+
function odbc_fetch_row(Odbc\Result $statement, ?int $row = null): bool {}
368368

369-
function odbc_result(ODBC\Result $statement, string|int $field): string|bool|null {}
369+
function odbc_result(Odbc\Result $statement, string|int $field): string|bool|null {}
370370

371371
/** @deprecated */
372-
function odbc_result_all(ODBC\Result $statement, string $format = ""): int|false {}
372+
function odbc_result_all(Odbc\Result $statement, string $format = ""): int|false {}
373373

374-
function odbc_free_result(ODBC\Result $statement): true {}
374+
function odbc_free_result(Odbc\Result $statement): true {}
375375

376-
function odbc_connect(string $dsn, ?string $user = null, #[\SensitiveParameter] ?string $password = null, int $cursor_option = SQL_CUR_USE_DRIVER): ODBC\Connection|false {}
376+
function odbc_connect(string $dsn, ?string $user = null, #[\SensitiveParameter] ?string $password = null, int $cursor_option = SQL_CUR_USE_DRIVER): Odbc\Connection|false {}
377377

378-
function odbc_pconnect(string $dsn, ?string $user = null, #[\SensitiveParameter] ?string $password = null, int $cursor_option = SQL_CUR_USE_DRIVER): ODBC\Connection|false {}
378+
function odbc_pconnect(string $dsn, ?string $user = null, #[\SensitiveParameter] ?string $password = null, int $cursor_option = SQL_CUR_USE_DRIVER): Odbc\Connection|false {}
379379

380-
function odbc_close(ODBC\Connection $odbc): void {}
380+
function odbc_close(Odbc\Connection $odbc): void {}
381381

382-
function odbc_num_rows(ODBC\Result $statement): int {}
382+
function odbc_num_rows(Odbc\Result $statement): int {}
383383

384-
#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30)
385-
function odbc_next_result(ODBC\Result $statement): bool {}
386-
#endif
384+
#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30)
385+
function odbc_next_result(Odbc\Result $statement): bool {}
386+
#endif
387387

388-
function odbc_num_fields(ODBC\Result $statement): int {}
388+
function odbc_num_fields(Odbc\Result $statement): int {}
389389

390-
function odbc_field_name(ODBC\Result $statement, int $field): string|false {}
390+
function odbc_field_name(Odbc\Result $statement, int $field): string|false {}
391391

392-
function odbc_field_type(ODBC\Result $statement, int $field): string|false {}
392+
function odbc_field_type(Odbc\Result $statement, int $field): string|false {}
393393

394-
function odbc_field_len(ODBC\Result $statement, int $field): int|false {}
394+
function odbc_field_len(Odbc\Result $statement, int $field): int|false {}
395395

396396
/** @alias odbc_field_len */
397-
function odbc_field_precision(ODBC\Result $statement, int $field): int|false {}
397+
function odbc_field_precision(Odbc\Result $statement, int $field): int|false {}
398398

399-
function odbc_field_scale(ODBC\Result $statement, int $field): int|false {}
399+
function odbc_field_scale(Odbc\Result $statement, int $field): int|false {}
400400

401-
function odbc_field_num(ODBC\Result $statement, string $field): int|false {}
401+
function odbc_field_num(Odbc\Result $statement, string $field): int|false {}
402402

403-
function odbc_autocommit(ODBC\Connection $odbc, ?bool $enable = null): int|bool {}
403+
function odbc_autocommit(Odbc\Connection $odbc, ?bool $enable = null): int|bool {}
404404

405-
function odbc_commit(ODBC\Connection $odbc): bool {}
405+
function odbc_commit(Odbc\Connection $odbc): bool {}
406406

407-
function odbc_rollback(ODBC\Connection $odbc): bool {}
407+
function odbc_rollback(Odbc\Connection $odbc): bool {}
408408

409-
function odbc_error(?ODBC\Connection $odbc = null): string {}
409+
function odbc_error(?Odbc\Connection $odbc = null): string {}
410410

411-
function odbc_errormsg(?ODBC\Connection $odbc = null): string {}
411+
function odbc_errormsg(?Odbc\Connection $odbc = null): string {}
412412

413-
function odbc_setoption(ODBC\Connection|ODBC\Result $odbc, int $which, int $option, int $value): bool {}
413+
function odbc_setoption(Odbc\Connection|Odbc\Result $odbc, int $which, int $option, int $value): bool {}
414414

415-
function odbc_tables(ODBC\Connection $odbc, ?string $catalog = null, ?string $schema = null, ?string $table = null, ?string $types = null): ODBC\Result|false {}
415+
function odbc_tables(Odbc\Connection $odbc, ?string $catalog = null, ?string $schema = null, ?string $table = null, ?string $types = null): Odbc\Result|false {}
416416

417-
function odbc_columns(ODBC\Connection $odbc, ?string $catalog = null, ?string $schema = null, ?string $table = null, ?string $column = null): ODBC\Result|false {}
417+
function odbc_columns(Odbc\Connection $odbc, ?string $catalog = null, ?string $schema = null, ?string $table = null, ?string $column = null): Odbc\Result|false {}
418418

419-
function odbc_gettypeinfo(ODBC\Connection $odbc, int $data_type = 0): ODBC\Result|false {}
419+
function odbc_gettypeinfo(Odbc\Connection $odbc, int $data_type = 0): Odbc\Result|false {}
420420

421-
function odbc_primarykeys(ODBC\Connection $odbc, ?string $catalog, string $schema, string $table): ODBC\Result|false {}
421+
function odbc_primarykeys(Odbc\Connection $odbc, ?string $catalog, string $schema, string $table): Odbc\Result|false {}
422422

423-
#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35)
424-
function odbc_procedurecolumns(ODBC\Connection $odbc, ?string $catalog = null, ?string $schema = null, ?string $procedure = null, ?string $column = null): ODBC\Result|false {}
423+
#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35)
424+
function odbc_procedurecolumns(Odbc\Connection $odbc, ?string $catalog = null, ?string $schema = null, ?string $procedure = null, ?string $column = null): Odbc\Result|false {}
425425

426-
function odbc_procedures(ODBC\Connection $odbc, ?string $catalog = null, ?string $schema = null, ?string $procedure = null): ODBC\Result|false {}
426+
function odbc_procedures(Odbc\Connection $odbc, ?string $catalog = null, ?string $schema = null, ?string $procedure = null): Odbc\Result|false {}
427427

428-
function odbc_foreignkeys(ODBC\Connection $odbc, ?string $pk_catalog, string $pk_schema, string $pk_table, string $fk_catalog, string $fk_schema, string $fk_table): ODBC\Result|false {}
429-
#endif
428+
function odbc_foreignkeys(Odbc\Connection $odbc, ?string $pk_catalog, string $pk_schema, string $pk_table, string $fk_catalog, string $fk_schema, string $fk_table): Odbc\Result|false {}
429+
#endif
430430

431-
function odbc_specialcolumns(ODBC\Connection $odbc, int $type, ?string $catalog, string $schema, string $table, int $scope, int $nullable): ODBC\Result|false {}
431+
function odbc_specialcolumns(Odbc\Connection $odbc, int $type, ?string $catalog, string $schema, string $table, int $scope, int $nullable): Odbc\Result|false {}
432432

433-
function odbc_statistics(ODBC\Connection $odbc, ?string $catalog, string $schema, string $table, int $unique, int $accuracy): ODBC\Result|false {}
433+
function odbc_statistics(Odbc\Connection $odbc, ?string $catalog, string $schema, string $table, int $unique, int $accuracy): Odbc\Result|false {}
434434

435-
#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) &&!defined(HAVE_SOLID_35)
436-
function odbc_tableprivileges(ODBC\Connection $odbc, ?string $catalog, string $schema, string $table): ODBC\Result|false {}
435+
#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) &&!defined(HAVE_SOLID_35)
436+
function odbc_tableprivileges(Odbc\Connection $odbc, ?string $catalog, string $schema, string $table): Odbc\Result|false {}
437437

438-
function odbc_columnprivileges(ODBC\Connection $odbc, ?string $catalog, string $schema, string $table, string $column): ODBC\Result|false {}
439-
#endif
438+
function odbc_columnprivileges(Odbc\Connection $odbc, ?string $catalog, string $schema, string $table, string $column): Odbc\Result|false {}
439+
#endif
440440

441441
/* odbc_utils.c */
442442

0 commit comments

Comments
 (0)