Skip to content
Closed
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ addons:
- libsasl2-dev
- libxpm-dev
- libzip-dev
- libsqlite3-dev


services:
Expand Down
3 changes: 0 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@ locations.
└─ ...
└─ skeleton/ # Skeleton for developing new extensions with `ext/ext_skel.php`
└─ ...
└─ sqlite3/
├─ libsqlite/ # https://www.sqlite.org mirror: https://github.com/mackyle/sqlite
└─ ...
└─ standard/
└─ html_tables/
├─ mappings/ # https://www.unicode.org/Public/MAPPINGS/
Expand Down
2 changes: 1 addition & 1 deletion Makefile.gcov
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ php_lcov.info: lcov-test
cp $$x.bbg lcov_data/$$y.bbg ; \
fi; \
done; \
for dir in ext/bcmath/libbcmath ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcre2lib ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
for dir in ext/bcmath/libbcmath ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcre2lib ext/xmlrpc/libxmlrpc ext/zip/lib; do \
if test -d lcov_data/$$dir; then \
rm -rf lcov_data/$$dir ; \
fi; \
Expand Down
66 changes: 28 additions & 38 deletions README.REDIST.BINS
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
1. libmagic (ext/fileinfo) see ext/fileinfo/libmagic/LICENSE
2. Oniguruma (ext/mbstring) see ext/mbstring/oniguruma/COPYING
3. libmbfl (ext/mbstring) see ext/mbstring/libmbfl/LICENSE
4. pcre2lib (ext/pcre)
5. ext/standard crypt
6. ext/standard crypt's blowfish implementation
7. Sqlite/Sqlite3 ext/sqlite3 ext/sqlite
8. ext/standard/rand
9. ext/standard/scanf
10. ext/standard/strnatcmp.c
11. ext/standard/uuencode
12. libxmlrpc ext/xmlrpc
13. main/snprintf.c
14. main/strlcat
15. main/strlcpy
16. libgd see ext/gd/libgd/COPYING
17. ext/phar portions of tar implementations
18. ext/phar/zip.c portion extracted from libzip
19. libbcmath (ext/bcmath) see ext/bcmath/libbcmath/COPYING.LIB
1. libmagic (ext/fileinfo) see ext/fileinfo/libmagic/LICENSE
2. Oniguruma (ext/mbstring) see ext/mbstring/oniguruma/COPYING
3. libmbfl (ext/mbstring) see ext/mbstring/libmbfl/LICENSE
4. pcre2lib (ext/pcre)
5. ext/standard crypt
6. ext/standard crypt's blowfish implementation
7. ext/standard/rand
8. ext/standard/scanf
9. ext/standard/strnatcmp.c
10. ext/standard/uuencode
11. libxmlrpc ext/xmlrpc
12. main/snprintf.c
13. main/strlcat
14. main/strlcpy
15. libgd see ext/gd/libgd/COPYING
16. ext/phar portions of tar implementations
17. ext/phar/zip.c portion extracted from libzip
18. libbcmath (ext/bcmath) see ext/bcmath/libbcmath/COPYING.LIB


4. pcre2lib (ext/pcre)
Expand Down Expand Up @@ -195,16 +194,7 @@ Blowfish library (I can't be sure if I would think of something if I
hadn't seen his code).


7. Sqlite/Sqlite3 ext/sqlite3 ext/sqlite

The author disclaims copyright to this source code. In place of
a legal notice, here is a blessing:
May you do good and not evil.
May you find forgiveness for yourself and forgive others.
May you share freely, never taking more than you give.


8. ext/standard/rand
7. ext/standard/rand

The following php_mt_...() functions are based on a C++ class MTRand by
Richard J. Wagner. For more information see the web page at
Expand Down Expand Up @@ -258,7 +248,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


9. ext/standard/scanf
8. ext/standard/scanf

scanf.c --

Expand Down Expand Up @@ -306,7 +296,7 @@ permission to use and distribute the software in accordance with the
terms specified in this license.


10. ext/standard/strnatcmp.c
9. ext/standard/strnatcmp.c

strnatcmp.c -- Perform 'natural order' comparisons of strings in C.
Copyright (C) 2000 by Martin Pool <mbp@humbug.org.au>
Expand All @@ -328,7 +318,7 @@ freely, subject to the following restrictions:
3. This notice may not be removed or altered from any source distribution.


11. ext/standard/uuencode
10. ext/standard/uuencode

Portions of this code are based on Berkeley's uuencode/uudecode
implementation.
Expand Down Expand Up @@ -365,7 +355,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.


12. libxmlrpc ext/xmlrpc
11. libxmlrpc ext/xmlrpc

Copyright 2000 Epinions, Inc.

Expand All @@ -390,7 +380,7 @@ NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH
DAMAGES.


13. main/snprintf.c
12. main/snprintf.c

Copyright (c) 2002, 2006 Todd C. Miller <Todd.Miller@courtesan.com>

Expand Down Expand Up @@ -465,8 +455,8 @@ SIO stdio-replacement strx_* functions by Panos Tsirigotis
<panos@alumni.cs.colorado.edu> for xinetd.


14. main/strlcat
15. main/strlcpy
13. main/strlcat
14. main/strlcpy

Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
All rights reserved.
Expand Down Expand Up @@ -494,7 +484,7 @@ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


17. ext/phar portions of tar implementations
16. ext/phar portions of tar implementations

portions of tar implementations in ext/phar - phar_tar_octal() are based on an
implementation by Tim Kientzle from libarchive, licensed with this license:
Expand Down Expand Up @@ -523,7 +513,7 @@ implementation by Tim Kientzle from libarchive, licensed with this license:
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


18. ext/phar/zip.c portion extracted from libzip
17. ext/phar/zip.c portion extracted from libzip

zip_dirent.c -- read directory entry (local or central), clean dirent
Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner
Expand Down
106 changes: 39 additions & 67 deletions ext/pdo_sqlite/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -31,78 +31,50 @@ if test "$PHP_PDO_SQLITE" != "no"; then

php_pdo_sqlite_sources_core="pdo_sqlite.c sqlite_driver.c sqlite_statement.c"

if test "$PHP_PDO_SQLITE" != "yes"; then
SEARCH_PATH="$PHP_PDO_SQLITE /usr/local /usr" # you might want to change this
SEARCH_FOR="/include/sqlite3.h" # you most likely want to change this
if test -r $PHP_PDO_SQLITE/$SEARCH_FOR; then # path given as parameter
PDO_SQLITE_DIR=$PHP_PDO_SQLITE
else # search default path list
AC_MSG_CHECKING([for sqlite3 files in default path])
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
PDO_SQLITE_DIR=$i
AC_MSG_RESULT(found in $i)
fi
done
fi
if test -z "$PDO_SQLITE_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Please reinstall the sqlite3 distribution])
fi

PHP_ADD_INCLUDE($PDO_SQLITE_DIR/include)

LIBNAME=sqlite3
LIBSYMBOL=sqlite3_open

PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
[
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $PDO_SQLITE_DIR/$PHP_LIBDIR, PDO_SQLITE_SHARED_LIBADD)
AC_DEFINE(HAVE_PDO_SQLITELIB,1,[ ])
],[
AC_MSG_ERROR([wrong sqlite lib version or lib not found])
],[
-L$PDO_SQLITE_DIR/$PHP_LIBDIR -lm
])
PHP_CHECK_LIBRARY(sqlite3,sqlite3_key,[
AC_DEFINE(HAVE_SQLITE3_KEY,1, [have commercial sqlite3 with crypto support])
])
PHP_CHECK_LIBRARY(sqlite3,sqlite3_close_v2,[
AC_DEFINE(HAVE_SQLITE3_CLOSE_V2, 1, [have sqlite3_close_v2])
])

PHP_SUBST(PDO_SQLITE_SHARED_LIBADD)
PHP_NEW_EXTENSION(pdo_sqlite, $php_pdo_sqlite_sources_core, $ext_shared,,-I$pdo_cv_inc_path)
else
# use bundled libs
if test "$enable_maintainer_zts" = "yes"; then
threadsafe_flags="-DSQLITE_THREADSAFE=1"
else
threadsafe_flags="-DSQLITE_THREADSAFE=0"
fi

AC_DEFINE(HAVE_SQLITE3_CLOSE_V2, 1, [have sqlite3_close_v2])
other_flags="-DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_FTS4=1 -DSQLITE_ENABLE_FTS5=1 -DSQLITE_ENABLE_JSON1=1 -DSQLITE_CORE=1 -DSQLITE_ENABLE_COLUMN_METADATA=1"

dnl As long as intl is not shared we can have ICU support
if test "$PHP_INTL" = "yes" && test "$PHP_INTL_SHARED" != "yes"; then
other_flags="$other_flags -DSQLITE_ENABLE_ICU=1"
SEARCH_PATH="$PHP_PDO_SQLITE /usr/local /usr" # you might want to change this
SEARCH_FOR="/include/sqlite3.h" # you most likely want to change this
if test -r $PHP_PDO_SQLITE/$SEARCH_FOR; then # path given as parameter
PDO_SQLITE_DIR=$PHP_PDO_SQLITE
else # search default path list
AC_MSG_CHECKING([for sqlite3 files in default path])
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
PDO_SQLITE_DIR=$i
AC_MSG_RESULT(found in $i)
fi
done
fi
if test -z "$PDO_SQLITE_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Please reinstall the sqlite3 distribution])
fi

if test "$PHP_SQLITE3" != "yes"; then
PHP_ADD_SOURCES(PHP_EXT_DIR(sqlite3), libsqlite/sqlite3.c)
fi
PHP_ADD_INCLUDE($PDO_SQLITE_DIR/include)

PHP_NEW_EXTENSION(pdo_sqlite,
$php_pdo_sqlite_sources_core,
$ext_shared,,-DPDO_SQLITE_BUNDLED=1 $other_flags $threadsafe_flags -I$pdo_cv_inc_path)
LIBNAME=sqlite3
LIBSYMBOL=sqlite3_open

PHP_SUBST(PDO_SQLITE_SHARED_LIBADD)
PHP_ADD_EXTENSION_DEP(pdo_sqlite, sqlite3)
PHP_ADD_INCLUDE($abs_srcdir/ext/sqlite3/libsqlite)
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
[
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $PDO_SQLITE_DIR/$PHP_LIBDIR, PDO_SQLITE_SHARED_LIBADD)
AC_DEFINE(HAVE_PDO_SQLITELIB,1,[ ])
],[
AC_MSG_ERROR([wrong sqlite lib version or lib not found])
],[
-L$PDO_SQLITE_DIR/$PHP_LIBDIR -lm
])
PHP_CHECK_LIBRARY(sqlite3,sqlite3_key,[
AC_DEFINE(HAVE_SQLITE3_KEY,1, [have commercial sqlite3 with crypto support])
])
PHP_CHECK_LIBRARY(sqlite3,sqlite3_close_v2,[
AC_DEFINE(HAVE_SQLITE3_CLOSE_V2, 1, [have sqlite3_close_v2])
])
PHP_CHECK_LIBRARY(sqlite3,sqlite3_column_table_name,[
AC_DEFINE(HAVE_SQLITE3_COLUMN_TABLE_NAME, 1, [have sqlite3_column_table_name])
])

AC_CHECK_FUNCS(usleep nanosleep)
fi
PHP_SUBST(PDO_SQLITE_SHARED_LIBADD)
PHP_NEW_EXTENSION(pdo_sqlite, $php_pdo_sqlite_sources_core, $ext_shared,,-I$pdo_cv_inc_path)

dnl Solaris fix
PHP_CHECK_LIBRARY(rt, fdatasync, [PHP_ADD_LIBRARY(rt,, PDO_SQLITE_SHARED_LIBADD)])
Expand Down
21 changes: 5 additions & 16 deletions ext/pdo_sqlite/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,12 @@
ARG_WITH("pdo-sqlite", "for pdo_sqlite support", "no");

if (PHP_PDO_SQLITE != "no") {
EXTENSION("pdo_sqlite", "pdo_sqlite.c sqlite_driver.c sqlite_statement.c", null, "/DSQLITE_THREADSAFE=" + (PHP_ZTS == "yes" ? "1" : "0") + " /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_FTS4=1 /D SQLITE_ENABLE_FTS5=1 /D SQLITE_ENABLE_JSON1=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_CORE=1 /I" + configure_module_dirname + "/../sqlite3/libsqlite /I" + configure_module_dirname);

ADD_EXTENSION_DEP('pdo_sqlite', 'pdo');
// If pdo_sqlite is static, and sqlite3 is also static, then we don't add a second copy of the sqlite3 libs
if (PHP_PDO_SQLITE_SHARED || PHP_SQLITE3_SHARED || PHP_SQLITE3 == 'no') {
ADD_SOURCES(configure_module_dirname + "/../sqlite3/libsqlite", "sqlite3.c", "pdo_sqlite");
}
}
if (SETUP_SQLITE3("pdo_sqlite", PHP_PDO_SQLITE, PHP_PDO_SQLITE_SHARED)) {
EXTENSION("pdo_sqlite", "pdo_sqlite.c sqlite_driver.c sqlite_statement.c");
Copy link
Member

@KalleZ KalleZ Sep 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just making a note here, are we sure that we don't need the old CFLAGS like SQLITE_ENABLE_FTS3, SQLITE_ENABLE_FTS4, SQLITE_ENABLE_FTS5, SQLITE_ENABLE_JSON1 & SQLITE_CORE here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've grepped for these, and they are not used anywhere. However, if they were, that wouldn't work anyway, since the external libsqlite might have been compiled differently.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, then we should be good to go then as I don't see any other obvious things at a glance

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, those are library flags, not extension flags. Pushed a repo now https://github.com/winlibs/sqlite3.


ARG_WITH("pdo-sqlite-external", "for pdo_sqlite support from an external dll", "no");
if (PHP_PDO_SQLITE_EXTERNAL != "no") {
if (CHECK_HEADER_ADD_INCLUDE("sqlite3.h", "CFLAGS_PDO_SQLITE_EXTERNAL", PHP_PDO_SQLITE_EXTERNAL + ";" + PHP_PHP_BUILD + "\\include\\sqlite3") &&
CHECK_LIB("sqlite3-import.lib", "pdo_sqlite_external", PHP_PDO_SQLITE_EXTERNAL + ";" + PHP_PHP_BUILD + "\\lib")
&& ADD_EXTENSION_DEP('pdo_sqlite_external', 'pdo') ) {
EXTENSION("pdo_sqlite_external", "pdo_sqlite.c sqlite_driver.c sqlite_statement.c", null, "/I" + configure_module_dirname, null, "ext\\pdo_sqlite_external");
ADD_EXTENSION_DEP('pdo_sqlite', 'pdo');
AC_DEFINE("HAVE_SQLITE3_COLUMN_TABLE_NAME", 1, "have sqlite3_column_table_name");
} else {
WARNING("pdo-sqlite-external support can't be enabled, libraries or headers are missing")
PHP_PDO_SQLITE_EXTERNAL = "no"
WARNING("pdo_sqlite not enabled; libraries and/or headers not found");
}
}
2 changes: 1 addition & 1 deletion ext/pdo_sqlite/sqlite_statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *ret
add_assoc_string(return_value, "sqlite:decl_type", (char *)str);
}

#ifdef SQLITE_ENABLE_COLUMN_METADATA
#ifdef HAVE_SQLITE3_COLUMN_TABLE_NAME
str = sqlite3_column_table_name(S->stmt, colno);
if (str) {
add_assoc_string(return_value, "table", (char *)str);
Expand Down
18 changes: 9 additions & 9 deletions ext/sqlite3/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
ARG_WITH("sqlite3", "SQLite 3 support", "no");

if (PHP_SQLITE3 != "no") {
ADD_FLAG("CFLAGS_SQLITE3", "/D SQLITE_THREADSAFE=" + (PHP_ZTS == "yes" ? "1" : "0") + " /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_FTS4=1 /D SQLITE_ENABLE_FTS5=1 /D SQLITE_ENABLE_JSON1=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_CORE=1 /D SQLITE_API=__declspec(dllexport) ");
EXTENSION("sqlite3", "sqlite3.c", null, "/I" + configure_module_dirname + "/libsqlite /I" + configure_module_dirname + " /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");

ADD_SOURCES(configure_module_dirname + "/libsqlite", "sqlite3.c", "sqlite3");

AC_DEFINE("HAVE_SQLITE3", 1, "SQLite support");
AC_DEFINE("HAVE_SQLITE3_ERRSTR", 1, "have sqlite3_errstr function")
AC_DEFINE("HAVE_SQLITE3_CLOSE_V2", 1, "have sqlite3_close_v2")
PHP_INSTALL_HEADERS("ext/sqlite3", "libsqlite/sqlite3.h");
if (SETUP_SQLITE3("sqlite3", PHP_SQLITE3, PHP_SQLITE3_SHARED)) {
EXTENSION("sqlite3", "sqlite3.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as for the pdo_sqlite/config.w32 note here


AC_DEFINE("HAVE_SQLITE3", 1, "SQLite support");
AC_DEFINE("HAVE_SQLITE3_ERRSTR", 1, "have sqlite3_errstr function");
AC_DEFINE("HAVE_SQLITE3_CLOSE_V2", 1, "have sqlite3_close_v2");
} else {
WARNING("sqlite3 not enabled; libraries and/or headers not found");
}
}
Loading