diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 89aafde7ee395..3a43f837ae844 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -122,772 +122,15 @@ 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() -/* }}} */ - -/* {{{ 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); -/* }}} */ +#include "oci8_arginfo.h" /* {{{ 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_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_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_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 */ @@ -1047,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 new file mode 100644 index 0000000000000..e3ef6fb3cc6b9 --- /dev/null +++ b/ext/oci8/oci8.stub.php @@ -0,0 +1,815 @@ + 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))); @@ -2092,6 +2100,7 @@ PHP_FUNCTION(oci_result) PHP_FUNCTION(oci_client_version) { char version[256]; + ZEND_PARSE_PARAMETERS_NONE(); php_oci_client_get_version(version, sizeof(version)); RETURN_STRING(version); diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index 9eb0f15efb13e..c64fb35083f24 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; + zend_long column_index_int; + 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; } }