31
31
#include "ext/standard/info.h"
32
32
#include "php_ini.h"
33
33
34
- #if HAVE_OCI8
34
+ #ifdef HAVE_OCI8
35
35
36
36
#include "php_oci8.h"
37
37
#include "php_oci8_int.h"
@@ -48,38 +48,18 @@ PHP_FUNCTION(oci_register_taf_callback)
48
48
zval * callback ;
49
49
zend_string * callback_name ;
50
50
51
+ /* TODO Use ZPP callable */
51
52
if (zend_parse_parameters (ZEND_NUM_ARGS (), "r|z!" , & z_connection , & callback ) == FAILURE ) {
52
53
RETURN_THROWS ();
53
54
}
54
55
55
56
if (callback ) {
56
- #if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 2 )
57
57
if (!zend_is_callable (callback , 0 , 0 )) {
58
58
callback_name = zend_get_callable_name (callback );
59
59
php_error_docref (NULL , E_WARNING , "Function '%s' is not callable" , ZSTR_VAL (callback_name ));
60
- #if PHP_VERSION_ID < 70300
61
60
zend_string_release (callback_name );
62
- #else
63
- zend_string_release_ex (callback_name , 0 );
64
- #endif
65
- RETURN_FALSE ;
66
- }
67
- #else
68
- if (!zend_is_callable (callback , 0 , & callback_name )) {
69
- php_error_docref (NULL , E_WARNING , "Function '%s' is not callable" , ZSTR_VAL (callback_name ));
70
- #if PHP_VERSION_ID < 70300
71
- zend_string_release (callback_name );
72
- #else
73
- zend_string_release_ex (callback_name , 0 );
74
- #endif
75
61
RETURN_FALSE ;
76
62
}
77
- #if PHP_VERSION_ID < 70300
78
- zend_string_release (callback_name );
79
- #else
80
- zend_string_release_ex (callback_name , 0 );
81
- #endif
82
- #endif
83
63
}
84
64
85
65
PHP_OCI_ZVAL_TO_CONNECTION (z_connection , connection );
@@ -152,18 +132,10 @@ PHP_FUNCTION(oci_define_by_name)
152
132
/* if (zend_hash_add(statement->defines, name, name_len, define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) { */
153
133
zvtmp = zend_string_init (name , name_len , 0 );
154
134
if ((define = zend_hash_add_new_ptr (statement -> defines , zvtmp , define )) != NULL ) {
155
- #if PHP_VERSION_ID < 70300
156
- zend_string_release (zvtmp );
157
- #else
158
135
zend_string_release_ex (zvtmp , 0 );
159
- #endif
160
136
} else {
161
137
efree (define );
162
- #if PHP_VERSION_ID < 70300
163
- zend_string_release (zvtmp );
164
- #else
165
138
zend_string_release_ex (zvtmp , 0 );
166
- #endif
167
139
RETURN_FALSE ;
168
140
}
169
141
@@ -1365,11 +1337,7 @@ PHP_FUNCTION(oci_fetch_all)
1365
1337
zend_string * zvtmp ;
1366
1338
zvtmp = zend_string_init (columns [ i ]-> name , columns [ i ]-> name_len , 0 );
1367
1339
zend_symtable_update (Z_ARRVAL (row ), zvtmp , & element );
1368
- #if PHP_VERSION_ID < 70300
1369
- zend_string_release (zvtmp );
1370
- #else
1371
1340
zend_string_release_ex (zvtmp , 0 );
1372
- #endif
1373
1341
}
1374
1342
}
1375
1343
@@ -1408,11 +1376,7 @@ PHP_FUNCTION(oci_fetch_all)
1408
1376
array_init (& tmp );
1409
1377
zvtmp = zend_string_init (columns [ i ]-> name , columns [ i ]-> name_len , 0 );
1410
1378
outarrs [ i ] = zend_symtable_update (Z_ARRVAL_P (array ), zvtmp , & tmp );
1411
- #if PHP_VERSION_ID < 70300
1412
- zend_string_release (zvtmp );
1413
- #else
1414
1379
zend_string_release_ex (zvtmp , 0 );
1415
- #endif
1416
1380
}
1417
1381
}
1418
1382
0 commit comments