com php-src: Get oci8 extension compiling with php7.: ext/oci8/oci8.c ext/oci8/oci8_interface.c ext/oci8/oci8_stateme nt.c
| From: | Xinchen Hui | Date: | Sat, 06 Jun 2015 18:05:19 +0000 |
| Subject: | com php-src: Get oci8 extension compiling with php7.: ext/oci8/oci8.c ext/oci8/oci8_interface.c ext/oci8/oci8_stateme nt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-87263@lists.php.net to get a copy of this message | ||
Commit: 3cf0bea098d22347a400506b524b27cfb3d600f8
Author: Cameron Porter <camporter1@gmail.com> Sat, 6 Jun 2015 13:05:19 -0500
Parents: 7f39ee7159e500c7971da99a9cfdbdab0648e8f9
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3cf0bea098d22347a400506b524b27cfb3d600f8
Log:
Get oci8 extension compiling with php7.
Changed paths:
M ext/oci8/oci8.c
M ext/oci8/oci8_interface.c
M ext/oci8/oci8_statement.c
Diff:
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 80b847f..01c9b6d 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -2561,7 +2561,7 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode)
}
if (column->is_cursor) { /* REFCURSOR -> simply return the statement id */
- zend_register_resource(value, column->stmtid, 0); /* XXX type correct? */
+ ZVAL_RES(value, zend_register_resource(column->stmtid, 0)); /* XXX type correct? */
++GC_REFCOUNT(column->stmtid);
} else if (column->is_descr) {
@@ -2844,7 +2844,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len,
cha
}
/* Populate key if passed */
- if (hash_key->val) {
+ if (hash_key && hash_key->val) {
session_pool->spool_hash_key = zend_string_dup(hash_key, 1);
if (session_pool->spool_hash_key == NULL) {
iserror = 1;
diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c
index a76f15a..c4a2773 100644
--- a/ext/oci8/oci8_interface.c
+++ b/ext/oci8/oci8_interface.c
@@ -1466,7 +1466,7 @@ PHP_FUNCTION(oci_fetch_all)
while (!php_oci_statement_fetch(statement, nrows)) {
for (i = 0; i < statement->ncolumns; i++) {
php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS);
- zend_hash_index_update(&(outarrs[ i ])->value.arr->ht, rows, &element);
+ zend_hash_index_update(Z_ARRVAL_P(outarrs[ i ]), rows, &element);
}
rows++;
@@ -1613,7 +1613,7 @@ PHP_FUNCTION(oci_error)
}
if (ZEND_NUM_ARGS() > 0) {
- statement = (php_oci_statement *) zend_fetch_resource(arg, -1, NULL, NULL, 1, le_statement);
+ statement = (php_oci_statement *) zend_fetch_resource_ex(arg, NULL, le_statement);
if (statement) {
errh = statement->err;
errcode = statement->errcode;
@@ -1624,14 +1624,14 @@ PHP_FUNCTION(oci_error)
goto go_out;
}
- connection = (php_oci_connection *) zend_fetch_resource(arg, -1, NULL, NULL, 1, le_connection);
+ connection = (php_oci_connection *) zend_fetch_resource_ex(arg, NULL, le_connection);
if (connection) {
errh = connection->err;
errcode = connection->errcode;
goto go_out;
}
- connection = (php_oci_connection *) zend_fetch_resource(arg, -1, NULL, NULL, 1, le_pconnection);
+ connection = (php_oci_connection *) zend_fetch_resource_ex(arg, NULL, le_pconnection);
if (connection) {
errh = connection->err;
errcode = connection->errcode;
diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c
index d55de32..2583e1a 100644
--- a/ext/oci8/oci8_statement.c
+++ b/ext/oci8/oci8_statement.c
@@ -1439,7 +1439,7 @@ php_oci_out_column
*php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
return NULL;
}
- statement = (php_oci_statement *) zend_fetch_resource(z_statement, -1, "oci8 statement",
NULL, 1, le_statement);
+ statement = (php_oci_statement *) zend_fetch_resource_ex(z_statement, "oci8 statement",
le_statement);
if (!statement) {
return NULL;