Skip to content

Commit 5ab1180

Browse files
committed
ext/pdo_firebird: Added getApiVersion() and removed from getAttribute
1 parent 4cb82b0 commit 5ab1180

8 files changed

+24
-21
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ PHP NEWS
1010

1111
- PDO_FIREBIRD:
1212
. Added Pdo\Firebird::ATTR_API_VERSION. (SakiTakamachi)
13+
. Added getApiVersion() and removed from getAttribute().
14+
(SakiTakamachi)
1315

1416
- Standard:
1517
. Fix references in request_parse_body() options array. (nielsdos)

UPGRADING

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ PHP 8.4 UPGRADE NOTES
510510
. When using persistent connections, there is now a liveness check in the
511511
constructor.
512512
. The content that is built changes depending on the value of FB_API_VER in
513-
ibase.h, so added the attribute value Pdo\Firebird::ATTR_API_VERSION to
514-
obtain that value. This value can also be referenced from phpinfo.
513+
ibase.h, so added static method Pdo\Firebird::getApiVersion() to obtain that
514+
value. This value can also be referenced from phpinfo.
515515

516516
- PDO_MYSQL:
517517
. getAttribute, enabled to get the value of ATTR_FETCH_TABLE_NAMES.

ext/pdo_firebird/firebird_driver.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,10 +1177,6 @@ static int pdo_firebird_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val)
11771177
}
11781178
return 1;
11791179

1180-
case PDO_FB_ATTR_API_VERSION:
1181-
ZVAL_LONG(val, FB_API_VER);
1182-
return 1;
1183-
11841180
case PDO_ATTR_SERVER_VERSION:
11851181
case PDO_ATTR_SERVER_INFO:
11861182
*tmp = 0;

ext/pdo_firebird/pdo_firebird.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,12 @@ PHP_MINFO_FUNCTION(pdo_firebird) /* {{{ */
100100
php_info_print_table_end();
101101
}
102102
/* }}} */
103+
104+
PHP_METHOD(Pdo_Firebird, getApiVersion)
105+
{
106+
if (zend_parse_parameters_none() == FAILURE) {
107+
RETURN_THROWS();
108+
}
109+
110+
RETURN_LONG(FB_API_VER);
111+
}

ext/pdo_firebird/pdo_firebird.stub.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ class Firebird extends \PDO
1919
/** @cvalue PDO_FB_ATTR_TIMESTAMP_FORMAT */
2020
public const int ATTR_TIMESTAMP_FORMAT = UNKNOWN;
2121

22-
/** @cvalue PDO_FB_ATTR_API_VERSION */
23-
public const int ATTR_API_VERSION = UNKNOWN;
24-
2522
/** @cvalue PDO_FB_TRANSACTION_ISOLATION_LEVEL */
2623
public const int TRANSACTION_ISOLATION_LEVEL = UNKNOWN;
2724

@@ -36,4 +33,6 @@ class Firebird extends \PDO
3633

3734
/** @cvalue PDO_FB_WRITABLE_TRANSACTION */
3835
public const int WRITABLE_TRANSACTION = UNKNOWN;
36+
37+
public static function getApiVersion(): int {}
3938
}

ext/pdo_firebird/pdo_firebird_arginfo.h

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/pdo_firebird/php_pdo_firebird_int.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ enum {
142142
PDO_FB_ATTR_DATE_FORMAT = PDO_ATTR_DRIVER_SPECIFIC,
143143
PDO_FB_ATTR_TIME_FORMAT,
144144
PDO_FB_ATTR_TIMESTAMP_FORMAT,
145-
PDO_FB_ATTR_API_VERSION,
146145

147146
/*
148147
* transaction isolation level

ext/pdo_firebird/tests/get_api_version.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
PDO_Firebird: get api version
2+
PDO_Firebird: getApiVersion()
33
--EXTENSIONS--
44
pdo_firebird
55
--SKIPIF--
@@ -9,9 +9,7 @@ A bug in firebird causes a memory leak when calling `isc_attach_database()`.
99
See https://github.com/FirebirdSQL/firebird/issues/7849
1010
--FILE--
1111
<?php
12-
require("testdb.inc");
13-
$dbh = getDbConnection();
14-
echo $dbh->getAttribute(Pdo\Firebird::ATTR_API_VERSION) . "\n";
12+
echo Pdo\Firebird::getApiVersion() . "\n";
1513
echo 'done!';
1614
?>
1715
--EXPECTF--

0 commit comments

Comments
 (0)