From b44e29f8430189914ad4047176527918f80b935c Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Tue, 19 Jan 2021 12:54:42 +0000 Subject: php_pdo_register_driver() might fail Therefore correctly report failure in MINIT for the drivers which didn't. --- ext/pdo/pdo.c | 2 +- ext/pdo/php_pdo_driver.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'ext/pdo') diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c index 573de78cff..b5eb35e841 100644 --- a/ext/pdo/pdo.c +++ b/ext/pdo/pdo.c @@ -115,7 +115,7 @@ zend_module_entry pdo_module_entry = { ZEND_GET_MODULE(pdo) #endif -PDO_API int php_pdo_register_driver(const pdo_driver_t *driver) /* {{{ */ +PDO_API zend_result php_pdo_register_driver(const pdo_driver_t *driver) /* {{{ */ { if (driver->api_version != PDO_DRIVER_API) { zend_error(E_ERROR, "PDO: driver %s requires PDO API version " ZEND_ULONG_FMT "; this is PDO version %d", diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index 775ffd240f..ed5518a017 100644 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@ -655,8 +655,9 @@ struct _pdo_row_t { pdo_stmt_t *stmt; }; -/* call this in MINIT to register your PDO driver */ -PDO_API int php_pdo_register_driver(const pdo_driver_t *driver); +/* Call this in MINIT to register the PDO driver. + * Registering the driver might fail and should be reported accordingly in MINIT. */ +PDO_API zend_result php_pdo_register_driver(const pdo_driver_t *driver); /* call this in MSHUTDOWN to unregister your PDO driver */ PDO_API void php_pdo_unregister_driver(const pdo_driver_t *driver); -- cgit v1.2.1