X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=src%2Fphp_pqtypes.c;h=323883c778b264ab852c3c5465f650e674be694f;hp=3f05248ece3b5529860babc4e3214b79245149e4;hb=7ebb278e7854e8dd7c4fd6c0363531642d135676;hpb=8d0dbf7286d9132be18de64625837afa55409f84 diff --git a/src/php_pqtypes.c b/src/php_pqtypes.c index 3f05248..323883c 100644 --- a/src/php_pqtypes.c +++ b/src/php_pqtypes.c @@ -143,6 +143,16 @@ static zval *php_pqtypes_object_read_dimension(zval *object, zval *member, int t return data; } +static void php_pqtypes_object_write_dimension(zval *object, zval *offset, zval *value) +{ + throw_exce(EX_RUNTIME, "pq\\Types object must not be modified"); +} + +static void php_pqtypes_object_unset_dimension(zval *object, zval *offset) +{ + throw_exce(EX_RUNTIME, "pq\\Types object must not be modified"); +} + ZEND_BEGIN_ARG_INFO_EX(ai_pqtypes_construct, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, connection, pq\\Connection, 0) ZEND_ARG_ARRAY_INFO(0, namespaces, 1) @@ -181,8 +191,7 @@ static PHP_METHOD(pqtypes, __construct) { #define PHP_PQ_TYPES_QUERY \ "select t.oid, t.* " \ "from pg_type t join pg_namespace n on t.typnamespace=n.oid " \ - "where typisdefined " \ - "and typrelid=0" + "where typisdefined" #ifndef PHP_PQ_OID_TEXT # define PHP_PQ_OID_TEXT 25 #endif @@ -264,7 +273,7 @@ static PHP_METHOD(pqtypes, refresh) { } } - php_pq_clear_res(res); + php_pqres_clear(res); php_pqconn_notify_listeners(obj->intern->conn); } } @@ -272,7 +281,7 @@ static PHP_METHOD(pqtypes, refresh) { } static zend_function_entry php_pqtypes_methods[] = { - PHP_ME(pqtypes, __construct, ai_pqtypes_construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(pqtypes, __construct, ai_pqtypes_construct, ZEND_ACC_PUBLIC) PHP_ME(pqtypes, refresh, ai_pqtypes_refresh, ZEND_ACC_PUBLIC) {0} }; @@ -302,14 +311,14 @@ PHP_MINIT_FUNCTION(pqtypes) php_pqtypes_object_handlers.read_property = php_pq_object_read_prop; php_pqtypes_object_handlers.write_property = php_pq_object_write_prop; php_pqtypes_object_handlers.clone_obj = NULL; - php_pqtypes_object_handlers.get_property_ptr_ptr = NULL; + php_pqtypes_object_handlers.get_property_ptr_ptr = php_pq_object_get_prop_ptr_null; php_pqtypes_object_handlers.get_gc = php_pq_object_get_gc; php_pqtypes_object_handlers.get_properties = php_pq_object_properties; php_pqtypes_object_handlers.get_debug_info = php_pq_object_debug_info; php_pqtypes_object_handlers.has_dimension = php_pqtypes_object_has_dimension; php_pqtypes_object_handlers.read_dimension = php_pqtypes_object_read_dimension; - php_pqtypes_object_handlers.unset_dimension = NULL; - php_pqtypes_object_handlers.write_dimension = NULL; + php_pqtypes_object_handlers.unset_dimension = php_pqtypes_object_unset_dimension; + php_pqtypes_object_handlers.write_dimension = php_pqtypes_object_write_dimension; zend_hash_init(&php_pqtypes_object_prophandlers, 1, NULL, php_pq_object_prophandler_dtor, 1);