+++ /dev/null
-top_srcdir = /local/projects/php/php4
-top_builddir = /local/projects/php/php4
-srcdir = /local/projects/php/php4/ext/msession
-builddir = /local/projects/php/php4/ext/msession
-VPATH = /local/projects/php/php4/ext/msession
-# $Id$
-
-LTLIBRARY_NAME = libmsession.la
-LTLIBRARY_SOURCES = msession.c
-LTLIBRARY_SHARED_NAME = msession.la
-
-LTLIBRARY_SHARED_LIBADD = $(PHOENIX_LIB)
-
-EXTRA_INCLUDES = $(PHOENIX_INCLUDE)
-
-include $(top_srcdir)/build/dynlib.mk
+----------------------------------------------------------------------+
| msession 1.0 |
+----------------------------------------------------------------------+
- | Copyright (c) 2001 Mark L. Woodward (Mohawk Software) |
+ | Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
#include "php_ini.h"
#include "php_msession.h"
#include "reqclient.h"
+#include "../session/php_session.h"
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+// #define ERR_DEBUG
+
+#ifdef ERR_DEBUG
+#define ELOG( str ) php_log_err( str )
+#else
+#define ELOG( str )
+#endif
+
+char g_msession[]="Msession";
#if HAVE_MSESSION
+PS_FUNCS(msession);
+
+ps_module ps_mod_msession = {
+ PS_MOD(msession)
+};
+
// #define ERR_DEBUG
/* If you declare any globals in php_msession.h uncomment this:
g_conn = NULL;
g_host = g_defhost;
+ php_session_register_module(&ps_mod_msession);
+
return SUCCESS;
}
g_port);
RETURN_STRINGL(string, len, 1);
}
-int PHPMsessionConnect(char *szhost, int nport)
+int PHPMsessionConnect(const char *szhost, int nport)
{
if(!g_reqb)
g_reqb = AllocateRequestBuffer(2048);
}
}
-char *PHPMsessionGetData(char *session)
+char *PHPMsessionGetData(const char *session)
{
char *ret = NULL;
ret = safe_estrdup(g_reqb->req.datum);
return ret;
}
-int PHPMsessionSetData(char *session, char *data)
+int PHPMsessionSetData(const char *session, const char *data)
{
int ret=0;
#ifdef ERR_DEBUG
return ret;
}
-int PHPMsessionDestroy(char *session)
+int PHPMsessionDestroy(const char *session)
{
int ret=0;
if(!g_reqb)
}
}
+PS_OPEN_FUNC(msession)
+{
+ ELOG( "ps_open_msession");
+ PS_SET_MOD_DATA((void *)1); // session.c needs a non-zero here!
+ return PHPMsessionConnect(save_path, 8086) ? SUCCESS : FAILURE;
+}
+
+PS_CLOSE_FUNC(msession)
+{
+ PHPMsessionDisconnect();
+ ELOG( "ps_close_msession");
+ return SUCCESS;
+}
+
+PS_READ_FUNC(msession)
+{
+ ELOG( "ps_read_msession");
+ *val = PHPMsessionGetData(key);
+ if(*val)
+ {
+ *vallen = strlen(*val);
+ }
+ else
+ {
+ *val = emalloc(1);
+ **val=0;
+ *vallen = 0;
+ }
+ return SUCCESS;
+}
+
+PS_WRITE_FUNC(msession)
+{
+ ELOG( "ps_write_msession");
+ return (PHPMsessionSetData(key,val)) ? SUCCESS : FAILURE;
+}
+
+PS_DESTROY_FUNC(msession)
+{
+ ELOG( "ps_destroy_msession");
+ return (PHPMsessionDestroy(key)) ? SUCCESS : FAILURE;
+}
+
+PS_GC_FUNC(msession)
+{
+ ELOG( "ps_gc_msession");
+ return SUCCESS;
+}
#endif /* HAVE_MSESSION */
+----------------------------------------------------------------------+
| msession 1.0 |
+----------------------------------------------------------------------+
- | Copyright (c) 2001 Mark L. Woodward (Mohawk Software) |
+ | Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
REQB *SizeRequestBuffer(REQB *req, unsigned int size);
REQB *StaticRequestBuffer(char *buffer, unsigned int cb);
-int FormatRequest(REQB **buffer, int stat, char *session, char *name, char *value, int param);
+int FormatRequest(REQB **buffer, int stat, const char *session, const char *name, const char *value, int param);
int FormatRequestMulti(REQB **buffer, int stat, char *session, int n, char **pairs, int param);
int DoSingleRequest(char *hostname, int port, REQB **preq);
void *OpenReqConn(char *hostname, int port);