derick Sat Oct 19 08:58:41 2002 EDT Modified files: /php4/ext/pgsql pgsql.c Log: - Style polizei =)
Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.240 php4/ext/pgsql/pgsql.c:1.241 --- php4/ext/pgsql/pgsql.c:1.240 Sat Oct 19 02:05:16 2002 +++ php4/ext/pgsql/pgsql.c Sat Oct 19 08:58:41 2002 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql.c,v 1.240 2002/10/19 06:05:16 yohgaki Exp $ */ +/* $Id: pgsql.c,v 1.241 2002/10/19 12:58:41 derick Exp $ */ #include <stdlib.h> @@ -71,7 +71,7 @@ #define PQ_SETNONBLOCKING(pg_link, flag) 0 #endif -#define CHECK_DEFAULT_LINK(x) if ((x) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "No PostgreSQL link opened yet"); } +#define CHECK_DEFAULT_LINK(x) if ((x) == -1) { php_error_docref(NULL TSRMLS_CC, +E_WARNING, "No PostgreSQL link opened yet."); } /* {{{ pgsql_functions[] */ @@ -308,7 +308,7 @@ link = (PGconn *) rsrc->ptr; if (PQ_SETNONBLOCKING(link, 0)) { - php_error_docref("ref.pgsql" TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode"); + php_error_docref("ref.pgsql" TSRMLS_CC, E_NOTICE, "Cannot set +connection to blocking mode."); return -1; } @@ -541,12 +541,12 @@ if (PGG(max_links)!=-1 && PGG(num_links)>=PGG(max_links)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Cannot create new link. Too many open links (%d)", PGG(num_links)); + "Cannot create new +link. Too many open links (%d).", PGG(num_links)); goto err; } if (PGG(max_persistent)!=-1 && PGG(num_persistent)>=PGG(max_persistent)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Cannot create new link. Too many open persistent links (%d)", PGG(num_persistent)); + "Cannot create new +link. Too many open persistent links (%d).", PGG(num_persistent)); goto err; } @@ -558,7 +558,7 @@ } if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) { php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Unable to connect to PostgreSQL server: %s", PQerrorMessage(pgsql)); + "Unable to connect to +PostgreSQL server: %s.", PQerrorMessage(pgsql)); if (pgsql) { PQfinish(pgsql); } @@ -597,7 +597,7 @@ PQreset(le->ptr); } if (le->ptr==NULL || PQstatus(le->ptr)==CONNECTION_BAD) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"PostgreSQL link lost, unable to reconnect"); + php_error_docref(NULL TSRMLS_CC, +E_WARNING,"PostgreSQL link lost, unable to reconnect."); zend_hash_del(&EG(persistent_list),str.c,str.len+1); goto err; } @@ -634,7 +634,7 @@ } } if (PGG(max_links)!=-1 && PGG(num_links)>=PGG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create new link. Too many open links (%d)", PGG(num_links)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create new +link. Too many open links (%d).", PGG(num_links)); goto err; } if (connstring) { @@ -643,7 +643,7 @@ pgsql = PQsetdb(host,port,options,tty,dbname); } if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to PostgreSQL server: %s", PQerrorMessage(pgsql)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect +to PostgreSQL server: %s.", PQerrorMessage(pgsql)); goto err; } @@ -918,7 +918,7 @@ convert_to_string_ex(query); if (PQ_SETNONBLOCKING(pgsql, 0)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to +blocking mode."); RETURN_FALSE; } while ((pgsql_result = PQgetResult(pgsql))) { @@ -926,7 +926,7 @@ leftover = 1; } if (leftover) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get results"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this +connection. Use pg_get_result() to get these results first."); } pgsql_result = PQexec(pgsql, Z_STRVAL_PP(query)); @@ -941,7 +941,7 @@ case PGRES_BAD_RESPONSE: case PGRES_NONFATAL_ERROR: case PGRES_FATAL_ERROR: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Query failed: %s", PQerrorMessage(pgsql)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Query failed: +%s.", PQerrorMessage(pgsql)); RETURN_FALSE; break; case PGRES_COMMAND_OK: /* successful command that did not return rows */ @@ -991,7 +991,7 @@ #if HAVE_PQCMDTUPLES Z_LVAL_P(return_value) = atoi(PQcmdTuples(pgsql_result)); #else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supportted under this build"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supportted +under this build."); Z_LVAL_P(return_value) = 0; #endif break; @@ -1128,7 +1128,7 @@ convert_to_long_ex(field); if (Z_LVAL_PP(field) < 0 || Z_LVAL_PP(field) >= PQnfields(pgsql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset specified"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset +specified."); RETURN_FALSE; } @@ -1228,7 +1228,7 @@ convert_to_long_ex(row); pgsql_row = Z_LVAL_PP(row); if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %d on PostgreSQL result index %d", Z_LVAL_PP(row), Z_LVAL_PP(result)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to +row %d on PostgreSQL result index %d.", Z_LVAL_PP(row), Z_LVAL_PP(result)); RETURN_FALSE; } } @@ -1242,7 +1242,7 @@ break; } if (field_offset<0 || field_offset>=PQnfields(pgsql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset +specified."); RETURN_FALSE; } @@ -1291,7 +1291,7 @@ } if (!(result_type & PGSQL_BOTH)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type."); RETURN_FALSE; } @@ -1311,7 +1311,7 @@ pgsql_row = Z_LVAL_PP(row); pg_result->row = pgsql_row; if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %d on PostgreSQL result index %d", Z_LVAL_PP(row), Z_LVAL_PP(result)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to +jump to row %d on PostgreSQL result index %d.", Z_LVAL_PP(row), Z_LVAL_PP(result)); RETURN_FALSE; } } else { @@ -1489,7 +1489,7 @@ convert_to_long_ex(row); pgsql_row = Z_LVAL_PP(row); if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %d on PostgreSQL result index %d", Z_LVAL_PP(row), Z_LVAL_PP(result)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to +row %d on PostgreSQL result index %d.", Z_LVAL_PP(row), Z_LVAL_PP(result)); RETURN_FALSE; } } @@ -1505,7 +1505,7 @@ break; } if (field_offset < 0 || field_offset >= PQnfields(pgsql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset +specified."); RETURN_FALSE; } @@ -1710,7 +1710,7 @@ */ if ((pgsql_oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create PostgreSQL large object"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create +PostgreSQL large object."); RETURN_FALSE; } PGSQL_RETURN_OID(pgsql_oid); @@ -1736,14 +1736,14 @@ oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value +passed."); RETURN_FALSE; } } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "rl", &pgsql_link, &oid_long) == SUCCESS) { if (oid_long <= InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID is specified"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID +specified."); RETURN_FALSE; } oid = (Oid)oid_long; @@ -1753,7 +1753,7 @@ oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value +passed."); RETURN_FALSE; } id = PGG(default_link); @@ -1762,7 +1762,7 @@ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "l", &oid_long) == SUCCESS) { if (oid_long <= InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID is specified"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID is +specified."); RETURN_FALSE; } oid = (Oid)oid_long; @@ -1770,14 +1770,14 @@ CHECK_DEFAULT_LINK(id); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 1 or 2 arguments"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 1 or 2 +arguments."); RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); if (lo_unlink(pgsql, oid) == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to delete PostgreSQL large object %u", oid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to delete +PostgreSQL large object %u.", oid); RETURN_FALSE; } RETURN_TRUE; @@ -1805,14 +1805,14 @@ oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value +passed."); RETURN_FALSE; } } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "rls", &pgsql_link, &oid_long, &mode_string, &mode_strlen) == SUCCESS) { if (oid_long <= InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID is specified"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID +specified."); RETURN_FALSE; } oid = (Oid)oid_long; @@ -1822,7 +1822,7 @@ oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value +passed."); RETURN_FALSE; } id = PGG(default_link); @@ -1831,7 +1831,7 @@ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "ls", &oid_long, &mode_string, &mode_strlen) == SUCCESS) { if (oid_long <= InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID is specified"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID +specified."); RETURN_FALSE; } oid = (Oid)oid_long; @@ -1839,7 +1839,7 @@ CHECK_DEFAULT_LINK(id); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 1 or 2 arguments"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 1 or 2 +arguments."); RETURN_FALSE; } @@ -1870,17 +1870,17 @@ if (create) { if ((oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == 0) { efree(pgsql_lofp); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create PostgreSQL large object"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to +create PostgreSQL large object."); RETURN_FALSE; } else { if ((pgsql_lofd = lo_open(pgsql, oid, pgsql_mode)) == -1) { if (lo_unlink(pgsql, oid) == -1) { efree(pgsql_lofp); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Something's really messed up!!! Your database is badly corrupted in a way NOT related to PHP"); + php_error_docref(NULL TSRMLS_CC, +E_WARNING, "Something is really messed up! Your database is badly corrupted in a way +NOT related to PHP."); RETURN_FALSE; } efree(pgsql_lofp); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open PostgreSQL large object"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, +"Unable to open PostgreSQL large object."); RETURN_FALSE; } else { pgsql_lofp->conn = pgsql; @@ -1891,7 +1891,7 @@ } } else { efree(pgsql_lofp); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open PostgreSQL large object"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open +PostgreSQL large object."); RETURN_FALSE; } } else { @@ -1923,7 +1923,7 @@ ZEND_FETCH_RESOURCE(pgsql, pgLofp *, pgsql_lofp, -1, "PostgreSQL large object", le_lofp); if (lo_close((PGconn *)pgsql->conn, pgsql->lofd) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to close PostgreSQL large object descriptor %d", pgsql->lofd); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to close +PostgreSQL large object descriptor %d.", pgsql->lofd); RETVAL_FALSE; } else { RETVAL_TRUE; @@ -1988,11 +1988,11 @@ if (argc > 2) { convert_to_long_ex(z_len); if (Z_LVAL_PP(z_len) > Z_STRLEN_PP(str)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write more than buffer size %d. Tried to wtite %d", Z_LVAL_PP(str), Z_LVAL_PP(z_len)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write more +than buffer size %d. Tried to write %d.", Z_LVAL_PP(str), Z_LVAL_PP(z_len)); RETURN_FALSE; } if (Z_LVAL_PP(z_len) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Buffer size must be larger than 0. %d specified for buffer size", Z_LVAL_PP(str), Z_LVAL_PP(z_len)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Buffer size must +be larger than 0, but %d was specified.", Z_LVAL_PP(str), Z_LVAL_PP(z_len)); RETURN_FALSE; } len = Z_LVAL_PP(z_len); @@ -2107,7 +2107,7 @@ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "rls", &pgsql_link, &oid_long, &file_out, &name_len) == SUCCESS) { if (oid_long <= InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID is specified"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID +specified."); RETURN_FALSE; } oid = (Oid)oid_long; @@ -2117,14 +2117,14 @@ oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value +passed."); RETURN_FALSE; } } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "ls", &oid_long, &file_out, &name_len) == SUCCESS) { if (oid_long <= InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID is specified"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID +specified."); RETURN_FALSE; } oid = (Oid)oid_long; @@ -2136,7 +2136,7 @@ oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value +passed."); RETURN_FALSE; } id = PGG(default_link); @@ -2147,7 +2147,7 @@ oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value +passed."); RETURN_FALSE; } } @@ -2155,13 +2155,13 @@ "lsr", &oid_long, &file_out, &name_len, &pgsql_link) == SUCCESS) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, " %s(): Old API is used"); if (oid_long <= InvalidOid) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID is specified"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID +specified."); RETURN_FALSE; } oid = (Oid)oid_long; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 2 or 3 arguments"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 2 or 3 +arguments."); RETURN_FALSE; } @@ -2195,7 +2195,7 @@ return; } if (whence != SEEK_SET && whence != SEEK_CUR && whence != SEEK_END) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid whence parameter"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid whence +parameter."); return; } @@ -2337,7 +2337,7 @@ result = PQendcopy(pgsql); if (result!=0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Query failed: %s", PQerrorMessage(pgsql)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Query failed: %s.", +PQerrorMessage(pgsql)); RETURN_FALSE; } RETURN_TRUE; @@ -2378,7 +2378,7 @@ result = PQputline(pgsql, Z_STRVAL_PP(query)); if (result==EOF) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Query failed: %s", PQerrorMessage(pgsql)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Query failed: %s.", +PQerrorMessage(pgsql)); RETURN_FALSE; } RETURN_TRUE; @@ -2445,7 +2445,7 @@ while (!copydone) { if ((ret = PQgetline(pgsql, copybuf, COPYBUFSIZ))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "getline failed: %s", PQerrorMessage(pgsql)); + php_error_docref(NULL TSRMLS_CC, +E_WARNING, "getline failed: %s.", PQerrorMessage(pgsql)); RETURN_FALSE; } @@ -2479,7 +2479,7 @@ } } if (PQendcopy(pgsql)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "endcopy failed: %s", PQerrorMessage(pgsql)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, +"endcopy failed: %s.", PQerrorMessage(pgsql)); RETURN_FALSE; } while ((pgsql_result = PQgetResult(pgsql))) { @@ -2492,7 +2492,7 @@ break; default: PQclear(pgsql_result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "COPY command failed: %s", PQerrorMessage(pgsql)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Copy command +failed: %s.", PQerrorMessage(pgsql)); RETURN_FALSE; break; } @@ -2560,18 +2560,18 @@ strcat(query, "\n"); if (PQputline(pgsql, query)) { efree(query); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "copy failed: %s", PQerrorMessage(pgsql)); + php_error_docref(NULL TSRMLS_CC, +E_WARNING, "copy failed: %s.", PQerrorMessage(pgsql)); RETURN_FALSE; } efree(query); zend_hash_move_forward_ex(Z_ARRVAL_P(pg_rows), &pos); } if (PQputline(pgsql, "\\.\n") == EOF) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "putline failed: %s", PQerrorMessage(pgsql)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, +"putline failed: %s.", PQerrorMessage(pgsql)); RETURN_FALSE; } if (PQendcopy(pgsql)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "endcopy failed: %s", PQerrorMessage(pgsql)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, +"endcopy failed: %s.", PQerrorMessage(pgsql)); RETURN_FALSE; } while ((pgsql_result = PQgetResult(pgsql))) { @@ -2585,7 +2585,7 @@ break; default: PQclear(pgsql_result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "COPY command failed: %s", PQerrorMessage(pgsql)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Copy command +failed: %s.", PQerrorMessage(pgsql)); RETURN_FALSE; break; } @@ -2833,7 +2833,7 @@ int leftover = 0; if (PQsetnonblocking(pgsql, 1)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to nonblocking mode"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to +nonblocking mode."); return -1; } while ((res = PQgetResult(pgsql))) { @@ -2862,7 +2862,7 @@ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); if (PQ_SETNONBLOCKING(pgsql, 1)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to nonblocking mode"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to +nonblocking mode."); RETURN_FALSE; } switch(entry_type) { @@ -2879,11 +2879,11 @@ } break; default: - php_error_docref(NULL TSRMLS_CC, E_ERROR,"PostgreSQL module error. Report this error"); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "PostgreSQL module +error, please report this error."); break; } if (PQ_SETNONBLOCKING(pgsql, 0)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to +blocking mode."); } convert_to_boolean_ex(&return_value); } @@ -2925,7 +2925,7 @@ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); if (PQ_SETNONBLOCKING(pgsql, 1)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to nonblocking mode"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to +nonblocking mode."); RETURN_FALSE; } while ((res = PQgetResult(pgsql))) { @@ -2933,13 +2933,13 @@ leftover = 1; } if (leftover) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE,"There are results on this connection. Call pg_get_result() until it returns FALSE"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There are results on this +connection. Call pg_get_result() until it returns FALSE."); } if (!PQsendQuery(pgsql, query)) { RETURN_FALSE; } if (PQ_SETNONBLOCKING(pgsql, 0)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to +blocking mode."); } RETURN_TRUE; } @@ -3002,7 +3002,7 @@ RETURN_STRING(PQcmdStatus(pgsql_result), 1); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expects optional 2nd parameter to be PGSQL_STATUS_LONG or PGSQL_STATUS_STRING"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Optional 2nd parameter +should be PGSQL_STATUS_LONG or PGSQL_STATUS_STRING."); RETURN_FALSE; } } @@ -3088,7 +3088,7 @@ pg_result = PQexec(pg_link, querystr.c); if (PQresultStatus(pg_result) != PGRES_TUPLES_OK || (num_rows = PQntuples(pg_result)) == 0) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to query meta_data for '%s' table %s", table_name, querystr.c); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to query meta_data +for '%s' table %s.", table_name, querystr.c); smart_str_free(&querystr); PQclear(pg_result); return FAILURE; @@ -3253,25 +3253,25 @@ regerr = regcomp(&re, regex, regopt); if (regerr) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot compile regex"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot compile regex."); regfree(&re); return FAILURE; } subs = (regmatch_t *)ecalloc(sizeof(regmatch_t), re.re_nsub+1); if (!subs) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate memory"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate memory."); regfree(&re); return FAILURE; } regerr = regexec(&re, str, re.re_nsub+1, subs, 0); if (regerr == REG_NOMATCH) { #ifdef PHP_DEBUG - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "'%s' does not match with '%s'", str, regex); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "'%s' does not match with +'%s'.", str, regex); #endif ret = FAILURE; } else if (regerr) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot exec regex"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot exec regex."); ret = FAILURE; } regfree(&re); @@ -3316,7 +3316,7 @@ } \ /* raise error if it's not null and cannot be ignored */ \ else if (!(opt & PGSQL_CONV_IGNORE_NOT_NULL) && Z_BVAL_PP(not_null)) { \ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected NULL for 'NOT NULL' field '%s'", field ); \ + php_error_docref(NULL TSRMLS_CC, +E_NOTICE, "Detected NULL for 'NOT NULL' field '%s'.", field ); \ err = 1; \ } \ } @@ -3358,37 +3358,37 @@ skip_field = 0; if ((key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(values), &field, &field_len, &num_idx, 0, &pos)) == HASH_KEY_NON_EXISTANT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to get array key type"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to get +array key type."); err = 1; } if (!err && key_type == HASH_KEY_IS_LONG) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Accepts only string key for values"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Accepts only +string key for values."); err = 1; } if (!err && key_type == HASH_KEY_NON_EXISTANT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Accepts only string key for values"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Accepts only +string key for values."); err = 1; } if (!err && zend_hash_find(Z_ARRVAL_P(meta), field, field_len, (void **)&def) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid field name (%s) in values", field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid field name +(%s) in values.", field); err = 1; } if (!err && zend_hash_find(Z_ARRVAL_PP(def), "type", sizeof("type"), (void **)&type) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'type'"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken +meta data. Missing 'type'."); err = 1; } if (!err && zend_hash_find(Z_ARRVAL_PP(def), "not null", sizeof("not null"), (void **)¬_null) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'not null'"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken +meta data. Missing 'not null'."); err = 1; } if (!err && zend_hash_find(Z_ARRVAL_PP(def), "has default", sizeof("has default"), (void **)&has_default) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'has default'"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken +meta data. Missing 'has default'."); err = 1; } if (!err && (Z_TYPE_PP(val) == IS_ARRAY || Z_TYPE_PP(val) == IS_OBJECT || Z_TYPE_PP(val) == IS_CONSTANT_ARRAY)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects scaler values as field values"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects scaler +values as field values."); err = 1; } if (err) { @@ -3419,7 +3419,7 @@ ZVAL_STRING(new_val, "'f'", 1); } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected invalid value (%s) for PostgreSQL %s field (%s)", Z_STRVAL_PP(val), Z_STRVAL_PP(type), field); + php_error_docref(NULL +TSRMLS_CC, E_NOTICE, "Detected invalid value (%s) for PostgreSQL %s field (%s).", +Z_STRVAL_PP(val), Z_STRVAL_PP(type), field); err = 1; } } @@ -3444,7 +3444,7 @@ } PGSQL_CONV_CHECK_IGNORE(); if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string, null, long or boolelan value for PostgreSQL '%s' (%s)", Z_STRVAL_PP(type), field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, +"Expects string, null, long or boolelan value for PostgreSQL '%s' (%s).", +Z_STRVAL_PP(type), field); } break; @@ -3486,7 +3486,7 @@ } PGSQL_CONV_CHECK_IGNORE(); if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string, null, long or double value for pgsql '%s' (%s)", Z_STRVAL_PP(type), field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, +"Expects NULL, string, long or double value for pgsql '%s' (%s).", Z_STRVAL_PP(type), +field); } break; @@ -3527,7 +3527,7 @@ } PGSQL_CONV_CHECK_IGNORE(); if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string, null, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_PP(type), field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, +"Expects NULL, string, long or double value for PostgreSQL '%s' (%s).", +Z_STRVAL_PP(type), field); } break; @@ -3579,7 +3579,7 @@ } PGSQL_CONV_CHECK_IGNORE(); if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string, null, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_PP(type), field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, +"Expects NULL, string, long or double value for PostgreSQL '%s' (%s).", +Z_STRVAL_PP(type), field); } break; @@ -3621,7 +3621,7 @@ } PGSQL_CONV_CHECK_IGNORE(); if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string, null, long or double value for '%s' (%s)", Z_STRVAL_PP(type), field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, +"Expects NULL, string, long or double value for '%s' (%s).", Z_STRVAL_PP(type), +field); } break; @@ -3653,7 +3653,7 @@ } PGSQL_CONV_CHECK_IGNORE(); if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string or null for '%s' (%s)", Z_STRVAL_PP(type), field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, +"Expects NULL or string for '%s' (%s).", Z_STRVAL_PP(type), field); } break; @@ -3685,7 +3685,7 @@ } PGSQL_CONV_CHECK_IGNORE(); if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string or null for PostgreSQL %s field (%s)", Z_STRVAL_PP(type), field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, +"Expects NULL or string for PostgreSQL %s field (%s).", Z_STRVAL_PP(type), field); } break; @@ -3716,7 +3716,7 @@ } PGSQL_CONV_CHECK_IGNORE(); if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string or null for PostgreSQL %s field (%s)", Z_STRVAL_PP(type), field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, +"Expects NULL or string for PostgreSQL %s field (%s).", Z_STRVAL_PP(type), field); } break; @@ -3747,7 +3747,7 @@ } PGSQL_CONV_CHECK_IGNORE(); if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string or null for PostgreSQL %s field (%s)", Z_STRVAL_PP(type), field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, +"Expects NULL or string for PostgreSQL %s field (%s).", Z_STRVAL_PP(type), field); } break; @@ -3779,7 +3779,7 @@ } PGSQL_CONV_CHECK_IGNORE(); if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string or null for PostgreSQL %s field (%s)", Z_STRVAL_PP(type), field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, +"Expects NULL or string for PostgreSQL %s field (%s).", Z_STRVAL_PP(type), field); } break; #ifdef HAVE_PQESCAPE @@ -3822,7 +3822,7 @@ } PGSQL_CONV_CHECK_IGNORE(); if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string, null, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_PP(type), field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, +"Expects NULL, string, long or double value for PostgreSQL '%s' (%s).", +Z_STRVAL_PP(type), field); } break; @@ -3853,7 +3853,7 @@ } PGSQL_CONV_CHECK_IGNORE(); if (err) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string or null for PostgreSQL %s field (%s)", Z_STRVAL_PP(type), field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, +"Expects NULL or string for PostgreSQL %s field (%s).", Z_STRVAL_PP(type), field); } break; @@ -3868,13 +3868,13 @@ case PG_PATH: case PG_POLYGON: case PG_CIRCLE: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "does not support PostgreSQL '%s' type (%s)", Z_STRVAL_PP(type), field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "PostgreSQL +'%s' type (%s) is not supported.", Z_STRVAL_PP(type), field); err = 1; break; case PG_UNKNOWN: default: - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "unknown or system data type '%s' for '%s'", Z_STRVAL_PP(type), field); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or +system data type '%s' for '%s'.", Z_STRVAL_PP(type), field); err = 1; break; } /* switch */ @@ -3919,18 +3919,18 @@ return; } if (option & ~PGSQL_CONV_OPTS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is +specified."); RETURN_FALSE; } if (!table_name_len) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Table name is invalid"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Table name is invalid."); RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pg_link, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); if (php_pgsql_flush_query(pg_link TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled +result(s) in connection."); } array_init(return_value); if (php_pgsql_convert(pg_link, table_name, values, return_value, option TSRMLS_CC) == FAILURE) { @@ -3954,7 +3954,7 @@ if (PQresultStatus(pg_result) == expect) { return 0; } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to execute '%s'", querystr->c); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to execute +'%s'.", querystr->c); PQclear(pg_result); } } @@ -4000,7 +4000,7 @@ while ((key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(var_array), &fld, &fld_len, &num_idx, 0, &pos)) != HASH_KEY_NON_EXISTANT) { if (key_type == HASH_KEY_IS_LONG) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Expects associative array for values to be inserted"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects +associative array for values to be inserted."); goto cleanup; } smart_str_appendl(&querystr, fld, fld_len - 1); @@ -4028,7 +4028,7 @@ break; default: /* should not happen */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Report this error to [EMAIL PROTECTED] Type = %d", Z_TYPE_PP(val)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Report +this error to [EMAIL PROTECTED], type = %d.", Z_TYPE_PP(val)); goto cleanup; break; } @@ -4078,14 +4078,14 @@ return; } if (option & ~(PGSQL_CONV_OPTS|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_ASYNC|PGSQL_DML_STRING)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is +specified."); RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pg_link, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); if (php_pgsql_flush_query(pg_link TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled +result(s) in connection."); } if (php_pgsql_insert(pg_link, table, values, option, &sql TSRMLS_CC) == FAILURE) { RETURN_FALSE; @@ -4112,7 +4112,7 @@ zend_hash_move_forward_ex(ht, &pos)) { key_type = zend_hash_get_current_key_ex(ht, &fld, &fld_len, &num_idx, 0, &pos); if (key_type == HASH_KEY_IS_LONG) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Expects associative array for values to be inserted"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects +associative array for values to be inserted."); return -1; } smart_str_appendl(querystr, fld, fld_len - 1); @@ -4130,7 +4130,7 @@ break; default: /* should not happen */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects scaler values other than null. Need to convert?"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects +scaler values other than NULL. Need to convert?"); return -1; } smart_str_appendl(querystr, pad, pad_len); @@ -4227,14 +4227,14 @@ return; } if (option & ~(PGSQL_CONV_OPTS|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_STRING)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is +specified."); RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pg_link, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); if (php_pgsql_flush_query(pg_link TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled +result(s) in connection."); } if (php_pgsql_update(pg_link, table, values, ids, option, &sql TSRMLS_CC) == FAILURE) { RETURN_FALSE; @@ -4315,14 +4315,14 @@ return; } if (option & ~(PGSQL_CONV_FORCE_NULL|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_STRING)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is +specified."); RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pg_link, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); if (php_pgsql_flush_query(pg_link TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled +result(s) in connection."); } if (php_pgsql_delete(pg_link, table, ids, option, &sql TSRMLS_CC) == FAILURE) { RETURN_FALSE; @@ -4418,7 +4418,7 @@ if (PQresultStatus(pg_result) == PGRES_TUPLES_OK) { ret = php_pgsql_result2array(pg_result, ret_array TSRMLS_CC); } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to execute '%s'", querystr.c); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to execute '%s'.", +querystr.c); PQclear(pg_result); } @@ -4452,14 +4452,14 @@ return; } if (option & ~(PGSQL_CONV_FORCE_NULL|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_ASYNC|PGSQL_DML_STRING)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is +specified."); RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pg_link, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); if (php_pgsql_flush_query(pg_link TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled +result(s) in connection."); } array_init(return_value); if (php_pgsql_select(pg_link, table, ids, return_value, option, &sql TSRMLS_CC) == FAILURE) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php