Tidy up driver specific method handling

This commit is contained in:
Wez Furlong 2005-01-17 23:59:16 +00:00
parent 7c152b6a8e
commit 37ea5fbeb5
2 changed files with 7 additions and 3 deletions

View file

@ -839,7 +839,9 @@ static union _zend_function *dbh_method_get(
/* not a pre-defined method, nor a user-defined method; check /* not a pre-defined method, nor a user-defined method; check
* the driver specific methods */ * the driver specific methods */
if (!dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH]) { if (!dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH]) {
if (!pdo_hash_methods(dbh, PDO_DBH_DRIVER_METHOD_KIND_DBH TSRMLS_CC)) { if (!pdo_hash_methods(dbh,
PDO_DBH_DRIVER_METHOD_KIND_DBH TSRMLS_CC)
|| !dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH]) {
goto out; goto out;
} }
} }

View file

@ -1060,12 +1060,14 @@ static union _zend_function *dbstmt_method_get(
/* not a pre-defined method, nor a user-defined method; check /* not a pre-defined method, nor a user-defined method; check
* the driver specific methods */ * the driver specific methods */
if (!stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT]) { if (!stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT]) {
if (!pdo_hash_methods(stmt->dbh, PDO_DBH_DRIVER_METHOD_KIND_STMT TSRMLS_CC)) { if (!pdo_hash_methods(stmt->dbh,
PDO_DBH_DRIVER_METHOD_KIND_STMT TSRMLS_CC)
|| !stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT]) {
goto out; goto out;
} }
} }
if (zend_hash_find(stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH], if (zend_hash_find(stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT],
lc_method_name, method_len+1, (void**)&fbc) == FAILURE) { lc_method_name, method_len+1, (void**)&fbc) == FAILURE) {
fbc = NULL; fbc = NULL;
goto out; goto out;