PHP 4.0 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+?? ??? 200?, Version 4.0.7
+- Add pg_last_notice() function (Rasmus from suggestion by Dirk@rackspace.com)
?? ??? 200?, Version 4.0.6
- Fixed a bug in preg_split() that would incorrectly limit the number of
PHP_FE(pg_pconnect, NULL)
PHP_FE(pg_close, NULL)
PHP_FE(pg_cmdtuples, NULL)
+ PHP_FE(pg_last_notice, NULL)
PHP_FE(pg_dbname, NULL)
PHP_FE(pg_errormessage, NULL)
PHP_FE(pg_trace, NULL)
PQfinish(link);
PGG(num_persistent)--;
PGG(num_links)--;
+ if(PGG(last_notice) != NULL) {
+ efree(PGG(last_notice));
+ }
}
if (! PGG(ignore_notices)) {
php_log_err(message);
+ if (PGG(last_notice) != NULL) {
+ efree(PGG(last_notice));
+ }
+ PGG(last_notice) = estrdup(message);
}
}
-
static int _rollback_transactions(zend_rsrc_list_entry *rsrc)
{
PGconn *link = (PGconn *)rsrc->ptr;
{
PGG(num_persistent) = 0;
PGG(ignore_notices) = 0;
+ PGG(last_notice) = NULL;
}
PHP_MINIT_FUNCTION(pgsql)
}
/* }}} */
+/* {{{ proto int pg_last_notice(int connection)
+ Returns the last notice set by the backend */
+PHP_FUNCTION(pg_last_notice) {
+ if (PGG(last_notice) == NULL) {
+ RETURN_FALSE;
+ } else {
+ RETURN_STRING(PGG(last_notice),0);
+ }
+}
+/* }}} */
char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list)
{
PHP_FUNCTION(pg_numrows);
PHP_FUNCTION(pg_numfields);
PHP_FUNCTION(pg_cmdtuples);
+PHP_FUNCTION(pg_last_notice);
PHP_FUNCTION(pg_fieldname);
PHP_FUNCTION(pg_fieldsize);
PHP_FUNCTION(pg_fieldtype);
long allow_persistent;
int le_lofp,le_string;
int ignore_notices;
+ char *last_notice;
} php_pgsql_globals;