summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_driver.c
diff options
context:
space:
mode:
authorStanley Sufficool <ssufficool@php.net>2014-10-20 21:33:32 -0700
committerStanley Sufficool <ssufficool@php.net>2014-10-20 21:33:32 -0700
commit8defcb855ab01d9c8ab4759cb793d80149b55a8c (patch)
treeed51eb30a2cbc92b102557498fb3e4113da1bb07 /ext/mysqli/mysqli_driver.c
parent9c7dbb0487f5991fde03873ea8f5e66d6688415f (diff)
parentbaddb1c73a170ef1d2c31bd54cddbc6e1ab596b9 (diff)
downloadphp-git-8defcb855ab01d9c8ab4759cb793d80149b55a8c.tar.gz
Merge branch 'master' of https://git.php.net/push/php-src
* 'master' of https://git.php.net/push/php-src: (6215 commits) Extra comma Moved proxy object support in ASSIGN_ADD (and family) from VM to slow paths of corresponding operators Simplification zend_get_property_info_quick() cleanup and optimization initialize lineno before calling compile file file in phar Use ADDREF instead of DUP, it must be enough. Removed old irrelevant comment fixed compilation error Fix bug #68262: Broken reference across cloned objects export functions needed for phpdbg Fixed compilation Optimized property access handlers. Removed EG(std_property_info). Fixed bug #68199 (PDO::pgsqlGetNotify doesn't support NOTIFY payloads) Don't make difference between undefined and unaccessible properies when call __get() and family Don't make useless CSE array_pop/array_shift optimization check for zlib headers as well as lib for mysqlnd a realpath cache key can be int or float, catching this News entry for new curl constants News entry for new curl constants ...
Diffstat (limited to 'ext/mysqli/mysqli_driver.c')
-rw-r--r--ext/mysqli/mysqli_driver.c70
1 files changed, 25 insertions, 45 deletions
diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c
index 8684edcb47..95096f4a61 100644
--- a/ext/mysqli/mysqli_driver.c
+++ b/ext/mysqli/mysqli_driver.c
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2013 The PHP Group |
+ | Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -30,11 +30,10 @@
#include "mysqli_fe.h"
#define MAP_PROPERTY_MYG_BOOL_READ(name, value) \
-static int name(mysqli_object *obj, zval **retval TSRMLS_DC) \
+static zval *name(mysqli_object *obj, zval *retval TSRMLS_DC) \
{ \
- MAKE_STD_ZVAL(*retval); \
- ZVAL_BOOL(*retval, MyG(value)); \
- return SUCCESS; \
+ ZVAL_BOOL(retval, MyG(value)); \
+ return retval; \
} \
#define MAP_PROPERTY_MYG_BOOL_WRITE(name, value) \
@@ -45,11 +44,10 @@ static int name(mysqli_object *obj, zval *value TSRMLS_DC) \
} \
#define MAP_PROPERTY_MYG_LONG_READ(name, value) \
-static int name(mysqli_object *obj, zval **retval TSRMLS_DC) \
+static zval *name(mysqli_object *obj, zval *retval TSRMLS_DC) \
{ \
- MAKE_STD_ZVAL(*retval); \
- ZVAL_LONG(*retval, MyG(value)); \
- return SUCCESS; \
+ ZVAL_LONG(retval, MyG(value)); \
+ return retval; \
} \
#define MAP_PROPERTY_MYG_LONG_WRITE(name, value) \
@@ -60,11 +58,10 @@ static int name(mysqli_object *obj, zval *value TSRMLS_DC) \
} \
#define MAP_PROPERTY_MYG_STRING_READ(name, value) \
-static int name(mysqli_object *obj, zval **retval TSRMLS_DC) \
+static zval *name(mysqli_object *obj, zval *retval TSRMLS_DC) \
{ \
- MAKE_STD_ZVAL(*retval); \
- ZVAL_STRING(*retval, MyG(value), 1); \
- return SUCCESS; \
+ ZVAL_STRING(retval, MyG(value)); \
+ return retval; \
} \
#define MAP_PROPERTY_MYG_STRING_WRITE(name, value) \
@@ -85,42 +82,38 @@ static int driver_report_write(mysqli_object *obj, zval *value TSRMLS_DC)
/* }}} */
/* {{{ property driver_embedded_read */
-static int driver_embedded_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+static zval *driver_embedded_read(mysqli_object *obj, zval *retval TSRMLS_DC)
{
- MAKE_STD_ZVAL(*retval);
#ifdef HAVE_EMBEDDED_MYSQLI
- ZVAL_BOOL(*retval, 1);
+ ZVAL_BOOL(retval, 1);
#else
- ZVAL_BOOL(*retval, 0);
+ ZVAL_BOOL(retval, 0);
#endif
- return SUCCESS;
+ return retval;
}
/* }}} */
/* {{{ property driver_client_version_read */
-static int driver_client_version_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+static zval *driver_client_version_read(mysqli_object *obj, zval *retval TSRMLS_DC)
{
- MAKE_STD_ZVAL(*retval);
- ZVAL_LONG(*retval, MYSQL_VERSION_ID);
- return SUCCESS;
+ ZVAL_LONG(retval, MYSQL_VERSION_ID);
+ return retval;
}
/* }}} */
/* {{{ property driver_client_info_read */
-static int driver_client_info_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+static zval *driver_client_info_read(mysqli_object *obj, zval *retval TSRMLS_DC)
{
- MAKE_STD_ZVAL(*retval);
- ZVAL_STRING(*retval, (char *)mysql_get_client_info(), 1);
- return SUCCESS;
+ ZVAL_STRING(retval, (char *)mysql_get_client_info());
+ return retval;
}
/* }}} */
/* {{{ property driver_driver_version_read */
-static int driver_driver_version_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+static zval *driver_driver_version_read(mysqli_object *obj, zval *retval TSRMLS_DC)
{
- MAKE_STD_ZVAL(*retval);
- ZVAL_LONG(*retval, MYSQLI_VERSION_ID);
- return SUCCESS;
+ ZVAL_LONG(retval, MYSQLI_VERSION_ID);
+ return retval;
}
/* }}} */
@@ -136,7 +129,7 @@ ZEND_FUNCTION(mysqli_driver_construct)
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
mysqli_resource->ptr = 1;
mysqli_resource->status = (ZEND_NUM_ARGS() == 1) ? MYSQLI_STATUS_INITIALIZED : MYSQLI_STATUS_VALID;
- ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->ptr = mysqli_resource;
+ (Z_MYSQLI_P(getThis()))->ptr = mysqli_resource;
#endif
}
@@ -150,19 +143,6 @@ const mysqli_property_entry mysqli_driver_property_entries[] = {
{NULL, 0, NULL, NULL}
};
-/* {{{ mysqli_warning_property_info_entries */
-const zend_property_info mysqli_driver_property_info_entries[] = {
- {ZEND_ACC_PUBLIC, "client_info", sizeof("client_info") - 1, -1, 0, NULL, 0, NULL},
- {ZEND_ACC_PUBLIC, "client_version", sizeof("client_version") - 1, -1, 0, NULL, 0, NULL},
- {ZEND_ACC_PUBLIC, "driver_version", sizeof("driver_version") - 1, -1, 0, NULL, 0, NULL},
- {ZEND_ACC_PUBLIC, "embedded", sizeof("embedded") - 1, -1, 0, NULL, 0, NULL},
- {ZEND_ACC_PUBLIC, "reconnect", sizeof("reconnect") - 1, -1, 0, NULL, 0, NULL},
- {ZEND_ACC_PUBLIC, "report_mode", sizeof("report_mode") - 1, -1, 0, NULL, 0, NULL},
- {0, NULL, 0, -1, 0, NULL, 0, NULL},
-};
-/* }}} */
-
-
/* {{{ mysqli_driver_methods[]
*/
const zend_function_entry mysqli_driver_methods[] = {