summaryrefslogtreecommitdiff
path: root/ext/oci8/oci8_interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/oci8/oci8_interface.c')
-rw-r--r--ext/oci8/oci8_interface.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c
index 296c4f89e5..a822514432 100644
--- a/ext/oci8/oci8_interface.c
+++ b/ext/oci8/oci8_interface.c
@@ -1805,7 +1805,6 @@ PHP_FUNCTION(oci_set_client_identifier)
Sets the edition attribute for all subsequent connections created */
PHP_FUNCTION(oci_set_edition)
{
-#if ((OCI_MAJOR_VERSION > 11) || ((OCI_MAJOR_VERSION == 11) && (OCI_MINOR_VERSION >= 2)))
char *edition;
size_t edition_len;
@@ -1813,6 +1812,7 @@ PHP_FUNCTION(oci_set_edition)
Z_PARAM_STRING(edition, edition_len)
ZEND_PARSE_PARAMETERS_END();
+#if ((OCI_MAJOR_VERSION > 11) || ((OCI_MAJOR_VERSION == 11) && (OCI_MINOR_VERSION >= 2)))
if (OCI_G(edition)) {
efree(OCI_G(edition));
}
@@ -1837,18 +1837,20 @@ PHP_FUNCTION(oci_set_edition)
Sets the module attribute on the connection for end-to-end tracing */
PHP_FUNCTION(oci_set_module_name)
{
-#if (OCI_MAJOR_VERSION >= 10)
zval *z_connection;
- php_oci_connection *connection;
char *module;
size_t module_len;
- sword errstatus;
ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_RESOURCE(z_connection)
Z_PARAM_STRING(module, module_len)
ZEND_PARSE_PARAMETERS_END();
+#if (OCI_MAJOR_VERSION >= 10)
+
+ php_oci_connection *connection;
+ sword errstatus;
+
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) module, (ub4) module_len, (ub4) OCI_ATTR_MODULE, connection->err));
@@ -1870,18 +1872,20 @@ PHP_FUNCTION(oci_set_module_name)
Sets the action attribute on the connection for end-to-end tracing */
PHP_FUNCTION(oci_set_action)
{
-#if (OCI_MAJOR_VERSION >= 10)
zval *z_connection;
- php_oci_connection *connection;
char *action;
size_t action_len;
- sword errstatus;
ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_RESOURCE(z_connection)
Z_PARAM_STRING(action, action_len)
ZEND_PARSE_PARAMETERS_END();
+#if (OCI_MAJOR_VERSION >= 10)
+
+ php_oci_connection *connection;
+ sword errstatus;
+
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) action, (ub4) action_len, (ub4) OCI_ATTR_ACTION, connection->err));
@@ -1903,18 +1907,20 @@ PHP_FUNCTION(oci_set_action)
Sets the client info attribute on the connection for end-to-end tracing */
PHP_FUNCTION(oci_set_client_info)
{
-#if (OCI_MAJOR_VERSION >= 10)
zval *z_connection;
- php_oci_connection *connection;
char *client_info;
size_t client_info_len;
- sword errstatus;
ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_RESOURCE(z_connection)
Z_PARAM_STRING(client_info, client_info_len)
ZEND_PARSE_PARAMETERS_END();
+#if (OCI_MAJOR_VERSION >= 10)
+
+ php_oci_connection *connection;
+ sword errstatus;
+
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_info, (ub4) client_info_len, (ub4) OCI_ATTR_CLIENT_INFO, connection->err));
@@ -1937,9 +1943,7 @@ PHP_FUNCTION(oci_set_client_info)
For history, see Oracle bug 16695981 */
PHP_FUNCTION(oci_set_db_operation)
{
-#if (OCI_MAJOR_VERSION > 11)
zval *z_connection;
- php_oci_connection *connection;
char *dbop_name;
size_t dbop_name_len;
@@ -1948,6 +1952,9 @@ PHP_FUNCTION(oci_set_db_operation)
Z_PARAM_STRING(dbop_name, dbop_name_len)
ZEND_PARSE_PARAMETERS_END();
+#if (OCI_MAJOR_VERSION > 11)
+ php_oci_connection *connection;
+
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) dbop_name, (ub4) dbop_name_len, (ub4) OCI_ATTR_DBOP, OCI_G(err)));
@@ -1968,9 +1975,7 @@ PHP_FUNCTION(oci_set_db_operation)
*/
PHP_FUNCTION(oci_set_call_timeout)
{
-#if (OCI_MAJOR_VERSION >= 18)
zval *z_connection;
- php_oci_connection *connection;
zend_long call_timeout; // milliseconds
ZEND_PARSE_PARAMETERS_START(2, 2)
@@ -1978,6 +1983,9 @@ PHP_FUNCTION(oci_set_call_timeout)
Z_PARAM_LONG(call_timeout)
ZEND_PARSE_PARAMETERS_END();
+#if (OCI_MAJOR_VERSION >= 18)
+ php_oci_connection *connection;
+
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) &call_timeout, 0, OCI_ATTR_CALL_TIMEOUT, OCI_G(err)));
@@ -2092,6 +2100,7 @@ PHP_FUNCTION(oci_result)
PHP_FUNCTION(oci_client_version)
{
char version[256];
+ ZEND_PARSE_PARAMETERS_NONE();
php_oci_client_get_version(version, sizeof(version));
RETURN_STRING(version);