From f8f11ac0a2566f100d525fc2830b31ce20ac8f0e Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Wed, 2 Oct 2002 02:11:27 +0000 Subject: [PATCH] Rename pg_metadata() to pg_meta_data() to confirm naming standard --- NEWS | 2 +- ext/pgsql/pgsql.c | 20 +++++++++---------- ext/pgsql/php_pgsql.h | 4 ++-- ...11pg_metadata.phpt => 11pg_meta_data.phpt} | 2 +- .../{pg_metadata.inc => pg_meta_data.inc} | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) rename ext/pgsql/tests/{11pg_metadata.phpt => 11pg_meta_data.phpt} (95%) rename ext/pgsql/tests/{pg_metadata.inc => pg_meta_data.inc} (72%) diff --git a/NEWS b/NEWS index 721901d100..11397aae22 100644 --- a/NEWS +++ b/NEWS @@ -7,7 +7,7 @@ PHP 4 NEWS - Fixed bug #17825 (ob_start() chunk size option didn't work well). (Yasuo) - Fixed output buffering implicit flush. (Yasuo) - Added getopt() for parsing command line options and arguments. (Jon) -- Added pg_fetch_assoc(), pg_fetch_all(), pg_metadata(), pg_convert(), +- Added pg_fetch_assoc(), pg_fetch_all(), pg_meta_data(), pg_convert(), pg_insert(), pg_select(), pg_update() and pg_delete(). (Yasuo) - Fixed bug #17281 (Sanity checks for encoding sessions). (Ilia) - Fixed bug #16995 and #19392 (Prevent crash if $HTTP_SESSION_VARS != ARRAY). diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 15546a733a..4b3e4a2d00 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -146,7 +146,7 @@ function_entry pgsql_functions[] = { PHP_FE(pg_set_client_encoding, NULL) #endif /* misc function */ - PHP_FE(pg_metadata, NULL) + PHP_FE(pg_meta_data, NULL) PHP_FE(pg_convert, NULL) PHP_FE(pg_insert, NULL) PHP_FE(pg_update, NULL) @@ -2809,10 +2809,10 @@ PHP_FUNCTION(pg_result_status) } /* }}} */ -/* {{{ php_pgsql_metadata - * TODO: Add metadata cache for better performance +/* {{{ php_pgsql_meta_data + * TODO: Add meta_data cache for better performance */ -PHPAPI int php_pgsql_metadata(PGconn *pg_link, const char *table_name, zval *meta TSRMLS_DC) +PHPAPI int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta TSRMLS_DC) { PGresult *pg_result; char *tmp_name; @@ -2835,7 +2835,7 @@ PHPAPI int php_pgsql_metadata(PGconn *pg_link, const char *table_name, zval *met 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 metadata 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; @@ -2871,9 +2871,9 @@ PHPAPI int php_pgsql_metadata(PGconn *pg_link, const char *table_name, zval *met /* }}} */ -/* {{{ proto array pg_metadata(resource db, string table) - Get metadata */ -PHP_FUNCTION(pg_metadata) +/* {{{ proto array pg_meta_data(resource db, string table) + Get meta_data */ +PHP_FUNCTION(pg_meta_data) { zval *pgsql_link; char *table_name; @@ -2889,7 +2889,7 @@ PHP_FUNCTION(pg_metadata) ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); array_init(return_value); - if (php_pgsql_metadata(pgsql, table_name, return_value TSRMLS_CC) == FAILURE) { + if (php_pgsql_meta_data(pgsql, table_name, return_value TSRMLS_CC) == FAILURE) { zval_dtor(return_value); /* destroy array */ RETURN_FALSE; } @@ -3094,7 +3094,7 @@ PHPAPI int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval FREE_ZVAL(meta); return FAILURE; } - if (php_pgsql_metadata(pg_link, table_name, meta TSRMLS_CC) == FAILURE) { + if (php_pgsql_meta_data(pg_link, table_name, meta TSRMLS_CC) == FAILURE) { zval_dtor(meta); FREE_ZVAL(meta); return FAILURE; diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h index 552f86230c..644ec7d5ac 100644 --- a/ext/pgsql/php_pgsql.h +++ b/ext/pgsql/php_pgsql.h @@ -130,7 +130,7 @@ PHP_FUNCTION(pg_escape_bytea); #endif /* misc functions */ -PHP_FUNCTION(pg_metadata); +PHP_FUNCTION(pg_meta_data); PHP_FUNCTION(pg_convert); PHP_FUNCTION(pg_insert); PHP_FUNCTION(pg_update); @@ -149,7 +149,7 @@ PHP_FUNCTION(pg_select); #define PGSQL_DML_STRING (1<<11) /* Return query string */ /* exported functions */ -PHPAPI int php_pgsql_metadata(PGconn *pg_link, const char *table_name, zval *meta TSRMLS_DC); +PHPAPI int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta TSRMLS_DC); PHPAPI int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, ulong opt TSRMLS_DC); PHPAPI int php_pgsql_insert(PGconn *pg_link, const char *table, zval *values, ulong opt, char **sql TSRMLS_DC); PHPAPI int php_pgsql_update(PGconn *pg_link, const char *table, zval *values, zval *ids, ulong opt , char **sql TSRMLS_DC); diff --git a/ext/pgsql/tests/11pg_metadata.phpt b/ext/pgsql/tests/11pg_meta_data.phpt similarity index 95% rename from ext/pgsql/tests/11pg_metadata.phpt rename to ext/pgsql/tests/11pg_meta_data.phpt index 6e08e2c609..85e2d2cf07 100644 --- a/ext/pgsql/tests/11pg_metadata.phpt +++ b/ext/pgsql/tests/11pg_meta_data.phpt @@ -4,7 +4,7 @@ PostgreSQL pg_metadata() --FILE-- --EXPECT-- array(3) { diff --git a/ext/pgsql/tests/pg_metadata.inc b/ext/pgsql/tests/pg_meta_data.inc similarity index 72% rename from ext/pgsql/tests/pg_metadata.inc rename to ext/pgsql/tests/pg_meta_data.inc index 16a2577e36..4486935838 100644 --- a/ext/pgsql/tests/pg_metadata.inc +++ b/ext/pgsql/tests/pg_meta_data.inc @@ -5,7 +5,7 @@ include 'config.inc'; $db = pg_connect($conn_str); -$meta = pg_metadata($db, $table_name); +$meta = pg_meta_data($db, $table_name); var_dump($meta); -- 2.50.1