@@ -1454,8 +1454,13 @@ void php_oci_column_hash_dtor(zval *data)
1454
1454
if (column -> descid ) {
1455
1455
if (GC_REFCOUNT (column -> descid ) == 1 )
1456
1456
zend_list_close (column -> descid );
1457
- else
1457
+ else {
1458
+ #if PHP_VERSION_ID < 70300
1458
1459
GC_REFCOUNT (column -> descid )-- ;
1460
+ #else
1461
+ GC_DELREF (column -> descid );
1462
+ #endif
1463
+ }
1459
1464
}
1460
1465
1461
1466
if (column -> data ) {
@@ -1536,7 +1541,7 @@ sb4 php_oci_error(OCIError *err_p, sword errstatus)
1536
1541
case OCI_ERROR :
1537
1542
errcode = php_oci_fetch_errmsg (err_p , errbuf , sizeof (errbuf ));
1538
1543
if (errcode ) {
1539
- php_error_docref (NULL , E_WARNING , "%s" , errbuf , sizeof ( errbuf ) );
1544
+ php_error_docref (NULL , E_WARNING , "%s" , errbuf );
1540
1545
} else {
1541
1546
php_error_docref (NULL , E_WARNING , "failed to fetch error message" );
1542
1547
}
@@ -1877,7 +1882,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
1877
1882
(memcmp (ZSTR_VAL (tmp -> hash_key ), ZSTR_VAL (hashed_details .s ),
1878
1883
ZSTR_LEN (tmp -> hash_key )) == 0 )) {
1879
1884
connection = tmp ;
1885
+ #if PHP_VERSION_ID < 70300
1880
1886
++ GC_REFCOUNT (connection -> id );
1887
+ #else
1888
+ GC_ADDREF (connection -> id );
1889
+ #endif
1881
1890
}
1882
1891
} else {
1883
1892
PHP_OCI_REGISTER_RESOURCE (connection , le_pconnection );
@@ -1887,7 +1896,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
1887
1896
* decremented in the persistent helper
1888
1897
*/
1889
1898
if (OCI_G (old_oci_close_semantics )) {
1899
+ #if PHP_VERSION_ID < 70300
1890
1900
++ GC_REFCOUNT (connection -> id );
1901
+ #else
1902
+ GC_ADDREF (connection -> id );
1903
+ #endif
1891
1904
}
1892
1905
}
1893
1906
smart_str_free (& hashed_details );
@@ -1898,7 +1911,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
1898
1911
} else {
1899
1912
/* we do not ping non-persistent connections */
1900
1913
smart_str_free (& hashed_details );
1914
+ #if PHP_VERSION_ID < 70300
1901
1915
++ GC_REFCOUNT (connection -> id );
1916
+ #else
1917
+ GC_ADDREF (connection -> id );
1918
+ #endif
1902
1919
return connection ;
1903
1920
}
1904
1921
} /* is_open is true? */
@@ -2040,8 +2057,10 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
2040
2057
2041
2058
/* add to the appropriate hash */
2042
2059
if (connection -> is_persistent ) {
2060
+ #if PHP_VERSION_ID < 70300
2043
2061
new_le .ptr = connection ;
2044
2062
new_le .type = le_pconnection ;
2063
+ #endif
2045
2064
connection -> used_this_request = 1 ;
2046
2065
PHP_OCI_REGISTER_RESOURCE (connection , le_pconnection );
2047
2066
@@ -2050,9 +2069,17 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
2050
2069
* refcount is decremented in the persistent helper
2051
2070
*/
2052
2071
if (OCI_G (old_oci_close_semantics )) {
2072
+ #if PHP_VERSION_ID < 70300
2053
2073
++ GC_REFCOUNT (connection -> id );
2074
+ #else
2075
+ GC_ADDREF (connection -> id );
2076
+ #endif
2054
2077
}
2078
+ #if PHP_VERSION_ID < 70300
2055
2079
zend_hash_update_mem (& EG (persistent_list ), connection -> hash_key , (void * )& new_le , sizeof (zend_resource ));
2080
+ #else
2081
+ zend_register_persistent_resource_ex (connection -> hash_key , connection , le_pconnection );
2082
+ #endif
2056
2083
OCI_G (num_persistent )++ ;
2057
2084
OCI_G (num_links )++ ;
2058
2085
} else if (!exclusive ) {
@@ -2447,7 +2474,11 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode)
2447
2474
2448
2475
if (column -> is_cursor ) { /* REFCURSOR -> simply return the statement id */
2449
2476
ZVAL_RES (value , column -> stmtid );
2477
+ #if PHP_VERSION_ID < 70300
2450
2478
++ GC_REFCOUNT (column -> stmtid );
2479
+ #else
2480
+ GC_ADDREF (column -> stmtid );
2481
+ #endif
2451
2482
} else if (column -> is_descr ) {
2452
2483
2453
2484
if (column -> data_type != SQLT_RDD ) {
@@ -2491,7 +2522,11 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode)
2491
2522
/* return the locator */
2492
2523
object_init_ex (value , oci_lob_class_entry_ptr );
2493
2524
add_property_resource (value , "descriptor" , column -> descid );
2525
+ #if PHP_VERSION_ID < 70300
2494
2526
++ GC_REFCOUNT (column -> descid );
2527
+ #else
2528
+ GC_ADDREF (column -> descid );
2529
+ #endif
2495
2530
}
2496
2531
} else {
2497
2532
switch (column -> retcode ) {
@@ -2873,7 +2908,9 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *
2873
2908
{
2874
2909
smart_str spool_hashed_details = {0 };
2875
2910
php_oci_spool * session_pool = NULL ;
2911
+ #if PHP_VERSION_ID < 70300
2876
2912
zend_resource spool_le = {{0 }};
2913
+ #endif
2877
2914
zend_resource * spool_out_le = NULL ;
2878
2915
zend_bool iserror = 0 ;
2879
2916
zval * spool_out_zv = NULL ;
@@ -2920,10 +2957,14 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *
2920
2957
iserror = 1 ;
2921
2958
goto exit_get_spool ;
2922
2959
}
2960
+ #if PHP_VERSION_ID < 70300
2923
2961
spool_le .ptr = session_pool ;
2924
2962
spool_le .type = le_psessionpool ;
2925
2963
PHP_OCI_REGISTER_RESOURCE (session_pool , le_psessionpool );
2926
2964
zend_hash_update_mem (& EG (persistent_list ), session_pool -> spool_hash_key , (void * )& spool_le , sizeof (zend_resource ));
2965
+ #else
2966
+ zend_register_persistent_resource_ex (session_pool -> spool_hash_key , session_pool , le_psessionpool );
2967
+ #endif
2927
2968
} else if (spool_out_le -> type == le_psessionpool &&
2928
2969
ZSTR_LEN (((php_oci_spool * )(spool_out_le -> ptr ))-> spool_hash_key ) == ZSTR_LEN (spool_hashed_details .s ) &&
2929
2970
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 ) {
0 commit comments