// #define ERR_DEBUG
-/* If you declare any globals in php_msession.h uncomment this:
-
-ZEND_DECLARE_MODULE_GLOBALS(msession)
-*/
-
/* True global resources - no need for thread safety here */
static char g_defhost[]="localhost";
static char * g_host=g_defhost;
#define GET_REQB \
if(!g_reqb) { RETURN_NULL(); }
-/* Every user visible function must have an entry in msession_functions[].
- */
function_entry msession_functions[] = {
- PHP_FE(confirm_msession_compiled, NULL) /* For testing, remove later. */
PHP_FE(msession_connect,NULL)
PHP_FE(msession_disconnect,NULL)
PHP_FE(msession_lock,NULL)
"msession",
msession_functions,
PHP_MINIT(msession),
- PHP_MSHUTDOWN(msession),
- PHP_RINIT(msession), /* Replace with NULL if there's nothing to do at request start */
- PHP_RSHUTDOWN(msession),/* Replace with NULL if there's nothing to do at request end */
+ NULL,
+ NULL,
+ PHP_RSHUTDOWN(msession),
PHP_MINFO(msession),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
ZEND_GET_MODULE(msession)
#endif
- /* Remove comments and fill if you need to have entries in php.ini
- PHP_INI_BEGIN()
- PHP_INI_END()
- */
-
- PHP_MINIT_FUNCTION(msession)
+PHP_MINIT_FUNCTION(msession)
{
- /* Remove comments if you have entries in php.ini
- REGISTER_INI_ENTRIES();
- */
g_conn = NULL;
g_host = g_defhost;
return SUCCESS;
}
-PHP_MSHUTDOWN_FUNCTION(msession)
-{
- /* Remove comments if you have entries in php.ini
- UNREGISTER_INI_ENTRIES();
- */
- return SUCCESS;
-}
-
-/* Remove if there's nothing to do at request start */
-PHP_RINIT_FUNCTION(msession)
-{
- return SUCCESS;
-}
-
-/* Remove if there's nothing to do at request end */
PHP_RSHUTDOWN_FUNCTION(msession)
{
if(g_conn)
php_info_print_table_start();
php_info_print_table_header(2, "msession support", "enabled");
php_info_print_table_end();
-
- /* Remove comments if you have entries in php.ini
- DISPLAY_INI_ENTRIES();
- */
-}
-
-PHP_FUNCTION(confirm_msession_compiled)
-{
- zval **arg;
- int len;
- char string[256];
-
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- convert_to_string_ex(arg);
-
- len = sprintf(string, "(%s) Module %s is compiled into PHP, g_host:%s, g_port:%d",
- __TIME__,
- Z_STRVAL_PP(arg),
- g_host,
- g_port);
- RETURN_STRINGL(string, len, 1);
}
int PHPMsessionConnect(const char *szhost, int nport)
ret = safe_estrdup(g_reqb->req.datum);
return ret;
}
+
int PHPMsessionSetData(const char *session, const char *data)
{
int ret=0;
RETURN_TRUE;
}
+
PHP_FUNCTION(msession_lock)
{
long key;
RETURN_LONG( key);
}
+
PHP_FUNCTION(msession_unlock)
{
long lkey;
{
RETURN_FALSE;
}
-
}
+
PHP_FUNCTION(msession_get)
{
char *val;
if(g_reqb->req.stat==REQ_OK)
val = safe_estrdup(g_reqb->req.datum);
- RETURN_STRING(val, 0)
- }
+ RETURN_STRING(val, 0);
+}
+
PHP_FUNCTION(msession_uniq)
{
long val;
RETURN_NULL();
}
}
+
PHP_FUNCTION(msession_randstr)
{
long val;
RETURN_NULL();
}
}
+
PHP_FUNCTION(msession_find)
{
zval **name;
RETURN_NULL();
}
}
+
PHP_FUNCTION(msession_list)
{
GET_REQB
}
}
}
+
PHP_FUNCTION(msession_set_array)
{
zval **session;
RETURN_NULL();
}
}
+
PHP_FUNCTION(msession_inc)
{
char *val;
RETURN_FALSE;
}
}
+
PHP_FUNCTION(msession_getdata)
{
char *val;
RETURN_FALSE;
}
}
+
PHP_FUNCTION(msession_plugin)
{
int ret;