summaryrefslogtreecommitdiff
path: root/ext/pgsql
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-09-09 15:49:05 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-09-09 15:50:30 +0200
commit9a6c22da7030bd630a7ea00251d1d59fd1197c4f (patch)
tree60e8adc38922ac061dd3d7cce1098c46969bef60 /ext/pgsql
parentee9948bc46f2db44791231d8af8307d073f732f1 (diff)
downloadphp-git-9a6c22da7030bd630a7ea00251d1d59fd1197c4f.tar.gz
Remove deprecated pgsql signatures
As the comment indicates, these are deprecated in PHP 4.2...
Diffstat (limited to 'ext/pgsql')
-rw-r--r--ext/pgsql/pgsql.c28
-rw-r--r--ext/pgsql/tests/05large_object.phpt2
2 files changed, 2 insertions, 28 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 118ecabbf3..f8fcd74c9d 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -3298,12 +3298,6 @@ PHP_FUNCTION(pg_lo_import)
link = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(link);
}
- /* old calling convention, deprecated since PHP 4.2 */
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
- "pr", &file_in, &name_len, &pgsql_link ) == SUCCESS) {
- php_error_docref(NULL, E_NOTICE, "Old API is used");
- link = Z_RES_P(pgsql_link);
- }
else {
WRONG_PARAM_COUNT;
}
@@ -3384,7 +3378,7 @@ PHP_FUNCTION(pg_lo_export)
link = Z_RES_P(pgsql_link);
}
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
- "rss", &pgsql_link, &oid_string, &oid_strlen, &file_out, &name_len) == SUCCESS) {
+ "rsp", &pgsql_link, &oid_string, &oid_strlen, &file_out, &name_len) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
@@ -3414,26 +3408,6 @@ PHP_FUNCTION(pg_lo_export)
link = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(link);
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
- "spr", &oid_string, &oid_strlen, &file_out, &name_len, &pgsql_link) == SUCCESS) {
- oid = (Oid)strtoul(oid_string, &end_ptr, 10);
- if ((oid_string+oid_strlen) != end_ptr) {
- /* wrong integer format */
- php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
- RETURN_FALSE;
- }
- link = Z_RES_P(pgsql_link);
- }
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
- "lpr", &oid_long, &file_out, &name_len, &pgsql_link) == SUCCESS) {
- php_error_docref(NULL, E_NOTICE, "Old API is used");
- if (oid_long <= (zend_long)InvalidOid) {
- php_error_docref(NULL, E_NOTICE, "Invalid OID specified");
- RETURN_FALSE;
- }
- oid = (Oid)oid_long;
- link = Z_RES_P(pgsql_link);
- }
else {
zend_argument_count_error("Requires 2 or 3 arguments, %d given", ZEND_NUM_ARGS());
RETURN_THROWS();
diff --git a/ext/pgsql/tests/05large_object.phpt b/ext/pgsql/tests/05large_object.phpt
index df47d07404..3a4a40eb08 100644
--- a/ext/pgsql/tests/05large_object.phpt
+++ b/ext/pgsql/tests/05large_object.phpt
@@ -61,7 +61,7 @@ $oid = pg_lo_import($db, $path . 'php.gif');
pg_query($db, 'commit');
pg_query($db, 'begin');
@unlink($path . 'php.gif.exported');
-pg_lo_export($oid, $path . 'php.gif.exported', $db);
+pg_lo_export($db, $oid, $path . 'php.gif.exported');
if (!file_exists($path . 'php.gif.exported')) {
echo "Export failed\n";
}