Skip to content

Commit 7fe2959

Browse files
committed
PdoPgsql::setNoticeCallback()
Make the newly implemented setNoticeCallback() officially exposed (php#6764)
1 parent 23afe57 commit 7fe2959

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

ext/pdo_pgsql/pdo_pgsql.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ PHP_METHOD(PdoPgsql, getPid)
145145
pgsqlGetPid_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU);
146146
}
147147

148+
/* Sets a callback to receive DB notices (after client_min_messages has been set). */
149+
PHP_METHOD(PdoPgsql, setNoticeCallback)
150+
{
151+
pgsqlSetNoticeCallback_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU);
152+
}
153+
148154
/* true global environment */
149155

150156
/* {{{ PHP_MINIT_FUNCTION */

ext/pdo_pgsql/pdo_pgsql.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ public function lobUnlink(string $oid): bool {}
5252
public function getNotify(int $fetchMode = PDO::FETCH_DEFAULT, int $timeoutMilliseconds = 0): array|false {}
5353

5454
public function getPid(): int {}
55+
56+
public function setNoticeCallback(?callable $callback): void {}
5557
}

ext/pdo_pgsql/pdo_pgsql_arginfo.h

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/pdo_pgsql/pgsql_driver.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,9 +1242,7 @@ PHP_METHOD(PDO_PGSql_Ext, pgsqlGetPid)
12421242
}
12431243
/* }}} */
12441244

1245-
/* {{{ proto void PDO::pgsqlSetNoticeCallback(mixed callback)
1246-
Sets a callback to receive DB notices (after client_min_messages has been set) */
1247-
PHP_METHOD(PDO_PGSql_Ext, pgsqlSetNoticeCallback)
1245+
void pgsqlSetNoticeCallback_internal(INTERNAL_FUNCTION_PARAMETERS)
12481246
{
12491247
zend_fcall_info fci = empty_fcall_info;
12501248
zend_fcall_info_cache fcc = empty_fcall_info_cache;
@@ -1264,6 +1262,12 @@ PHP_METHOD(PDO_PGSql_Ext, pgsqlSetNoticeCallback)
12641262
zend_fcc_dup(H->notice_callback, &fcc);
12651263
}
12661264
}
1265+
1266+
/* {{{ Sets a callback to receive DB notices (after client_min_messages has been set) */
1267+
PHP_METHOD(PDO_PGSql_Ext, pgsqlSetNoticeCallback)
1268+
{
1269+
pgsqlSetNoticeCallback_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU);
1270+
}
12671271
/* }}} */
12681272

12691273
static const zend_function_entry *pdo_pgsql_get_driver_methods(pdo_dbh_t *dbh, int kind)

ext/pdo_pgsql/php_pdo_pgsql_int.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,6 @@ void pgsqlLOBOpen_internal(INTERNAL_FUNCTION_PARAMETERS);
120120
void pgsqlLOBUnlink_internal(INTERNAL_FUNCTION_PARAMETERS);
121121
void pgsqlGetNotify_internal(INTERNAL_FUNCTION_PARAMETERS);
122122
void pgsqlGetPid_internal(INTERNAL_FUNCTION_PARAMETERS);
123+
void pgsqlSetNoticeCallback_internal(INTERNAL_FUNCTION_PARAMETERS);
123124

124125
#endif /* PHP_PDO_PGSQL_INT_H */

0 commit comments

Comments
 (0)