[php-src] PR #15230: Formatting time zone types.
| From: | sim1984 | Date: | Sun, 04 Aug 2024 16:40:33 +0000 |
| Subject: | [php-src] PR #15230: Formatting time zone types. | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-27652@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/15230
Author: sim1984
The previous solution for implementing support for Firebird 4.0+ data types was simple, but had a
significant drawback. The
TIME WITH TIME ZONE and TIMESTAMP WITH TIME ZONE
data types were returned as a string, but did not have a fixed format. This patch adds support for
formats for types with time zones.
I did not add new attributes with formats, but used the existing ones. That is, the TIME WITH
TIME ZONE data types use the output format defined in ATTR_TIME_FORMAT, after
which the time zone name is added. The TIMESTAMP WITH TIME ZONE data type uses the
ATTR_TIMESTAMP_FORMAT format, after which the time zone name is added.
This solution requires adding new functions from the Firebird object-oriented API. There are no
ready-made files for the C language, but they can be created using the CLOOP tool. Thus, these are
automatically generated files. I did not add the entire API, since it is quite large, I limited
myself to a minimal set of functions for decoding types with time zones.
The Firebird OO API is a set of interfaces. The entry point is the
fb_get_master_interface(void) function, which returns a pointer to the Master interface
from which all other interfaces can be obtained. There are no classes or abstract classes in C, but
the Firebird developers have provided for this. In fact, all interfaces are replaced by structures
with a homemade virtual function table, which can be seen in the code. Since a function pointer
takes up as much as void*, I replaced the functions that we do not need with a stub.
The amount of code to change is quite large, and I am waiting for help in organizing this patch
correctly.
Thank you.