sniper Fri Nov 25 10:40:15 2005 EDT
Modified files:
/php-src/ext/pdo pdo.c
/php-src/ext/pdo_dblib pdo_dblib.c
/php-src/ext/pdo_mysql pdo_mysql.c
/php-src/ext/pdo_oci oci_statement.c pdo_oci.c php_pdo_oci_int.h
/php-src/ext/pdo_pgsql pdo_pgsql.c
/php-src/ext/pdo_sqlite pdo_sqlite.c
/php-src/ext/sqlite sqlite.c
/php-src/ext/xmlreader php_xmlreader.c
Log:
- Use right define: ZEND_MODULE_API_NO as these are PHP modules, not Zend
extensions
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo.c?r1=1.67&r2=1.68&ty=u
Index: php-src/ext/pdo/pdo.c
diff -u php-src/ext/pdo/pdo.c:1.67 php-src/ext/pdo/pdo.c:1.68
--- php-src/ext/pdo/pdo.c:1.67 Thu Oct 6 15:32:27 2005
+++ php-src/ext/pdo/pdo.c Fri Nov 25 10:40:10 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo.c,v 1.67 2005/10/06 19:32:27 helly Exp $ */
+/* $Id: pdo.c,v 1.68 2005/11/25 15:40:10 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -115,7 +115,7 @@
/* }}} */
/* {{{ pdo_functions[] */
-#if ZEND_EXTENSION_API_NO >= 220050617
+#if ZEND_MODULE_API_NO >= 20050922
static zend_module_dep pdo_deps[] = {
#ifdef HAVE_SPL
ZEND_MOD_REQUIRED("spl")
@@ -127,7 +127,7 @@
/* {{{ pdo_module_entry */
zend_module_entry pdo_module_entry = {
-#if ZEND_EXTENSION_API_NO >= 220050617
+#if ZEND_MODULE_API_NO >= 20050922
STANDARD_MODULE_HEADER_EX, NULL,
pdo_deps,
#else
http://cvs.php.net/diff.php/php-src/ext/pdo_dblib/pdo_dblib.c?r1=1.9&r2=1.10&ty=u
Index: php-src/ext/pdo_dblib/pdo_dblib.c
diff -u php-src/ext/pdo_dblib/pdo_dblib.c:1.9
php-src/ext/pdo_dblib/pdo_dblib.c:1.10
--- php-src/ext/pdo_dblib/pdo_dblib.c:1.9 Tue Jul 26 23:12:43 2005
+++ php-src/ext/pdo_dblib/pdo_dblib.c Fri Nov 25 10:40:13 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_dblib.c,v 1.9 2005/07/27 03:12:43 wez Exp $ */
+/* $Id: pdo_dblib.c,v 1.10 2005/11/25 15:40:13 sniper Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -38,7 +38,7 @@
{NULL, NULL, NULL}
};
-#if ZEND_EXTENSION_API_NO >= 220050617
+#if ZEND_MODULE_API_NO >= 20050922
static zend_module_dep pdo_dblib_deps[] = {
ZEND_MOD_REQUIRED("pdo")
{NULL, NULL, NULL}
@@ -46,7 +46,7 @@
#endif
zend_module_entry pdo_dblib_module_entry = {
-#if ZEND_EXTENSION_API_NO >= 220050617
+#if ZEND_MODULE_API_NO >= 20050922
STANDARD_MODULE_HEADER_EX, NULL,
pdo_dblib_deps,
#else
http://cvs.php.net/diff.php/php-src/ext/pdo_mysql/pdo_mysql.c?r1=1.11&r2=1.12&ty=u
Index: php-src/ext/pdo_mysql/pdo_mysql.c
diff -u php-src/ext/pdo_mysql/pdo_mysql.c:1.11
php-src/ext/pdo_mysql/pdo_mysql.c:1.12
--- php-src/ext/pdo_mysql/pdo_mysql.c:1.11 Thu Oct 27 13:33:43 2005
+++ php-src/ext/pdo_mysql/pdo_mysql.c Fri Nov 25 10:40:13 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_mysql.c,v 1.11 2005/10/27 17:33:43 tony2001 Exp $ */
+/* $Id: pdo_mysql.c,v 1.12 2005/11/25 15:40:13 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -37,7 +37,7 @@
/* }}} */
/* {{{ pdo_mysql_functions[] */
-#if ZEND_EXTENSION_API_NO >= 220050617
+#if ZEND_MODULE_API_NO >= 20050922
static zend_module_dep pdo_mysql_deps[] = {
ZEND_MOD_REQUIRED("pdo")
{NULL, NULL, NULL}
@@ -47,7 +47,7 @@
/* {{{ pdo_mysql_module_entry */
zend_module_entry pdo_mysql_module_entry = {
-#if ZEND_EXTENSION_API_NO >= 220050617
+#if ZEND_MODULE_API_NO >= 20050922
STANDARD_MODULE_HEADER_EX, NULL,
pdo_mysql_deps,
#else
http://cvs.php.net/diff.php/php-src/ext/pdo_oci/oci_statement.c?r1=1.17&r2=1.18&ty=u
Index: php-src/ext/pdo_oci/oci_statement.c
diff -u php-src/ext/pdo_oci/oci_statement.c:1.17
php-src/ext/pdo_oci/oci_statement.c:1.18
--- php-src/ext/pdo_oci/oci_statement.c:1.17 Fri Oct 28 11:01:47 2005
+++ php-src/ext/pdo_oci/oci_statement.c Fri Nov 25 10:40:13 2005
@@ -1,488 +1,488 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | [EMAIL PROTECTED] so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Wez Furlong <[EMAIL PROTECTED]>
|
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: oci_statement.c,v 1.17 2005/10/28 15:01:47 tony2001 Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "pdo/php_pdo.h"
-#include "pdo/php_pdo_driver.h"
-#include "php_pdo_oci.h"
-#include "php_pdo_oci_int.h"
-#include "Zend/zend_extensions.h"
-
-#define STMT_CALL(name, params) \
- S->last_err = name params; \
- S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name, S->last_err,
__FILE__, __LINE__ TSRMLS_CC); \
- if (S->last_err) { \
- return 0; \
- }
-
-#define STMT_CALL_MSG(name, msg, params) \
- S->last_err = name params; \
- S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name ": " #msg,
S->last_err, __FILE__, __LINE__ TSRMLS_CC); \
- if (S->last_err) { \
- return 0; \
- }
-
-
-static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
-{
- pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
- HashTable *BC = stmt->bound_columns;
- HashTable *BP = stmt->bound_params;
-
- int i;
-
- if (S->stmt) {
- /* cancel server side resources for the statement if we didn't
- * fetch it all */
- OCIStmtFetch(S->stmt, S->err, 0, OCI_FETCH_NEXT, OCI_DEFAULT);
-
- /* free the handle */
- OCIHandleFree(S->stmt, OCI_HTYPE_STMT);
- S->stmt = NULL;
- }
- if (S->err) {
- OCIHandleFree(S->err, OCI_HTYPE_ERROR);
- S->err = NULL;
- }
-
- /* need to ensure these go away now */
- if (BC) {
- zend_hash_destroy(BC);
- FREE_HASHTABLE(stmt->bound_columns);
- stmt->bound_columns = NULL;
- }
-
- if (BP) {
- zend_hash_destroy(BP);
- FREE_HASHTABLE(stmt->bound_params);
- stmt->bound_params = NULL;
- }
-
- if (S->einfo.errmsg) {
- efree(S->einfo.errmsg);
- S->einfo.errmsg = NULL;
- }
-
- if (S->cols) {
- for (i = 0; i < stmt->column_count; i++) {
- if (S->cols[i].data) {
- efree(S->cols[i].data);
- }
- }
- efree(S->cols);
- S->cols = NULL;
- }
- efree(S);
-
- stmt->driver_data = NULL;
-
- return 1;
-} /* }}} */
-
-static int oci_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
-{
- pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
- ub4 rowcount;
- b4 mode;
-
- if (!S->stmt_type) {
- STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_STMT_TYPE",
- (S->stmt, OCI_HTYPE_STMT, &S->stmt_type, 0,
OCI_ATTR_STMT_TYPE, S->err));
- }
-
- if (stmt->executed) {
- /* ensure that we cancel the cursor from a previous fetch */
- OCIStmtFetch(S->stmt, S->err, 0, OCI_FETCH_NEXT, OCI_DEFAULT);
- }
-
-#ifdef OCI_STMT_SCROLLABLE_READONLY /* needed for oci8 ? */
- if (S->exec_type == OCI_STMT_SCROLLABLE_READONLY) {
- mode = OCI_STMT_SCROLLABLE_READONLY;
- } else
-#endif
- if (stmt->dbh->auto_commit && !stmt->dbh->in_txn) {
- mode = OCI_COMMIT_ON_SUCCESS;
- } else {
- mode = OCI_DEFAULT;
- }
-
- STMT_CALL(OCIStmtExecute, (S->H->svc, S->stmt, S->err,
- S->stmt_type == OCI_STMT_SELECT ? 0 : 1, 0,
NULL, NULL,
- mode));
-
- if (!stmt->executed) {
- ub4 colcount;
- /* do first-time-only definition of bind/mapping stuff */
-
- /* how many columns do we have ? */
- STMT_CALL_MSG(OCIAttrGet, "ATTR_PARAM_COUNT",
- (S->stmt, OCI_HTYPE_STMT, &colcount, 0,
OCI_ATTR_PARAM_COUNT, S->err));
-
- stmt->column_count = (int)colcount;
-
- S->cols = ecalloc(colcount, sizeof(pdo_oci_column));
- }
-
- STMT_CALL_MSG(OCIAttrGet, "ATTR_ROW_COUNT",
- (S->stmt, OCI_HTYPE_STMT, &rowcount, 0,
OCI_ATTR_ROW_COUNT, S->err));
- stmt->row_count = (long)rowcount;
-
- return 1;
-} /* }}} */
-
-static sb4 oci_bind_input_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index,
dvoid **bufpp, ub4 *alenp, ub1 *piecep, dvoid **indpp) /* {{{ */
-{
- struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx;
- pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data;
- TSRMLS_FETCH();
-
- if (!param || !param->parameter) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "param is NULL in
oci_bind_input_cb; this should not happen");
- return OCI_ERROR;
- }
-
- *indpp = &P->indicator;
-
- if (ZVAL_IS_NULL(param->parameter)) {
- /* insert a NULL value into the column */
- P->indicator = -1; /* NULL */
- *bufpp = 0;
- *alenp = -1;
- } else if (!P->thing) {
- /* regular string bind */
- convert_to_string(param->parameter);
- *bufpp = Z_STRVAL_P(param->parameter);
- *alenp = Z_STRLEN_P(param->parameter);
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "P->thing should
not be set??");
- return OCI_ERROR;
- }
-
- *piecep = OCI_ONE_PIECE;
- return OCI_CONTINUE;
-} /* }}} */
-
-static sb4 oci_bind_output_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index,
dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp) /* {{{
*/
-{
- struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx;
- pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data;
- TSRMLS_FETCH();
-
- if (!param || !param->parameter) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "param is NULL in
oci_bind_output_cb; this should not happen");
- return OCI_ERROR;
- }
-
- if (Z_TYPE_P(param->parameter) == IS_OBJECT ||
Z_TYPE_P(param->parameter) == IS_RESOURCE) {
- return OCI_CONTINUE;
- }
-
- convert_to_string(param->parameter);
- zval_dtor(param->parameter);
-
- Z_STRLEN_P(param->parameter) = param->max_value_len;
- Z_STRVAL_P(param->parameter) = emalloc(Z_STRLEN_P(param->parameter)+1);
- P->used_for_output = 1;
-
- P->actual_len = Z_STRLEN_P(param->parameter);
- *alenpp = &P->actual_len;
- *bufpp = Z_STRVAL_P(param->parameter);
- *piecep = OCI_ONE_PIECE;
- *rcodepp = &P->retcode;
- *indpp = &P->indicator;
-
- return OCI_CONTINUE;
-} /* }}} */
-
-static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data
*param, enum pdo_param_event event_type TSRMLS_DC) /* {{{ */
-{
- pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
-
- /* we're only interested in parameters for prepared SQL right now */
- if (param->is_param) {
- pdo_oci_bound_param *P;
- sb4 value_sz = -1;
-
- P = (pdo_oci_bound_param*)param->driver_data;
-
- switch (event_type) {
- case PDO_PARAM_EVT_FREE:
- P = param->driver_data;
- if (P) {
- efree(P);
- }
- break;
-
- case PDO_PARAM_EVT_ALLOC:
- P = (pdo_oci_bound_param*)ecalloc(1,
sizeof(pdo_oci_bound_param));
- param->driver_data = P;
-
- /* figure out what we're doing */
- switch (PDO_PARAM_TYPE(param->param_type)) {
- case PDO_PARAM_LOB:
- case PDO_PARAM_STMT:
- return 0;
-
- case PDO_PARAM_STR:
- default:
- P->oci_type = SQLT_CHR;
- value_sz = param->max_value_len
+ 1;
- if (param->max_value_len == 0) {
- value_sz = 4000; /*
maximum size before value is interpreted as a LONG value */
- }
-
- }
-
- if (param->name) {
- STMT_CALL(OCIBindByName, (S->stmt,
- &P->bind, S->err,
(text*)param->name,
- param->namelen, 0,
value_sz, P->oci_type,
- &P->indicator, 0,
&P->retcode, 0, 0,
- OCI_DATA_AT_EXEC));
- } else {
- STMT_CALL(OCIBindByPos, (S->stmt,
- &P->bind, S->err,
param->paramno+1,
- 0, value_sz,
P->oci_type,
- &P->indicator, 0,
&P->retcode, 0, 0,
- OCI_DATA_AT_EXEC));
- }
-
- STMT_CALL(OCIBindDynamic, (P->bind,
- S->err,
- param,
oci_bind_input_cb,
- param,
oci_bind_output_cb));
-
- return 1;
-
- case PDO_PARAM_EVT_EXEC_PRE:
- P->indicator = 0;
- P->used_for_output = 0;
- return 1;
-
- case PDO_PARAM_EVT_EXEC_POST:
- /* fixup stuff set in motion in
oci_bind_output_cb */
- if (P->used_for_output) {
- if (P->indicator == -1) {
- /* set up a NULL value */
- if (Z_TYPE_P(param->parameter)
== IS_STRING
-#if ZEND_EXTENSION_API_NO < 220040718
- &&
Z_STRVAL_P(param->parameter) != empty_string
-#endif
- ) {
- /* OCI likes to stick
non-terminated strings in things */
-
*Z_STRVAL_P(param->parameter) = '\0';
- }
- zval_dtor(param->parameter);
- ZVAL_NULL(param->parameter);
- } else if (Z_TYPE_P(param->parameter)
== IS_STRING
-#if ZEND_EXTENSION_API_NO < 220040718
- &&
Z_STRVAL_P(param->parameter) != empty_string
-#endif
- ) {
- Z_STRLEN_P(param->parameter) =
P->actual_len;
- Z_STRVAL_P(param->parameter) =
erealloc(Z_STRVAL_P(param->parameter), P->actual_len+1);
-
Z_STRVAL_P(param->parameter)[P->actual_len] = '\0';
- }
- }
-
- return 1;
- }
- }
-
- return 1;
-} /* }}} */
-
-static int oci_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori,
long offset TSRMLS_DC) /* {{{ */
-{
-#if HAVE_OCISTMTFETCH2
- ub4 ociori;
-#endif
- pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
-
-#if HAVE_OCISTMTFETCH2
- switch (ori) {
- case PDO_FETCH_ORI_NEXT: ociori = OCI_FETCH_NEXT; break;
- case PDO_FETCH_ORI_PRIOR: ociori = OCI_FETCH_PRIOR; break;
- case PDO_FETCH_ORI_FIRST: ociori = OCI_FETCH_FIRST; break;
- case PDO_FETCH_ORI_LAST: ociori = OCI_FETCH_LAST; break;
- case PDO_FETCH_ORI_ABS: ociori = OCI_FETCH_ABSOLUTE;
break;
- case PDO_FETCH_ORI_REL: ociori = OCI_FETCH_RELATIVE;
break;
- }
- S->last_err = OCIStmtFetch2(S->stmt, S->err, 1, ociori, offset,
OCI_DEFAULT);
-#else
- S->last_err = OCIStmtFetch(S->stmt, S->err, 1, OCI_FETCH_NEXT,
OCI_DEFAULT);
-#endif
-
- if (S->last_err == OCI_NO_DATA) {
- /* no (more) data */
- return 0;
- }
-
- if (S->last_err == OCI_NEED_DATA) {
- oci_stmt_error("OCI_NEED_DATA");
- return 0;
- }
-
- if (S->last_err == OCI_SUCCESS_WITH_INFO || S->last_err == OCI_SUCCESS)
{
- return 1;
- }
-
- oci_stmt_error("OCIStmtFetch");
-
- return 0;
-} /* }}} */
-
-static int oci_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */
-{
- pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
- OCIParam *param = NULL;
- text *colname;
- ub2 dtype, data_size, scale, precis;
- ub4 namelen;
- struct pdo_column_data *col = &stmt->columns[colno];
- zend_bool dyn = FALSE;
-
- /* describe the column */
- STMT_CALL(OCIParamGet, (S->stmt, OCI_HTYPE_STMT, S->err,
(dvoid*)¶m, colno+1));
-
- /* what type ? */
- STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_DATA_TYPE",
- (param, OCI_DTYPE_PARAM, &dtype, 0, OCI_ATTR_DATA_TYPE,
S->err));
-
- /* how big ? */
- STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_DATA_SIZE",
- (param, OCI_DTYPE_PARAM, &data_size, 0,
OCI_ATTR_DATA_SIZE, S->err));
-
- /* scale ? */
- STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_SCALE",
- (param, OCI_DTYPE_PARAM, &scale, 0, OCI_ATTR_SCALE,
S->err));
-
- /* precision ? */
- STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_PRECISION",
- (param, OCI_DTYPE_PARAM, &precis, 0,
OCI_ATTR_PRECISION, S->err));
-
- /* name ? */
- STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_NAME",
- (param, OCI_DTYPE_PARAM, &colname, &namelen,
OCI_ATTR_NAME, S->err));
-
- col->precision = scale;
- col->maxlen = data_size;
- col->namelen = namelen;
- col->name = estrndup(colname, namelen);
-
- /* how much room do we need to store the field */
- switch (dtype) {
- case SQLT_LBI:
- case SQLT_LNG:
- dyn = FALSE;
- if (dtype == SQLT_LBI) {
- dtype = SQLT_BIN;
- } else {
- dtype = SQLT_CHR;
- }
- S->cols[colno].datalen = 512; /* XXX should be INT_MAX
and fetched by pieces */
- S->cols[colno].data = emalloc(S->cols[colno].datalen +
1);
- col->param_type = PDO_PARAM_STR;
- break;
-
- case SQLT_BIN:
- default:
- dyn = FALSE;
- if (dtype == SQLT_DAT || dtype == SQLT_NUM
-#ifdef SQLT_TIMESTAMP
- || dtype == SQLT_TIMESTAMP
-#endif
-#ifdef SQLT_TIMESTAMP_TZ
- || dtype == SQLT_TIMESTAMP_TZ
-#endif
- ) {
- /* should be big enough for most date formats
and numbers */
- S->cols[colno].datalen = 512;
- } else {
- S->cols[colno].datalen = col->maxlen;
- }
- if (dtype == SQLT_BIN) {
- S->cols[colno].datalen *= 3;
- }
- S->cols[colno].data = emalloc(S->cols[colno].datalen +
1);
- dtype = SQLT_CHR;
-
- /* returning data as a string */
- col->param_type = PDO_PARAM_STR;
- }
-
- if (!dyn) {
- STMT_CALL(OCIDefineByPos, (S->stmt, &S->cols[colno].def,
S->err, colno+1,
- S->cols[colno].data,
S->cols[colno].datalen, dtype, &S->cols[colno].indicator,
- &S->cols[colno].fetched_len,
&S->cols[colno].retcode, OCI_DEFAULT));
- }
-
- return 1;
-} /* }}} */
-
-static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned
long *len, int *caller_frees TSRMLS_DC) /* {{{ */
-{
- pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
- pdo_oci_column *C = &S->cols[colno];
-
- /* check the indicator to ensure that the data is intact */
- if (C->indicator == -1) {
- /* A NULL value */
- *ptr = NULL;
- *len = 0;
- return 1;
- } else if (C->indicator == 0) {
- /* it was stored perfectly */
- *ptr = C->data;
- *len = C->fetched_len;
- return 1;
- } else {
- /* it was truncated */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d data was
too large for buffer and was truncated to fit it", colno);
-
- *ptr = C->data;
- *len = C->fetched_len;
- return 1;
- }
-} /* }}} */
-
-struct pdo_stmt_methods oci_stmt_methods = {
- oci_stmt_dtor,
- oci_stmt_execute,
- oci_stmt_fetch,
- oci_stmt_describe,
- oci_stmt_get_col,
- oci_stmt_param_hook
-};
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | [EMAIL PROTECTED] so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <[EMAIL PROTECTED]>
|
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: oci_statement.c,v 1.18 2005/11/25 15:40:13 sniper Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "pdo/php_pdo.h"
+#include "pdo/php_pdo_driver.h"
+#include "php_pdo_oci.h"
+#include "php_pdo_oci_int.h"
+#include "Zend/zend_extensions.h"
+
+#define STMT_CALL(name, params) \
+ S->last_err = name params; \
+ S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name, S->last_err,
__FILE__, __LINE__ TSRMLS_CC); \
+ if (S->last_err) { \
+ return 0; \
+ }
+
+#define STMT_CALL_MSG(name, msg, params) \
+ S->last_err = name params; \
+ S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name ": " #msg,
S->last_err, __FILE__, __LINE__ TSRMLS_CC); \
+ if (S->last_err) { \
+ return 0; \
+ }
+
+
+static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
+ HashTable *BC = stmt->bound_columns;
+ HashTable *BP = stmt->bound_params;
+
+ int i;
+
+ if (S->stmt) {
+ /* cancel server side resources for the statement if we didn't
+ * fetch it all */
+ OCIStmtFetch(S->stmt, S->err, 0, OCI_FETCH_NEXT, OCI_DEFAULT);
+
+ /* free the handle */
+ OCIHandleFree(S->stmt, OCI_HTYPE_STMT);
+ S->stmt = NULL;
+ }
+ if (S->err) {
+ OCIHandleFree(S->err, OCI_HTYPE_ERROR);
+ S->err = NULL;
+ }
+
+ /* need to ensure these go away now */
+ if (BC) {
+ zend_hash_destroy(BC);
+ FREE_HASHTABLE(stmt->bound_columns);
+ stmt->bound_columns = NULL;
+ }
+
+ if (BP) {
+ zend_hash_destroy(BP);
+ FREE_HASHTABLE(stmt->bound_params);
+ stmt->bound_params = NULL;
+ }
+
+ if (S->einfo.errmsg) {
+ efree(S->einfo.errmsg);
+ S->einfo.errmsg = NULL;
+ }
+
+ if (S->cols) {
+ for (i = 0; i < stmt->column_count; i++) {
+ if (S->cols[i].data) {
+ efree(S->cols[i].data);
+ }
+ }
+ efree(S->cols);
+ S->cols = NULL;
+ }
+ efree(S);
+
+ stmt->driver_data = NULL;
+
+ return 1;
+} /* }}} */
+
+static int oci_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
+ ub4 rowcount;
+ b4 mode;
+
+ if (!S->stmt_type) {
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_STMT_TYPE",
+ (S->stmt, OCI_HTYPE_STMT, &S->stmt_type, 0,
OCI_ATTR_STMT_TYPE, S->err));
+ }
+
+ if (stmt->executed) {
+ /* ensure that we cancel the cursor from a previous fetch */
+ OCIStmtFetch(S->stmt, S->err, 0, OCI_FETCH_NEXT, OCI_DEFAULT);
+ }
+
+#ifdef OCI_STMT_SCROLLABLE_READONLY /* needed for oci8 ? */
+ if (S->exec_type == OCI_STMT_SCROLLABLE_READONLY) {
+ mode = OCI_STMT_SCROLLABLE_READONLY;
+ } else
+#endif
+ if (stmt->dbh->auto_commit && !stmt->dbh->in_txn) {
+ mode = OCI_COMMIT_ON_SUCCESS;
+ } else {
+ mode = OCI_DEFAULT;
+ }
+
+ STMT_CALL(OCIStmtExecute, (S->H->svc, S->stmt, S->err,
+ S->stmt_type == OCI_STMT_SELECT ? 0 : 1, 0,
NULL, NULL,
+ mode));
+
+ if (!stmt->executed) {
+ ub4 colcount;
+ /* do first-time-only definition of bind/mapping stuff */
+
+ /* how many columns do we have ? */
+ STMT_CALL_MSG(OCIAttrGet, "ATTR_PARAM_COUNT",
+ (S->stmt, OCI_HTYPE_STMT, &colcount, 0,
OCI_ATTR_PARAM_COUNT, S->err));
+
+ stmt->column_count = (int)colcount;
+
+ S->cols = ecalloc(colcount, sizeof(pdo_oci_column));
+ }
+
+ STMT_CALL_MSG(OCIAttrGet, "ATTR_ROW_COUNT",
+ (S->stmt, OCI_HTYPE_STMT, &rowcount, 0,
OCI_ATTR_ROW_COUNT, S->err));
+ stmt->row_count = (long)rowcount;
+
+ return 1;
+} /* }}} */
+
+static sb4 oci_bind_input_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index,
dvoid **bufpp, ub4 *alenp, ub1 *piecep, dvoid **indpp) /* {{{ */
+{
+ struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx;
+ pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data;
+ TSRMLS_FETCH();
+
+ if (!param || !param->parameter) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "param is NULL in
oci_bind_input_cb; this should not happen");
+ return OCI_ERROR;
+ }
+
+ *indpp = &P->indicator;
+
+ if (ZVAL_IS_NULL(param->parameter)) {
+ /* insert a NULL value into the column */
+ P->indicator = -1; /* NULL */
+ *bufpp = 0;
+ *alenp = -1;
+ } else if (!P->thing) {
+ /* regular string bind */
+ convert_to_string(param->parameter);
+ *bufpp = Z_STRVAL_P(param->parameter);
+ *alenp = Z_STRLEN_P(param->parameter);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "P->thing should
not be set??");
+ return OCI_ERROR;
+ }
+
+ *piecep = OCI_ONE_PIECE;
+ return OCI_CONTINUE;
+} /* }}} */
+
+static sb4 oci_bind_output_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index,
dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp) /* {{{
*/
+{
+ struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx;
+ pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data;
+ TSRMLS_FETCH();
+
+ if (!param || !param->parameter) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "param is NULL in
oci_bind_output_cb; this should not happen");
+ return OCI_ERROR;
+ }
+
+ if (Z_TYPE_P(param->parameter) == IS_OBJECT ||
Z_TYPE_P(param->parameter) == IS_RESOURCE) {
+ return OCI_CONTINUE;
+ }
+
+ convert_to_string(param->parameter);
+ zval_dtor(param->parameter);
+
+ Z_STRLEN_P(param->parameter) = param->max_value_len;
+ Z_STRVAL_P(param->parameter) = emalloc(Z_STRLEN_P(param->parameter)+1);
+ P->used_for_output = 1;
+
+ P->actual_len = Z_STRLEN_P(param->parameter);
+ *alenpp = &P->actual_len;
+ *bufpp = Z_STRVAL_P(param->parameter);
+ *piecep = OCI_ONE_PIECE;
+ *rcodepp = &P->retcode;
+ *indpp = &P->indicator;
+
+ return OCI_CONTINUE;
+} /* }}} */
+
+static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data
*param, enum pdo_param_event event_type TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
+
+ /* we're only interested in parameters for prepared SQL right now */
+ if (param->is_param) {
+ pdo_oci_bound_param *P;
+ sb4 value_sz = -1;
+
+ P = (pdo_oci_bound_param*)param->driver_data;
+
+ switch (event_type) {
+ case PDO_PARAM_EVT_FREE:
+ P = param->driver_data;
+ if (P) {
+ efree(P);
+ }
+ break;
+
+ case PDO_PARAM_EVT_ALLOC:
+ P = (pdo_oci_bound_param*)ecalloc(1,
sizeof(pdo_oci_bound_param));
+ param->driver_data = P;
+
+ /* figure out what we're doing */
+ switch (PDO_PARAM_TYPE(param->param_type)) {
+ case PDO_PARAM_LOB:
+ case PDO_PARAM_STMT:
+ return 0;
+
+ case PDO_PARAM_STR:
+ default:
+ P->oci_type = SQLT_CHR;
+ value_sz = param->max_value_len
+ 1;
+ if (param->max_value_len == 0) {
+ value_sz = 4000; /*
maximum size before value is interpreted as a LONG value */
+ }
+
+ }
+
+ if (param->name) {
+ STMT_CALL(OCIBindByName, (S->stmt,
+ &P->bind, S->err,
(text*)param->name,
+ param->namelen, 0,
value_sz, P->oci_type,
+ &P->indicator, 0,
&P->retcode, 0, 0,
+ OCI_DATA_AT_EXEC));
+ } else {
+ STMT_CALL(OCIBindByPos, (S->stmt,
+ &P->bind, S->err,
param->paramno+1,
+ 0, value_sz,
P->oci_type,
+ &P->indicator, 0,
&P->retcode, 0, 0,
+ OCI_DATA_AT_EXEC));
+ }
+
+ STMT_CALL(OCIBindDynamic, (P->bind,
+ S->err,
+ param,
oci_bind_input_cb,
+ param,
oci_bind_output_cb));
+
+ return 1;
+
+ case PDO_PARAM_EVT_EXEC_PRE:
+ P->indicator = 0;
+ P->used_for_output = 0;
+ return 1;
+
+ case PDO_PARAM_EVT_EXEC_POST:
+ /* fixup stuff set in motion in
oci_bind_output_cb */
+ if (P->used_for_output) {
+ if (P->indicator == -1) {
+ /* set up a NULL value */
+ if (Z_TYPE_P(param->parameter)
== IS_STRING
+#if ZEND_EXTENSION_API_NO < 220040718
+ &&
Z_STRVAL_P(param->parameter) != empty_string
+#endif
+ ) {
+ /* OCI likes to stick
non-terminated strings in things */
+
*Z_STRVAL_P(param->parameter) = '\0';
+ }
+ zval_dtor(param->parameter);
+ ZVAL_NULL(param->parameter);
+ } else if (Z_TYPE_P(param->parameter)
== IS_STRING
+#if ZEND_EXTENSION_API_NO < 220040718
+ &&
Z_STRVAL_P(param->parameter) != empty_string
+#endif
+ ) {
+ Z_STRLEN_P(param->parameter) =
P->actual_len;
+ Z_STRVAL_P(param->parameter) =
erealloc(Z_STRVAL_P(param->parameter), P->actual_len+1);
+
Z_STRVAL_P(param->parameter)[P->actual_len] = '\0';
+ }
+ }
+
+ return 1;
+ }
+ }
+
+ return 1;
+} /* }}} */
+
+static int oci_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori,
long offset TSRMLS_DC) /* {{{ */
+{
+#if HAVE_OCISTMTFETCH2
+ ub4 ociori;
+#endif
+ pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
+
+#if HAVE_OCISTMTFETCH2
+ switch (ori) {
+ case PDO_FETCH_ORI_NEXT: ociori = OCI_FETCH_NEXT; break;
+ case PDO_FETCH_ORI_PRIOR: ociori = OCI_FETCH_PRIOR; break;
+ case PDO_FETCH_ORI_FIRST: ociori = OCI_FETCH_FIRST; break;
+ case PDO_FETCH_ORI_LAST: ociori = OCI_FETCH_LAST; break;
+ case PDO_FETCH_ORI_ABS: ociori = OCI_FETCH_ABSOLUTE;
break;
+ case PDO_FETCH_ORI_REL: ociori = OCI_FETCH_RELATIVE;
break;
+ }
+ S->last_err = OCIStmtFetch2(S->stmt, S->err, 1, ociori, offset,
OCI_DEFAULT);
+#else
+ S->last_err = OCIStmtFetch(S->stmt, S->err, 1, OCI_FETCH_NEXT,
OCI_DEFAULT);
+#endif
+
+ if (S->last_err == OCI_NO_DATA) {
+ /* no (more) data */
+ return 0;
+ }
+
+ if (S->last_err == OCI_NEED_DATA) {
+ oci_stmt_error("OCI_NEED_DATA");
+ return 0;
+ }
+
+ if (S->last_err == OCI_SUCCESS_WITH_INFO || S->last_err == OCI_SUCCESS)
{
+ return 1;
+ }
+
+ oci_stmt_error("OCIStmtFetch");
+
+ return 0;
+} /* }}} */
+
+static int oci_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
+ OCIParam *param = NULL;
+ text *colname;
+ ub2 dtype, data_size, scale, precis;
+ ub4 namelen;
+ struct pdo_column_data *col = &stmt->columns[colno];
+ zend_bool dyn = FALSE;
+
+ /* describe the column */
+ STMT_CALL(OCIParamGet, (S->stmt, OCI_HTYPE_STMT, S->err,
(dvoid*)¶m, colno+1));
+
+ /* what type ? */
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_DATA_TYPE",
+ (param, OCI_DTYPE_PARAM, &dtype, 0, OCI_ATTR_DATA_TYPE,
S->err));
+
+ /* how big ? */
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_DATA_SIZE",
+ (param, OCI_DTYPE_PARAM, &data_size, 0,
OCI_ATTR_DATA_SIZE, S->err));
+
+ /* scale ? */
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_SCALE",
+ (param, OCI_DTYPE_PARAM, &scale, 0, OCI_ATTR_SCALE,
S->err));
+
+ /* precision ? */
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_PRECISION",
+ (param, OCI_DTYPE_PARAM, &precis, 0,
OCI_ATTR_PRECISION, S->err));
+
+ /* name ? */
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_NAME",
+ (param, OCI_DTYPE_PARAM, &colname, &namelen,
OCI_ATTR_NAME, S->err));
+
+ col->precision = scale;
+ col->maxlen = data_size;
+ col->namelen = namelen;
+ col->name = estrndup(colname, namelen);
+
+ /* how much room do we need to store the field */
+ switch (dtype) {
+ case SQLT_LBI:
+ case SQLT_LNG:
+ dyn = FALSE;
+ if (dtype == SQLT_LBI) {
+ dtype = SQLT_BIN;
+ } else {
+ dtype = SQLT_CHR;
+ }
+ S->cols[colno].datalen = 512; /* XXX should be INT_MAX
and fetched by pieces */
+ S->cols[colno].data = emalloc(S->cols[colno].datalen +
1);
+ col->param_type = PDO_PARAM_STR;
+ break;
+
+ case SQLT_BIN:
+ default:
+ dyn = FALSE;
+ if (dtype == SQLT_DAT || dtype == SQLT_NUM
+#ifdef SQLT_TIMESTAMP
+ || dtype == SQLT_TIMESTAMP
+#endif
+#ifdef SQLT_TIMESTAMP_TZ
+ || dtype == SQLT_TIMESTAMP_TZ
+#endif
+ ) {
+ /* should be big enough for most date formats
and numbers */
+ S->cols[colno].datalen = 512;
+ } else {
+ S->cols[colno].datalen = col->maxlen;
+ }
+ if (dtype == SQLT_BIN) {
+ S->cols[colno].datalen *= 3;
+ }
+ S->cols[colno].data = emalloc(S->cols[colno].datalen +
1);
+ dtype = SQLT_CHR;
+
+ /* returning data as a string */
+ col->param_type = PDO_PARAM_STR;
+ }
+
+ if (!dyn) {
+ STMT_CALL(OCIDefineByPos, (S->stmt, &S->cols[colno].def,
S->err, colno+1,
+ S->cols[colno].data,
S->cols[colno].datalen, dtype, &S->cols[colno].indicator,
+ &S->cols[colno].fetched_len,
&S->cols[colno].retcode, OCI_DEFAULT));
+ }
+
+ return 1;
+} /* }}} */
+
+static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned
long *len, int *caller_frees TSRMLS_DC) /* {{{ */
+{
+ pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
+ pdo_oci_column *C = &S->cols[colno];
+
+ /* check the indicator to ensure that the data is intact */
+ if (C->indicator == -1) {
+ /* A NULL value */
+ *ptr = NULL;
+ *len = 0;
+ return 1;
+ } else if (C->indicator == 0) {
+ /* it was stored perfectly */
+ *ptr = C->data;
+ *len = C->fetched_len;
+ return 1;
+ } else {
+ /* it was truncated */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d data was
too large for buffer and was truncated to fit it", colno);
+
+ *ptr = C->data;
+ *len = C->fetched_len;
+ return 1;
+ }
+} /* }}} */
+
+struct pdo_stmt_methods oci_stmt_methods = {
+ oci_stmt_dtor,
+ oci_stmt_execute,
+ oci_stmt_fetch,
+ oci_stmt_describe,
+ oci_stmt_get_col,
+ oci_stmt_param_hook
+};
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
http://cvs.php.net/diff.php/php-src/ext/pdo_oci/pdo_oci.c?r1=1.5&r2=1.6&ty=u
Index: php-src/ext/pdo_oci/pdo_oci.c
diff -u php-src/ext/pdo_oci/pdo_oci.c:1.5 php-src/ext/pdo_oci/pdo_oci.c:1.6
--- php-src/ext/pdo_oci/pdo_oci.c:1.5 Tue Jul 26 23:48:08 2005
+++ php-src/ext/pdo_oci/pdo_oci.c Fri Nov 25 10:40:13 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_oci.c,v 1.5 2005/07/27 03:48:08 wez Exp $ */
+/* $Id: pdo_oci.c,v 1.6 2005/11/25 15:40:13 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -38,7 +38,7 @@
/* {{{ pdo_oci_module_entry */
-#if ZEND_EXTENSION_API_NO >= 220050617
+#if ZEND_MODULE_API_NO >= 20050922
static zend_module_dep pdo_oci_deps[] = {
ZEND_MOD_REQUIRED("pdo")
{NULL, NULL, NULL}
@@ -46,7 +46,7 @@
#endif
zend_module_entry pdo_oci_module_entry = {
-#if ZEND_EXTENSION_API_NO >= 220050617
+#if ZEND_MODULE_API_NO >= 20050922
STANDARD_MODULE_HEADER_EX, NULL,
pdo_oci_deps,
#else
http://cvs.php.net/diff.php/php-src/ext/pdo_oci/php_pdo_oci_int.h?r1=1.4&r2=1.5&ty=u
Index: php-src/ext/pdo_oci/php_pdo_oci_int.h
diff -u php-src/ext/pdo_oci/php_pdo_oci_int.h:1.4
php-src/ext/pdo_oci/php_pdo_oci_int.h:1.5
--- php-src/ext/pdo_oci/php_pdo_oci_int.h:1.4 Mon Jul 11 22:43:39 2005
+++ php-src/ext/pdo_oci/php_pdo_oci_int.h Fri Nov 25 10:40:13 2005
@@ -1,91 +1,91 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | [EMAIL PROTECTED] so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Wez Furlong <[EMAIL PROTECTED]>
|
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: php_pdo_oci_int.h,v 1.4 2005/07/12 02:43:39 wez Exp $ */
-
-#include <oci.h>
-
-typedef struct {
- const char *file;
- int line;
- sb4 errcode;
- char *errmsg;
-} pdo_oci_error_info;
-
-/* stuff we use in an OCI database handle */
-typedef struct {
- OCIServer *server;
- OCISession *session;
- OCIEnv *env;
- OCIError *err;
- OCISvcCtx *svc;
- /* OCI9; 0 == use NLS_LANG */
- ub2 charset;
- sword last_err;
-
- unsigned attached:1;
- unsigned _reserved:31;
-
- pdo_oci_error_info einfo;
-} pdo_oci_db_handle;
-
-typedef struct {
- OCIDefine *def;
- ub2 fetched_len;
- ub2 retcode;
- sb2 indicator;
-
- char *data;
- unsigned long datalen;
-
-} pdo_oci_column;
-
-typedef struct {
- pdo_oci_db_handle *H;
- OCIStmt *stmt;
- OCIError *err;
- sword last_err;
- ub2 stmt_type;
- ub4 exec_type;
- pdo_oci_column *cols;
- pdo_oci_error_info einfo;
-} pdo_oci_stmt;
-
-typedef struct {
- OCIBind *bind; /* allocated by OCI */
- sb2 oci_type;
- sb2 indicator;
- ub2 retcode;
-
- ub4 actual_len;
-
- dvoid *thing; /* for LOBS, REFCURSORS etc. */
-
- unsigned used_for_output;
-} pdo_oci_bound_param;
-
-extern const ub4 PDO_OCI_INIT_MODE;
-extern pdo_driver_t pdo_oci_driver;
-extern OCIEnv *pdo_oci_Env;
-
-ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what,
sword status, const char *file, int line TSRMLS_DC);
-#define oci_drv_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err,
__FILE__, __LINE__ TSRMLS_CC)
-#define oci_stmt_error(w) _oci_error(S->err, stmt->dbh, stmt, w,
S->last_err, __FILE__, __LINE__ TSRMLS_CC)
-
-extern struct pdo_stmt_methods oci_stmt_methods;
-
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2005 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | [EMAIL PROTECTED] so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <[EMAIL PROTECTED]>
|
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_pdo_oci_int.h,v 1.5 2005/11/25 15:40:13 sniper Exp $ */
+
+#include <oci.h>
+
+typedef struct {
+ const char *file;
+ int line;
+ sb4 errcode;
+ char *errmsg;
+} pdo_oci_error_info;
+
+/* stuff we use in an OCI database handle */
+typedef struct {
+ OCIServer *server;
+ OCISession *session;
+ OCIEnv *env;
+ OCIError *err;
+ OCISvcCtx *svc;
+ /* OCI9; 0 == use NLS_LANG */
+ ub2 charset;
+ sword last_err;
+
+ unsigned attached:1;
+ unsigned _reserved:31;
+
+ pdo_oci_error_info einfo;
+} pdo_oci_db_handle;
+
+typedef struct {
+ OCIDefine *def;
+ ub2 fetched_len;
+ ub2 retcode;
+ sb2 indicator;
+
+ char *data;
+ unsigned long datalen;
+
+} pdo_oci_column;
+
+typedef struct {
+ pdo_oci_db_handle *H;
+ OCIStmt *stmt;
+ OCIError *err;
+ sword last_err;
+ ub2 stmt_type;
+ ub4 exec_type;
+ pdo_oci_column *cols;
+ pdo_oci_error_info einfo;
+} pdo_oci_stmt;
+
+typedef struct {
+ OCIBind *bind; /* allocated by OCI */
+ sb2 oci_type;
+ sb2 indicator;
+ ub2 retcode;
+
+ ub4 actual_len;
+
+ dvoid *thing; /* for LOBS, REFCURSORS etc. */
+
+ unsigned used_for_output;
+} pdo_oci_bound_param;
+
+extern const ub4 PDO_OCI_INIT_MODE;
+extern pdo_driver_t pdo_oci_driver;
+extern OCIEnv *pdo_oci_Env;
+
+ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what,
sword status, const char *file, int line TSRMLS_DC);
+#define oci_drv_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err,
__FILE__, __LINE__ TSRMLS_CC)
+#define oci_stmt_error(w) _oci_error(S->err, stmt->dbh, stmt, w,
S->last_err, __FILE__, __LINE__ TSRMLS_CC)
+
+extern struct pdo_stmt_methods oci_stmt_methods;
+
http://cvs.php.net/diff.php/php-src/ext/pdo_pgsql/pdo_pgsql.c?r1=1.9&r2=1.10&ty=u
Index: php-src/ext/pdo_pgsql/pdo_pgsql.c
diff -u php-src/ext/pdo_pgsql/pdo_pgsql.c:1.9
php-src/ext/pdo_pgsql/pdo_pgsql.c:1.10
--- php-src/ext/pdo_pgsql/pdo_pgsql.c:1.9 Mon Sep 19 20:46:07 2005
+++ php-src/ext/pdo_pgsql/pdo_pgsql.c Fri Nov 25 10:40:13 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_pgsql.c,v 1.9 2005/09/20 00:46:07 iliaa Exp $ */
+/* $Id: pdo_pgsql.c,v 1.10 2005/11/25 15:40:13 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -38,7 +38,7 @@
/* {{{ pdo_sqlite_deps
*/
-#if ZEND_EXTENSION_API_NO >= 220050617
+#if ZEND_MODULE_API_NO >= 20050922
static zend_module_dep pdo_pgsql_deps[] = {
ZEND_MOD_REQUIRED("pdo")
{NULL, NULL, NULL}
@@ -48,7 +48,7 @@
/* {{{ pdo_pgsql_module_entry */
zend_module_entry pdo_pgsql_module_entry = {
-#if ZEND_EXTENSION_API_NO >= 220050617
+#if ZEND_MODULE_API_NO >= 20050922
STANDARD_MODULE_HEADER_EX, NULL,
pdo_pgsql_deps,
#else
http://cvs.php.net/diff.php/php-src/ext/pdo_sqlite/pdo_sqlite.c?r1=1.10&r2=1.11&ty=u
Index: php-src/ext/pdo_sqlite/pdo_sqlite.c
diff -u php-src/ext/pdo_sqlite/pdo_sqlite.c:1.10
php-src/ext/pdo_sqlite/pdo_sqlite.c:1.11
--- php-src/ext/pdo_sqlite/pdo_sqlite.c:1.10 Wed Jul 27 00:07:11 2005
+++ php-src/ext/pdo_sqlite/pdo_sqlite.c Fri Nov 25 10:40:14 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_sqlite.c,v 1.10 2005/07/27 04:07:11 wez Exp $ */
+/* $Id: pdo_sqlite.c,v 1.11 2005/11/25 15:40:14 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -41,7 +41,7 @@
/* {{{ pdo_sqlite_deps
*/
-#if ZEND_EXTENSION_API_NO >= 220050617
+#if ZEND_MODULE_API_NO >= 20050922
static zend_module_dep pdo_sqlite_deps[] = {
ZEND_MOD_REQUIRED("pdo")
{NULL, NULL, NULL}
@@ -52,7 +52,7 @@
/* {{{ pdo_sqlite_module_entry
*/
zend_module_entry pdo_sqlite_module_entry = {
-#if ZEND_EXTENSION_API_NO >= 220050617
+#if ZEND_MODULE_API_NO >= 20050922
STANDARD_MODULE_HEADER_EX, NULL,
pdo_sqlite_deps,
#else
@@ -100,7 +100,7 @@
"(bundled) "
#endif
PHP_PDO_SQLITE_MODULE_VERSION
- " $Id: pdo_sqlite.c,v 1.10 2005/07/27 04:07:11 wez Exp $");
+ " $Id: pdo_sqlite.c,v 1.11 2005/11/25 15:40:14 sniper Exp $");
php_info_print_table_row(2, "SQLite Library", sqlite3_libversion());
php_info_print_table_end();
}
http://cvs.php.net/diff.php/php-src/ext/sqlite/sqlite.c?r1=1.177&r2=1.178&ty=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.177 php-src/ext/sqlite/sqlite.c:1.178
--- php-src/ext/sqlite/sqlite.c:1.177 Thu Nov 17 09:40:11 2005
+++ php-src/ext/sqlite/sqlite.c Fri Nov 25 10:40:14 2005
@@ -17,7 +17,7 @@
| Marcus Boerger <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
- $Id: sqlite.c,v 1.177 2005/11/17 14:40:11 iliaa Exp $
+ $Id: sqlite.c,v 1.178 2005/11/25 15:40:14 sniper Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -282,7 +282,7 @@
};
zend_module_entry sqlite_module_entry = {
-#if ZEND_MODULE_API_NO >= 20050608
+#if ZEND_MODULE_API_NO >= 20050922
STANDARD_MODULE_HEADER_EX, NULL,
sqlite_deps,
#elif ZEND_MODULE_API_NO >= 20010901
@@ -1126,7 +1126,7 @@
{
php_info_print_table_start();
php_info_print_table_header(2, "SQLite support", "enabled");
- php_info_print_table_row(2, "PECL Module version",
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.177 2005/11/17 14:40:11 iliaa Exp
$");
+ php_info_print_table_row(2, "PECL Module version",
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.178 2005/11/25 15:40:14 sniper
Exp $");
php_info_print_table_row(2, "SQLite Library", sqlite_libversion());
php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding());
php_info_print_table_end();
http://cvs.php.net/diff.php/php-src/ext/xmlreader/php_xmlreader.c?r1=1.19&r2=1.20&ty=u
Index: php-src/ext/xmlreader/php_xmlreader.c
diff -u php-src/ext/xmlreader/php_xmlreader.c:1.19
php-src/ext/xmlreader/php_xmlreader.c:1.20
--- php-src/ext/xmlreader/php_xmlreader.c:1.19 Tue Nov 15 10:21:47 2005
+++ php-src/ext/xmlreader/php_xmlreader.c Fri Nov 25 10:40:14 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_xmlreader.c,v 1.19 2005/11/15 15:21:47 dmitry Exp $ */
+/* $Id: php_xmlreader.c,v 1.20 2005/11/25 15:40:14 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -276,7 +276,7 @@
}
#endif
-#if ZEND_EXTENSION_API_NO >= 220050617
+#if ZEND_MODULE_API_NO >= 20050922
static zend_module_dep xmlreader_deps[] = {
ZEND_MOD_REQUIRED("libxml")
{NULL, NULL, NULL}
@@ -286,7 +286,7 @@
/* {{{ xmlreader_module_entry
*/
zend_module_entry xmlreader_module_entry = {
-#if ZEND_EXTENSION_API_NO >= 220050617
+#if ZEND_MODULE_API_NO >= 20050922
STANDARD_MODULE_HEADER_EX, NULL,
xmlreader_deps,
#else
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php