#define SQLT_CFILEE 115
#endif
-#if ZEND_MODULE_API_NO > 20020429
-#define ONUPDATELONGFUNC OnUpdateLong
-#else
-#define ONUPDATELONGFUNC OnUpdateInt
-#endif
-
#ifdef ZTS
#define PHP_OCI_INIT_MODE (OCI_DEFAULT | OCI_OBJECT | OCI_THREADED | OCI_NO_MUTEX)
#else
#endif /* COMPILE_DL */
/* }}} */
-#if defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3)
-
/* {{{ Function arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_define_by_name, 0, 0, 3)
ZEND_ARG_INFO(0, statement_resource)
ZEND_END_ARG_INFO()
/* }}} */
-#else /* defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3) */
-/* {{{ Keep the old arginfo behavior when building with PHP 4 */
-
-static unsigned char arginfo_ocifetchinto[] = { 2, BYREF_NONE, BYREF_FORCE };
-static unsigned char arginfo_oci_fetch_all[] = { 2, BYREF_NONE, BYREF_FORCE };
-static unsigned char arginfo_oci_define_by_name[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
-static unsigned char arginfo_oci_bind_by_name[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
-static unsigned char arginfo_oci_bind_array_by_name[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
-
-#define arginfo_oci_free_descriptor NULL
-#define arginfo_oci_lob_save NULL
-#define arginfo_oci_lob_import NULL
-#define arginfo_oci_lob_load NULL
-#define arginfo_oci_lob_read NULL
-#define arginfo_oci_lob_eof NULL
-#define arginfo_oci_lob_tell NULL
-#define arginfo_oci_lob_rewind NULL
-#define arginfo_oci_lob_seek NULL
-#define arginfo_oci_lob_size NULL
-#define arginfo_oci_lob_write NULL
-#define arginfo_oci_lob_append NULL
-#define arginfo_oci_lob_truncate NULL
-#define arginfo_oci_lob_erase NULL
-#define arginfo_oci_lob_flush NULL
-#define arginfo_ocisetbufferinglob NULL
-#define arginfo_ocigetbufferinglob NULL
-#define arginfo_oci_lob_copy NULL
-#define arginfo_oci_lob_is_equal NULL
-#define arginfo_oci_lob_export NULL
-#define arginfo_oci_new_descriptor NULL
-#define arginfo_oci_rollback NULL
-#define arginfo_oci_commit NULL
-#define arginfo_oci_field_name NULL
-#define arginfo_oci_field_size NULL
-#define arginfo_oci_field_scale NULL
-#define arginfo_oci_field_precision NULL
-#define arginfo_oci_field_type NULL
-#define arginfo_oci_field_type_raw NULL
-#define arginfo_oci_field_is_null NULL
-#define arginfo_oci_internal_debug NULL
-#define arginfo_oci_execute NULL
-#define arginfo_oci_cancel NULL
-#define arginfo_oci_fetch NULL
-#define arginfo_oci_fetch_object NULL
-#define arginfo_oci_fetch_row NULL
-#define arginfo_oci_fetch_assoc NULL
-#define arginfo_oci_fetch_array NULL
-#define arginfo_oci_free_statement NULL
-#define arginfo_oci_close NULL
-#define arginfo_oci_new_connect NULL
-#define arginfo_oci_connect NULL
-#define arginfo_oci_pconnect NULL
-#define arginfo_oci_error NULL
-#define arginfo_oci_num_fields NULL
-#define arginfo_oci_parse NULL
-#define arginfo_oci_get_implicit_resultset NULL
-#define arginfo_oci_set_prefetch NULL
-#define arginfo_oci_set_client_identifier NULL
-#define arginfo_oci_set_edition NULL
-#define arginfo_oci_set_module_name NULL
-#define arginfo_oci_set_action NULL
-#define arginfo_oci_set_client_info NULL
-#ifdef WAITIING_ORACLE_BUG_16695981_FIX
-#define arginfo_oci_set_db_operation NULL
-#endif
-#define arginfo_oci_password_change NULL
-#define arginfo_oci_new_cursor NULL
-#define arginfo_oci_result NULL
-#define arginfo_oci_client_version NULL
-#define arginfo_oci_server_version NULL
-#define arginfo_oci_statement_type NULL
-#define arginfo_oci_num_rows NULL
-#define arginfo_oci_free_collection NULL
-#define arginfo_oci_collection_append NULL
-#define arginfo_oci_collection_element_get NULL
-#define arginfo_oci_collection_assign NULL
-#define arginfo_oci_collection_element_assign NULL
-#define arginfo_oci_collection_size NULL
-#define arginfo_oci_collection_max NULL
-#define arginfo_oci_collection_trim NULL
-#define arginfo_oci_new_collection NULL
-#define arginfo_oci_lob_size_method NULL
-#define arginfo_oci_lob_getbuffering_method NULL
-#define arginfo_oci_lob_close_method NULL
-#define arginfo_oci_lob_save_method NULL
-#define arginfo_oci_lob_import_method NULL
-#define arginfo_oci_lob_read_method NULL
-#define arginfo_oci_lob_seek_method NULL
-#define arginfo_oci_lob_write_method NULL
-#define arginfo_oci_lob_append_method NULL
-#define arginfo_oci_lob_truncate_method NULL
-#define arginfo_oci_lob_erase_method NULL
-#define arginfo_oci_lob_flush_method NULL
-#define arginfo_oci_lob_setbuffering_method NULL
-#define arginfo_oci_lob_export_method NULL
-#define arginfo_oci_lob_write_temporary_method NULL
-#define arginfo_oci_lob_load_method NULL
-#define arginfo_oci_lob_tell_method NULL
-#define arginfo_oci_lob_rewind_method NULL
-#define arginfo_oci_lob_eof_method NULL
-#define arginfo_oci_free_descriptor_method NULL
-#define arginfo_oci_collection_append_method NULL
-#define arginfo_oci_collection_element_get_method NULL
-#define arginfo_oci_collection_assign_method NULL
-#define arginfo_oci_collection_size_method NULL
-#define arginfo_oci_collection_element_assign_method NULL
-#define arginfo_oci_collection_max_method NULL
-#define arginfo_oci_collection_trim_method NULL
-#define arginfo_oci_collection_free_method NULL
-/* }}} */
-#endif /* defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3) */
-
/* {{{ extension function prototypes
*/
PHP_FUNCTION(oci_bind_by_name);
/* {{{ extension definition structures
*/
-static
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 2) || (PHP_MAJOR_VERSION > 5)
-/* This "if" allows PECL builds from this file to be portable to older PHP releases */
-const
-#endif
-zend_function_entry php_oci_functions[] = {
+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_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)
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION >= 7) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || (PHP_MAJOR_VERSION > 5)
PHP_FE_END
-#else
- {NULL,NULL,NULL}
-#endif
};
-static
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 2) || (PHP_MAJOR_VERSION > 5)
-/* This "if" allows PECL builds from this file to be portable to older PHP releases */
-const
-#endif
-zend_function_entry php_oci_lob_class_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(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)
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION >= 7) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || (PHP_MAJOR_VERSION > 5)
PHP_FE_END
-#else
- {NULL,NULL,NULL}
-#endif
};
-static
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 2) || (PHP_MAJOR_VERSION > 5)
-/* This "if" allows PECL builds from this file to be portable to older PHP releases */
-const
-#endif
-zend_function_entry php_oci_coll_class_functions[] = {
+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(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)
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION >= 7) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || (PHP_MAJOR_VERSION > 5)
PHP_FE_END
-#else
- {NULL,NULL,NULL}
-#endif
};
zend_module_entry oci8_module_entry = {
/* {{{ PHP_INI */
PHP_INI_BEGIN()
- STD_PHP_INI_ENTRY( "oci8.max_persistent", "-1", PHP_INI_SYSTEM, ONUPDATELONGFUNC, max_persistent, zend_oci_globals, oci_globals)
- STD_PHP_INI_ENTRY( "oci8.persistent_timeout", "-1", PHP_INI_SYSTEM, ONUPDATELONGFUNC, persistent_timeout, zend_oci_globals, oci_globals)
- STD_PHP_INI_ENTRY( "oci8.ping_interval", "60", PHP_INI_SYSTEM, ONUPDATELONGFUNC, ping_interval, zend_oci_globals, oci_globals)
+ STD_PHP_INI_ENTRY( "oci8.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_persistent, zend_oci_globals, oci_globals)
+ STD_PHP_INI_ENTRY( "oci8.persistent_timeout", "-1", PHP_INI_SYSTEM, OnUpdateLong, persistent_timeout, zend_oci_globals, oci_globals)
+ STD_PHP_INI_ENTRY( "oci8.ping_interval", "60", PHP_INI_SYSTEM, OnUpdateLong, ping_interval, zend_oci_globals, oci_globals)
STD_PHP_INI_BOOLEAN("oci8.privileged_connect", "0", PHP_INI_SYSTEM, OnUpdateBool, privileged_connect, zend_oci_globals, oci_globals)
- STD_PHP_INI_ENTRY( "oci8.statement_cache_size", "20", PHP_INI_SYSTEM, ONUPDATELONGFUNC, statement_cache_size, zend_oci_globals, oci_globals)
- STD_PHP_INI_ENTRY( "oci8.default_prefetch", "100", PHP_INI_SYSTEM, ONUPDATELONGFUNC, default_prefetch, zend_oci_globals, oci_globals)
+ STD_PHP_INI_ENTRY( "oci8.statement_cache_size", "20", PHP_INI_SYSTEM, OnUpdateLong, statement_cache_size, zend_oci_globals, oci_globals)
+ STD_PHP_INI_ENTRY( "oci8.default_prefetch", "100", PHP_INI_SYSTEM, OnUpdateLong, default_prefetch, zend_oci_globals, oci_globals)
STD_PHP_INI_BOOLEAN("oci8.old_oci_close_semantics", "0", PHP_INI_SYSTEM, OnUpdateBool, old_oci_close_semantics,zend_oci_globals, oci_globals)
#if (OCI_MAJOR_VERSION >= 11)
STD_PHP_INI_ENTRY( "oci8.connection_class", "", PHP_INI_ALL, OnUpdateString, connection_class, zend_oci_globals, oci_globals)
php_info_print_table_start();
php_info_print_table_header(2, "Statistics", "");
- snprintf(buf, sizeof(buf), "%pd", OCI_G(num_persistent));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, OCI_G(num_persistent));
php_info_print_table_row(2, "Active Persistent Connections", buf);
- snprintf(buf, sizeof(buf), "%pd", OCI_G(num_links));
+ snprintf(buf, sizeof(buf), ZEND_LONG_FMT, OCI_G(num_links));
php_info_print_table_row(2, "Active Connections", buf);
php_info_print_table_end();
}
ub2 charsetid_nls_lang = 0;
if (session_mode & ~(OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) {
- php_error_docref(NULL, E_WARNING, "Invalid session mode specified (%pd)", session_mode);
+ php_error_docref(NULL, E_WARNING, "Invalid session mode specified (" ZEND_LONG_FMT ")", session_mode);
return NULL;
}
if (session_mode & (OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) {
php_error_docref(NULL, E_WARNING, "Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA");
return NULL;
}
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
- /* Safe mode has been removed in PHP 5.4 */
- if (PG(safe_mode)) {
- php_error_docref(NULL, E_WARNING, "Privileged connect is disabled in Safe Mode");
- return NULL;
- }
-#endif
}
}
if (OCI_G(max_persistent) != -1 && OCI_G(num_persistent) >= OCI_G(max_persistent)) {
/* all persistent connactions are in use, fallback to non-persistent connection creation */
- php_error_docref(NULL, E_NOTICE, "Too many open persistent connections (%pd)", OCI_G(num_persistent));
+ php_error_docref(NULL, E_NOTICE, "Too many open persistent connections (" ZEND_LONG_FMT ")", OCI_G(num_persistent));
alloc_non_persistent = 1;
}
}
size_t filename_len;
if (getThis()) {
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
-#else
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) {
-#endif
return;
}
}
else {
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Op", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
-#else
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
-#endif
return;
}
}
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
- /* The "p" parsing parameter handles this case in PHP 5.4+ */
- if (strlen(filename) != filename_len) {
- php_error_docref(NULL, E_WARNING, "Filename cannot contain null bytes");
- RETURN_FALSE;
- }
-#endif
-
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
ub4 lob_length;
if (getThis()) {
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|ll", &filename, &filename_len, &start, &length) == FAILURE) {
-#else
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &filename, &filename_len, &start, &length) == FAILURE) {
-#endif
return;
}
}
}
else {
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Op|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
-#else
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
-#endif
return;
}
}
}
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
- /* The "p" parsing parameter handles this case in PHP 5.4+ */
- if (strlen(filename) != filename_len) {
- php_error_docref(NULL, E_WARNING, "Filename cannot contain null bytes");
- RETURN_FALSE;
- }
-#endif
-
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
RETURN_FALSE;
}
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
- /* Safe mode has been removed in PHP 5.4 */
- if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
- RETURN_FALSE;
- }
-#endif
-
if (php_check_open_basedir(filename)) {
RETURN_FALSE;
}
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
stream = php_stream_open_wrapper_ex(filename, "w", REPORT_ERRORS, NULL, NULL);
-#else
- stream = php_stream_open_wrapper_ex(filename, "w", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL);
-#endif
block_length = PHP_OCI_LOB_BUFFER_SIZE;
if (block_length > length) {
size_t user_len, pass_old_len, pass_new_len, dbname_len;
php_oci_connection *connection;
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
- /* Safe mode has been removed in PHP 5.4 */
- if (PG(safe_mode)) {
- php_error_docref(NULL, E_WARNING, "is disabled in Safe Mode");
- RETURN_FALSE;
- }
-#endif
-
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "rsss", &z_connection, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) {
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);