]> granicus.if.org Git - php/commitdiff
Make mysqli compilable in a 5_2 environment. Some want to use mysqlnd+mysqli
authorAndrey Hristov <andrey@php.net>
Tue, 6 May 2008 17:05:14 +0000 (17:05 +0000)
committerAndrey Hristov <andrey@php.net>
Tue, 6 May 2008 17:05:14 +0000 (17:05 +0000)
with 5_2. This won't hurt 5_2 in any way. Won't be MFB-ed because HEAD is
completely different.

ext/mysqli/mysqli.c
ext/mysqli/mysqli_nonapi.c

index 84a07319cd4a55a980b2763f4f232b6340aa7360..2fc0b00cd0f4d20c4a69567b9678590243db38b7 100644 (file)
@@ -512,6 +512,7 @@ static int mysqli_object_has_property(zval *object, zval *member, int has_set_ex
 } /* }}} */
 
 
+#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3
 HashTable * mysqli_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
 {
        mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC);
@@ -539,7 +540,7 @@ HashTable * mysqli_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
        *is_temp = 1;
        return retval;
 }
-
+#endif
 
 /* {{{ mysqli_objects_new
  */
@@ -708,7 +709,9 @@ PHP_MINIT_FUNCTION(mysqli)
        mysqli_object_handlers.get_property_ptr_ptr = std_hnd->get_property_ptr_ptr;
        mysqli_object_handlers.get_constructor = php_mysqli_constructor_get;
        mysqli_object_handlers.has_property = mysqli_object_has_property;
+#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3
        mysqli_object_handlers.get_debug_info = mysqli_object_get_debug_info;
+#endif
 
        zend_hash_init(&classes, 0, NULL, NULL, 1);
 
index 9b18e8c383a6d5ab929b36579635c8298cacdc7a..27e6b4ebd42e5313191dd435481bf387b11a8faf 100644 (file)
 
 #define SAFE_STR(a) ((a)?a:"")
 
+#ifndef zend_parse_parameters_none
+#define zend_parse_parameters_none()   \
+        zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")
+#endif
+
 /* {{{ php_mysqli_set_error
  */
 static void php_mysqli_set_error(long mysql_errno, char *mysql_err TSRMLS_DC)