From 27760a3b6586f834742abe3b138628ac62dcc1af Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 15 Oct 2026 12:53:24 +0200 Subject: [PATCH] Require YAZ 5.1.0 or later YAZ 5.1.0 was released 2014. PHP 7.0.0 was released 2015. --- config.m4 | 4 ++-- config.w32 | 4 ++-- debian/control | 2 +- php_yaz.c | 26 +++----------------------- php_yaz.h | 2 -- 5 files changed, 8 insertions(+), 30 deletions(-) diff --git a/config.m4 b/config.m4 index f73e046..29b0c58 100644 --- a/config.m4 +++ b/config.m4 @@ -5,7 +5,7 @@ if test "$PHP_YAZ" = "yes"; then AC_MSG_CHECKING([for YAZ libraries by calling pkg-config --exists yaz]) if pkg-config --exists yaz; then AC_MSG_RESULT([found]) - if pkg-config --atleast-version 3.0.2 yaz; then + if pkg-config --atleast-version 5.1.0 yaz; then lib=`pkg-config --libs yaz` for c in $lib; do case $c in @@ -24,7 +24,7 @@ if test "$PHP_YAZ" = "yes"; then PHP_NEW_EXTENSION(yaz, php_yaz.c, $ext_shared) PHP_SUBST(YAZ_SHARED_LIBADD) else - AC_MSG_ERROR([YAZ is too old. 3.0.2 or later required]) + AC_MSG_ERROR([YAZ is too old. 5.1.0 or later required]) fi else AC_MSG_RESULT([not found]) diff --git a/config.w32 b/config.w32 index 4009539..c90aa15 100644 --- a/config.w32 +++ b/config.w32 @@ -16,10 +16,10 @@ function yaz_check_version() c = file_get_contents(yaz_h + "\\yaz\\yaz-version.h"); if (typeof(c) == "string" && c.match(/YAZ_VERSIONL\s+(0x[a-zA-Z0-9]+)/)) { v = RegExp.$1; - if (parseInt(v) >= 0x50000) { + if (parseInt(v) >= 0x50100) { return true; } - WARNING("yaz not enabled; version 5.0.0 or higher required; you have version " + v); + WARNING("yaz not enabled; version 5.1.0 or higher required; you have version " + v); } return false; } diff --git a/debian/control b/debian/control index 3890408..b445f8d 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: php8.1-yaz Section: web Priority: optional Maintainer: Adam Dickmeiss -Build-Depends: debhelper (>= 10), php8.1-dev, libyaz5-dev (>= 5.0.0) +Build-Depends: debhelper (>= 10), php8.1-dev, libyaz5-dev (>= 5.1.0) Standards-Version: 3.1.1 Package: php8.1-yaz diff --git a/php_yaz.c b/php_yaz.c index 6b7ddb9..4ba2812 100644 --- a/php_yaz.c +++ b/php_yaz.c @@ -17,9 +17,9 @@ #include "php_yaz.h" #ifndef YAZ_VERSIONL -#error YAZ version 3.0.2 or later must be used. -#elif YAZ_VERSIONL < 0x030020 -#error YAZ version 3.0.2 or later must be used. +#error YAZ version 5.1.0 or later must be used. +#elif YAZ_VERSIONL < 0x050100 +#error YAZ version 5.1.0 or later must be used. #endif #ifdef PHP_WIN32 @@ -36,9 +36,7 @@ #include #include -#if YAZ_VERSIONL >= 0x050100 #include -#endif #ifndef ODR_INT_PRINTF #define ODR_INT_PRINTF "%d" @@ -50,9 +48,7 @@ typedef struct Yaz_AssociationInfo *Yaz_Association; struct Yaz_AssociationInfo { CCL_bibset bibset; -#if YAZ_VERSIONL >= 0x050100 cql_transform_t ct; -#endif ZOOM_connection zoom_conn; ZOOM_resultset zoom_set; ZOOM_scanset zoom_scan; @@ -80,9 +76,7 @@ static Yaz_Association yaz_association_mk() p->order = 0; p->persistent = 0; p->bibset = ccl_qual_mk(); -#if YAZ_VERSIONL >= 0x050100 p->ct = cql_transform_create(); -#endif p->time_stamp = 0; return p; } @@ -93,9 +87,7 @@ static void yaz_association_destroy(Yaz_Association p) return; } -#if YAZ_VERSIONL >= 0x050100 cql_transform_close(p->ct); -#endif ZOOM_resultset_destroy(p->zoom_set); ZOOM_scanset_destroy(p->zoom_scan); ZOOM_package_destroy(p->zoom_package); @@ -262,10 +254,8 @@ zend_function_entry yaz_functions [] = { PHP_FE(yaz_present, arginfo_yaz_present) PHP_FE(yaz_ccl_conf, arginfo_yaz_ccl_conf) PHP_FE(yaz_ccl_parse, arginfo_yaz_ccl_parse) -#if YAZ_VERSIONL >= 0x050100 PHP_FE(yaz_cql_parse, arginfo_yaz_cql_parse) PHP_FE(yaz_cql_conf, arginfo_yaz_cql_conf) -#endif PHP_FE(yaz_database, arginfo_databases) PHP_FE(yaz_sort, arginfo_yaz_sort) PHP_FE(yaz_schema, arginfo_yaz_schema) @@ -1884,11 +1874,7 @@ PHP_FUNCTION(yaz_scan_result) if (p && p->zoom_scan) { size_t pos = 0; /* ZOOM_scanset_term changed from YAZ 3 to YAZ 4 */ -#if YAZ_VERSIONL >= 0x040000 size_t occ, len; -#else - int occ, len; -#endif size_t size = ZOOM_scanset_size(p->zoom_scan); for (pos = 0; pos < size; pos++) { @@ -2062,8 +2048,6 @@ PHP_FUNCTION(yaz_ccl_parse) /* }}} */ -#if YAZ_VERSIONL >= 0x050100 - /* {{{ proto bool yaz_cql_parse(resource id, string cql, array res, bool rev) Parse a CQL query */ PHP_FUNCTION(yaz_cql_parse) @@ -2146,9 +2130,6 @@ PHP_FUNCTION(yaz_cql_parse) } /* }}} */ -#endif - -#if YAZ_VERSIONL >= 0x050100 /* {{{ proto void yaz_cql_conf(resource id, array package) Configure CQL package */ PHP_FUNCTION(yaz_cql_conf) @@ -2184,7 +2165,6 @@ PHP_FUNCTION(yaz_cql_conf) release_assoc(p); } /* }}} */ -#endif /* {{{ proto bool yaz_database (resource id, string databases) Specify the databases within a session */ diff --git a/php_yaz.h b/php_yaz.h index 3c6d47c..0cf0729 100644 --- a/php_yaz.h +++ b/php_yaz.h @@ -34,10 +34,8 @@ PHP_FUNCTION(yaz_es_result); PHP_FUNCTION(yaz_present); PHP_FUNCTION(yaz_ccl_conf); PHP_FUNCTION(yaz_ccl_parse); -#if YAZ_VERSIONL >= 0x050100 PHP_FUNCTION(yaz_cql_parse); PHP_FUNCTION(yaz_cql_conf); -#endif PHP_FUNCTION(yaz_database); PHP_FUNCTION(yaz_sort); PHP_FUNCTION(yaz_schema);