#include "php_ini.h"
#include "zend_smart_str.h"
-#if HAVE_OCI8
+#ifdef HAVE_OCI8
/* PHP 5.2 is the minimum supported version for OCI8 2.0 */
#if PHP_MAJOR_VERSION < 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION <= 1)
/* add to the appropriate hash */
if (connection->is_persistent) {
-#if PHP_VERSION_ID < 70300
- new_le.ptr = connection;
- new_le.type = le_pconnection;
-#endif
connection->used_this_request = 1;
PHP_OCI_REGISTER_RESOURCE(connection, le_pconnection);
if (OCI_G(old_oci_close_semantics)) {
GC_ADDREF(connection->id);
}
-#if PHP_VERSION_ID < 70300
- zend_hash_update_mem(&EG(persistent_list), connection->hash_key, (void *)&new_le, sizeof(zend_resource));
-#else
zend_register_persistent_resource_ex(connection->hash_key, connection, le_pconnection);
-#endif
OCI_G(num_persistent)++;
OCI_G(num_links)++;
} else if (!exclusive) {
{
smart_str spool_hashed_details = {0};
php_oci_spool *session_pool = NULL;
-#if PHP_VERSION_ID < 70300
- zend_resource spool_le = {{0}};
-#endif
zend_resource *spool_out_le = NULL;
zend_bool iserror = 0;
zval *spool_out_zv = NULL;
iserror = 1;
goto exit_get_spool;
}
-#if PHP_VERSION_ID < 70300
- spool_le.ptr = session_pool;
- spool_le.type = le_psessionpool;
- PHP_OCI_REGISTER_RESOURCE(session_pool, le_psessionpool);
- zend_hash_update_mem(&EG(persistent_list), session_pool->spool_hash_key, (void *)&spool_le, sizeof(zend_resource));
-#else
zend_register_persistent_resource_ex(session_pool->spool_hash_key, session_pool, le_psessionpool);
-#endif
} else if (spool_out_le->type == le_psessionpool &&
ZSTR_LEN(((php_oci_spool *)(spool_out_le->ptr))->spool_hash_key) == ZSTR_LEN(spool_hashed_details.s) &&
memcmp(ZSTR_VAL(((php_oci_spool *)(spool_out_le->ptr))->spool_hash_key), ZSTR_VAL(spool_hashed_details.s), ZSTR_LEN(spool_hashed_details.s)) == 0) {
#include "ext/standard/info.h"
#include "php_ini.h"
-#if HAVE_OCI8
+#ifdef HAVE_OCI8
#include "php_oci8.h"
#include "php_oci8_int.h"
collection->connection = connection;
collection->collection = NULL;
-#if PHP_VERSION_ID < 70300
- ++GC_REFCOUNT(collection->connection->id);
-#else
GC_ADDREF(collection->connection->id);
-#endif
/* get type handle by name */
PHP_OCI_CALL_RETURN(errstatus, OCITypeByName,
#include "ext/standard/info.h"
#include "php_ini.h"
-#if HAVE_OCI8
+#ifdef HAVE_OCI8
#include "php_oci8.h"
#include "php_oci8_int.h"
#include "ext/standard/info.h"
#include "php_ini.h"
-#if HAVE_OCI8
+#ifdef HAVE_OCI8
#include "php_oci8.h"
#include "php_oci8_int.h"
zval *callback;
zend_string *callback_name;
+ /* TODO Use ZPP callable */
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z!", &z_connection, &callback) == FAILURE) {
RETURN_THROWS();
}
if (callback) {
-#if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 2)
if (!zend_is_callable(callback, 0, 0)) {
callback_name = zend_get_callable_name(callback);
php_error_docref(NULL, E_WARNING, "Function '%s' is not callable", ZSTR_VAL(callback_name));
-#if PHP_VERSION_ID < 70300
zend_string_release(callback_name);
-#else
- zend_string_release_ex(callback_name, 0);
-#endif
- RETURN_FALSE;
- }
-#else
- if (!zend_is_callable(callback, 0, &callback_name)) {
- php_error_docref(NULL, E_WARNING, "Function '%s' is not callable", ZSTR_VAL(callback_name));
-#if PHP_VERSION_ID < 70300
- zend_string_release(callback_name);
-#else
- zend_string_release_ex(callback_name, 0);
-#endif
RETURN_FALSE;
}
-#if PHP_VERSION_ID < 70300
- zend_string_release(callback_name);
-#else
- zend_string_release_ex(callback_name, 0);
-#endif
-#endif
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
/* if (zend_hash_add(statement->defines, name, name_len, define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) { */
zvtmp = zend_string_init(name, name_len, 0);
if ((define = zend_hash_add_new_ptr(statement->defines, zvtmp, define)) != NULL) {
-#if PHP_VERSION_ID < 70300
- zend_string_release(zvtmp);
-#else
zend_string_release_ex(zvtmp, 0);
-#endif
} else {
efree(define);
-#if PHP_VERSION_ID < 70300
- zend_string_release(zvtmp);
-#else
zend_string_release_ex(zvtmp, 0);
-#endif
RETURN_FALSE;
}
zend_string *zvtmp;
zvtmp = zend_string_init(columns[ i ]->name, columns[ i ]->name_len, 0);
zend_symtable_update(Z_ARRVAL(row), zvtmp, &element);
-#if PHP_VERSION_ID < 70300
- zend_string_release(zvtmp);
-#else
zend_string_release_ex(zvtmp, 0);
-#endif
}
}
array_init(&tmp);
zvtmp = zend_string_init(columns[ i ]->name, columns[ i ]->name_len, 0);
outarrs[ i ] = zend_symtable_update(Z_ARRVAL_P(array), zvtmp, &tmp);
-#if PHP_VERSION_ID < 70300
- zend_string_release(zvtmp);
-#else
zend_string_release_ex(zvtmp, 0);
-#endif
}
}
#include "ext/standard/info.h"
#include "php_ini.h"
-#if HAVE_OCI8
+#ifdef HAVE_OCI8
#include "php_oci8.h"
#include "php_oci8_int.h"
#include "ext/standard/info.h"
#include "php_ini.h"
-#if HAVE_OCI8
+#ifdef HAVE_OCI8
#include "php_oci8.h"
#include "php_oci8_int.h"
* binds, php_oci_bind_out_callback() should have allocated a
* new string that we can modify here.
*/
-#if PHP_VERSION_ID < 70300
- SEPARATE_STRING(zv);
- Z_STR_P(zv) = zend_string_extend(Z_STR_P(zv), Z_STRLEN_P(zv)+1, 0);
-#else
ZVAL_NEW_STR(zv, zend_string_extend(Z_STR_P(zv), Z_STRLEN_P(zv)+1, 0));
-#endif
Z_STRVAL_P(zv)[ Z_STRLEN_P(zv) ] = '\0';
} else if (Z_TYPE_P(zv) == IS_ARRAY) {
int i;
zvtmp = zend_string_init(name, name_len, 0);
bindp = (php_oci_bind *) ecalloc(1, sizeof(php_oci_bind));
bindp = zend_hash_update_ptr(statement->binds, zvtmp, bindp);
-#if PHP_VERSION_ID < 70300
- zend_string_release(zvtmp);
-#else
zend_string_release_ex(zvtmp, 0);
-#endif
}
/* Make sure the minimum of value_sz is 1 to avoid ORA-3149
zvtmp = zend_string_init(name, name_len, 0);
zend_hash_update_ptr(statement->binds, zvtmp, bind);
-#if PHP_VERSION_ID < 70300
- zend_string_release(zvtmp);
-#else
zend_string_release_ex(zvtmp, 0);
-#endif
statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */
return 0;
+----------------------------------------------------------------------+
*/
-#if HAVE_OCI8
+#ifdef HAVE_OCI8
# ifndef PHP_OCI8_H
# define PHP_OCI8_H
+----------------------------------------------------------------------+
*/
-#if HAVE_OCI8
+#ifdef HAVE_OCI8
# ifndef PHP_OCI8_INT_H
# define PHP_OCI8_INT_H