From 3aeea945caf98c10a79dbf76dadb30e3853ef238 Mon Sep 17 00:00:00 2001 From: Jens de Nies Date: Wed, 10 Jun 2020 23:37:14 +0200 Subject: [PATCH 01/11] Added stubs for oci8. --- ext/oci8/oci8.c | 507 +-------------------------- ext/oci8/oci8.stub.php | 734 ++++++++++++++++++++++++++++++++++++++++ ext/oci8/oci8_arginfo.h | 433 ++++++++++++++++++++++++ 3 files changed, 1168 insertions(+), 506 deletions(-) create mode 100644 ext/oci8/oci8.stub.php create mode 100644 ext/oci8/oci8_arginfo.h diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 89aafde7ee395..8d728d4d3393d 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -122,512 +122,7 @@ ZEND_GET_MODULE(oci8) #endif /* COMPILE_DL */ /* }}} */ -/* {{{ Function arginfo */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_define_by_name, 0, 0, 3) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, column_name) - ZEND_ARG_INFO(1, variable) - ZEND_ARG_INFO(0, type) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_bind_by_name, 0, 0, 3) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, column_name) - ZEND_ARG_INFO(1, variable) - ZEND_ARG_INFO(0, maximum_length) - ZEND_ARG_INFO(0, type) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_bind_array_by_name, 0, 0, 4) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, column_name) - ZEND_ARG_INFO(1, variable) - ZEND_ARG_INFO(0, maximum_array_length) - ZEND_ARG_INFO(0, maximum_item_length) - ZEND_ARG_INFO(0, type) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_free_descriptor, 0, 0, 1) - ZEND_ARG_INFO(0, lob_descriptor) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_save, 0, 0, 2) - ZEND_ARG_INFO(0, lob_descriptor) - ZEND_ARG_INFO(0, data) - ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_import, 0, 0, 2) - ZEND_ARG_INFO(0, lob_descriptor) - ZEND_ARG_INFO(0, filename) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_load, 0, 0, 1) - ZEND_ARG_INFO(0, lob_descriptor) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_read, 0, 0, 2) - ZEND_ARG_INFO(0, lob_descriptor) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_eof, 0, 0, 1) - ZEND_ARG_INFO(0, lob_descriptor) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_tell, 0, 0, 1) - ZEND_ARG_INFO(0, lob_descriptor) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_rewind, 0, 0, 1) - ZEND_ARG_INFO(0, lob_descriptor) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_seek, 0, 0, 2) - ZEND_ARG_INFO(0, lob_descriptor) - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, whence) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_size, 0, 0, 1) - ZEND_ARG_INFO(0, lob_descriptor) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_write, 0, 0, 2) - ZEND_ARG_INFO(0, lob_descriptor) - ZEND_ARG_INFO(0, string) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_append, 0, 0, 2) - ZEND_ARG_INFO(0, lob_descriptor_to) - ZEND_ARG_INFO(0, lob_descriptor_from) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_truncate, 0, 0, 1) - ZEND_ARG_INFO(0, lob_descriptor) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_erase, 0, 0, 1) - ZEND_ARG_INFO(0, lob_descriptor) - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_flush, 0, 0, 1) - ZEND_ARG_INFO(0, lob_descriptor) - ZEND_ARG_INFO(0, flag) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_ocisetbufferinglob, 0, 0, 2) - ZEND_ARG_INFO(0, lob_descriptor) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_ocigetbufferinglob, 0, 0, 1) - ZEND_ARG_INFO(0, lob_descriptor) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_copy, 0, 0, 2) - ZEND_ARG_INFO(0, lob_descriptor_to) - ZEND_ARG_INFO(0, lob_descriptor_from) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_is_equal, 0, 0, 2) - ZEND_ARG_INFO(0, lob_descriptor) - ZEND_ARG_INFO(0, lob_descriptor) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_export, 0, 0, 2) - ZEND_ARG_INFO(0, lob_descriptor) - ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(0, start) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_new_descriptor, 0, 0, 1) - ZEND_ARG_INFO(0, connection_resource) - ZEND_ARG_INFO(0, type) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_rollback, 0, 0, 1) - ZEND_ARG_INFO(0, connection_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_commit, 0, 0, 1) - ZEND_ARG_INFO(0, connection_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_name, 0, 0, 2) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, column_number_or_name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_size, 0, 0, 2) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, column_number_or_name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_scale, 0, 0, 2) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, column_number_or_name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_precision, 0, 0, 2) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, column_number_or_name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_type, 0, 0, 2) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, column_number_or_name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_type_raw, 0, 0, 2) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, column_number_or_name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_is_null, 0, 0, 2) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, column_number_or_name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_internal_debug, 0, 0, 1) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_execute, 0, 0, 1) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_cancel, 0, 0, 1) - ZEND_ARG_INFO(0, statement_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_fetch, 0, 0, 1) - ZEND_ARG_INFO(0, statement_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_ocifetchinto, 0, 0, 2) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(1, result) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_fetch_all, 0, 0, 2) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(1, output) - ZEND_ARG_INFO(0, skip) - ZEND_ARG_INFO(0, maximum_rows) - ZEND_ARG_INFO(0, flags) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_fetch_object, 0, 0, 1) - ZEND_ARG_INFO(0, statement_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_fetch_row, 0, 0, 1) - ZEND_ARG_INFO(0, statement_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_fetch_assoc, 0, 0, 1) - ZEND_ARG_INFO(0, statement_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_fetch_array, 0, 0, 1) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_free_statement, 0, 0, 1) - ZEND_ARG_INFO(0, statement_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_close, 0, 0, 1) - ZEND_ARG_INFO(0, connection_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_new_connect, 0, 0, 2) - ZEND_ARG_INFO(0, username) - ZEND_ARG_INFO(0, password) - ZEND_ARG_INFO(0, connection_string) - ZEND_ARG_INFO(0, character_set) - ZEND_ARG_INFO(0, session_mode) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_connect, 0, 0, 2) - ZEND_ARG_INFO(0, username) - ZEND_ARG_INFO(0, password) - ZEND_ARG_INFO(0, connection_string) - ZEND_ARG_INFO(0, character_set) - ZEND_ARG_INFO(0, session_mode) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_pconnect, 0, 0, 2) - ZEND_ARG_INFO(0, username) - ZEND_ARG_INFO(0, password) - ZEND_ARG_INFO(0, connection_string) - ZEND_ARG_INFO(0, character_set) - ZEND_ARG_INFO(0, session_mode) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_error, 0, 0, 0) - ZEND_ARG_INFO(0, connection_or_statement_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_num_fields, 0, 0, 1) - ZEND_ARG_INFO(0, statement_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_parse, 0, 0, 2) - ZEND_ARG_INFO(0, connection_resource) - ZEND_ARG_INFO(0, sql_text) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_get_implicit_resultset, 0, 0, 1) -ZEND_ARG_INFO(0, statement_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_set_prefetch, 0, 0, 2) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, number_of_rows) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_set_client_identifier, 0, 0, 2) - ZEND_ARG_INFO(0, connection_resource) - ZEND_ARG_INFO(0, client_identifier) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_set_edition, 0, 0, 1) - ZEND_ARG_INFO(0, edition_name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_set_module_name, 0, 0, 2) - ZEND_ARG_INFO(0, connection_resource) - ZEND_ARG_INFO(0, module_name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_set_action, 0, 0, 2) - ZEND_ARG_INFO(0, connection_resource) - ZEND_ARG_INFO(0, action) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_set_client_info, 0, 0, 2) - ZEND_ARG_INFO(0, connection_resource) - ZEND_ARG_INFO(0, client_information) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_set_db_operation, 0, 0, 2) - ZEND_ARG_INFO(0, connection_resource) - ZEND_ARG_INFO(0, action) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_set_call_timeout, 0, 0, 2) - ZEND_ARG_INFO(0, connection_resource) - ZEND_ARG_INFO(0, call_timeout) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_password_change, 0, 0, 4) - ZEND_ARG_INFO(0, connection_resource_or_connection_string) - ZEND_ARG_INFO(0, username) - ZEND_ARG_INFO(0, old_password) - ZEND_ARG_INFO(0, new_password) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_new_cursor, 0, 0, 1) - ZEND_ARG_INFO(0, connection_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_result, 0, 0, 2) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, column_number_or_name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_oci_client_version, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_server_version, 0, 0, 1) - ZEND_ARG_INFO(0, connection_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_statement_type, 0, 0, 1) - ZEND_ARG_INFO(0, statement_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_num_rows, 0, 0, 1) - ZEND_ARG_INFO(0, statement_resource) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_free_collection, 0, 0, 1) - ZEND_ARG_INFO(0, collection) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_append, 0, 0, 2) - ZEND_ARG_INFO(0, collection) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_element_get, 0, 0, 2) - ZEND_ARG_INFO(0, collection) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_assign, 0, 0, 2) - ZEND_ARG_INFO(0, collection_to) - ZEND_ARG_INFO(0, collection_from) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_element_assign, 0, 0, 3) - ZEND_ARG_INFO(0, collection) - ZEND_ARG_INFO(0, index) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_size, 0, 0, 1) - ZEND_ARG_INFO(0, collection) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_max, 0, 0, 1) - ZEND_ARG_INFO(0, collection) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_trim, 0, 0, 2) - ZEND_ARG_INFO(0, collection) - ZEND_ARG_INFO(0, number) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_new_collection, 0, 0, 2) - ZEND_ARG_INFO(0, connection_resource) - ZEND_ARG_INFO(0, type_name) - ZEND_ARG_INFO(0, schema_name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_register_taf_callback, 0, 0, 1) - ZEND_ARG_INFO(0, connection_resource) - ZEND_ARG_INFO(0, function_name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_unregister_taf_callback, 0, 0, 1) - ZEND_ARG_INFO(0, connection_resource) -ZEND_END_ARG_INFO() -/* }}} */ - -/* {{{ LOB Method arginfo */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_save_method, 0, 0, 1) - ZEND_ARG_INFO(0, data) - ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_import_method, 0, 0, 1) - ZEND_ARG_INFO(0, filename) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_load_method, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_read_method, 0, 0, 1) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_eof_method, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_tell_method, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_rewind_method, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_seek_method, 0, 0, 1) - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, whence) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_size_method, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_write_method, 0, 0, 1) - ZEND_ARG_INFO(0, string) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_append_method, 0, 0, 1) - ZEND_ARG_INFO(0, lob_descriptor_from) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_truncate_method, 0, 0, 0) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_erase_method, 0, 0, 0) - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_flush_method, 0, 0, 0) - ZEND_ARG_INFO(0, flag) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_setbuffering_method, 0, 0, 1) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_getbuffering_method, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_export_method, 0, 0, 1) - ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(0, start) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_write_temporary_method, 0, 0, 1) - ZEND_ARG_INFO(0, data) - ZEND_ARG_INFO(0, type) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_close_method, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_oci_free_descriptor_method, 0) -ZEND_END_ARG_INFO() -/* }}} */ - -/* {{{ Collection Method arginfo */ -ZEND_BEGIN_ARG_INFO(arginfo_oci_collection_free_method, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_append_method, 0, 0, 1) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_element_get_method, 0, 0, 1) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_assign_method, 0, 0, 1) - ZEND_ARG_INFO(0, collection_from) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_element_assign_method, 0, 0, 2) - ZEND_ARG_INFO(0, index) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_oci_collection_size_method, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_oci_collection_max_method, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_trim_method, 0, 0, 1) - ZEND_ARG_INFO(0, number) -ZEND_END_ARG_INFO() -/* }}} */ +#include "oci8_arginfo.h" /* {{{ extension function prototypes */ diff --git a/ext/oci8/oci8.stub.php b/ext/oci8/oci8.stub.php new file mode 100644 index 0000000000000..5b0fc6d3a84a7 --- /dev/null +++ b/ext/oci8/oci8.stub.php @@ -0,0 +1,734 @@ + Date: Thu, 11 Jun 2020 00:09:40 +0200 Subject: [PATCH 02/11] Replaces arginfo names. --- ext/oci8/oci8.c | 60 ++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 8d728d4d3393d..d7fae9bb702a9 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -342,40 +342,40 @@ static const zend_function_entry php_oci_functions[] = { }; static const zend_function_entry php_oci_lob_class_functions[] = { - PHP_FALIAS(load, oci_lob_load, arginfo_oci_lob_load_method) - PHP_FALIAS(tell, oci_lob_tell, arginfo_oci_lob_tell_method) - PHP_FALIAS(truncate, oci_lob_truncate, arginfo_oci_lob_truncate_method) - PHP_FALIAS(erase, oci_lob_erase, arginfo_oci_lob_erase_method) - PHP_FALIAS(flush, oci_lob_flush, arginfo_oci_lob_flush_method) - PHP_FALIAS(setbuffering,ocisetbufferinglob, arginfo_oci_lob_setbuffering_method) - PHP_FALIAS(getbuffering,ocigetbufferinglob, arginfo_oci_lob_getbuffering_method) - PHP_FALIAS(rewind, oci_lob_rewind, arginfo_oci_lob_rewind_method) - PHP_FALIAS(read, oci_lob_read, arginfo_oci_lob_read_method) - PHP_FALIAS(eof, oci_lob_eof, arginfo_oci_lob_eof_method) - PHP_FALIAS(seek, oci_lob_seek, arginfo_oci_lob_seek_method) - PHP_FALIAS(write, oci_lob_write, arginfo_oci_lob_write_method) - PHP_FALIAS(append, oci_lob_append, arginfo_oci_lob_append_method) - PHP_FALIAS(size, oci_lob_size, arginfo_oci_lob_size_method) - PHP_FALIAS(writetofile, oci_lob_export, arginfo_oci_lob_export_method) - PHP_FALIAS(export, oci_lob_export, arginfo_oci_lob_export_method) - PHP_FALIAS(import, oci_lob_import, arginfo_oci_lob_import_method) - PHP_FALIAS(writetemporary, oci_lob_write_temporary, arginfo_oci_lob_write_temporary_method) - PHP_FALIAS(close, oci_lob_close, arginfo_oci_lob_close_method) - PHP_FALIAS(save, oci_lob_save, arginfo_oci_lob_save_method) - PHP_FALIAS(savefile, oci_lob_import, arginfo_oci_lob_import_method) - PHP_FALIAS(free, oci_free_descriptor, arginfo_oci_free_descriptor_method) + PHP_FALIAS(load, oci_lob_load, arginfo_class_OCI_Lob_load) + PHP_FALIAS(tell, oci_lob_tell, arginfo_class_OCI_Lob_tell) + PHP_FALIAS(truncate, oci_lob_truncate, arginfo_class_OCI_Lob_truncate) + PHP_FALIAS(erase, oci_lob_erase, arginfo_class_OCI_Lob_erase) + PHP_FALIAS(flush, oci_lob_flush, arginfo_class_OCI_Lob_flush) + PHP_FALIAS(setbuffering,ocisetbufferinglob, arginfo_class_OCI_Lob_setbuffering) + PHP_FALIAS(getbuffering,ocigetbufferinglob, arginfo_class_OCI_Lob_getbuffering) + PHP_FALIAS(rewind, oci_lob_rewind, arginfo_class_OCI_Lob_rewind) + PHP_FALIAS(read, oci_lob_read, arginfo_class_OCI_Lob_read) + PHP_FALIAS(eof, oci_lob_eof, arginfo_class_OCI_Lob_eof) + PHP_FALIAS(seek, oci_lob_seek, arginfo_class_OCI_Lob_seek) + PHP_FALIAS(write, oci_lob_write, arginfo_class_OCI_Lob_write) + PHP_FALIAS(append, oci_lob_append, arginfo_class_OCI_Lob_append) + PHP_FALIAS(size, oci_lob_size, arginfo_class_OCI_Lob_size) + PHP_FALIAS(writetofile, oci_lob_export, arginfo_class_OCI_Lob_writetofile) + PHP_FALIAS(export, oci_lob_export, arginfo_class_OCI_Lob_export) + PHP_FALIAS(import, oci_lob_import, arginfo_class_OCI_Lob_import) + PHP_FALIAS(writetemporary, oci_lob_write_temporary, arginfo_class_OCI_Lob_writetemporary) + PHP_FALIAS(close, oci_lob_close, arginfo_class_OCI_Lob_close) + PHP_FALIAS(save, oci_lob_save, arginfo_class_OCI_Lob_save) + PHP_FALIAS(savefile, oci_lob_import, arginfo_class_OCI_Lob_savefile) + PHP_FALIAS(free, oci_free_descriptor, arginfo_class_OCI_Lob_free) PHP_FE_END }; static const zend_function_entry php_oci_coll_class_functions[] = { - PHP_FALIAS(append, oci_collection_append, arginfo_oci_collection_append_method) - PHP_FALIAS(getelem, oci_collection_element_get, arginfo_oci_collection_element_get_method) - PHP_FALIAS(assignelem, oci_collection_element_assign, arginfo_oci_collection_element_assign_method) - PHP_FALIAS(assign, oci_collection_assign, arginfo_oci_collection_assign_method) - PHP_FALIAS(size, oci_collection_size, arginfo_oci_collection_size_method) - PHP_FALIAS(max, oci_collection_max, arginfo_oci_collection_max_method) - PHP_FALIAS(trim, oci_collection_trim, arginfo_oci_collection_trim_method) - PHP_FALIAS(free, oci_free_collection, arginfo_oci_collection_free_method) + PHP_FALIAS(append, oci_collection_append, arginfo_class_OCI_Collection_append) + PHP_FALIAS(getelem, oci_collection_element_get, arginfo_class_OCI_Collection_getElem) + PHP_FALIAS(assignelem, oci_collection_element_assign, arginfo_class_OCI_Collection_assignelem) + PHP_FALIAS(assign, oci_collection_assign, arginfo_class_OCI_Collection_assign) + PHP_FALIAS(size, oci_collection_size, arginfo_class_OCI_Collection_size) + PHP_FALIAS(max, oci_collection_max, arginfo_class_OCI_Collection_max) + PHP_FALIAS(trim, oci_collection_trim, arginfo_class_OCI_Collection_trim) + PHP_FALIAS(free, oci_free_collection, arginfo_class_OCI_Collection_free) PHP_FE_END }; From 14898d656643f7d757689edfbfa893201a0dea51 Mon Sep 17 00:00:00 2001 From: Jens de Nies Date: Thu, 11 Jun 2020 23:19:31 +0200 Subject: [PATCH 03/11] Removed return types from oci8 class stubs. --- ext/oci8/oci8.stub.php | 50 ++++++++++++++++++++--------------------- ext/oci8/oci8_arginfo.h | 47 +++++++++++++++++++------------------- 2 files changed, 48 insertions(+), 49 deletions(-) diff --git a/ext/oci8/oci8.stub.php b/ext/oci8/oci8.stub.php index 5b0fc6d3a84a7..3cb65098ba10d 100644 --- a/ext/oci8/oci8.stub.php +++ b/ext/oci8/oci8.stub.php @@ -7,7 +7,7 @@ * @param int $type * @return bool */ -function oci_define_by_name($statement_resource, string $column_name, $variable, int $type = 0): bool {} +function oci_define_by_name($statement_resource, string $column_name, &$variable, int $type = 0): bool {} /** * @param resource $statement_resource @@ -17,7 +17,7 @@ function oci_define_by_name($statement_resource, string $column_name, $variable, * @param int $type * @return bool */ -function oci_bind_by_name($statement_resource, string $column_name, $variable, int $maximum_length = -1, int $type = 0): bool {} +function oci_bind_by_name($statement_resource, string $column_name, &$variable, int $maximum_length = -1, int $type = 0): bool {} /** * @param resource $statement_resource @@ -28,7 +28,7 @@ function oci_bind_by_name($statement_resource, string $column_name, $variable, i * @param int $type * @return bool */ -function oci_bind_array_by_name($statement_resource, string $column_name, $variable, int $maximum_array_length, int $maximum_item_length = -1, int $type = SQLT_AFC): bool {} +function oci_bind_array_by_name($statement_resource, string $column_name, &$variable, int $maximum_array_length, int $maximum_item_length = -1, int $type = SQLT_AFC): bool {} /** * @param OCI_Lob $lob_descriptor @@ -270,7 +270,7 @@ function oci_fetch($statement_resource): bool {} * @param int $mode * @return int|false @todo return false, double check? */ -function ocifetchinto($statement_resource, $result, int $mode = 0) {} +function ocifetchinto($statement_resource, &$result, int $mode = 0) {} /** * @param resource $statement_resource @@ -280,7 +280,7 @@ function ocifetchinto($statement_resource, $result, int $mode = 0) {} * @param int $flags * @return int @todo double check. */ -function oci_fetch_all($statement_resource, $output, int $skip = 0, int $maximum_rows = -1, int $flags = 0): int {} +function oci_fetch_all($statement_resource, &$output, int $skip = 0, int $maximum_rows = -1, int $flags = 0): int {} /** * @param resource $statement_resource @@ -556,19 +556,19 @@ class OCI_Lob { * @param int $offset * @return bool */ - public function save(string $data, int $offset = 0): bool {} + public function save(string $data, int $offset = 0) {} /** * @param $filename @todo path? * @return bool */ - public function import($filename): bool {} + public function import($filename) {} /** * @param $filename @todo path? * @return bool */ - public function savefile($filename): bool {} + public function savefile($filename) {} /** * @return string|false @todo return false @@ -584,7 +584,7 @@ public function read(int $length) {} /** * @return bool */ - public function eof(): bool {} + public function eof() {} /** * @return int|false @todo return false @@ -594,14 +594,14 @@ public function tell() {} /** * @return bool */ - public function rewind(): bool {} + public function rewind() {} /** * @param int $offset * @param int $whence * @return bool */ - public function seek(int $offset, int $whence = 0): bool {} + public function seek(int $offset, int $whence = 0) {} /** * @return int|false @todo return false @@ -619,13 +619,13 @@ public function write(string $string, int $length = 0) {} * @param OCI_Lob $lob_descriptor_from * @return bool */ - public function append(OCI_Lob $lob_descriptor_from): bool {} + public function append(OCI_Lob $lob_descriptor_from) {} /** * @param int $length * @return bool */ - public function truncate(int $length = 0): bool {} + public function truncate(int $length = 0) {} /** * @param int $offset @@ -644,12 +644,12 @@ public function flush(int $flag = 0): bool {} * @param bool $mode * @return bool */ - public function setbuffering(bool $mode): bool {} + public function setbuffering(bool $mode) {} /** * @return bool */ - public function getbuffering(): bool {} + public function getbuffering() {} /** * @param $path @todo path? @@ -657,7 +657,7 @@ public function getbuffering(): bool {} * @param int $length * @return bool */ - public function writetofile($path, int $start = -1, int $length = -1): bool {} + public function writetofile($path, int $start = -1, int $length = -1) {} /** * @param $path @todo path? @@ -665,37 +665,37 @@ public function writetofile($path, int $start = -1, int $length = -1): bool {} * @param int $length * @return bool */ - public function export($path, int $start = -1, int $length = -1): bool {} + public function export($path, int $start = -1, int $length = -1) {} /** * @param string $data * @param int $type * @return bool */ - public function writetemporary(string $data, int $type = OCI_TEMP_CLOB): bool {} + public function writetemporary(string $data, int $type = OCI_TEMP_CLOB) {} /** * @return bool @todo double check. */ - public function close(): bool {} + public function close() {} /** * @return bool */ - public function free(): bool {} + public function free() {} } class OCI_Collection { /** * @return bool */ - public function free(): bool {} + public function free() {} /** * @param string $value * @return bool */ - public function append(string $value): bool {} + public function append(string $value) {} /** * @param int $index @@ -707,14 +707,14 @@ public function getElem(int $index) {} * @param OCI_Collection $collection_from * @return bool */ - public function assign(OCI_Collection $collection_from): bool {} + public function assign(OCI_Collection $collection_from) {} /** * @param int $index * @param string $value * @return bool */ - public function assignelem(int $index, string $value): bool {} + public function assignelem(int $index, string $value) {} /** * @return int|false @otodo check return false. @@ -730,5 +730,5 @@ public function max() {} * @param int $number * @return bool */ - public function trim(int $number): bool {} + public function trim(int $number) {} } \ No newline at end of file diff --git a/ext/oci8/oci8_arginfo.h b/ext/oci8/oci8_arginfo.h index 3a3b2c9afcb1f..1b9f9880da4bc 100644 --- a/ext/oci8/oci8_arginfo.h +++ b/ext/oci8/oci8_arginfo.h @@ -3,14 +3,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_define_by_name, 0, 3, _IS_BOOL, 0) ZEND_ARG_INFO(0, statement_resource) ZEND_ARG_TYPE_INFO(0, column_name, IS_STRING, 0) - ZEND_ARG_INFO(0, variable) + ZEND_ARG_INFO(1, variable) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_bind_by_name, 0, 3, _IS_BOOL, 0) ZEND_ARG_INFO(0, statement_resource) ZEND_ARG_TYPE_INFO(0, column_name, IS_STRING, 0) - ZEND_ARG_INFO(0, variable) + ZEND_ARG_INFO(1, variable) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maximum_length, IS_LONG, 0, "-1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -18,7 +18,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_bind_array_by_name, 0, 4, _IS_BOOL, 0) ZEND_ARG_INFO(0, statement_resource) ZEND_ARG_TYPE_INFO(0, column_name, IS_STRING, 0) - ZEND_ARG_INFO(0, variable) + ZEND_ARG_INFO(1, variable) ZEND_ARG_TYPE_INFO(0, maximum_array_length, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maximum_item_length, IS_LONG, 0, "-1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "SQLT_AFC") @@ -162,13 +162,13 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ocifetchinto, 0, 0, 2) ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, result) + ZEND_ARG_INFO(1, result) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_fetch_all, 0, 2, IS_LONG, 0) ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_INFO(0, output) + ZEND_ARG_INFO(1, output) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, skip, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maximum_rows, IS_LONG, 0, "-1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") @@ -328,12 +328,12 @@ ZEND_END_ARG_INFO() #define arginfo_oci_unregister_taf_callback arginfo_oci_rollback -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Lob_save, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_save, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Lob_import, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_import, 0, 0, 1) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() @@ -346,14 +346,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_read, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Lob_eof, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() +#define arginfo_class_OCI_Lob_eof arginfo_class_OCI_Lob_load #define arginfo_class_OCI_Lob_tell arginfo_class_OCI_Lob_load -#define arginfo_class_OCI_Lob_rewind arginfo_class_OCI_Lob_eof +#define arginfo_class_OCI_Lob_rewind arginfo_class_OCI_Lob_load -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Lob_seek, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_seek, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, whence, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -365,11 +364,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_write, 0, 0, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Lob_append, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_append, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, lob_descriptor_from, OCI_Lob, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Lob_truncate, 0, 0, _IS_BOOL, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_truncate, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -382,13 +381,13 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Lob_flush, 0, 0, _IS_B ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flag, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Lob_setbuffering, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_setbuffering, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, mode, _IS_BOOL, 0) ZEND_END_ARG_INFO() -#define arginfo_class_OCI_Lob_getbuffering arginfo_class_OCI_Lob_eof +#define arginfo_class_OCI_Lob_getbuffering arginfo_class_OCI_Lob_load -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Lob_writetofile, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_writetofile, 0, 0, 1) ZEND_ARG_INFO(0, path) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, start, IS_LONG, 0, "-1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "-1") @@ -396,18 +395,18 @@ ZEND_END_ARG_INFO() #define arginfo_class_OCI_Lob_export arginfo_class_OCI_Lob_writetofile -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Lob_writetemporary, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_writetemporary, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "OCI_TEMP_CLOB") ZEND_END_ARG_INFO() -#define arginfo_class_OCI_Lob_close arginfo_class_OCI_Lob_eof +#define arginfo_class_OCI_Lob_close arginfo_class_OCI_Lob_load -#define arginfo_class_OCI_Lob_free arginfo_class_OCI_Lob_eof +#define arginfo_class_OCI_Lob_free arginfo_class_OCI_Lob_load -#define arginfo_class_OCI_Collection_free arginfo_class_OCI_Lob_eof +#define arginfo_class_OCI_Collection_free arginfo_class_OCI_Lob_load -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Collection_append, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Collection_append, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -415,11 +414,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Collection_getElem, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Collection_assign, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Collection_assign, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, collection_from, OCI_Collection, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Collection_assignelem, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Collection_assignelem, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -428,6 +427,6 @@ ZEND_END_ARG_INFO() #define arginfo_class_OCI_Collection_max arginfo_class_OCI_Lob_load -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Collection_trim, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Collection_trim, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, number, IS_LONG, 0) ZEND_END_ARG_INFO() From 18a6fc0d3e0d96d054e74fd7ddf5657be42a04ab Mon Sep 17 00:00:00 2001 From: Jens de Nies Date: Fri, 12 Jun 2020 20:21:21 +0200 Subject: [PATCH 04/11] Added stubs for deprecated functions, added alias docblocks and generated function entries. --- ext/oci8/oci8.c | 258 +--------------- ext/oci8/oci8.stub.php | 654 +++++++++++++++++++++++----------------- ext/oci8/oci8_arginfo.h | 411 +++++++++++++++++++++++-- 3 files changed, 761 insertions(+), 562 deletions(-) diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index d7fae9bb702a9..3a43f837ae844 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -124,265 +124,13 @@ ZEND_GET_MODULE(oci8) #include "oci8_arginfo.h" -/* {{{ extension function prototypes -*/ -PHP_FUNCTION(oci_bind_by_name); -PHP_FUNCTION(oci_bind_array_by_name); -PHP_FUNCTION(oci_define_by_name); -PHP_FUNCTION(oci_field_is_null); -PHP_FUNCTION(oci_field_name); -PHP_FUNCTION(oci_field_size); -PHP_FUNCTION(oci_field_scale); -PHP_FUNCTION(oci_field_precision); -PHP_FUNCTION(oci_field_type); -PHP_FUNCTION(oci_field_type_raw); -PHP_FUNCTION(oci_execute); -PHP_FUNCTION(oci_fetch); -PHP_FUNCTION(oci_cancel); -PHP_FUNCTION(ocifetchinto); -PHP_FUNCTION(oci_fetch_object); -PHP_FUNCTION(oci_fetch_row); -PHP_FUNCTION(oci_fetch_assoc); -PHP_FUNCTION(oci_fetch_array); -PHP_FUNCTION(ocifetchstatement); -PHP_FUNCTION(oci_fetch_all); -PHP_FUNCTION(oci_free_statement); -PHP_FUNCTION(oci_internal_debug); -PHP_FUNCTION(oci_close); -PHP_FUNCTION(oci_connect); -PHP_FUNCTION(oci_new_connect); -PHP_FUNCTION(oci_pconnect); -PHP_FUNCTION(oci_error); -PHP_FUNCTION(oci_free_descriptor); -PHP_FUNCTION(oci_commit); -PHP_FUNCTION(oci_rollback); -PHP_FUNCTION(oci_new_descriptor); -PHP_FUNCTION(oci_num_fields); -PHP_FUNCTION(oci_parse); -PHP_FUNCTION(oci_get_implicit_resultset); -PHP_FUNCTION(oci_new_cursor); -PHP_FUNCTION(oci_result); -PHP_FUNCTION(oci_client_version); -PHP_FUNCTION(oci_server_version); -PHP_FUNCTION(oci_statement_type); -PHP_FUNCTION(oci_num_rows); -PHP_FUNCTION(oci_set_prefetch); -PHP_FUNCTION(oci_set_client_identifier); -PHP_FUNCTION(oci_set_db_operation); -PHP_FUNCTION(oci_set_call_timeout); -PHP_FUNCTION(oci_set_edition); -PHP_FUNCTION(oci_set_module_name); -PHP_FUNCTION(oci_set_action); -PHP_FUNCTION(oci_set_client_info); -PHP_FUNCTION(oci_password_change); -PHP_FUNCTION(oci_lob_save); -PHP_FUNCTION(oci_lob_import); -PHP_FUNCTION(oci_lob_export); -PHP_FUNCTION(oci_lob_load); -PHP_FUNCTION(oci_lob_tell); -PHP_FUNCTION(oci_lob_write); -PHP_FUNCTION(oci_lob_append); -PHP_FUNCTION(oci_lob_copy); -PHP_FUNCTION(oci_lob_truncate); -PHP_FUNCTION(oci_lob_erase); -PHP_FUNCTION(oci_lob_flush); -PHP_FUNCTION(ocisetbufferinglob); -PHP_FUNCTION(ocigetbufferinglob); -PHP_FUNCTION(oci_lob_is_equal); -PHP_FUNCTION(oci_lob_rewind); -PHP_FUNCTION(oci_lob_read); -PHP_FUNCTION(oci_lob_eof); -PHP_FUNCTION(oci_lob_seek); -PHP_FUNCTION(oci_lob_size); -PHP_FUNCTION(oci_lob_write_temporary); -PHP_FUNCTION(oci_lob_close); -PHP_FUNCTION(oci_new_collection); -PHP_FUNCTION(oci_free_collection); -PHP_FUNCTION(oci_collection_append); -PHP_FUNCTION(oci_collection_element_get); -PHP_FUNCTION(oci_collection_element_assign); -PHP_FUNCTION(oci_collection_assign); -PHP_FUNCTION(oci_collection_size); -PHP_FUNCTION(oci_collection_max); -PHP_FUNCTION(oci_collection_trim); -PHP_FUNCTION(oci_register_taf_callback); -PHP_FUNCTION(oci_unregister_taf_callback); -/* }}} */ - /* {{{ extension definition structures */ -static const zend_function_entry php_oci_functions[] = { - PHP_FE(oci_define_by_name, arginfo_oci_define_by_name) - PHP_FE(oci_bind_by_name, arginfo_oci_bind_by_name) - PHP_FE(oci_bind_array_by_name, arginfo_oci_bind_array_by_name) - PHP_FE(oci_field_is_null, arginfo_oci_field_is_null) - PHP_FE(oci_field_name, arginfo_oci_field_name) - PHP_FE(oci_field_size, arginfo_oci_field_size) - PHP_FE(oci_field_scale, arginfo_oci_field_scale) - PHP_FE(oci_field_precision, arginfo_oci_field_precision) - PHP_FE(oci_field_type, arginfo_oci_field_type) - PHP_FE(oci_field_type_raw, arginfo_oci_field_type_raw) - PHP_FE(oci_execute, arginfo_oci_execute) - PHP_FE(oci_cancel, arginfo_oci_cancel) - PHP_FE(oci_fetch, arginfo_oci_fetch) - PHP_FE(oci_fetch_object, arginfo_oci_fetch_object) - PHP_FE(oci_fetch_row, arginfo_oci_fetch_row) - PHP_FE(oci_fetch_assoc, arginfo_oci_fetch_assoc) - PHP_FE(oci_fetch_array, arginfo_oci_fetch_array) - PHP_FE(ocifetchinto, arginfo_ocifetchinto) - PHP_FE(oci_fetch_all, arginfo_oci_fetch_all) - PHP_FE(oci_free_statement, arginfo_oci_free_statement) - PHP_FE(oci_internal_debug, arginfo_oci_internal_debug) - PHP_FE(oci_num_fields, arginfo_oci_num_fields) - PHP_FE(oci_parse, arginfo_oci_parse) - PHP_FE(oci_get_implicit_resultset, arginfo_oci_get_implicit_resultset) - PHP_FE(oci_new_cursor, arginfo_oci_new_cursor) - PHP_FE(oci_result, arginfo_oci_result) - PHP_FE(oci_client_version, arginfo_oci_client_version) - PHP_FE(oci_server_version, arginfo_oci_server_version) - PHP_FE(oci_statement_type, arginfo_oci_statement_type) - PHP_FE(oci_num_rows, arginfo_oci_num_rows) - PHP_FE(oci_close, arginfo_oci_close) - PHP_FE(oci_connect, arginfo_oci_connect) - PHP_FE(oci_new_connect, arginfo_oci_new_connect) - PHP_FE(oci_pconnect, arginfo_oci_pconnect) - PHP_FE(oci_error, arginfo_oci_error) - PHP_FE(oci_free_descriptor, arginfo_oci_free_descriptor) - PHP_FE(oci_lob_save, arginfo_oci_lob_save) - PHP_FE(oci_lob_import, arginfo_oci_lob_import) - PHP_FE(oci_lob_size, arginfo_oci_lob_size) - PHP_FE(oci_lob_load, arginfo_oci_lob_load) - PHP_FE(oci_lob_read, arginfo_oci_lob_read) - PHP_FE(oci_lob_eof, arginfo_oci_lob_eof) - PHP_FE(oci_lob_tell, arginfo_oci_lob_tell) - PHP_FE(oci_lob_truncate, arginfo_oci_lob_truncate) - PHP_FE(oci_lob_erase, arginfo_oci_lob_erase) - PHP_FE(oci_lob_flush, arginfo_oci_lob_flush) - PHP_FE(ocisetbufferinglob, arginfo_ocisetbufferinglob) - PHP_FE(ocigetbufferinglob, arginfo_ocigetbufferinglob) - PHP_FE(oci_lob_is_equal, arginfo_oci_lob_is_equal) - PHP_FE(oci_lob_rewind, arginfo_oci_lob_rewind) - PHP_FE(oci_lob_write, arginfo_oci_lob_write) - PHP_FE(oci_lob_append, arginfo_oci_lob_append) - PHP_FE(oci_lob_copy, arginfo_oci_lob_copy) - PHP_FE(oci_lob_export, arginfo_oci_lob_export) - PHP_FE(oci_lob_seek, arginfo_oci_lob_seek) - PHP_FE(oci_commit, arginfo_oci_commit) - PHP_FE(oci_rollback, arginfo_oci_rollback) - PHP_FE(oci_new_descriptor, arginfo_oci_new_descriptor) - PHP_FE(oci_set_prefetch, arginfo_oci_set_prefetch) - PHP_FE(oci_set_client_identifier, arginfo_oci_set_client_identifier) - PHP_FE(oci_set_db_operation, arginfo_oci_set_db_operation) - PHP_FE(oci_set_call_timeout, arginfo_oci_set_call_timeout) - PHP_FE(oci_set_edition, arginfo_oci_set_edition) - PHP_FE(oci_set_module_name, arginfo_oci_set_module_name) - PHP_FE(oci_set_action, arginfo_oci_set_action) - PHP_FE(oci_set_client_info, arginfo_oci_set_client_info) - PHP_FE(oci_password_change, arginfo_oci_password_change) - PHP_FE(oci_free_collection, arginfo_oci_free_collection) - PHP_FE(oci_collection_append, arginfo_oci_collection_append) - PHP_FE(oci_collection_element_get, arginfo_oci_collection_element_get) - PHP_FE(oci_collection_element_assign, arginfo_oci_collection_element_assign) - PHP_FE(oci_collection_assign, arginfo_oci_collection_assign) - PHP_FE(oci_collection_size, arginfo_oci_collection_size) - PHP_FE(oci_collection_max, arginfo_oci_collection_max) - PHP_FE(oci_collection_trim, arginfo_oci_collection_trim) - PHP_FE(oci_new_collection, arginfo_oci_new_collection) - PHP_FE(oci_register_taf_callback, arginfo_oci_register_taf_callback) - PHP_FE(oci_unregister_taf_callback, arginfo_oci_unregister_taf_callback) - - PHP_FALIAS(oci_free_cursor, oci_free_statement, arginfo_oci_free_statement) - PHP_DEP_FALIAS(ocifreecursor, oci_free_statement, arginfo_oci_free_statement) - PHP_DEP_FALIAS(ocibindbyname, oci_bind_by_name, arginfo_oci_bind_by_name) - PHP_DEP_FALIAS(ocidefinebyname, oci_define_by_name, arginfo_oci_define_by_name) - PHP_DEP_FALIAS(ocicolumnisnull, oci_field_is_null, arginfo_oci_field_is_null) - PHP_DEP_FALIAS(ocicolumnname, oci_field_name, arginfo_oci_field_name) - PHP_DEP_FALIAS(ocicolumnsize, oci_field_size, arginfo_oci_field_size) - PHP_DEP_FALIAS(ocicolumnscale, oci_field_scale, arginfo_oci_field_scale) - PHP_DEP_FALIAS(ocicolumnprecision, oci_field_precision, arginfo_oci_field_precision) - PHP_DEP_FALIAS(ocicolumntype, oci_field_type, arginfo_oci_field_type) - PHP_DEP_FALIAS(ocicolumntyperaw, oci_field_type_raw, arginfo_oci_field_type_raw) - PHP_DEP_FALIAS(ociexecute, oci_execute, arginfo_oci_execute) - PHP_DEP_FALIAS(ocicancel, oci_cancel, arginfo_oci_cancel) - PHP_DEP_FALIAS(ocifetch, oci_fetch, arginfo_oci_fetch) - PHP_DEP_FALIAS(ocifetchstatement, oci_fetch_all, arginfo_oci_fetch_all) - PHP_DEP_FALIAS(ocifreestatement, oci_free_statement, arginfo_oci_free_statement) - PHP_DEP_FALIAS(ociinternaldebug, oci_internal_debug, arginfo_oci_internal_debug) - PHP_DEP_FALIAS(ocinumcols, oci_num_fields, arginfo_oci_num_fields) - PHP_DEP_FALIAS(ociparse, oci_parse, arginfo_oci_parse) - PHP_DEP_FALIAS(ocinewcursor, oci_new_cursor, arginfo_oci_new_cursor) - PHP_DEP_FALIAS(ociresult, oci_result, arginfo_oci_result) - PHP_DEP_FALIAS(ociserverversion, oci_server_version, arginfo_oci_server_version) - PHP_DEP_FALIAS(ocistatementtype, oci_statement_type, arginfo_oci_statement_type) - PHP_DEP_FALIAS(ocirowcount, oci_num_rows, arginfo_oci_num_rows) - PHP_DEP_FALIAS(ocilogoff, oci_close, arginfo_oci_close) - PHP_DEP_FALIAS(ocilogon, oci_connect, arginfo_oci_connect) - PHP_DEP_FALIAS(ocinlogon, oci_new_connect, arginfo_oci_new_connect) - PHP_DEP_FALIAS(ociplogon, oci_pconnect, arginfo_oci_pconnect) - PHP_DEP_FALIAS(ocierror, oci_error, arginfo_oci_error) - PHP_DEP_FALIAS(ocifreedesc, oci_free_descriptor, arginfo_oci_free_descriptor) - PHP_DEP_FALIAS(ocisavelob, oci_lob_save, arginfo_oci_lob_save) - PHP_DEP_FALIAS(ocisavelobfile, oci_lob_import, arginfo_oci_lob_import) - PHP_DEP_FALIAS(ociwritelobtofile, oci_lob_export, arginfo_oci_lob_export) - PHP_DEP_FALIAS(ociloadlob, oci_lob_load, arginfo_oci_lob_load) - PHP_DEP_FALIAS(ocicommit, oci_commit, arginfo_oci_commit) - PHP_DEP_FALIAS(ocirollback, oci_rollback, arginfo_oci_rollback) - PHP_DEP_FALIAS(ocinewdescriptor, oci_new_descriptor, arginfo_oci_new_descriptor) - PHP_DEP_FALIAS(ocisetprefetch, oci_set_prefetch, arginfo_oci_set_prefetch) - PHP_DEP_FALIAS(ocipasswordchange, oci_password_change, arginfo_oci_password_change) - PHP_DEP_FALIAS(ocifreecollection, oci_free_collection, arginfo_oci_free_collection) - PHP_DEP_FALIAS(ocinewcollection, oci_new_collection, arginfo_oci_new_collection) - PHP_DEP_FALIAS(ocicollappend, oci_collection_append, arginfo_oci_collection_append) - PHP_DEP_FALIAS(ocicollgetelem, oci_collection_element_get, arginfo_oci_collection_element_get) - PHP_DEP_FALIAS(ocicollassignelem, oci_collection_element_assign, arginfo_oci_collection_element_assign) - PHP_DEP_FALIAS(ocicollsize, oci_collection_size, arginfo_oci_collection_size) - PHP_DEP_FALIAS(ocicollmax, oci_collection_max, arginfo_oci_collection_max) - PHP_DEP_FALIAS(ocicolltrim, oci_collection_trim, arginfo_oci_collection_trim) - PHP_FE_END -}; - -static const zend_function_entry php_oci_lob_class_functions[] = { - PHP_FALIAS(load, oci_lob_load, arginfo_class_OCI_Lob_load) - PHP_FALIAS(tell, oci_lob_tell, arginfo_class_OCI_Lob_tell) - PHP_FALIAS(truncate, oci_lob_truncate, arginfo_class_OCI_Lob_truncate) - PHP_FALIAS(erase, oci_lob_erase, arginfo_class_OCI_Lob_erase) - PHP_FALIAS(flush, oci_lob_flush, arginfo_class_OCI_Lob_flush) - PHP_FALIAS(setbuffering,ocisetbufferinglob, arginfo_class_OCI_Lob_setbuffering) - PHP_FALIAS(getbuffering,ocigetbufferinglob, arginfo_class_OCI_Lob_getbuffering) - PHP_FALIAS(rewind, oci_lob_rewind, arginfo_class_OCI_Lob_rewind) - PHP_FALIAS(read, oci_lob_read, arginfo_class_OCI_Lob_read) - PHP_FALIAS(eof, oci_lob_eof, arginfo_class_OCI_Lob_eof) - PHP_FALIAS(seek, oci_lob_seek, arginfo_class_OCI_Lob_seek) - PHP_FALIAS(write, oci_lob_write, arginfo_class_OCI_Lob_write) - PHP_FALIAS(append, oci_lob_append, arginfo_class_OCI_Lob_append) - PHP_FALIAS(size, oci_lob_size, arginfo_class_OCI_Lob_size) - PHP_FALIAS(writetofile, oci_lob_export, arginfo_class_OCI_Lob_writetofile) - PHP_FALIAS(export, oci_lob_export, arginfo_class_OCI_Lob_export) - PHP_FALIAS(import, oci_lob_import, arginfo_class_OCI_Lob_import) - PHP_FALIAS(writetemporary, oci_lob_write_temporary, arginfo_class_OCI_Lob_writetemporary) - PHP_FALIAS(close, oci_lob_close, arginfo_class_OCI_Lob_close) - PHP_FALIAS(save, oci_lob_save, arginfo_class_OCI_Lob_save) - PHP_FALIAS(savefile, oci_lob_import, arginfo_class_OCI_Lob_savefile) - PHP_FALIAS(free, oci_free_descriptor, arginfo_class_OCI_Lob_free) - PHP_FE_END -}; - -static const zend_function_entry php_oci_coll_class_functions[] = { - PHP_FALIAS(append, oci_collection_append, arginfo_class_OCI_Collection_append) - PHP_FALIAS(getelem, oci_collection_element_get, arginfo_class_OCI_Collection_getElem) - PHP_FALIAS(assignelem, oci_collection_element_assign, arginfo_class_OCI_Collection_assignelem) - PHP_FALIAS(assign, oci_collection_assign, arginfo_class_OCI_Collection_assign) - PHP_FALIAS(size, oci_collection_size, arginfo_class_OCI_Collection_size) - PHP_FALIAS(max, oci_collection_max, arginfo_class_OCI_Collection_max) - PHP_FALIAS(trim, oci_collection_trim, arginfo_class_OCI_Collection_trim) - PHP_FALIAS(free, oci_free_collection, arginfo_class_OCI_Collection_free) - PHP_FE_END -}; zend_module_entry oci8_module_entry = { STANDARD_MODULE_HEADER, "oci8", /* extension name */ - php_oci_functions, /* extension function list */ + ext_functions, /* extension function list */ PHP_MINIT(oci), /* extension-wide startup function */ PHP_MSHUTDOWN(oci), /* extension-wide shutdown function */ PHP_RINIT(oci), /* per-request startup function */ @@ -542,8 +290,8 @@ PHP_MINIT_FUNCTION(oci) le_descriptor = zend_register_list_destructors_ex(php_oci_descriptor_list_dtor, NULL, "oci8 descriptor", module_number); le_collection = zend_register_list_destructors_ex(php_oci_collection_list_dtor, NULL, "oci8 collection", module_number); - INIT_CLASS_ENTRY(oci_lob_class_entry, "OCI-Lob", php_oci_lob_class_functions); - INIT_CLASS_ENTRY(oci_coll_class_entry, "OCI-Collection", php_oci_coll_class_functions); + INIT_CLASS_ENTRY(oci_lob_class_entry, "OCI-Lob", class_OCI_Lob_methods); + INIT_CLASS_ENTRY(oci_coll_class_entry, "OCI-Collection", class_OCI_Collection_methods); oci_lob_class_entry_ptr = zend_register_internal_class(&oci_lob_class_entry); oci_coll_class_entry_ptr = zend_register_internal_class(&oci_coll_class_entry); diff --git a/ext/oci8/oci8.stub.php b/ext/oci8/oci8.stub.php index 3cb65098ba10d..4bbab7f569431 100644 --- a/ext/oci8/oci8.stub.php +++ b/ext/oci8/oci8.stub.php @@ -1,374 +1,438 @@ Date: Sun, 14 Jun 2020 12:22:10 +0200 Subject: [PATCH 05/11] Fixed some default values. --- ext/oci8/oci8.stub.php | 4 ++-- ext/oci8/oci8_arginfo.h | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ext/oci8/oci8.stub.php b/ext/oci8/oci8.stub.php index 4bbab7f569431..221d888eee5ad 100644 --- a/ext/oci8/oci8.stub.php +++ b/ext/oci8/oci8.stub.php @@ -80,7 +80,7 @@ function oci_lob_seek(OCI_Lob $lob_descriptor, int $offset, int $whence = OCI_SE function oci_lob_size(OCI_Lob $lob_descriptor): int|false {} -function oci_lob_write(OCI_Lob $lob_descriptor, string $string, ?int $length = null): int|false {} +function oci_lob_write(OCI_Lob $lob_descriptor, string $string, int $length = UNKNOWN): int|false {} function oci_lob_append(OCI_Lob $lob_descriptor_to, OCI_Lob $lob_descriptor_from): bool {} @@ -362,7 +362,7 @@ function ocilogoff($connection_resource): bool {} /** * @return resource|false */ -function oci_new_connect(string $username, string $password, ?string $connection_string = null, ?string $character_set = null, int $session_mode = OCI_DEFAULT) {} +function oci_new_connect(string $username, string $password, string $connection_string = UNKNOWN, string $character_set = UNKNOWN, int $session_mode = OCI_DEFAULT) {} /** * @return resource|false diff --git a/ext/oci8/oci8_arginfo.h b/ext/oci8/oci8_arginfo.h index 5dd254f1daeb6..bfb912afb6165 100644 --- a/ext/oci8/oci8_arginfo.h +++ b/ext/oci8/oci8_arginfo.h @@ -79,7 +79,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_lob_write, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, lob_descriptor, OCI_Lob, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_append, 0, 2, _IS_BOOL, 0) @@ -249,6 +249,14 @@ ZEND_END_ARG_INFO() #define arginfo_ocilogoff arginfo_oci_rollback ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_new_connect, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, connection_string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, character_set, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, session_mode, IS_LONG, 0, "OCI_DEFAULT") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ocinlogon, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, connection_string, IS_STRING, 1, "null") @@ -256,15 +264,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_new_connect, 0, 0, 2) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, session_mode, IS_LONG, 0, "OCI_DEFAULT") ZEND_END_ARG_INFO() -#define arginfo_ocinlogon arginfo_oci_new_connect - -#define arginfo_oci_connect arginfo_oci_new_connect +#define arginfo_oci_connect arginfo_ocinlogon -#define arginfo_ocilogon arginfo_oci_new_connect +#define arginfo_ocilogon arginfo_ocinlogon -#define arginfo_oci_pconnect arginfo_oci_new_connect +#define arginfo_oci_pconnect arginfo_ocinlogon -#define arginfo_ociplogon arginfo_oci_new_connect +#define arginfo_ociplogon arginfo_ocinlogon ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_error, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, connection_or_statement_resource, "null") From 59b4119639e354e80cac5d9cf4ce19c430e0ff92 Mon Sep 17 00:00:00 2001 From: Jens de Nies Date: Wed, 17 Jun 2020 00:27:28 +0200 Subject: [PATCH 06/11] Fixed some stubs and some adjustments to oci8_statement. --- ext/oci8/oci8.stub.php | 62 ++++++++++++++++----------------------- ext/oci8/oci8_arginfo.h | 52 +++++++++++++++++--------------- ext/oci8/oci8_statement.c | 19 ++++++------ 3 files changed, 64 insertions(+), 69 deletions(-) diff --git a/ext/oci8/oci8.stub.php b/ext/oci8/oci8.stub.php index 221d888eee5ad..fb35de32151f6 100644 --- a/ext/oci8/oci8.stub.php +++ b/ext/oci8/oci8.stub.php @@ -86,7 +86,7 @@ function oci_lob_append(OCI_Lob $lob_descriptor_to, OCI_Lob $lob_descriptor_from function oci_lob_truncate(OCI_Lob $lob_descriptor, int $length = 0): bool {} -function oci_lob_erase(OCI_Lob $lob_descriptor, int $offset = -1, int $length = -1): int|false {} +function oci_lob_erase(OCI_Lob $lob_descriptor, int $offset = UNKNOWN, int $length = UNKNOWN): int|false {} function oci_lob_flush(OCI_Lob $lob_descriptor, int $flag = 0): bool {} @@ -94,29 +94,29 @@ function ocisetbufferinglob(OCI_Lob $lob_descriptor, bool $mode): bool {} function ocigetbufferinglob(OCI_Lob $lob_descriptor): bool {} -function oci_lob_copy(OCI_Lob $lob_descriptor_to, OCI_Lob $lob_descriptor_from, int $length = 0): bool {} +function oci_lob_copy(OCI_Lob $lob_descriptor_to, OCI_Lob $lob_descriptor_from, int $length = UNKNOWN): bool {} function oci_lob_is_equal(OCI_Lob $lob_descriptor_first, OCI_Lob $lob_descriptor_second): bool {} -function oci_lob_export(OCI_Lob $lob_descriptor, $path, int $start = -1, int $length = -1): bool {} +function oci_lob_export(OCI_Lob $lob_descriptor, $path, int $start = UNKNOWN, int $length = UNKNOWN): bool {} /** * @alias oci_lob_export * @deprecated */ -function ociwritelobtofile(OCI_Lob $lob_descriptor, $path, int $start = -1, int $length = -1): bool {} +function ociwritelobtofile(OCI_Lob $lob_descriptor, $path, int $start = UNKNOWN, int $length = UNKNOWN): bool {} /** * @param resource $connection_resource */ -function oci_new_descriptor($connection_resource, int $type = OCI_DTYPE_LOB): OCI_Lob {} +function oci_new_descriptor($connection_resource, int $type = OCI_DTYPE_LOB): ?OCI_Lob {} /** * @param resource $connection_resource * @alias oci_new_descriptor * @deprecated */ -function ocinewdescriptor($connection_resource, int $type = OCI_DTYPE_LOB): OCI_Lob {} +function ocinewdescriptor($connection_resource, int $type = OCI_DTYPE_LOB): ?OCI_Lob {} /** * @param resource $connection_resource @@ -144,99 +144,87 @@ function ocicommit($connection_resource): bool {} /** * @param resource $statement_resource - * @return string|false|null @todo return false, null? */ -function oci_field_name($statement_resource, mixed $column_number_or_name) {} +function oci_field_name($statement_resource, string|int $column_number_or_name): string|false {} /** * @param resource $statement_resource - * @return string|false|null @todo return false, null? * @alias oci_field_name * @deprecated */ -function ocicolumnname($statement_resource, mixed $column_number_or_name) {} +function ocicolumnname($statement_resource, string|int $column_number_or_name): string|false {} /** * @param resource $statement_resource - * @return int|false|null @todo return false, null? */ -function oci_field_size($statement_resource, mixed $column_number_or_name) {} +function oci_field_size($statement_resource, string|int $column_number_or_name): int|false {} /** * @param resource $statement_resource - * @return int|false|null @todo return false, null? * @alias oci_field_size * @deprecated */ -function ocicolumnsize($statement_resource, mixed $column_number_or_name) {} +function ocicolumnsize($statement_resource, string|int $column_number_or_name): int|false {} /** * @param resource $statement_resource - * @return int|false|null @todo return false, null? */ -function oci_field_scale($statement_resource, mixed $column_number_or_name) {} +function oci_field_scale($statement_resource, string|int $column_number_or_name): int|false {} /** * @param resource $statement_resource - * @return int|false|null @todo return false, null? * @alias oci_field_scale * @deprecated */ -function ocicolumnscale($statement_resource, mixed $column_number_or_name) {} +function ocicolumnscale($statement_resource, string|int $column_number_or_name): int|false {} /** * @param resource $statement_resource - * @return int|false|null @todo return false, null? */ -function oci_field_precision($statement_resource, mixed $column_number_or_name) {} +function oci_field_precision($statement_resource, string|int $column_number_or_name): int|false {} /** * @param resource $statement_resource - * @return int|false|null @todo return false, null? * @alias oci_field_precision * @deprecated */ -function ocicolumnprecision($statement_resource, mixed $column_number_or_name) {} +function ocicolumnprecision($statement_resource, string|int $column_number_or_name): int|false {} /** * @param resource $statement_resource - * @return string|int|false|null @todo return false, null? */ -function oci_field_type($statement_resource, mixed $column_number_or_name) {} +function oci_field_type($statement_resource, string|int $column_number_or_name): string|int|false {} /** * @param resource $statement_resource - * @return string|int|false|null @todo return false, null? * @alias oci_field_type * @deprecated */ -function ocicolumntype($statement_resource, mixed $column_number_or_name) {} +function ocicolumntype($statement_resource, string|int $column_number_or_name): string|int|false {} /** * @param resource $statement_resource - * @return int|false|null @todo return false, null? */ -function oci_field_type_raw($statement_resource, mixed $column_number_or_name) {} +function oci_field_type_raw($statement_resource, string|int $column_number_or_name): int|false {} /** * @param resource $statement_resource - * @return int|false|null @todo return false, null? * @alias oci_field_type_raw * @deprecated */ -function ocicolumntyperaw($statement_resource, mixed $column_number_or_name) {} +function ocicolumntyperaw($statement_resource, string|int $column_number_or_name): int|false {} /** * @param resource $statement_resource */ -function oci_field_is_null($statement_resource, mixed $column_number_or_name): bool {} +function oci_field_is_null($statement_resource, string|int $column_number_or_name): bool {} /** * @param resource $statement_resource * @alias oci_field_is_null * @deprecated */ -function ocicolumnisnull($statement_resource, mixed $column_number_or_name): bool {} +function ocicolumnisnull($statement_resource, string|int $column_number_or_name): bool {} function oci_internal_debug(bool $mode): void {} @@ -284,13 +272,13 @@ function ocifetch($statement_resource): bool {} /** * @param resource $statement_resource - * @param mixed $result + * @param array $result */ -function ocifetchinto($statement_resource, &$result, int $mode = 0): int|false {} +function ocifetchinto($statement_resource, &$result, int $mode = OCI_NUM): int|false {} /** * @param resource $statement_resource - * @param mixed $output + * @param array $output */ function oci_fetch_all($statement_resource, &$output, int $skip = 0, int $maximum_rows = -1, int $flags = 0): int {} @@ -305,7 +293,7 @@ function ocifetchstatement($statement_resource, &$output, int $skip = 0, int $ma /** * @param resource $statement_resource */ -function oci_fetch_object($statement_resource, int $mode = 0): object {} +function oci_fetch_object($statement_resource, int $mode = PHP_OCI_ASSOC | PHP_OCI_RETURN_NULLS): ?stdClass {} /** * @param resource $statement_resource @@ -320,7 +308,7 @@ function oci_fetch_assoc($statement_resource): array|false {} /** * @param resource $statement_resource */ -function oci_fetch_array($statement_resource, int $mode = 0): array|false {} +function oci_fetch_array($statement_resource, int $mode = PHP_OCI_BOTH | PHP_OCI_RETURN_NULLS): array|false {} /** * @param resource $statement_resource diff --git a/ext/oci8/oci8_arginfo.h b/ext/oci8/oci8_arginfo.h index bfb912afb6165..56b3b539a7b64 100644 --- a/ext/oci8/oci8_arginfo.h +++ b/ext/oci8/oci8_arginfo.h @@ -94,8 +94,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_lob_erase, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, lob_descriptor, OCI_Lob, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "-1") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "-1") + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_flush, 0, 1, _IS_BOOL, 0) @@ -113,7 +113,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_copy, 0, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, lob_descriptor_to, OCI_Lob, 0) ZEND_ARG_OBJ_INFO(0, lob_descriptor_from, OCI_Lob, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_is_equal, 0, 2, _IS_BOOL, 0) @@ -124,13 +124,13 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_export, 0, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, lob_descriptor, OCI_Lob, 0) ZEND_ARG_INFO(0, path) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, start, IS_LONG, 0, "-1") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "-1") + ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_ociwritelobtofile arginfo_oci_lob_export -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_oci_new_descriptor, 0, 1, OCI_Lob, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_oci_new_descriptor, 0, 1, OCI_Lob, 1) ZEND_ARG_INFO(0, connection_resource) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "OCI_DTYPE_LOB") ZEND_END_ARG_INFO() @@ -147,36 +147,42 @@ ZEND_END_ARG_INFO() #define arginfo_ocicommit arginfo_oci_rollback -ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_name, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_field_name, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_TYPE_INFO(0, column_number_or_name, IS_MIXED, 0) + ZEND_ARG_TYPE_MASK(0, column_number_or_name, MAY_BE_STRING|MAY_BE_LONG, NULL) ZEND_END_ARG_INFO() #define arginfo_ocicolumnname arginfo_oci_field_name -#define arginfo_oci_field_size arginfo_oci_field_name +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_field_size, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_INFO(0, statement_resource) + ZEND_ARG_TYPE_MASK(0, column_number_or_name, MAY_BE_STRING|MAY_BE_LONG, NULL) +ZEND_END_ARG_INFO() -#define arginfo_ocicolumnsize arginfo_oci_field_name +#define arginfo_ocicolumnsize arginfo_oci_field_size -#define arginfo_oci_field_scale arginfo_oci_field_name +#define arginfo_oci_field_scale arginfo_oci_field_size -#define arginfo_ocicolumnscale arginfo_oci_field_name +#define arginfo_ocicolumnscale arginfo_oci_field_size -#define arginfo_oci_field_precision arginfo_oci_field_name +#define arginfo_oci_field_precision arginfo_oci_field_size -#define arginfo_ocicolumnprecision arginfo_oci_field_name +#define arginfo_ocicolumnprecision arginfo_oci_field_size -#define arginfo_oci_field_type arginfo_oci_field_name +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_field_type, 0, 2, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_INFO(0, statement_resource) + ZEND_ARG_TYPE_MASK(0, column_number_or_name, MAY_BE_STRING|MAY_BE_LONG, NULL) +ZEND_END_ARG_INFO() -#define arginfo_ocicolumntype arginfo_oci_field_name +#define arginfo_ocicolumntype arginfo_oci_field_type -#define arginfo_oci_field_type_raw arginfo_oci_field_name +#define arginfo_oci_field_type_raw arginfo_oci_field_size -#define arginfo_ocicolumntyperaw arginfo_oci_field_name +#define arginfo_ocicolumntyperaw arginfo_oci_field_size ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_field_is_null, 0, 2, _IS_BOOL, 0) ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_TYPE_INFO(0, column_number_or_name, IS_MIXED, 0) + ZEND_ARG_TYPE_MASK(0, column_number_or_name, MAY_BE_STRING|MAY_BE_LONG, NULL) ZEND_END_ARG_INFO() #define arginfo_ocicolumnisnull arginfo_oci_field_is_null @@ -207,7 +213,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ocifetchinto, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_INFO(0, statement_resource) ZEND_ARG_INFO(1, result) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "OCI_NUM") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_fetch_all, 0, 2, IS_LONG, 0) @@ -220,9 +226,9 @@ ZEND_END_ARG_INFO() #define arginfo_ocifetchstatement arginfo_oci_fetch_all -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_fetch_object, 0, 1, IS_OBJECT, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_oci_fetch_object, 0, 1, stdClass, 1) ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "PHP_OCI_ASSOC | PHP_OCI_RETURN_NULLS") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_fetch_row, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) @@ -233,7 +239,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_fetch_array, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "PHP_OCI_BOTH | PHP_OCI_RETURN_NULLS") ZEND_END_ARG_INFO() #define arginfo_oci_free_statement arginfo_oci_cancel diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index 9eb0f15efb13e..05c6b860c7658 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -1516,13 +1516,16 @@ sb4 php_oci_bind_out_callback( Helper function to get column by name and index */ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS, int need_data) { - zval *z_statement, *column_index; + zval *z_statement; + zend_string *column_index_string = NULL; + zend_long column_index_int = 0; + php_oci_statement *statement; php_oci_out_column *column; ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_RESOURCE(z_statement) - Z_PARAM_ZVAL(column_index) + Z_PARAM_STR_OR_LONG(column_index_string, column_index_int) ZEND_PARSE_PARAMETERS_END_EX(return NULL); statement = (php_oci_statement *) zend_fetch_resource_ex(z_statement, "oci8 statement", le_statement); @@ -1535,19 +1538,17 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME return NULL; } - if (Z_TYPE_P(column_index) == IS_STRING) { - column = php_oci_statement_get_column(statement, -1, Z_STRVAL_P(column_index), (int) Z_STRLEN_P(column_index)); + if (column_index_string != NULL) { + column = php_oci_statement_get_column(statement, -1, ZSTR_VAL(column_index_string), (int) ZSTR_LEN(column_index_string)); if (!column) { - php_error_docref(NULL, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_P(column_index)); + php_error_docref(NULL, E_WARNING, "Invalid column name \"%s\"", ZSTR_VAL(column_index_string)); return NULL; } } else { - zend_long tmp; + column = php_oci_statement_get_column(statement, column_index_int, NULL, 0); - tmp = zval_get_long(column_index); - column = php_oci_statement_get_column(statement, tmp, NULL, 0); if (!column) { - php_error_docref(NULL, E_WARNING, "Invalid column index \"" ZEND_LONG_FMT "\"", tmp); + php_error_docref(NULL, E_WARNING, "Invalid column index \"" ZEND_LONG_FMT "\"", column_index_int); return NULL; } } From c493b2e2891d7bdc0f6d021a8dbfe38dc939e013 Mon Sep 17 00:00:00 2001 From: Jens de Nies Date: Thu, 18 Jun 2020 21:30:19 +0200 Subject: [PATCH 07/11] Various changes. --- ext/oci8/oci8.stub.php | 40 +++++++++++++++++----------------- ext/oci8/oci8_arginfo.h | 45 ++++++++++++++++++++------------------- ext/oci8/oci8_interface.c | 37 ++++++++++++++++++++------------ ext/oci8/oci8_statement.c | 4 ++-- 4 files changed, 68 insertions(+), 58 deletions(-) diff --git a/ext/oci8/oci8.stub.php b/ext/oci8/oci8.stub.php index fb35de32151f6..a984b8dd858c2 100644 --- a/ext/oci8/oci8.stub.php +++ b/ext/oci8/oci8.stub.php @@ -293,7 +293,7 @@ function ocifetchstatement($statement_resource, &$output, int $skip = 0, int $ma /** * @param resource $statement_resource */ -function oci_fetch_object($statement_resource, int $mode = PHP_OCI_ASSOC | PHP_OCI_RETURN_NULLS): ?stdClass {} +function oci_fetch_object($statement_resource, int $mode = PHP_OCI_ASSOC | PHP_OCI_RETURN_NULLS): stdClass|null|false {} /** * @param resource $statement_resource @@ -338,55 +338,55 @@ function ocifreecursor($statement_resource): bool {} /** * @param resource $connection_resource */ -function oci_close($connection_resource): bool {} +function oci_close($connection_resource): bool|null {} /** * @param resource $connection_resource * @alias oci_close * @deprecated */ -function ocilogoff($connection_resource): bool {} +function ocilogoff($connection_resource): bool|null {} /** * @return resource|false */ -function oci_new_connect(string $username, string $password, string $connection_string = UNKNOWN, string $character_set = UNKNOWN, int $session_mode = OCI_DEFAULT) {} +function oci_new_connect(string $username, string $password, string $connection_string = UNKNOWN, string $character_set = '', int $session_mode = OCI_DEFAULT) {} /** * @return resource|false * @alias oci_new_connect * @deprecated */ -function ocinlogon(string $username, string $password, ?string $connection_string = null, ?string $character_set = null, int $session_mode = OCI_DEFAULT) {} +function ocinlogon(string $username, string $password, string $connection_string = UNKNOWN, string $character_set = '', int $session_mode = OCI_DEFAULT) {} /** * @return resource|false */ -function oci_connect(string $username, string $password, ?string $connection_string = null, ?string $character_set = null, int $session_mode = OCI_DEFAULT) {} +function oci_connect(string $username, string $password, string $connection_string = UNKNOWN, string $character_set = '', int $session_mode = OCI_DEFAULT) {} /** * @return resource|false * @alias oci_connect * @deprecated */ -function ocilogon(string $username, string $password, ?string $connection_string = null, ?string $character_set = null, int $session_mode = OCI_DEFAULT) {} +function ocilogon(string $username, string $password, string $connection_string = UNKNOWN, string $character_set = '', int $session_mode = OCI_DEFAULT) {} /** * @return resource|false */ -function oci_pconnect(string $username, string $password, ?string $connection_string = null, ?string $character_set = null, int $session_mode = OCI_DEFAULT) {} +function oci_pconnect(string $username, string $password, string $connection_string = UNKNOWN, string $character_set = '', int $session_mode = OCI_DEFAULT) {} /** * @return resource|false * @alias oci_pconnect * @deprecated */ -function ociplogon(string $username, string $password, ?string $connection_string = null, ?string $character_set = null, int $session_mode = OCI_DEFAULT) {} +function ociplogon(string $username, string $password, string $connection_string = UNKNOWN, string $character_set = '', int $session_mode = OCI_DEFAULT) {} /** - * @param resource|null $connection_or_statement_resource + * @param resource $connection_or_statement_resource */ -function oci_error($connection_or_statement_resource = null): array|false {} +function oci_error($connection_or_statement_resource = UNKNOWN): array|false {} /** * @param resource|null $connection_or_statement_resource @@ -430,7 +430,7 @@ function oci_get_implicit_resultset($statement_resource) {} /** * @param resource $statement_resource */ -function oci_set_prefetch($statement_resource, int $number_of_rows): bool {} +function oci_set_prefetch($statement_resource, int $number_of_rows): ?bool {} /** * @param resource $statement_resource @@ -487,13 +487,13 @@ function ocipasswordchange($connection_resource_or_connection_string, string $us /** * @param resource $connection_resource - * @return resource|false @todo check return false + * @return resource|false */ function oci_new_cursor($connection_resource) {} /** * @param resource $connection_resource - * @return resource|false @todo check return false + * @return resource|false * @alias oci_new_cursor * @deprecated */ @@ -502,14 +502,14 @@ function ocinewcursor($connection_resource) {} /** * @param resource $statement_resource */ -function oci_result($statement_resource, mixed $column_number_or_name): mixed {} +function oci_result($statement_resource, string|int $column_number_or_name): mixed {} /** * @param resource $statement_resource * @alias oci_result * @deprecated */ -function ociresult($statement_resource, mixed $column_number_or_name): mixed {} +function ociresult($statement_resource, string|int $column_number_or_name): mixed {} function oci_client_version(): string {} @@ -565,13 +565,13 @@ function oci_collection_append(OCI_Collection $collection, string $value): bool */ function ocicollappend(OCI_Collection $collection, string $value): bool {} -function oci_collection_element_get(OCI_Collection $collection, int $index): mixed {} +function oci_collection_element_get(OCI_Collection $collection, int $index): string|double|null {} /** * @alias oci_collection_element_get * @deprecated */ -function ocicollgetelem(OCI_Collection $collection, int $index): mixed {} +function ocicollgetelem(OCI_Collection $collection, int $index): string|double|null {} function oci_collection_assign(OCI_Collection $collection_to, OCI_Collection $collection_from): bool {} @@ -610,14 +610,14 @@ function ocicolltrim(OCI_Collection $collection, int $number): bool {} /** * @param resource $connection_resource */ -function oci_new_collection($connection_resource, string $type_name, ?string $schema_name = null): OCI_Collection|false {} +function oci_new_collection($connection_resource, string $type_name, string $schema_name = UNKNOWN): OCI_Collection|false {} /** * @param resource $connection_resource * @alias oci_new_collection * @deprecated */ -function ocinewcollection($connection_resource, string $type_name, ?string $schema_name = null): OCI_Collection|false {} +function ocinewcollection($connection_resource, string $type_name, string $schema_name = UNKNOWN): OCI_Collection|false {} /** * @param resource $connection_resource diff --git a/ext/oci8/oci8_arginfo.h b/ext/oci8/oci8_arginfo.h index 56b3b539a7b64..5b246c5e56614 100644 --- a/ext/oci8/oci8_arginfo.h +++ b/ext/oci8/oci8_arginfo.h @@ -226,7 +226,7 @@ ZEND_END_ARG_INFO() #define arginfo_ocifetchstatement arginfo_oci_fetch_all -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_oci_fetch_object, 0, 1, stdClass, 1) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_oci_fetch_object, 0, 1, stdClass, MAY_BE_NULL|MAY_BE_FALSE) ZEND_ARG_INFO(0, statement_resource) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "PHP_OCI_ASSOC | PHP_OCI_RETURN_NULLS") ZEND_END_ARG_INFO() @@ -250,39 +250,37 @@ ZEND_END_ARG_INFO() #define arginfo_ocifreecursor arginfo_oci_cancel -#define arginfo_oci_close arginfo_oci_rollback +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_close, 0, 1, _IS_BOOL, 1) + ZEND_ARG_INFO(0, connection_resource) +ZEND_END_ARG_INFO() -#define arginfo_ocilogoff arginfo_oci_rollback +#define arginfo_ocilogoff arginfo_oci_close ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_new_connect, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, connection_string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, character_set, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, character_set, IS_STRING, 0, "\'\'") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, session_mode, IS_LONG, 0, "OCI_DEFAULT") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_ocinlogon, 0, 0, 2) - ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, connection_string, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, character_set, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, session_mode, IS_LONG, 0, "OCI_DEFAULT") -ZEND_END_ARG_INFO() +#define arginfo_ocinlogon arginfo_oci_new_connect -#define arginfo_oci_connect arginfo_ocinlogon +#define arginfo_oci_connect arginfo_oci_new_connect -#define arginfo_ocilogon arginfo_ocinlogon +#define arginfo_ocilogon arginfo_oci_new_connect -#define arginfo_oci_pconnect arginfo_ocinlogon +#define arginfo_oci_pconnect arginfo_oci_new_connect -#define arginfo_ociplogon arginfo_ocinlogon +#define arginfo_ociplogon arginfo_oci_new_connect ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_error, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, connection_or_statement_resource, "null") + ZEND_ARG_INFO(0, connection_or_statement_resource) ZEND_END_ARG_INFO() -#define arginfo_ocierror arginfo_oci_error +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ocierror, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, connection_or_statement_resource, "null") +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_num_fields, 0, 1, IS_LONG, 0) ZEND_ARG_INFO(0, statement_resource) @@ -301,12 +299,15 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_get_implicit_resultset, 0, 0, 1) ZEND_ARG_INFO(0, statement_resource) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_set_prefetch, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_set_prefetch, 0, 2, _IS_BOOL, 1) ZEND_ARG_INFO(0, statement_resource) ZEND_ARG_TYPE_INFO(0, number_of_rows, IS_LONG, 0) ZEND_END_ARG_INFO() -#define arginfo_ocisetprefetch arginfo_oci_set_prefetch +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ocisetprefetch, 0, 2, _IS_BOOL, 0) + ZEND_ARG_INFO(0, statement_resource) + ZEND_ARG_TYPE_INFO(0, number_of_rows, IS_LONG, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_set_client_identifier, 0, 2, _IS_BOOL, 0) ZEND_ARG_INFO(0, connection_resource) @@ -356,7 +357,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_result, 0, 2, IS_MIXED, 0) ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_TYPE_INFO(0, column_number_or_name, IS_MIXED, 0) + ZEND_ARG_TYPE_MASK(0, column_number_or_name, MAY_BE_STRING|MAY_BE_LONG, NULL) ZEND_END_ARG_INFO() #define arginfo_ociresult arginfo_oci_result @@ -395,7 +396,7 @@ ZEND_END_ARG_INFO() #define arginfo_ocicollappend arginfo_oci_collection_append -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_collection_element_get, 0, 2, IS_MIXED, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_oci_collection_element_get, 0, 2, double, MAY_BE_STRING|MAY_BE_NULL) ZEND_ARG_OBJ_INFO(0, collection, OCI_Collection, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -435,7 +436,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_oci_new_collection, 0, 2, OCI_Collection, MAY_BE_FALSE) ZEND_ARG_INFO(0, connection_resource) ZEND_ARG_TYPE_INFO(0, type_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, schema_name, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO(0, schema_name, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_ocinewcollection arginfo_oci_new_collection diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c index 296c4f89e5d40..87ff646d8b903 100644 --- a/ext/oci8/oci8_interface.c +++ b/ext/oci8/oci8_interface.c @@ -1805,7 +1805,6 @@ PHP_FUNCTION(oci_set_client_identifier) Sets the edition attribute for all subsequent connections created */ PHP_FUNCTION(oci_set_edition) { -#if ((OCI_MAJOR_VERSION > 11) || ((OCI_MAJOR_VERSION == 11) && (OCI_MINOR_VERSION >= 2))) char *edition; size_t edition_len; @@ -1813,6 +1812,7 @@ PHP_FUNCTION(oci_set_edition) Z_PARAM_STRING(edition, edition_len) ZEND_PARSE_PARAMETERS_END(); +#if ((OCI_MAJOR_VERSION > 11) || ((OCI_MAJOR_VERSION == 11) && (OCI_MINOR_VERSION >= 2))) if (OCI_G(edition)) { efree(OCI_G(edition)); } @@ -1837,18 +1837,20 @@ PHP_FUNCTION(oci_set_edition) Sets the module attribute on the connection for end-to-end tracing */ PHP_FUNCTION(oci_set_module_name) { -#if (OCI_MAJOR_VERSION >= 10) zval *z_connection; - php_oci_connection *connection; char *module; size_t module_len; - sword errstatus; ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_RESOURCE(z_connection) Z_PARAM_STRING(module, module_len) ZEND_PARSE_PARAMETERS_END(); +#if (OCI_MAJOR_VERSION >= 10) + + php_oci_connection *connection; + sword errstatus; + PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) module, (ub4) module_len, (ub4) OCI_ATTR_MODULE, connection->err)); @@ -1870,18 +1872,20 @@ PHP_FUNCTION(oci_set_module_name) Sets the action attribute on the connection for end-to-end tracing */ PHP_FUNCTION(oci_set_action) { -#if (OCI_MAJOR_VERSION >= 10) zval *z_connection; - php_oci_connection *connection; char *action; size_t action_len; - sword errstatus; ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_RESOURCE(z_connection) Z_PARAM_STRING(action, action_len) ZEND_PARSE_PARAMETERS_END(); +#if (OCI_MAJOR_VERSION >= 10) + + php_oci_connection *connection; + sword errstatus; + PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) action, (ub4) action_len, (ub4) OCI_ATTR_ACTION, connection->err)); @@ -1903,18 +1907,20 @@ PHP_FUNCTION(oci_set_action) Sets the client info attribute on the connection for end-to-end tracing */ PHP_FUNCTION(oci_set_client_info) { -#if (OCI_MAJOR_VERSION >= 10) zval *z_connection; - php_oci_connection *connection; char *client_info; size_t client_info_len; - sword errstatus; ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_RESOURCE(z_connection) Z_PARAM_STRING(client_info, client_info_len) ZEND_PARSE_PARAMETERS_END(); +#if (OCI_MAJOR_VERSION >= 10) + + php_oci_connection *connection; + sword errstatus; + PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_info, (ub4) client_info_len, (ub4) OCI_ATTR_CLIENT_INFO, connection->err)); @@ -1937,9 +1943,7 @@ PHP_FUNCTION(oci_set_client_info) For history, see Oracle bug 16695981 */ PHP_FUNCTION(oci_set_db_operation) { -#if (OCI_MAJOR_VERSION > 11) zval *z_connection; - php_oci_connection *connection; char *dbop_name; size_t dbop_name_len; @@ -1948,6 +1952,9 @@ PHP_FUNCTION(oci_set_db_operation) Z_PARAM_STRING(dbop_name, dbop_name_len) ZEND_PARSE_PARAMETERS_END(); +#if (OCI_MAJOR_VERSION > 11) + php_oci_connection *connection; + PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) dbop_name, (ub4) dbop_name_len, (ub4) OCI_ATTR_DBOP, OCI_G(err))); @@ -1968,9 +1975,7 @@ PHP_FUNCTION(oci_set_db_operation) */ PHP_FUNCTION(oci_set_call_timeout) { -#if (OCI_MAJOR_VERSION >= 18) zval *z_connection; - php_oci_connection *connection; zend_long call_timeout; // milliseconds ZEND_PARSE_PARAMETERS_START(2, 2) @@ -1978,6 +1983,9 @@ PHP_FUNCTION(oci_set_call_timeout) Z_PARAM_LONG(call_timeout) ZEND_PARSE_PARAMETERS_END(); +#if (OCI_MAJOR_VERSION >= 18) + php_oci_connection *connection; + PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection); PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) &call_timeout, 0, OCI_ATTR_CALL_TIMEOUT, OCI_G(err))); @@ -2091,6 +2099,7 @@ PHP_FUNCTION(oci_result) Return a string containing runtime client library version information */ PHP_FUNCTION(oci_client_version) { + ZEND_PARSE_PARAMETERS_NONE(); char version[256]; php_oci_client_get_version(version, sizeof(version)); diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index 05c6b860c7658..c64fb35083f24 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -1517,8 +1517,8 @@ sb4 php_oci_bind_out_callback( php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS, int need_data) { zval *z_statement; - zend_string *column_index_string = NULL; - zend_long column_index_int = 0; + zend_string *column_index_string; + zend_long column_index_int; php_oci_statement *statement; php_oci_out_column *column; From ee59439c766ecdc4509a95204ee66537fa90501e Mon Sep 17 00:00:00 2001 From: Jens de Nies Date: Mon, 22 Jun 2020 21:55:45 +0200 Subject: [PATCH 08/11] Fix. --- ext/oci8/oci8.stub.php | 15 ++++++++------- ext/oci8/oci8_arginfo.h | 14 +++++++------- ext/oci8/oci8_interface.c | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ext/oci8/oci8.stub.php b/ext/oci8/oci8.stub.php index a984b8dd858c2..11cb246495a3f 100644 --- a/ext/oci8/oci8.stub.php +++ b/ext/oci8/oci8.stub.php @@ -621,8 +621,9 @@ function ocinewcollection($connection_resource, string $type_name, string $schem /** * @param resource $connection_resource + * @param callable|null $function_name */ -function oci_register_taf_callback($connection_resource, mixed $function_name): bool {} +function oci_register_taf_callback($connection_resource, $function_name): bool {} /** * @param resource $connection_resource @@ -682,7 +683,7 @@ public function rewind() {} * @alias oci_lob_seek * @return bool */ - public function seek(int $offset, int $whence = 0) {} + public function seek(int $offset, int $whence = OCI_SEEK_SET) {} /** * @alias oci_lob_size @@ -694,7 +695,7 @@ public function size() {} * @alias oci_lob_write * @return int|false */ - public function write(string $string, int $length = 0) {} + public function write(string $string, int $length = UNKNOWN) {} /** * @alias oci_lob_append @@ -712,7 +713,7 @@ public function truncate(int $length = 0) {} * @alias oci_lob_erase * @return int|false */ - public function erase(int $offset = -1, int $length = -1) {} + public function erase(int $offset = UNKNOWN, int $length = UNKNOWN) {} /** * @alias oci_lob_flush @@ -736,13 +737,13 @@ public function getbuffering() {} * @alias oci_lob_export * @return bool */ - public function writetofile(string $path, int $start = -1, int $length = -1) {} + public function writetofile(string $path, int $start = UNKNOWN, int $length = UNKNOWN) {} /** * @alias oci_lob_export * @return bool */ - public function export(string $path, int $start = -1, int $length = -1) {} + public function export(string $path, int $start = UNKNOWN, int $length = UNKNOWN) {} /** * @alias oci_lob_write_temporary @@ -778,7 +779,7 @@ public function append(string $value) {} /** * @alias oci_collection_element_get - * @return mixed + * @return string|double|null */ public function getElem(int $index) {} diff --git a/ext/oci8/oci8_arginfo.h b/ext/oci8/oci8_arginfo.h index 5b246c5e56614..a61394eee6657 100644 --- a/ext/oci8/oci8_arginfo.h +++ b/ext/oci8/oci8_arginfo.h @@ -443,7 +443,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_register_taf_callback, 0, 2, _IS_BOOL, 0) ZEND_ARG_INFO(0, connection_resource) - ZEND_ARG_TYPE_INFO(0, function_name, IS_MIXED, 0) + ZEND_ARG_INFO(0, function_name) ZEND_END_ARG_INFO() #define arginfo_oci_unregister_taf_callback arginfo_oci_rollback @@ -474,14 +474,14 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_seek, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, whence, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, whence, IS_LONG, 0, "OCI_SEEK_SET") ZEND_END_ARG_INFO() #define arginfo_class_OCI_Lob_size arginfo_class_OCI_Lob_load ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_write, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_append, 0, 0, 1) @@ -493,8 +493,8 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_truncate, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_erase, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "-1") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "-1") + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_OCI_Lob_flush, 0, 0, _IS_BOOL, 0) @@ -509,8 +509,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_OCI_Lob_writetofile, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, start, IS_LONG, 0, "-1") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "-1") + ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_class_OCI_Lob_export arginfo_class_OCI_Lob_writetofile diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c index 87ff646d8b903..a82251443220e 100644 --- a/ext/oci8/oci8_interface.c +++ b/ext/oci8/oci8_interface.c @@ -2099,8 +2099,8 @@ PHP_FUNCTION(oci_result) Return a string containing runtime client library version information */ PHP_FUNCTION(oci_client_version) { - ZEND_PARSE_PARAMETERS_NONE(); char version[256]; + ZEND_PARSE_PARAMETERS_NONE(); php_oci_client_get_version(version, sizeof(version)); RETURN_STRING(version); From fcabd58aa7d0ecf5f4f87f76272741e8eff76e8f Mon Sep 17 00:00:00 2001 From: Jens de Nies Date: Wed, 24 Jun 2020 23:12:13 +0200 Subject: [PATCH 09/11] Fixes. --- ext/oci8/oci8.stub.php | 4 ++-- ext/oci8/oci8_arginfo.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/oci8/oci8.stub.php b/ext/oci8/oci8.stub.php index 11cb246495a3f..499d39b30ccf5 100644 --- a/ext/oci8/oci8.stub.php +++ b/ext/oci8/oci8.stub.php @@ -98,13 +98,13 @@ function oci_lob_copy(OCI_Lob $lob_descriptor_to, OCI_Lob $lob_descriptor_from, function oci_lob_is_equal(OCI_Lob $lob_descriptor_first, OCI_Lob $lob_descriptor_second): bool {} -function oci_lob_export(OCI_Lob $lob_descriptor, $path, int $start = UNKNOWN, int $length = UNKNOWN): bool {} +function oci_lob_export(OCI_Lob $lob_descriptor, string $path, int $start = UNKNOWN, int $length = UNKNOWN): bool {} /** * @alias oci_lob_export * @deprecated */ -function ociwritelobtofile(OCI_Lob $lob_descriptor, $path, int $start = UNKNOWN, int $length = UNKNOWN): bool {} +function ociwritelobtofile(OCI_Lob $lob_descriptor, string $path, int $start = UNKNOWN, int $length = UNKNOWN): bool {} /** * @param resource $connection_resource diff --git a/ext/oci8/oci8_arginfo.h b/ext/oci8/oci8_arginfo.h index a61394eee6657..2d3b6c7c572ba 100644 --- a/ext/oci8/oci8_arginfo.h +++ b/ext/oci8/oci8_arginfo.h @@ -123,7 +123,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_lob_export, 0, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, lob_descriptor, OCI_Lob, 0) - ZEND_ARG_INFO(0, path) + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() From 9e5ca8738cde73a88f5be6ea7cac11ec8fd043ef Mon Sep 17 00:00:00 2001 From: Jens de Nies Date: Thu, 2 Jul 2020 20:57:23 +0200 Subject: [PATCH 10/11] Fixes. --- ext/oci8/oci8.stub.php | 10 +++++----- ext/oci8/oci8_arginfo.h | 11 +++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/ext/oci8/oci8.stub.php b/ext/oci8/oci8.stub.php index 499d39b30ccf5..e3ef6fb3cc6b9 100644 --- a/ext/oci8/oci8.stub.php +++ b/ext/oci8/oci8.stub.php @@ -393,7 +393,7 @@ function oci_error($connection_or_statement_resource = UNKNOWN): array|false {} * @alias oci_error * @deprecated */ -function ocierror($connection_or_statement_resource = null): array|false {} +function ocierror($connection_or_statement_resource = UNKNOWN): array|false {} /** * @param resource $statement_resource @@ -437,7 +437,7 @@ function oci_set_prefetch($statement_resource, int $number_of_rows): ?bool {} * @alias oci_set_prefetch * @deprecated */ -function ocisetprefetch($statement_resource, int $number_of_rows): bool {} +function ocisetprefetch($statement_resource, int $number_of_rows): ?bool {} /** * @param resource $connection_resource @@ -565,13 +565,13 @@ function oci_collection_append(OCI_Collection $collection, string $value): bool */ function ocicollappend(OCI_Collection $collection, string $value): bool {} -function oci_collection_element_get(OCI_Collection $collection, int $index): string|double|null {} +function oci_collection_element_get(OCI_Collection $collection, int $index): string|float|null|false {} /** * @alias oci_collection_element_get * @deprecated */ -function ocicollgetelem(OCI_Collection $collection, int $index): string|double|null {} +function ocicollgetelem(OCI_Collection $collection, int $index): string|float|null|false {} function oci_collection_assign(OCI_Collection $collection_to, OCI_Collection $collection_from): bool {} @@ -779,7 +779,7 @@ public function append(string $value) {} /** * @alias oci_collection_element_get - * @return string|double|null + * @return string|float|null|false */ public function getElem(int $index) {} diff --git a/ext/oci8/oci8_arginfo.h b/ext/oci8/oci8_arginfo.h index 2d3b6c7c572ba..2bfabeeb9093f 100644 --- a/ext/oci8/oci8_arginfo.h +++ b/ext/oci8/oci8_arginfo.h @@ -278,9 +278,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_error, 0, 0, MAY_BE_ARRAY|MA ZEND_ARG_INFO(0, connection_or_statement_resource) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ocierror, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, connection_or_statement_resource, "null") -ZEND_END_ARG_INFO() +#define arginfo_ocierror arginfo_oci_error ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_num_fields, 0, 1, IS_LONG, 0) ZEND_ARG_INFO(0, statement_resource) @@ -304,10 +302,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_set_prefetch, 0, 2, _IS_BOOL ZEND_ARG_TYPE_INFO(0, number_of_rows, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ocisetprefetch, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, statement_resource) - ZEND_ARG_TYPE_INFO(0, number_of_rows, IS_LONG, 0) -ZEND_END_ARG_INFO() +#define arginfo_ocisetprefetch arginfo_oci_set_prefetch ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_set_client_identifier, 0, 2, _IS_BOOL, 0) ZEND_ARG_INFO(0, connection_resource) @@ -396,7 +391,7 @@ ZEND_END_ARG_INFO() #define arginfo_ocicollappend arginfo_oci_collection_append -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_oci_collection_element_get, 0, 2, double, MAY_BE_STRING|MAY_BE_NULL) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_oci_collection_element_get, 0, 2, MAY_BE_STRING|MAY_BE_DOUBLE|MAY_BE_NULL|MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, collection, OCI_Collection, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() From 7c81f38e747ed3b72e63febb1caefb2b6a0a30bd Mon Sep 17 00:00:00 2001 From: Jens de Nies Date: Fri, 3 Jul 2020 21:07:38 +0200 Subject: [PATCH 11/11] Fixes. --- ext/oci8/oci8_arginfo.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/oci8/oci8_arginfo.h b/ext/oci8/oci8_arginfo.h index 2bfabeeb9093f..334e9d672c512 100644 --- a/ext/oci8/oci8_arginfo.h +++ b/ext/oci8/oci8_arginfo.h @@ -1,4 +1,5 @@ -/* This is a generated file, edit the .stub.php file instead. */ +/* This is a generated file, edit the .stub.php file instead. + * Stub hash: 9b7f698c1f9f099a392760d85d2bb85e17846f13 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_define_by_name, 0, 3, _IS_BOOL, 0) ZEND_ARG_INFO(0, statement_resource)