-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ext/pdo_firebird: Added Pdo\Firebird::ATTR_API_VERSION
#14916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ext/pdo_firebird: Added Pdo\Firebird::ATTR_API_VERSION
#14916
Conversation
Maybe it's worth adding this information to phpinfo as well? PHP_MINFO_FUNCTION(pdo_firebird) /* {{{ */
{
char version[64];
isc_get_client_version(version);
php_info_print_table_start();
php_info_print_table_row(2, "PDO Driver for Firebird", "enabled");
php_info_print_table_row(2, "Client Library Version", version);
php_info_print_table_row(2, "Firebird API version", FB_API_VER);
php_info_print_table_end();
}
/* }}} */ |
Yes, this should also be added to phpinfo |
Okay, I'll add it later |
done |
ext/pdo_firebird/pdo_firebird.c
Outdated
@@ -60,6 +60,7 @@ PHP_MINIT_FUNCTION(pdo_firebird) /* {{{ */ | |||
REGISTER_PDO_CLASS_CONST_LONG("FB_ATTR_DATE_FORMAT", (zend_long) PDO_FB_ATTR_DATE_FORMAT); | |||
REGISTER_PDO_CLASS_CONST_LONG("FB_ATTR_TIME_FORMAT", (zend_long) PDO_FB_ATTR_TIME_FORMAT); | |||
REGISTER_PDO_CLASS_CONST_LONG("FB_ATTR_TIMESTAMP_FORMAT", (zend_long) PDO_FB_ATTR_TIMESTAMP_FORMAT); | |||
REGISTER_PDO_CLASS_CONST_LONG("FB_ATTR_API_VERSION", (zend_long) PDO_FB_ATTR_API_VERSION); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, is this related to the server, or the driver?
As it might make more sense to expose it via PDO::ATTR_SERVER_INFO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only related to the header file ibase.h
at build time.
The server side is completely irrelevant.
The client side is somewhat involved, but due to factors such as updates, the header file version at the time of build and the client version do not always match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, then this is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this looks sensible to me, but I wonder about the PDO driver specific subclasses; shouldn't PDO::FB_ATTR_API_VERSION
be rather something like PdoFirebird::ATTR_API_VERSION
?
@cmb69 Firstly I forgot to add this to the stub. And other constants that are new in 8.4 (such as transaction isolation levels) should probably be been the same way. However, other constants will be addressed in a follow-up PR. I'll fix this, thx! |
FYI:
|
done! |
I realized while changing this that the stub's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks good to me.
FB_ATTR_API_VERSION
Pdo\Firebird::ATTR_API_VERSION
This return
FB_API_VER
.Related #14897
The functions that are built change depending on the value of
FB_API_VER
described inibase.h
, but the only way for users to know this value is to actually look atibase.h
, so add an attribute value to make it possible to obtain it.