cvs: php4 /ext/ingres_ii ii.c php_ii.h
| From: | H�not David | Date: | Mon, 17 Jul 2000 23:57:35 +0000 |
| Subject: | cvs: php4 /ext/ingres_ii ii.c php_ii.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-798@lists.php.net to get a copy of this message | ||
henot Mon Jul 17 16:57:35 2000 EDT
Modified files:
/php4/ext/ingres_ii ii.c php_ii.h
Log:
Added new function ii_autocommit()
Index: php4/ext/ingres_ii/ii.c
diff -u php4/ext/ingres_ii/ii.c:1.3 php4/ext/ingres_ii/ii.c:1.4
--- php4/ext/ingres_ii/ii.c:1.3 Mon Jul 17 16:21:41 2000
+++ php4/ext/ingres_ii/ii.c Mon Jul 17 16:57:35 2000
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ii.c,v 1.3 2000/07/17 23:21:41 henot Exp $ */
+/* $Id: ii.c,v 1.4 2000/07/17 23:57:35 henot Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -54,6 +54,7 @@
PHP_FE(ii_fetch_object, NULL)
PHP_FE(ii_rollback, NULL)
PHP_FE(ii_commit, NULL)
+ PHP_FE(ii_autocommit, NULL)
{NULL, NULL, NULL} /* Must be the last line in ii_functions[] */
};
@@ -1281,6 +1282,44 @@
}
ii_link->tranHandle = NULL;
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto bool ii_autocommit([resource link])
+ Switch autocommit on or off */
+PHP_FUNCTION(ii_autocommit)
+{
+ zval **link;
+ int argc;
+ int link_id = -1;
+ II_LINK *ii_link;
+ IIAPI_AUTOPARM autoParm;
+ IILS_FETCH();
+
+ argc = ZEND_NUM_ARGS();
+ if (argc > 1 || (argc && zend_get_parameters_ex(argc, &link) == FAILURE)){
+ WRONG_PARAM_COUNT;
+ }
+
+ if (argc == 0) {
+ link_id = IIG(default_link);
+ }
+ ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link,
le_ii_plink);
+
+ autoParm.ac_genParm.gp_callback = NULL;
+ autoParm.ac_genParm.gp_closure = NULL;
+ autoParm.ac_connHandle = ii_link->connHandle;
+ autoParm.ac_tranHandle = ii_link->tranHandle;
+
+ IIapi_autocommit(&autoParm);
+ ii_sync(&(autoParm.ac_genParm));
+
+ if(ii_success(&(autoParm.ac_genParm))==II_FAIL) {
+ RETURN_FALSE;
+ }
+
+ ii_link->tranHandle = autoParm.ac_tranHandle;
RETURN_TRUE;
}
/* }}} */
Index: php4/ext/ingres_ii/php_ii.h
diff -u php4/ext/ingres_ii/php_ii.h:1.2 php4/ext/ingres_ii/php_ii.h:1.3
--- php4/ext/ingres_ii/php_ii.h:1.2 Mon Jul 17 16:21:41 2000
+++ php4/ext/ingres_ii/php_ii.h Mon Jul 17 16:57:35 2000
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ii.h,v 1.2 2000/07/17 23:21:41 henot Exp $ */
+/* $Id: php_ii.h,v 1.3 2000/07/17 23:57:35 henot Exp $ */
#ifndef PHP_II_H
#define PHP_II_H
@@ -55,6 +55,7 @@
PHP_FUNCTION(ii_fetch_object);
PHP_FUNCTION(ii_rollback);
PHP_FUNCTION(ii_commit);
+PHP_FUNCTION(ii_autocommit);
ZEND_BEGIN_MODULE_GLOBALS(ii)
long allow_persistent;