From: Christopher Jones Date: Wed, 16 Jul 2008 22:16:03 +0000 (+0000) Subject: MFH X-Git-Tag: php-5.3.0alpha1~313 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1c1c98c6205808402aeae66ee58a4b63210a1201;p=php MFH 1. Merged ARG_INFO patch (Felipe) 2. Allow empty username & password so Oracle can do non-password based authentication, i.e. "External Authentication". http://news.php.net/php.internals/37545 [DOC] A new OCI_CRED_EXT flag can be passed as the "session_mode" parameter to oci_connect(), oci_new_connect() and oci_pconnect(). $c1 = oci_connect("/", "", $db, null, OCI_CRED_EXT); This tells Oracle to do external or OS authentication, if configured in the database. OCI_CRED_EXT can only be used with username of "/" and a empty password. Oci8.privileged_connection may be On or Off. OCI_CRED_EXT is not supported on Windows for security reasons. The new flag may be combined with the existing OCI_SYSOPER or OCI_SYSDBA modes (note: oci8.privileged_connection needs to be On for OCI_SYSDBA and OCI_SYSOPER), e.g.: $c1 = oci_connect("/", "", $db, null, OCI_CRED_EXT+OCI_SYSOPER); --- diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 7d21b34de3..935e62425e 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -112,20 +112,416 @@ ZEND_GET_MODULE(oci8) #endif /* COMPILE_DL */ /* }}} */ -#ifdef ZEND_ENGINE_2 -ZEND_BEGIN_ARG_INFO(oci_second_arg_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) +/* {{{ arginfo */ +static +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(oci_third_arg_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) + +static +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() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_free_descriptor, 0, 0, 1) + ZEND_ARG_INFO(0, lob_descriptor) +ZEND_END_ARG_INFO() + +static +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() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_load, 0, 0, 1) + ZEND_ARG_INFO(0, lob_descriptor) +ZEND_END_ARG_INFO() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_eof, 0, 0, 1) + ZEND_ARG_INFO(0, lob_descriptor) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_tell, 0, 0, 1) + ZEND_ARG_INFO(0, lob_descriptor) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_rewind, 0, 0, 1) + ZEND_ARG_INFO(0, lob_descriptor) +ZEND_END_ARG_INFO() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_size, 0, 0, 1) + ZEND_ARG_INFO(0, lob_descriptor) +ZEND_END_ARG_INFO() + +static +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() + +static +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() + +static +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() + +static +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() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_ocisetbufferinglob, 0, 0, 2) + ZEND_ARG_INFO(0, lob_descriptor) + ZEND_ARG_INFO(0, flag) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_ocigetbufferinglob, 0, 0, 1) + ZEND_ARG_INFO(0, lob_descriptor) +ZEND_END_ARG_INFO() + +static +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() + +static +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() + +static +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() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_rollback, 0, 0, 1) + ZEND_ARG_INFO(0, connection_resource) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_commit, 0, 0, 1) + ZEND_ARG_INFO(0, connection_resource) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_name, 0, 0, 2) + ZEND_ARG_INFO(0, statement_resource) + ZEND_ARG_INFO(0, column_number) +ZEND_END_ARG_INFO() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_scale, 0, 0, 2) + ZEND_ARG_INFO(0, statement_resource) + ZEND_ARG_INFO(0, column_number) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_precision, 0, 0, 2) + ZEND_ARG_INFO(0, statement_resource) + ZEND_ARG_INFO(0, column_number) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_field_type, 0, 0, 2) + ZEND_ARG_INFO(0, statement_resource) + ZEND_ARG_INFO(0, column_number) +ZEND_END_ARG_INFO() + +static +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) +ZEND_END_ARG_INFO() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_internal_debug, 0, 0, 1) + ZEND_ARG_INFO(0, mode) +ZEND_END_ARG_INFO() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_cancel, 0, 0, 1) + ZEND_ARG_INFO(0, statement_resource) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_fetch, 0, 0, 1) + ZEND_ARG_INFO(0, statement_resource) +ZEND_END_ARG_INFO() + +static +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() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_fetch_object, 0, 0, 1) + ZEND_ARG_INFO(0, statement_resource) ZEND_END_ARG_INFO() -#else -static unsigned char oci_second_arg_force_ref[] = { 2, BYREF_NONE, BYREF_FORCE }; -static unsigned char oci_third_arg_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; -#endif + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_fetch_row, 0, 0, 1) + ZEND_ARG_INFO(0, statement_resource) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_fetch_assoc, 0, 0, 1) + ZEND_ARG_INFO(0, statement_resource) +ZEND_END_ARG_INFO() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_free_statement, 0, 0, 1) + ZEND_ARG_INFO(0, statement_resource) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_close, 0, 0, 1) + ZEND_ARG_INFO(0, connection_resource) +ZEND_END_ARG_INFO() + +static +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() + +static +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() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_error, 0, 0, 0) + ZEND_ARG_INFO(0, connection_or_statement_resource) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_num_fields, 0, 0, 1) + ZEND_ARG_INFO(0, statement_resource) +ZEND_END_ARG_INFO() + +static +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() + +static +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() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_new_cursor, 0, 0, 1) + ZEND_ARG_INFO(0, connection_resource) +ZEND_END_ARG_INFO() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_server_version, 0, 0, 1) + ZEND_ARG_INFO(0, connection_resource) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_statement_type, 0, 0, 1) + ZEND_ARG_INFO(0, statement_resource) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_num_rows, 0, 0, 1) + ZEND_ARG_INFO(0, statement_resource) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_free_collection, 0, 0, 1) + ZEND_ARG_INFO(0, collection) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_append, 0, 0, ) + ZEND_ARG_INFO(0, collection) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +static +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() + +static +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() + +static +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() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_size, 0, 0, 1) + ZEND_ARG_INFO(0, collection) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_max, 0, 0, 1) + ZEND_ARG_INFO(0, collection) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_trim, 0, 0, 2) + ZEND_ARG_INFO(0, collection) + ZEND_ARG_INFO(0, num) +ZEND_END_ARG_INFO() + +static +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() +/* }}} */ /* {{{ extension function prototypes */ @@ -209,121 +605,121 @@ static const #endif zend_function_entry php_oci_functions[] = { - PHP_FE(oci_define_by_name, oci_third_arg_force_ref) - PHP_FE(oci_bind_by_name, oci_third_arg_force_ref) - PHP_FE(oci_bind_array_by_name, oci_third_arg_force_ref) - PHP_FE(oci_field_is_null, NULL) - PHP_FE(oci_field_name, NULL) - PHP_FE(oci_field_size, NULL) - PHP_FE(oci_field_scale, NULL) - PHP_FE(oci_field_precision, NULL) - PHP_FE(oci_field_type, NULL) - PHP_FE(oci_field_type_raw, NULL) - PHP_FE(oci_execute, NULL) - PHP_FE(oci_cancel, NULL) - PHP_FE(oci_fetch, NULL) - PHP_FE(oci_fetch_object, NULL) - PHP_FE(oci_fetch_row, NULL) - PHP_FE(oci_fetch_assoc, NULL) - PHP_FE(oci_fetch_array, NULL) - PHP_FE(ocifetchinto, oci_second_arg_force_ref) - PHP_FE(oci_fetch_all, oci_second_arg_force_ref) - PHP_FE(oci_free_statement, NULL) - PHP_FE(oci_internal_debug, NULL) - PHP_FE(oci_num_fields, NULL) - PHP_FE(oci_parse, NULL) - PHP_FE(oci_new_cursor, NULL) - PHP_FE(oci_result, NULL) - PHP_FE(oci_server_version, NULL) - PHP_FE(oci_statement_type, NULL) - PHP_FE(oci_num_rows, NULL) - PHP_FE(oci_close, NULL) - PHP_FE(oci_connect, NULL) - PHP_FE(oci_new_connect, NULL) - PHP_FE(oci_pconnect, NULL) - PHP_FE(oci_error, NULL) - PHP_FE(oci_free_descriptor, NULL) - PHP_FE(oci_lob_save, NULL) - PHP_FE(oci_lob_import, NULL) - PHP_FE(oci_lob_size, NULL) - PHP_FE(oci_lob_load, NULL) - PHP_FE(oci_lob_read, NULL) - PHP_FE(oci_lob_eof, NULL) - PHP_FE(oci_lob_tell, NULL) - PHP_FE(oci_lob_truncate, NULL) - PHP_FE(oci_lob_erase, NULL) - PHP_FE(oci_lob_flush, NULL) - PHP_FE(ocisetbufferinglob, NULL) - PHP_FE(ocigetbufferinglob, NULL) - PHP_FE(oci_lob_is_equal, NULL) - PHP_FE(oci_lob_rewind, NULL) - PHP_FE(oci_lob_write, NULL) - PHP_FE(oci_lob_append, NULL) - PHP_FE(oci_lob_copy, NULL) - PHP_FE(oci_lob_export, NULL) - PHP_FE(oci_lob_seek, NULL) - PHP_FE(oci_commit, NULL) - PHP_FE(oci_rollback, NULL) - PHP_FE(oci_new_descriptor, NULL) - PHP_FE(oci_set_prefetch, NULL) - PHP_FE(oci_password_change, NULL) - PHP_FE(oci_free_collection, NULL) - PHP_FE(oci_collection_append, NULL) - PHP_FE(oci_collection_element_get, NULL) - PHP_FE(oci_collection_element_assign, NULL) - PHP_FE(oci_collection_assign, NULL) - PHP_FE(oci_collection_size, NULL) - PHP_FE(oci_collection_max, NULL) - PHP_FE(oci_collection_trim, NULL) - PHP_FE(oci_new_collection, NULL) - - PHP_FALIAS(oci_free_cursor, oci_free_statement, NULL) - PHP_FALIAS(ocifreecursor, oci_free_statement, NULL) - PHP_FALIAS(ocibindbyname, oci_bind_by_name, oci_third_arg_force_ref) - PHP_FALIAS(ocidefinebyname, oci_define_by_name, oci_third_arg_force_ref) - PHP_FALIAS(ocicolumnisnull, oci_field_is_null, NULL) - PHP_FALIAS(ocicolumnname, oci_field_name, NULL) - PHP_FALIAS(ocicolumnsize, oci_field_size, NULL) - PHP_FALIAS(ocicolumnscale, oci_field_scale, NULL) - PHP_FALIAS(ocicolumnprecision, oci_field_precision, NULL) - PHP_FALIAS(ocicolumntype, oci_field_type, NULL) - PHP_FALIAS(ocicolumntyperaw, oci_field_type_raw, NULL) - PHP_FALIAS(ociexecute, oci_execute, NULL) - PHP_FALIAS(ocicancel, oci_cancel, NULL) - PHP_FALIAS(ocifetch, oci_fetch, NULL) - PHP_FALIAS(ocifetchstatement, oci_fetch_all, oci_second_arg_force_ref) - PHP_FALIAS(ocifreestatement, oci_free_statement, NULL) - PHP_FALIAS(ociinternaldebug, oci_internal_debug, NULL) - PHP_FALIAS(ocinumcols, oci_num_fields, NULL) - PHP_FALIAS(ociparse, oci_parse, NULL) - PHP_FALIAS(ocinewcursor, oci_new_cursor, NULL) - PHP_FALIAS(ociresult, oci_result, NULL) - PHP_FALIAS(ociserverversion, oci_server_version, NULL) - PHP_FALIAS(ocistatementtype, oci_statement_type, NULL) - PHP_FALIAS(ocirowcount, oci_num_rows, NULL) - PHP_FALIAS(ocilogoff, oci_close, NULL) - PHP_FALIAS(ocilogon, oci_connect, NULL) - PHP_FALIAS(ocinlogon, oci_new_connect, NULL) - PHP_FALIAS(ociplogon, oci_pconnect, NULL) - PHP_FALIAS(ocierror, oci_error, NULL) - PHP_FALIAS(ocifreedesc, oci_free_descriptor, NULL) - PHP_FALIAS(ocisavelob, oci_lob_save, NULL) - PHP_FALIAS(ocisavelobfile, oci_lob_import, NULL) - PHP_FALIAS(ociwritelobtofile, oci_lob_export, NULL) - PHP_FALIAS(ociloadlob, oci_lob_load, NULL) - PHP_FALIAS(ocicommit, oci_commit, NULL) - PHP_FALIAS(ocirollback, oci_rollback, NULL) - PHP_FALIAS(ocinewdescriptor, oci_new_descriptor, NULL) - PHP_FALIAS(ocisetprefetch, oci_set_prefetch, NULL) - PHP_FALIAS(ocipasswordchange, oci_password_change, NULL) - PHP_FALIAS(ocifreecollection, oci_free_collection, NULL) - PHP_FALIAS(ocinewcollection, oci_new_collection, NULL) - PHP_FALIAS(ocicollappend, oci_collection_append, NULL) - PHP_FALIAS(ocicollgetelem, oci_collection_element_get, NULL) - PHP_FALIAS(ocicollassignelem, oci_collection_element_assign, NULL) - PHP_FALIAS(ocicollsize, oci_collection_size, NULL) - PHP_FALIAS(ocicollmax, oci_collection_max, NULL) - PHP_FALIAS(ocicolltrim, oci_collection_trim, NULL) + 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_new_cursor, arginfo_oci_new_cursor) + PHP_FE(oci_result, arginfo_oci_result) + 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_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_FALIAS(oci_free_cursor, oci_free_statement, arginfo_oci_free_statement) + PHP_FALIAS(ocifreecursor, oci_free_statement, arginfo_oci_free_statement) + PHP_FALIAS(ocibindbyname, oci_bind_by_name, arginfo_oci_bind_by_name) + PHP_FALIAS(ocidefinebyname, oci_define_by_name, arginfo_oci_define_by_name) + PHP_FALIAS(ocicolumnisnull, oci_field_is_null, arginfo_oci_field_is_null) + PHP_FALIAS(ocicolumnname, oci_field_name, arginfo_oci_field_name) + PHP_FALIAS(ocicolumnsize, oci_field_size, arginfo_oci_field_size) + PHP_FALIAS(ocicolumnscale, oci_field_scale, arginfo_oci_field_scale) + PHP_FALIAS(ocicolumnprecision, oci_field_precision, arginfo_oci_field_precision) + PHP_FALIAS(ocicolumntype, oci_field_type, arginfo_oci_field_type) + PHP_FALIAS(ocicolumntyperaw, oci_field_type_raw, arginfo_oci_field_type_raw) + PHP_FALIAS(ociexecute, oci_execute, arginfo_oci_execute) + PHP_FALIAS(ocicancel, oci_cancel, arginfo_oci_cancel) + PHP_FALIAS(ocifetch, oci_fetch, arginfo_oci_fetch) + PHP_FALIAS(ocifetchstatement, oci_fetch_all, arginfo_oci_fetch_all) + PHP_FALIAS(ocifreestatement, oci_free_statement, arginfo_oci_free_statement) + PHP_FALIAS(ociinternaldebug, oci_internal_debug, arginfo_oci_internal_debug) + PHP_FALIAS(ocinumcols, oci_num_fields, arginfo_oci_num_fields) + PHP_FALIAS(ociparse, oci_parse, arginfo_oci_parse) + PHP_FALIAS(ocinewcursor, oci_new_cursor, arginfo_oci_new_cursor) + PHP_FALIAS(ociresult, oci_result, arginfo_oci_result) + PHP_FALIAS(ociserverversion, oci_server_version, arginfo_oci_server_version) + PHP_FALIAS(ocistatementtype, oci_statement_type, arginfo_oci_statement_type) + PHP_FALIAS(ocirowcount, oci_num_rows, arginfo_oci_num_rows) + PHP_FALIAS(ocilogoff, oci_close, arginfo_oci_close) + PHP_FALIAS(ocilogon, oci_connect, arginfo_oci_connect) + PHP_FALIAS(ocinlogon, oci_new_connect, arginfo_oci_new_connect) + PHP_FALIAS(ociplogon, oci_pconnect, arginfo_oci_pconnect) + PHP_FALIAS(ocierror, oci_error, arginfo_oci_error) + PHP_FALIAS(ocifreedesc, oci_free_descriptor, arginfo_oci_free_descriptor) + PHP_FALIAS(ocisavelob, oci_lob_save, arginfo_oci_lob_save) + PHP_FALIAS(ocisavelobfile, oci_lob_import, arginfo_oci_lob_import) + PHP_FALIAS(ociwritelobtofile, oci_lob_export, arginfo_oci_lob_export) + PHP_FALIAS(ociloadlob, oci_lob_load, arginfo_oci_lob_load) + PHP_FALIAS(ocicommit, oci_commit, arginfo_oci_commit) + PHP_FALIAS(ocirollback, oci_rollback, arginfo_oci_rollback) + PHP_FALIAS(ocinewdescriptor, oci_new_descriptor, arginfo_oci_new_descriptor) + PHP_FALIAS(ocisetprefetch, oci_set_prefetch, arginfo_oci_set_prefetch) + PHP_FALIAS(ocipasswordchange, oci_password_change, arginfo_oci_password_change) + PHP_FALIAS(ocifreecollection, oci_free_collection, arginfo_oci_free_collection) + PHP_FALIAS(ocinewcollection, oci_new_collection, arginfo_oci_new_collection) + PHP_FALIAS(ocicollappend, oci_collection_append, arginfo_oci_collection_append) + PHP_FALIAS(ocicollgetelem, oci_collection_element_get, arginfo_oci_collection_element_get) + PHP_FALIAS(ocicollassignelem, oci_collection_element_assign, arginfo_oci_collection_element_assign) + PHP_FALIAS(ocicollsize, oci_collection_size, arginfo_oci_collection_size) + PHP_FALIAS(ocicollmax, oci_collection_max, arginfo_oci_collection_max) + PHP_FALIAS(ocicolltrim, oci_collection_trim, arginfo_oci_collection_trim) {NULL,NULL,NULL} }; @@ -533,6 +929,7 @@ PHP_MINIT_FUNCTION(oci) REGISTER_LONG_CONSTANT("OCI_DEFAULT",OCI_DEFAULT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OCI_SYSOPER",OCI_SYSOPER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OCI_SYSDBA",OCI_SYSDBA, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("OCI_CRED_EXT",PHP_OCI_CRED_EXT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OCI_DESCRIBE_ONLY",OCI_DESCRIBE_ONLY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OCI_COMMIT_ON_SUCCESS",OCI_COMMIT_ON_SUCCESS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OCI_EXACT_FETCH",OCI_EXACT_FETCH, CONST_CS | CONST_PERSISTENT); @@ -1083,11 +1480,33 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char ub2 charsetid = 0; ub2 charsetid_nls_lang = 0; - switch (session_mode) { - case OCI_DEFAULT: - break; - case OCI_SYSOPER: - case OCI_SYSDBA: + if (session_mode & ~(OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid session mode specified (%ld)", session_mode); + return NULL; + } + if (session_mode & (OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) { + if ((session_mode & OCI_SYSOPER) && (session_mode & OCI_SYSDBA)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SYSDBA and OCI_SYSOPER cannot be used together"); + return NULL; + } + if (session_mode & PHP_OCI_CRED_EXT) { +#ifdef PHP_WIN32 + /* Disable external authentication on Windows as Impersonation is not yet handled. + * TODO: Re-enable this once OCI provides capability. + */ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "External Authentication is not supported on Windows"); + return NULL; +#endif + if (username_len != 1 || username[0] != '/' || password_len != 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_CRED_EXT can only be used with a username of \"/\" and a NULL password"); + return NULL; + } + } + if (session_mode & (OCI_SYSOPER | OCI_SYSDBA)) { + /* Increase security by not caching privileged oci_pconnect() connections. The + * connection becomes equivalent to oci_connect() or oci_new_connect(). + */ + persistent = 0; if (!OCI_G(privileged_connect)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA"); return NULL; @@ -1099,23 +1518,15 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char php_error_docref(NULL TSRMLS_CC, E_WARNING, "Privileged connect is disabled in Safe Mode"); return NULL; } - - /* Increase security by not caching privileged oci_pconnect() connections. The - * connection becomes equivalent to oci_connect() or oci_new_connect(). - */ - persistent = 0; - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid session mode specified (%ld)", session_mode); - return NULL; - break; + } } - /* We cannot use the new session create logic (OCISessionGet from client-side session pool) when - * privileged connect or password change is attempted. TODO: Remove this once OCI provides - * capability + /* We cannot use the new session create logic (OCISessionGet from + * client-side session pool) when privileged connect or password + * change is attempted or OCI_CRED_EXT mode is specified. + * TODO: Re-enable this when OCI provides support. */ - if ((session_mode == OCI_SYSOPER) || (session_mode == OCI_SYSDBA) || (new_password_len)) { + if ((session_mode & (OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) || (new_password_len)) { use_spool = 0; } @@ -1290,14 +1701,14 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char connection->is_open = 0; connection->used_this_request = 1; - + /* We have to do a hash_del but need to preserve the resource if there is a positive * refcount. Set the data pointer in the list entry to NULL */ if (connection == zend_list_find(connection->rsrc_id, &rsrc_type) && rsrc_type == le_pconnection) { le->ptr = NULL; } - + zend_hash_del(&EG(persistent_list), hashed_details.c, hashed_details.len+1); } else { /* We only remove the hash entry. The resource and the list entry with its pointer @@ -2238,21 +2649,18 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna } /* }}} */ } else { /* start the session {{{ */ - switch (session_mode) { - case OCI_DEFAULT: - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_RDBMS, (ub4) OCI_STMT_CACHE)); - break; - case OCI_SYSDBA: - case OCI_SYSOPER: - default: - if (username_len == 1 && username[0] == '/' && password_len == 0) { - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_EXT, (ub4) session_mode)); - } else { - PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_RDBMS, (ub4) session_mode)); - } - break; + ub4 cred_type = OCI_CRED_RDBMS; + + /* Extract the overloaded session_mode parameter into valid Oracle credential and session mode values */ + if (session_mode & PHP_OCI_CRED_EXT) { + cred_type = OCI_CRED_EXT; + session_mode ^= PHP_OCI_CRED_EXT; } + session_mode |= OCI_STMT_CACHE; + + PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) cred_type, (ub4) session_mode)); + if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); /* OCISessionBegin returns OCI_SUCCESS_WITH_INFO when @@ -2426,7 +2834,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool } while (!(connection->svc)); PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) &statement_cache_size, 0, (ub4) OCI_ATTR_STMTCACHESIZE, OCI_G(err))); - + if (OCI_G(errcode) != OCI_SUCCESS) { php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC); return 1; diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h index 0a1eab2843..1f5aca2905 100644 --- a/ext/oci8/php_oci8_int.h +++ b/ext/oci8/php_oci8_int.h @@ -73,23 +73,33 @@ extern zend_class_entry *oci_coll_class_entry_ptr; #define PHP_OCI_MAX_NAME_LEN 64 #define PHP_OCI_MAX_DATA_SIZE INT_MAX -#define PHP_OCI_PIECE_SIZE (64*1024)-1 +#define PHP_OCI_PIECE_SIZE ((64*1024)-1) #define PHP_OCI_LOB_BUFFER_SIZE 1048576l /* 1Mb seems to be the most reasonable buffer size for LOB reading */ -#define PHP_OCI_ASSOC 1<<0 -#define PHP_OCI_NUM 1<<1 +#define PHP_OCI_ASSOC (1<<0) +#define PHP_OCI_NUM (1<<1) #define PHP_OCI_BOTH (PHP_OCI_ASSOC|PHP_OCI_NUM) -#define PHP_OCI_RETURN_NULLS 1<<2 -#define PHP_OCI_RETURN_LOBS 1<<3 +#define PHP_OCI_RETURN_NULLS (1<<2) +#define PHP_OCI_RETURN_LOBS (1<<3) -#define PHP_OCI_FETCHSTATEMENT_BY_COLUMN 1<<4 -#define PHP_OCI_FETCHSTATEMENT_BY_ROW 1<<5 +#define PHP_OCI_FETCHSTATEMENT_BY_COLUMN (1<<4) +#define PHP_OCI_FETCHSTATEMENT_BY_ROW (1<<5) #define PHP_OCI_FETCHSTATEMENT_BY (PHP_OCI_FETCHSTATEMENT_BY_COLUMN | PHP_OCI_FETCHSTATEMENT_BY_ROW) #define PHP_OCI_LOB_BUFFER_DISABLED 0 -#define PHP_OCI_LOB_BUFFER_ENABLED 1 -#define PHP_OCI_LOB_BUFFER_USED 2 +#define PHP_OCI_LOB_BUFFER_ENABLED 1 +#define PHP_OCI_LOB_BUFFER_USED 2 + +/* The mode parameter for oci_connect() is overloaded and accepts both + * privilege and external authentication flags OR'd together. + * PHP_OCI_CRED_EXT must be distinct from the OCI_xxx privilege + * values. + */ +#define PHP_OCI_CRED_EXT (1<<31) +#if ((PHP_OCI_CRED_EXT == OCI_DEFAULT) || (PHP_OCI_CRED_EXT & (OCI_SYSOPER | OCI_SYSDBA))) +#error Invalid value for PHP_OCI_CRED_EXT +#endif /* }}} */ diff --git a/ext/oci8/tests/extauth_01.phpt b/ext/oci8/tests/extauth_01.phpt new file mode 100644 index 0000000000..850b1385d1 --- /dev/null +++ b/ext/oci8/tests/extauth_01.phpt @@ -0,0 +1,196 @@ +--TEST-- +Test External Authentication errors with oci_connect +--SKIPIF-- + +--INI-- +oci8.privileged_connect=1 +--FILE-- + +===DONE=== + +--EXPECTF-- +Test 1 + +Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d +bool(false) +bool(false) +Test 2 + +Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d +bool(false) +bool(false) +Test 3 + +Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d +bool(false) +bool(false) +Test 4 + +Warning: oci_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d +bool(false) +bool(false) +Test 5 + +Warning: oci_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d +bool(false) +bool(false) +Test 6 + +Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d +bool(false) +bool(false) +Test 7 + +Warning: oci_connect(): ORA-12154: TNS:could not resolve the connect identifier specified in %s on line %d +array(4) { + ["code"]=> + int(12154) + ["message"]=> + string(65) "ORA-12154: %s" + ["offset"]=> + int(0) + ["sqltext"]=> + string(0) "" +} +bool(false) +Test 8 + +Warning: oci_connect(): ORA-12154: TNS:could not resolve the connect identifier specified in %s on line %d +array(4) { + ["code"]=> + int(12154) + ["message"]=> + string(65) "ORA-12154: %s" + ["offset"]=> + int(0) + ["sqltext"]=> + string(0) "" +} +bool(false) +Test 9 + +Warning: oci_connect(): ORA-12154: TNS:could not resolve the connect identifier specified in %s on line %d +array(4) { + ["code"]=> + int(12154) + ["message"]=> + string(65) "ORA-12154: %s" + ["offset"]=> + int(0) + ["sqltext"]=> + string(0) "" +} +bool(false) +Test 10 + +Warning: oci_connect(): ORA-12154: TNS:could not resolve the connect identifier specified in %s on line %d +array(4) { + ["code"]=> + int(12154) + ["message"]=> + string(65) "ORA-12154: %s" + ["offset"]=> + int(0) + ["sqltext"]=> + string(0) "" +} +bool(false) +===DONE=== diff --git a/ext/oci8/tests/extauth_02.phpt b/ext/oci8/tests/extauth_02.phpt new file mode 100644 index 0000000000..df9cb5eb0a --- /dev/null +++ b/ext/oci8/tests/extauth_02.phpt @@ -0,0 +1,196 @@ +--TEST-- +Test External Authentication errors with oci_new_connect +--SKIPIF-- + +--INI-- +oci8.privileged_connect=1 +--FILE-- + +===DONE=== + +--EXPECTF-- +Test 1 + +Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d +bool(false) +bool(false) +Test 2 + +Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d +bool(false) +bool(false) +Test 3 + +Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d +bool(false) +bool(false) +Test 4 + +Warning: oci_new_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d +bool(false) +bool(false) +Test 5 + +Warning: oci_new_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d +bool(false) +bool(false) +Test 6 + +Warning: oci_new_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d +bool(false) +bool(false) +Test 7 + +Warning: oci_new_connect(): ORA-12154: TNS:could not resolve the connect identifier specified in %s on line %d +array(4) { + ["code"]=> + int(12154) + ["message"]=> + string(65) "ORA-12154: %s" + ["offset"]=> + int(0) + ["sqltext"]=> + string(0) "" +} +bool(false) +Test 8 + +Warning: oci_new_connect(): ORA-12154: TNS:could not resolve the connect identifier specified in %s on line %d +array(4) { + ["code"]=> + int(12154) + ["message"]=> + string(65) "ORA-12154: %s" + ["offset"]=> + int(0) + ["sqltext"]=> + string(0) "" +} +bool(false) +Test 9 + +Warning: oci_new_connect(): ORA-12154: TNS:could not resolve the connect identifier specified in %s on line %d +array(4) { + ["code"]=> + int(12154) + ["message"]=> + string(65) "ORA-12154: %s" + ["offset"]=> + int(0) + ["sqltext"]=> + string(0) "" +} +bool(false) +Test 10 + +Warning: oci_new_connect(): ORA-12154: TNS:could not resolve the connect identifier specified in %s on line %d +array(4) { + ["code"]=> + int(12154) + ["message"]=> + string(65) "ORA-12154: %s" + ["offset"]=> + int(0) + ["sqltext"]=> + string(0) "" +} +bool(false) +===DONE=== diff --git a/ext/oci8/tests/extauth_03.phpt b/ext/oci8/tests/extauth_03.phpt new file mode 100644 index 0000000000..5012742326 --- /dev/null +++ b/ext/oci8/tests/extauth_03.phpt @@ -0,0 +1,196 @@ +--TEST-- +Test External Authentication errors with oci_pconnect +--SKIPIF-- + +--INI-- +oci8.privileged_connect=1 +--FILE-- + +===DONE=== + +--EXPECTF-- +Test 1 + +Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d +bool(false) +bool(false) +Test 2 + +Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d +bool(false) +bool(false) +Test 3 + +Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d +bool(false) +bool(false) +Test 4 + +Warning: oci_pconnect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d +bool(false) +bool(false) +Test 5 + +Warning: oci_pconnect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d +bool(false) +bool(false) +Test 6 + +Warning: oci_pconnect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d +bool(false) +bool(false) +Test 7 + +Warning: oci_pconnect(): ORA-12154: TNS:could not resolve the connect identifier specified in %s on line %d +array(4) { + ["code"]=> + int(12154) + ["message"]=> + string(65) "ORA-12154: %s" + ["offset"]=> + int(0) + ["sqltext"]=> + string(0) "" +} +bool(false) +Test 8 + +Warning: oci_pconnect(): ORA-12154: TNS:could not resolve the connect identifier specified in %s on line %d +array(4) { + ["code"]=> + int(12154) + ["message"]=> + string(65) "ORA-12154: %s" + ["offset"]=> + int(0) + ["sqltext"]=> + string(0) "" +} +bool(false) +Test 9 + +Warning: oci_pconnect(): ORA-12154: TNS:could not resolve the connect identifier specified in %s on line %d +array(4) { + ["code"]=> + int(12154) + ["message"]=> + string(65) "ORA-12154: %s" + ["offset"]=> + int(0) + ["sqltext"]=> + string(0) "" +} +bool(false) +Test 10 + +Warning: oci_pconnect(): ORA-12154: TNS:could not resolve the connect identifier specified in %s on line %d +array(4) { + ["code"]=> + int(12154) + ["message"]=> + string(65) "ORA-12154: %s" + ["offset"]=> + int(0) + ["sqltext"]=> + string(0) "" +} +bool(false) +===DONE=== diff --git a/ext/oci8/tests/extauth_04.phpt b/ext/oci8/tests/extauth_04.phpt new file mode 100644 index 0000000000..e502435bb0 --- /dev/null +++ b/ext/oci8/tests/extauth_04.phpt @@ -0,0 +1,56 @@ +--TEST-- +Test External Authentication errors on Windows +--SKIPIF-- + +--FILE-- + +===DONE=== + +--EXPECTF-- +Test 1 +Warning: oci_connect(): External Authentication is not supported on Windows in %s on line %d +bool(false) +bool(false) +Test 2 +Warning: oci_new_connect(): External Authentication is not supported on Windows in %s on line %d +bool(false) +bool(false) +Test 3 +Warning: oci_pconnect(): External Authentication is not supported on Windows in %s on line %d +bool(false) +bool(false) +===DONE=== diff --git a/ext/oci8/tests/reflection1.phpt b/ext/oci8/tests/reflection1.phpt new file mode 100644 index 0000000000..bc291fcd7d --- /dev/null +++ b/ext/oci8/tests/reflection1.phpt @@ -0,0 +1,1052 @@ +--TEST-- +Test OCI8 Reflection +--SKIPIF-- + +--FILE-- + +===DONE=== + +--EXPECTF-- +Function [ function oci_define_by_name ] { + + - Parameters [4] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_name ] + Parameter #2 [ &$variable ] + Parameter #3 [ $type ] + } +} + +Function [ function oci_bind_by_name ] { + + - Parameters [5] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_name ] + Parameter #2 [ &$variable ] + Parameter #3 [ $maximum_length ] + Parameter #4 [ $type ] + } +} + +Function [ function oci_bind_array_by_name ] { + + - Parameters [6] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_name ] + Parameter #2 [ &$variable ] + Parameter #3 [ $maximum_array_length ] + Parameter #4 [ $maximum_item_length ] + Parameter #5 [ $type ] + } +} + +Function [ function oci_field_is_null ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number_or_name ] + } +} + +Function [ function oci_field_name ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number ] + } +} + +Function [ function oci_field_size ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number_or_name ] + } +} + +Function [ function oci_field_scale ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number ] + } +} + +Function [ function oci_field_precision ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number ] + } +} + +Function [ function oci_field_type ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number ] + } +} + +Function [ function oci_field_type_raw ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number ] + } +} + +Function [ function oci_execute ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $mode ] + } +} + +Function [ function oci_cancel ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function oci_fetch ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function oci_fetch_object ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function oci_fetch_row ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function oci_fetch_assoc ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function oci_fetch_array ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $mode ] + } +} + +Function [ function ocifetchinto ] { + + - Parameters [3] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ &$result ] + Parameter #2 [ $mode ] + } +} + +Function [ function oci_fetch_all ] { + + - Parameters [5] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ &$output ] + Parameter #2 [ $skip ] + Parameter #3 [ $maximum_rows ] + Parameter #4 [ $flags ] + } +} + +Function [ function oci_free_statement ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function oci_internal_debug ] { + + - Parameters [1] { + Parameter #0 [ $mode ] + } +} + +Function [ function oci_num_fields ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function oci_parse ] { + + - Parameters [2] { + Parameter #0 [ $connection_resource ] + Parameter #1 [ $sql_text ] + } +} + +Function [ function oci_new_cursor ] { + + - Parameters [1] { + Parameter #0 [ $connection_resource ] + } +} + +Function [ function oci_result ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number_or_name ] + } +} + +Function [ function oci_server_version ] { + + - Parameters [1] { + Parameter #0 [ $connection_resource ] + } +} + +Function [ function oci_statement_type ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function oci_num_rows ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function oci_close ] { + + - Parameters [1] { + Parameter #0 [ $connection_resource ] + } +} + +Function [ function oci_connect ] { + + - Parameters [5] { + Parameter #0 [ $username ] + Parameter #1 [ $password ] + Parameter #2 [ $connection_string ] + Parameter #3 [ $character_set ] + Parameter #4 [ $session_mode ] + } +} + +Function [ function oci_new_connect ] { + + - Parameters [5] { + Parameter #0 [ $username ] + Parameter #1 [ $password ] + Parameter #2 [ $connection_string ] + Parameter #3 [ $character_set ] + Parameter #4 [ $session_mode ] + } +} + +Function [ function oci_pconnect ] { + + - Parameters [5] { + Parameter #0 [ $username ] + Parameter #1 [ $password ] + Parameter #2 [ $connection_string ] + Parameter #3 [ $character_set ] + Parameter #4 [ $session_mode ] + } +} + +Function [ function oci_error ] { + + - Parameters [1] { + Parameter #0 [ $connection_or_statement_resource ] + } +} + +Function [ function oci_free_descriptor ] { + + - Parameters [1] { + Parameter #0 [ $lob_descriptor ] + } +} + +Function [ function oci_lob_save ] { + + - Parameters [3] { + Parameter #0 [ $lob_descriptor ] + Parameter #1 [ $data ] + Parameter #2 [ $offset ] + } +} + +Function [ function oci_lob_import ] { + + - Parameters [2] { + Parameter #0 [ $lob_descriptor ] + Parameter #1 [ $filename ] + } +} + +Function [ function oci_lob_size ] { + + - Parameters [1] { + Parameter #0 [ $lob_descriptor ] + } +} + +Function [ function oci_lob_load ] { + + - Parameters [1] { + Parameter #0 [ $lob_descriptor ] + } +} + +Function [ function oci_lob_read ] { + + - Parameters [2] { + Parameter #0 [ $lob_descriptor ] + Parameter #1 [ $length ] + } +} + +Function [ function oci_lob_eof ] { + + - Parameters [1] { + Parameter #0 [ $lob_descriptor ] + } +} + +Function [ function oci_lob_tell ] { + + - Parameters [1] { + Parameter #0 [ $lob_descriptor ] + } +} + +Function [ function oci_lob_truncate ] { + + - Parameters [2] { + Parameter #0 [ $lob_descriptor ] + Parameter #1 [ $length ] + } +} + +Function [ function oci_lob_erase ] { + + - Parameters [3] { + Parameter #0 [ $lob_descriptor ] + Parameter #1 [ $offset ] + Parameter #2 [ $length ] + } +} + +Function [ function oci_lob_flush ] { + + - Parameters [2] { + Parameter #0 [ $lob_descriptor ] + Parameter #1 [ $flag ] + } +} + +Function [ function ocisetbufferinglob ] { + + - Parameters [2] { + Parameter #0 [ $lob_descriptor ] + Parameter #1 [ $flag ] + } +} + +Function [ function ocigetbufferinglob ] { + + - Parameters [1] { + Parameter #0 [ $lob_descriptor ] + } +} + +Function [ function oci_lob_is_equal ] { + + - Parameters [2] { + Parameter #0 [ $lob_descriptor ] + Parameter #1 [ $lob_descriptor ] + } +} + +Function [ function oci_lob_rewind ] { + + - Parameters [1] { + Parameter #0 [ $lob_descriptor ] + } +} + +Function [ function oci_lob_write ] { + + - Parameters [3] { + Parameter #0 [ $lob_descriptor ] + Parameter #1 [ $string ] + Parameter #2 [ $length ] + } +} + +Function [ function oci_lob_append ] { + + - Parameters [2] { + Parameter #0 [ $lob_descriptor_to ] + Parameter #1 [ $lob_descriptor_from ] + } +} + +Function [ function oci_lob_copy ] { + + - Parameters [3] { + Parameter #0 [ $lob_descriptor_to ] + Parameter #1 [ $lob_descriptor_from ] + Parameter #2 [ $length ] + } +} + +Function [ function oci_lob_export ] { + + - Parameters [4] { + Parameter #0 [ $lob_descriptor ] + Parameter #1 [ $filename ] + Parameter #2 [ $start ] + Parameter #3 [ $length ] + } +} + +Function [ function oci_lob_seek ] { + + - Parameters [3] { + Parameter #0 [ $lob_descriptor ] + Parameter #1 [ $offset ] + Parameter #2 [ $whence ] + } +} + +Function [ function oci_commit ] { + + - Parameters [1] { + Parameter #0 [ $connection_resource ] + } +} + +Function [ function oci_rollback ] { + + - Parameters [1] { + Parameter #0 [ $connection_resource ] + } +} + +Function [ function oci_new_descriptor ] { + + - Parameters [2] { + Parameter #0 [ $connection_resource ] + Parameter #1 [ $type ] + } +} + +Function [ function oci_set_prefetch ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $number_of_rows ] + } +} + +Function [ function oci_password_change ] { + + - Parameters [4] { + Parameter #0 [ $connection_resource_or_connection_string ] + Parameter #1 [ $username ] + Parameter #2 [ $old_password ] + Parameter #3 [ $new_password ] + } +} + +Function [ function oci_free_collection ] { + + - Parameters [1] { + Parameter #0 [ $collection ] + } +} + +Function [ function oci_collection_append ] { + + - Parameters [2] { + Parameter #0 [ $collection ] + Parameter #1 [ $value ] + } +} + +Function [ function oci_collection_element_get ] { + + - Parameters [2] { + Parameter #0 [ $collection ] + Parameter #1 [ $index ] + } +} + +Function [ function oci_collection_element_assign ] { + + - Parameters [3] { + Parameter #0 [ $collection ] + Parameter #1 [ $index ] + Parameter #2 [ $value ] + } +} + +Function [ function oci_collection_assign ] { + + - Parameters [2] { + Parameter #0 [ $collection_to ] + Parameter #1 [ $collection_from ] + } +} + +Function [ function oci_collection_size ] { + + - Parameters [1] { + Parameter #0 [ $collection ] + } +} + +Function [ function oci_collection_max ] { + + - Parameters [1] { + Parameter #0 [ $collection ] + } +} + +Function [ function oci_collection_trim ] { + + - Parameters [2] { + Parameter #0 [ $collection ] + Parameter #1 [ $num ] + } +} + +Function [ function oci_new_collection ] { + + - Parameters [3] { + Parameter #0 [ $connection_resource ] + Parameter #1 [ $type_name ] + Parameter #2 [ $schema_name ] + } +} + +Function [ function oci_free_cursor ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function ocifreecursor ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function ocibindbyname ] { + + - Parameters [5] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_name ] + Parameter #2 [ &$variable ] + Parameter #3 [ $maximum_length ] + Parameter #4 [ $type ] + } +} + +Function [ function ocidefinebyname ] { + + - Parameters [4] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_name ] + Parameter #2 [ &$variable ] + Parameter #3 [ $type ] + } +} + +Function [ function ocicolumnisnull ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number_or_name ] + } +} + +Function [ function ocicolumnname ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number ] + } +} + +Function [ function ocicolumnsize ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number_or_name ] + } +} + +Function [ function ocicolumnscale ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number ] + } +} + +Function [ function ocicolumnprecision ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number ] + } +} + +Function [ function ocicolumntype ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number ] + } +} + +Function [ function ocicolumntyperaw ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number ] + } +} + +Function [ function ociexecute ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $mode ] + } +} + +Function [ function ocicancel ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function ocifetch ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function ocifetchstatement ] { + + - Parameters [5] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ &$output ] + Parameter #2 [ $skip ] + Parameter #3 [ $maximum_rows ] + Parameter #4 [ $flags ] + } +} + +Function [ function ocifreestatement ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function ociinternaldebug ] { + + - Parameters [1] { + Parameter #0 [ $mode ] + } +} + +Function [ function ocinumcols ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function ociparse ] { + + - Parameters [2] { + Parameter #0 [ $connection_resource ] + Parameter #1 [ $sql_text ] + } +} + +Function [ function ocinewcursor ] { + + - Parameters [1] { + Parameter #0 [ $connection_resource ] + } +} + +Function [ function ociresult ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $column_number_or_name ] + } +} + +Function [ function ociserverversion ] { + + - Parameters [1] { + Parameter #0 [ $connection_resource ] + } +} + +Function [ function ocistatementtype ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function ocirowcount ] { + + - Parameters [1] { + Parameter #0 [ $statement_resource ] + } +} + +Function [ function ocilogoff ] { + + - Parameters [1] { + Parameter #0 [ $connection_resource ] + } +} + +Function [ function ocilogon ] { + + - Parameters [5] { + Parameter #0 [ $username ] + Parameter #1 [ $password ] + Parameter #2 [ $connection_string ] + Parameter #3 [ $character_set ] + Parameter #4 [ $session_mode ] + } +} + +Function [ function ocinlogon ] { + + - Parameters [5] { + Parameter #0 [ $username ] + Parameter #1 [ $password ] + Parameter #2 [ $connection_string ] + Parameter #3 [ $character_set ] + Parameter #4 [ $session_mode ] + } +} + +Function [ function ociplogon ] { + + - Parameters [5] { + Parameter #0 [ $username ] + Parameter #1 [ $password ] + Parameter #2 [ $connection_string ] + Parameter #3 [ $character_set ] + Parameter #4 [ $session_mode ] + } +} + +Function [ function ocierror ] { + + - Parameters [1] { + Parameter #0 [ $connection_or_statement_resource ] + } +} + +Function [ function ocifreedesc ] { + + - Parameters [1] { + Parameter #0 [ $lob_descriptor ] + } +} + +Function [ function ocisavelob ] { + + - Parameters [3] { + Parameter #0 [ $lob_descriptor ] + Parameter #1 [ $data ] + Parameter #2 [ $offset ] + } +} + +Function [ function ocisavelobfile ] { + + - Parameters [2] { + Parameter #0 [ $lob_descriptor ] + Parameter #1 [ $filename ] + } +} + +Function [ function ociwritelobtofile ] { + + - Parameters [4] { + Parameter #0 [ $lob_descriptor ] + Parameter #1 [ $filename ] + Parameter #2 [ $start ] + Parameter #3 [ $length ] + } +} + +Function [ function ociloadlob ] { + + - Parameters [1] { + Parameter #0 [ $lob_descriptor ] + } +} + +Function [ function ocicommit ] { + + - Parameters [1] { + Parameter #0 [ $connection_resource ] + } +} + +Function [ function ocirollback ] { + + - Parameters [1] { + Parameter #0 [ $connection_resource ] + } +} + +Function [ function ocinewdescriptor ] { + + - Parameters [2] { + Parameter #0 [ $connection_resource ] + Parameter #1 [ $type ] + } +} + +Function [ function ocisetprefetch ] { + + - Parameters [2] { + Parameter #0 [ $statement_resource ] + Parameter #1 [ $number_of_rows ] + } +} + +Function [ function ocipasswordchange ] { + + - Parameters [4] { + Parameter #0 [ $connection_resource_or_connection_string ] + Parameter #1 [ $username ] + Parameter #2 [ $old_password ] + Parameter #3 [ $new_password ] + } +} + +Function [ function ocifreecollection ] { + + - Parameters [1] { + Parameter #0 [ $collection ] + } +} + +Function [ function ocinewcollection ] { + + - Parameters [3] { + Parameter #0 [ $connection_resource ] + Parameter #1 [ $type_name ] + Parameter #2 [ $schema_name ] + } +} + +Function [ function ocicollappend ] { + + - Parameters [2] { + Parameter #0 [ $collection ] + Parameter #1 [ $value ] + } +} + +Function [ function ocicollgetelem ] { + + - Parameters [2] { + Parameter #0 [ $collection ] + Parameter #1 [ $index ] + } +} + +Function [ function ocicollassignelem ] { + + - Parameters [3] { + Parameter #0 [ $collection ] + Parameter #1 [ $index ] + Parameter #2 [ $value ] + } +} + +Function [ function ocicollsize ] { + + - Parameters [1] { + Parameter #0 [ $collection ] + } +} + +Function [ function ocicollmax ] { + + - Parameters [1] { + Parameter #0 [ $collection ] + } +} + +Function [ function ocicolltrim ] { + + - Parameters [2] { + Parameter #0 [ $collection ] + Parameter #1 [ $num ] + } +} + +===DONE===