diff options
author | George Peter Banyard <girgias@php.net> | 2021-01-19 12:54:42 +0000 |
---|---|---|
committer | George Peter Banyard <girgias@php.net> | 2021-01-19 12:55:07 +0000 |
commit | b44e29f8430189914ad4047176527918f80b935c (patch) | |
tree | 0573ad737518b18635be497fe651b45a825c4565 /ext/pdo | |
parent | 424b4802d2b3f3682ccef86bcb4a162832a4c12f (diff) | |
download | php-git-b44e29f8430189914ad4047176527918f80b935c.tar.gz |
php_pdo_register_driver() might fail
Therefore correctly report failure in MINIT for the drivers which didn't.
Diffstat (limited to 'ext/pdo')
-rw-r--r-- | ext/pdo/pdo.c | 2 | ||||
-rw-r--r-- | ext/pdo/php_pdo_driver.h | 5 |
2 files changed, 4 insertions, 3 deletions
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); |