Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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])
Expand Down
4 changes: 2 additions & 2 deletions config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: php8.1-yaz
Section: web
Priority: optional
Maintainer: Adam Dickmeiss <adam@indexdata.dk>
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
Expand Down
26 changes: 3 additions & 23 deletions php_yaz.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -36,9 +36,7 @@
#include <yaz/zoom.h>
#include <yaz/pquery.h>

#if YAZ_VERSIONL >= 0x050100
#include <yaz/rpn2cql.h>
#endif

#ifndef ODR_INT_PRINTF
#define ODR_INT_PRINTF "%d"
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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++) {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 0 additions & 2 deletions php_yaz.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading