Skip to content

Commit 35bb781

Browse files
committed
Remove HAVE_SQLITE3_{CLOSE_V2,ERRSTR}
As of PHP 8.5 the minimum required SQLite library is 3.7.17, and this removes the following preprocessor macros checks: - HAVE_SQLITE3_CLOSE_V2 (sqlite3_close_v2() function is available since SQLite 3.7.14.) - HAVE_SQLITE3_ERRSTR (sqlite3_errstr() function is available since SQLite 3.7.15) - SQLITE_VERSION_NUMBER should be now always greater than 3006011 (3.6.11).
1 parent 22e444c commit 35bb781

File tree

8 files changed

+2
-34
lines changed

8 files changed

+2
-34
lines changed

ext/pdo_sqlite/config.m4

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ if test "$PHP_PDO_SQLITE" != "no"; then
99

1010
PHP_SETUP_SQLITE([PDO_SQLITE_SHARED_LIBADD])
1111

12-
PHP_CHECK_LIBRARY([sqlite3], [sqlite3_close_v2],
13-
[AC_DEFINE([HAVE_SQLITE3_CLOSE_V2], [1],
14-
[Define to 1 if SQLite library has the 'sqlite3_close_v2' function.])],
15-
[],
16-
[$PDO_SQLITE_SHARED_LIBADD])
17-
1812
PHP_CHECK_LIBRARY([sqlite3], [sqlite3_column_table_name],
1913
[AC_DEFINE([HAVE_SQLITE3_COLUMN_TABLE_NAME], [1],
2014
[Define to 1 if SQLite library was compiled with the

ext/pdo_sqlite/config.w32

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ if (PHP_PDO_SQLITE != "no") {
88

99
ADD_EXTENSION_DEP('pdo_sqlite', 'pdo');
1010
AC_DEFINE("HAVE_SQLITE3_COLUMN_TABLE_NAME", 1, "Define to 1 if SQLite library was compiled with the SQLITE_ENABLE_COLUMN_METADATA and has the 'sqlite3_column_table_name' function.");
11-
AC_DEFINE("HAVE_SQLITE3_CLOSE_V2", 1, "Define to 1 if SQLite library has the 'sqlite3_close_v2' function.");
1211
ADD_MAKEFILE_FRAGMENT();
1312
} else {
1413
WARNING("pdo_sqlite not enabled; libraries and/or headers not found");

ext/pdo_sqlite/sqlite_driver.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,7 @@ static void sqlite_handle_closer(pdo_dbh_t *dbh) /* {{{ */
159159

160160
pdo_sqlite_cleanup_callbacks(H);
161161
if (H->db) {
162-
#ifdef HAVE_SQLITE3_CLOSE_V2
163162
sqlite3_close_v2(H->db);
164-
#else
165-
sqlite3_close(H->db);
166-
#endif
167163
H->db = NULL;
168164
}
169165
if (einfo->errmsg) {

ext/sqlite3/config.w32

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ if (PHP_SQLITE3 != "no") {
77
EXTENSION("sqlite3", "sqlite3.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
88

99
AC_DEFINE("HAVE_SQLITE3", 1, "Define to 1 if the PHP extension 'sqlite3' is available.");
10-
AC_DEFINE("HAVE_SQLITE3_ERRSTR", 1, "Define to 1 if SQLite library has the 'sqlite3_errstr' function.");
1110
AC_DEFINE("HAVE_SQLITE3_EXPANDED_SQL", 1, "Define to 1 if SQLite library has the 'sqlite3_expanded_sql' function.");
1211
} else {
1312
WARNING("sqlite3 not enabled; libraries and/or headers not found");

ext/sqlite3/config0.m4

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ if test $PHP_SQLITE3 != "no"; then
99
AC_DEFINE([HAVE_SQLITE3], [1],
1010
[Define to 1 if the PHP extension 'sqlite3' is available.])
1111

12-
PHP_CHECK_LIBRARY([sqlite3], [sqlite3_errstr],
13-
[AC_DEFINE([HAVE_SQLITE3_ERRSTR], [1],
14-
[Define to 1 if SQLite library has the 'sqlite3_errstr' function.])],
15-
[],
16-
[$SQLITE3_SHARED_LIBADD])
17-
1812
PHP_CHECK_LIBRARY([sqlite3], [sqlite3_expanded_sql],
1913
[AC_DEFINE([HAVE_SQLITE3_EXPANDED_SQL], [1],
2014
[Define to 1 if SQLite library has the 'sqlite3_expanded_sql' function.])],

ext/sqlite3/sqlite3.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,7 @@ PHP_METHOD(SQLite3, open)
143143
rc = sqlite3_open_v2(fullpath, &(db_obj->db), flags, NULL);
144144
if (rc != SQLITE_OK) {
145145
zend_throw_exception_ex(zend_ce_exception, 0, "Unable to open database: %s",
146-
#ifdef HAVE_SQLITE3_ERRSTR
147-
db_obj->db ? sqlite3_errmsg(db_obj->db) : sqlite3_errstr(rc));
148-
#else
149-
db_obj->db ? sqlite3_errmsg(db_obj->db) : "");
150-
#endif
146+
db_obj->db ? sqlite3_errmsg(db_obj->db) : sqlite3_errstr(rc));
151147
sqlite3_close(db_obj->db);
152148
if (fullpath != filename) {
153149
efree(fullpath);
@@ -1332,7 +1328,6 @@ PHP_METHOD(SQLite3, setAuthorizer)
13321328
/* }}} */
13331329

13341330

1335-
#if SQLITE_VERSION_NUMBER >= 3006011
13361331
/* {{{ Backups the current database to another one. */
13371332
PHP_METHOD(SQLite3, backup)
13381333
{
@@ -1386,7 +1381,6 @@ PHP_METHOD(SQLite3, backup)
13861381
RETURN_TRUE;
13871382
}
13881383
/* }}} */
1389-
#endif
13901384

13911385
/* {{{ Returns the number of parameters within the prepared statement. */
13921386
PHP_METHOD(SQLite3Stmt, paramCount)

ext/sqlite3/sqlite3.stub.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,8 @@ public function busyTimeout(int $milliseconds): bool {}
199199
public function loadExtension(string $name): bool {}
200200
#endif
201201

202-
#if SQLITE_VERSION_NUMBER >= 3006011
203202
/** @tentative-return-type */
204203
public function backup(SQLite3 $destination, string $sourceDatabase = "main", string $destinationDatabase = "main"): bool {}
205-
#endif
206204

207205
/** @tentative-return-type */
208206
public static function escapeString(string $string): string {}

ext/sqlite3/sqlite3_arginfo.h

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

0 commit comments

Comments
 (0)