From: Remi Collet Date: Tue, 13 Jun 2023 14:13:08 +0000 (+0200) Subject: new properties are read only X-Git-Tag: v2.2.3~3^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=refs%2Fpull%2F49%2Fhead;p=m6w6%2Fext-pq new properties are read only --- diff --git a/src/php_pq_misc.h b/src/php_pq_misc.h index d86beeb..dab24ec 100644 --- a/src/php_pq_misc.h +++ b/src/php_pq_misc.h @@ -101,6 +101,9 @@ extern int php_pq_compare_index(const void *lptr, const void *rptr); ZEND_BEGIN_ARG_INFO_EX(name, 0, return_reference, required_num_args) #endif +#ifndef ZEND_ACC_READONLY +#define ZEND_ACC_READONLY 0 +#endif extern PHP_MINIT_FUNCTION(pq_misc); diff --git a/src/php_pqconn.c b/src/php_pqconn.c index 0e9e32f..19ea6f0 100644 --- a/src/php_pqconn.c +++ b/src/php_pqconn.c @@ -2160,19 +2160,19 @@ PHP_MINIT_FUNCTION(pqconn) ph.write = NULL; #ifdef HAVE_PQLIBVERSION - zend_declare_property_null(php_pqconn_class_entry, ZEND_STRL("libraryVersion"), ZEND_ACC_PUBLIC); + zend_declare_property_null(php_pqconn_class_entry, ZEND_STRL("libraryVersion"), ZEND_ACC_PUBLIC|ZEND_ACC_READONLY); ph.read = php_pqconn_object_read_lib_version; zend_hash_str_add_mem(&php_pqconn_object_prophandlers, ZEND_STRL("libraryVersion"), (void *) &ph, sizeof(ph)); #endif #ifdef HAVE_PQPROTOCOLVERSION - zend_declare_property_null(php_pqconn_class_entry, ZEND_STRL("protocolVersion"), ZEND_ACC_PUBLIC); + zend_declare_property_null(php_pqconn_class_entry, ZEND_STRL("protocolVersion"), ZEND_ACC_PUBLIC|ZEND_ACC_READONLY); ph.read = php_pqconn_object_read_protocol_version; zend_hash_str_add_mem(&php_pqconn_object_prophandlers, ZEND_STRL("protocolVersion"), (void *) &ph, sizeof(ph)); #endif #ifdef HAVE_PQSERVERVERSION - zend_declare_property_null(php_pqconn_class_entry, ZEND_STRL("serverVersion"), ZEND_ACC_PUBLIC); + zend_declare_property_null(php_pqconn_class_entry, ZEND_STRL("serverVersion"), ZEND_ACC_PUBLIC|ZEND_ACC_READONLY); ph.read = php_pqconn_object_read_server_version; zend_hash_str_add_mem(&php_pqconn_object_prophandlers, ZEND_STRL("serverVersion"), (void *) &ph, sizeof(ph)); #endif