Skip to content

Update sqlite3 and pdo_sqlite preprocessor macros help texts #15291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions ext/pdo_sqlite/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,26 @@ if test "$PHP_PDO_SQLITE" != "no"; then
PHP_SETUP_SQLITE([PDO_SQLITE_SHARED_LIBADD])

PHP_CHECK_LIBRARY([sqlite3], [sqlite3_close_v2],
[AC_DEFINE([HAVE_SQLITE3_CLOSE_V2], [1], [have sqlite3_close_v2])],
[AC_DEFINE([HAVE_SQLITE3_CLOSE_V2], [1],
[Define to 1 if SQLite library has the 'sqlite3_close_v2' function.])],
[],
[$PDO_SQLITE_SHARED_LIBADD])

PHP_CHECK_LIBRARY([sqlite3], [sqlite3_column_table_name],
[AC_DEFINE([HAVE_SQLITE3_COLUMN_TABLE_NAME], [1],
[have sqlite3_column_table_name])],
[Define to 1 if SQLite library was compiled with the
SQLITE_ENABLE_COLUMN_METADATA and has the 'sqlite3_column_table_name'
function.])],
[],
[$PDO_SQLITE_SHARED_LIBADD])

PHP_CHECK_LIBRARY([sqlite3], [sqlite3_load_extension],
[],
[AC_DEFINE([PDO_SQLITE_OMIT_LOAD_EXTENSION], [1],
[have sqlite3 with extension support])],
[Define to 1 if SQLite library was compiled with the
SQLITE_OMIT_LOAD_EXTENSION and does not have the extension support with
the 'sqlite3_load_extension' function. For usage in the pdo_sqlite. See
https://www.sqlite.org/compile.html.])],
[$PDO_SQLITE_SHARED_LIBADD])

PHP_SUBST([PDO_SQLITE_SHARED_LIBADD])
Expand Down
4 changes: 2 additions & 2 deletions ext/pdo_sqlite/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ if (PHP_PDO_SQLITE != "no") {
EXTENSION("pdo_sqlite", "pdo_sqlite.c sqlite_driver.c sqlite_statement.c sqlite_sql_parser.c");

ADD_EXTENSION_DEP('pdo_sqlite', 'pdo');
AC_DEFINE("HAVE_SQLITE3_COLUMN_TABLE_NAME", 1, "have sqlite3_column_table_name");
AC_DEFINE("HAVE_SQLITE3_CLOSE_V2", 1, "have sqlite3_close_v2");
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.");
AC_DEFINE("HAVE_SQLITE3_CLOSE_V2", 1, "Define to 1 if SQLite library has the 'sqlite3_close_v2' function.");
ADD_MAKEFILE_FRAGMENT();
} else {
WARNING("pdo_sqlite not enabled; libraries and/or headers not found");
Expand Down
3 changes: 0 additions & 3 deletions ext/pdo_sqlite/pdo_sqlite.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ public function createFunction(
int $flags = 0
): bool {}

// PDO_SQLITE_OMIT_LOAD_EXTENSION might be defined by ext/pdo_sqlite/config.m4
// if Sqlite3 did not have the sqlite3_load_extension function present
// which can depend on how SQLite was compiled: https://www.sqlite.org/compile.html
#ifndef PDO_SQLITE_OMIT_LOAD_EXTENSION
public function loadExtension(string $name): void {}
#endif
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo_sqlite/pdo_sqlite_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ext/sqlite3/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ if (PHP_SQLITE3 != "no") {
EXTENSION("sqlite3", "sqlite3.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");

AC_DEFINE("HAVE_SQLITE3", 1, "Define to 1 if the PHP extension 'sqlite3' is available.");
AC_DEFINE("HAVE_SQLITE3_ERRSTR", 1, "have sqlite3_errstr function");
AC_DEFINE("HAVE_SQLITE3_EXPANDED_SQL", 1, "have sqlite3_expanded_sql function");
AC_DEFINE("HAVE_SQLITE3_ERRSTR", 1, "Define to 1 if SQLite library has the 'sqlite3_errstr' function.");
AC_DEFINE("HAVE_SQLITE3_EXPANDED_SQL", 1, "Define to 1 if SQLite library has the 'sqlite3_expanded_sql' function.");
} else {
WARNING("sqlite3 not enabled; libraries and/or headers not found");
}
Expand Down
10 changes: 7 additions & 3 deletions ext/sqlite3/config0.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,24 @@ if test $PHP_SQLITE3 != "no"; then
[Define to 1 if the PHP extension 'sqlite3' is available.])

PHP_CHECK_LIBRARY([sqlite3], [sqlite3_errstr],
[AC_DEFINE([HAVE_SQLITE3_ERRSTR], [1], [have sqlite3_errstr function])],
[AC_DEFINE([HAVE_SQLITE3_ERRSTR], [1],
[Define to 1 if SQLite library has the 'sqlite3_errstr' function.])],
[],
[$SQLITE3_SHARED_LIBADD])

PHP_CHECK_LIBRARY([sqlite3], [sqlite3_expanded_sql],
[AC_DEFINE([HAVE_SQLITE3_EXPANDED_SQL], [1],
[have sqlite3_expanded_sql function])],
[Define to 1 if SQLite library has the 'sqlite3_expanded_sql' function.])],
[],
[$SQLITE3_SHARED_LIBADD])

PHP_CHECK_LIBRARY([sqlite3], [sqlite3_load_extension],
[],
[AC_DEFINE([SQLITE_OMIT_LOAD_EXTENSION], [1],
[have sqlite3 with extension support])],
[Define to 1 if SQLite library was compiled with the
SQLITE_OMIT_LOAD_EXTENSION and does not have the extension support with
the 'sqlite3_load_extension' function. For usage in the sqlite3 PHP
extension. See https://www.sqlite.org/compile.html.])],
[$SQLITE3_SHARED_LIBADD])

PHP_NEW_EXTENSION([sqlite3],
Expand Down
Loading