From: Pierre Joye Date: Sun, 10 Dec 2006 02:32:17 +0000 (+0000) Subject: - fix build on HEAD X-Git-Tag: RELEASE_1_0_0RC1~735 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a6ec097ef960e63abac260f18e24bdac35cf0d37;p=php - fix build on HEAD (not sure if it should compile on 6 and 5 or if it is required only for pdo, other drivers require this fix) --- diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index 8eff8a960c..b2fa713b12 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -78,8 +78,13 @@ int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int li } if (!dbh->methods) { +#if PHP_VERSION_ID > 50200 + zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "SQLSTATE[%s] [%d] %s", + *pdo_err, einfo->errcode, einfo->errmsg); +#else zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "SQLSTATE[%s] [%d] %s", *pdo_err, einfo->errcode, einfo->errmsg); +#endif } return einfo->errcode; @@ -737,9 +742,13 @@ static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS filename = make_filename_safe(dbh->data_source TSRMLS_CC); if (!filename) { +#if PHP_VERSION_ID > 50200 + zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, + "open_basedir prohibits opening %s", dbh->data_source); +#else zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, - "open_basedir prohibits opening %s", - dbh->data_source); + "open_basedir prohibits opening %s", dbh->data_source); +#endif goto cleanup; }