Skip to content

Commit 7def2e2

Browse files
committed
Introduce versioning schema and create IBASE_VER constant
1 parent 436559d commit 7def2e2

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

interbase.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ zend_module_entry ibase_module_entry = {
453453
NULL,
454454
PHP_RSHUTDOWN(ibase),
455455
PHP_MINFO(ibase),
456-
PHP_INTERBASE_VERSION,
456+
PHP_INTERBASE_VER_STR,
457457
PHP_MODULE_GLOBALS(ibase),
458458
PHP_GINIT(ibase),
459459
NULL,
@@ -807,6 +807,7 @@ PHP_MINIT_FUNCTION(ibase)
807807
REGISTER_LONG_CONSTANT("IBASE_FETCH_BLOBS", PHP_IBASE_FETCH_BLOBS, CONST_PERSISTENT);
808808
REGISTER_LONG_CONSTANT("IBASE_FETCH_ARRAYS", PHP_IBASE_FETCH_ARRAYS, CONST_PERSISTENT);
809809
REGISTER_LONG_CONSTANT("IBASE_UNIXTIME", PHP_IBASE_UNIXTIME, CONST_PERSISTENT);
810+
REGISTER_LONG_CONSTANT("IBASE_VERS", PHP_INTERBASE_VER, CONST_PERSISTENT);
810811

811812
/* transactions */
812813
REGISTER_LONG_CONSTANT("IBASE_WRITE", PHP_IBASE_WRITE, CONST_PERSISTENT);
@@ -880,7 +881,7 @@ PHP_MINFO_FUNCTION(ibase)
880881
"static");
881882
#endif
882883

883-
php_info_print_table_row(2, "Interbase extension version", PHP_INTERBASE_VERSION);
884+
php_info_print_table_row(2, "Interbase extension version", PHP_INTERBASE_VER_STR);
884885

885886
#ifdef FB_API_VER
886887
snprintf( (s = tmp), sizeof(tmp), "Firebird API version %d", FB_API_VER);

php_interbase.h

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,22 @@
3030
extern zend_module_entry ibase_module_entry;
3131
#define phpext_interbase_ptr &ibase_module_entry
3232

33-
#include "php_version.h"
34-
// Keep version in track with Firebird
35-
#define PHP_INTERBASE_VERSION "5.0.3"
33+
#include "ibase.h"
34+
35+
#define TO_STRING_(x) #x
36+
#define TO_STRING(x) TO_STRING_(x)
37+
38+
#ifndef FB_API_VER
39+
FATAL: FB_API_VER is not defined. Assumed very old, unsupported client library
40+
#endif
41+
42+
#define PHP_INTERBASE_VER_MAJOR 6
43+
#define PHP_INTERBASE_VER_MINOR 1
44+
#define PHP_INTERBASE_VER_REV 1
45+
46+
// Keep FB_API_VER two digit style
47+
#define PHP_INTERBASE_VER PHP_INTERBASE_VER_MAJOR * 10 + PHP_INTERBASE_VER_MINOR
48+
#define PHP_INTERBASE_VER_STR TO_STRING(PHP_INTERBASE_VER_MAJOR) "." TO_STRING(PHP_INTERBASE_VER_MINOR) "." TO_STRING(PHP_INTERBASE_VER_REV)
3649

3750
PHP_MINIT_FUNCTION(ibase);
3851
PHP_RINIT_FUNCTION(ibase);

0 commit comments

Comments
 (0)