summaryrefslogtreecommitdiff
path: root/ext/sqlite3/sqlite3.c
diff options
context:
space:
mode:
authorScott MacVicar <scottmac@php.net>2009-05-07 16:52:40 +0000
committerScott MacVicar <scottmac@php.net>2009-05-07 16:52:40 +0000
commit540b5fdf8790a6fdd5d2efa64d14118454af5273 (patch)
treef55addf94e3dd81c1489ec04277712b2f62e7e8f /ext/sqlite3/sqlite3.c
parent47298668d42153f38520c652a739d52e9cc5cfd5 (diff)
downloadphp-git-540b5fdf8790a6fdd5d2efa64d14118454af5273.tar.gz
MFB Print warning when using loadExtension on non cli, cgi and embeded
Diffstat (limited to 'ext/sqlite3/sqlite3.c')
-rw-r--r--ext/sqlite3/sqlite3.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index baf137e6da..2875a6207b 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -324,6 +324,16 @@ PHP_METHOD(sqlite3, loadExtension)
return;
}
+#ifdef ZTS
+ if ((strncmp(sapi_module.name, "cgi", 3) != 0) &&
+ (strcmp(sapi_module.name, "cli") != 0) &&
+ (strncmp(sapi_module.name, "embed", 5) != 0)
+ ) {
+ php_sqlite3_error(db_obj, "Not supported in multithreaded Web servers");
+ RETURN_FALSE;
+ }
+#endif
+
if (!SQLITE3G(extension_dir)) {
php_sqlite3_error(db_obj, "SQLite Extension are disabled");
RETURN_FALSE;