new properties are read only 49/head
authorRemi Collet <remi@remirepo.net>
Tue, 13 Jun 2023 14:13:08 +0000 (16:13 +0200)
committerRemi Collet <remi@php.net>
Tue, 13 Jun 2023 14:13:08 +0000 (16:13 +0200)
src/php_pq_misc.h
src/php_pqconn.c

index d86beebc2ae251459e4ea2b54d4a1da21097ec7f..dab24ec7d1ee7231d34ca33778e9a1ecbc5b51d5 100644 (file)
@@ -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);
 
index 0e9e32fc34f8bbe49f60b1e825789c3254e70085..19ea6f05ebcaebd0abb059d475c7bad802f29128 100644 (file)
@@ -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