mirror of
https://github.com/php/php-src.git
synced 2024-12-11 19:04:38 +08:00
Fix warnings and allow builds without ext/session
This commit is contained in:
parent
e5af63a7d5
commit
d531dee390
@ -20,6 +20,9 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "php.h"
|
||||
|
||||
#if HAVE_PHP_SESSION
|
||||
|
||||
#include "ext/session/php_session.h"
|
||||
#include <sqlite.h>
|
||||
|
||||
@ -71,9 +74,7 @@ static int ps_sqlite_valid_key(const char *key)
|
||||
|
||||
PS_OPEN_FUNC(sqlite)
|
||||
{
|
||||
char *filepath;
|
||||
char *errmsg = NULL;
|
||||
int spath_len, sname_len, fp_len;
|
||||
sqlite *db;
|
||||
|
||||
/* TODO: do we need a safe_mode check here? */
|
||||
@ -203,6 +204,8 @@ PS_GC_FUNC(sqlite)
|
||||
SUCCESS : FAILURE;
|
||||
}
|
||||
|
||||
#endif /* HAVE_PHP_SESSION */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
@ -58,8 +58,10 @@
|
||||
|
||||
ZEND_DECLARE_MODULE_GLOBALS(sqlite)
|
||||
|
||||
#if HAVE_PHP_SESSION
|
||||
extern ps_module ps_mod_sqlite;
|
||||
#define ps_sqlite_ptr &ps_mod_sqlite
|
||||
#endif
|
||||
|
||||
extern int sqlite_encode_binary(const unsigned char *in, int n, unsigned char *out);
|
||||
extern int sqlite_decode_binary(const unsigned char *in, unsigned char *out);
|
||||
@ -882,7 +884,9 @@ PHP_MINIT_FUNCTION(sqlite)
|
||||
|
||||
REGISTER_INI_ENTRIES();
|
||||
|
||||
#if HAVE_PHP_SESSION
|
||||
php_session_register_module(ps_sqlite_ptr);
|
||||
#endif
|
||||
|
||||
le_sqlite_db = zend_register_list_destructors_ex(php_sqlite_db_dtor, NULL, "sqlite database", module_number);
|
||||
le_sqlite_pdb = zend_register_list_destructors_ex(NULL, php_sqlite_db_dtor, "sqlite database (persistent)", module_number);
|
||||
|
Loading…
Reference in New Issue
Block a user