]> granicus.if.org Git - php/commitdiff
SAPI/Servlet has been moved to PECL.
authorSebastian Bergmann <sebastian@php.net>
Mon, 17 Nov 2003 16:48:43 +0000 (16:48 +0000)
committerSebastian Bergmann <sebastian@php.net>
Mon, 17 Nov 2003 16:48:43 +0000 (16:48 +0000)
18 files changed:
sapi/servlet/CREDITS [deleted file]
sapi/servlet/EXPERIMENTAL [deleted file]
sapi/servlet/Makefile.frag [deleted file]
sapi/servlet/README [deleted file]
sapi/servlet/config.m4 [deleted file]
sapi/servlet/cookies.php [deleted file]
sapi/servlet/date.php [deleted file]
sapi/servlet/formatter.java [deleted file]
sapi/servlet/jinfo.php [deleted file]
sapi/servlet/jver.php [deleted file]
sapi/servlet/reqheaders.php [deleted file]
sapi/servlet/reqinfo.php [deleted file]
sapi/servlet/reqparams.php [deleted file]
sapi/servlet/servlet.c [deleted file]
sapi/servlet/servlet.dsp [deleted file]
sapi/servlet/servlet.java [deleted file]
sapi/servlet/sessions.php [deleted file]
sapi/servlet/web.xml [deleted file]

diff --git a/sapi/servlet/CREDITS b/sapi/servlet/CREDITS
deleted file mode 100644 (file)
index ae4e83e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Java Servlet
-Sam Ruby
diff --git a/sapi/servlet/EXPERIMENTAL b/sapi/servlet/EXPERIMENTAL
deleted file mode 100644 (file)
index 293159a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-this module is experimental,
-its functions may change their names 
-or move to extension all together 
-so do not rely to much on them 
-you have been warned!
diff --git a/sapi/servlet/Makefile.frag b/sapi/servlet/Makefile.frag
deleted file mode 100644 (file)
index 3ad40f8..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-
-sapi/servlet/java.c : sapi/servlet/../../ext/java/java.c sapi/servlet/phpsrvlt.jar
-       @cp sapi/servlet/../../ext/java/java.c sapi/servlet
-
-sapi/servlet/phpsrvlt.jar : sapi/servlet/servlet.java sapi/servlet/../../ext/java/reflect.java
-       $(mkinstalldirs) sapi/servlet/net/php
-       @echo library=php4 > sapi/servlet/net/php/reflect.properties
-       @echo library=php4 > sapi/servlet/net/php/servlet.properties
-       @cp sapi/servlet/formatter.java sapi/servlet/net/php
-       @cp sapi/servlet/servlet.java sapi/servlet/net/php
-       @cp sapi/servlet/../../ext/java/reflect.java sapi/servlet/net/php
-       cd sapi/servlet && javac net/php/reflect.java
-       @test ! -f sapi/servlet/reflect.class || mv sapi/servlet/reflect.class sapi/servlet/net/php # bug in KJC javac
-       cd sapi/servlet && javac -classpath .:$(SERVLET_CLASSPATH):$(CLASSPATH):. net/php/servlet.java
-       @test ! -f sapi/servlet/servlet.class || mv sapi/servlet/servlet.class sapi/servlet/net/php # bug in KJC javac
-       cd sapi/servlet && javac -classpath .:$(SERVLET_CLASSPATH):$(CLASSPATH):. net/php/formatter.java
-       @test ! -f sapi/servlet/formatter.class || mv sapi/servlet/formatter.class sapi/servlet/net/php # bug in KJC javac
-       cd sapi/servlet/ && $(JAVA_JAR) phpsrvlt.jar net/php/*.class net/php/*.properties
-       @rm -rf sapi/servlet/net
diff --git a/sapi/servlet/README b/sapi/servlet/README
deleted file mode 100644 (file)
index be874d2..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-Java Servlet SAPI Module for PHP 4
-
-
-  Introduction
-
-    The Java Servlet SAPI Module allows for the execution of PHP 4 as
-    a Servlet from within a Java Servlet Engine, such as Apache's
-    Jakarta Tomcat [1]. It builds upon the mechanism defined by PHP's
-    Java Extension, which can be found in /php4/ext/java.
-
-    The primary advantage of this from a PHP perspective is that web
-    servers which support servlets typically take great care in
-    pooling and reusing Java Virtual Machines (JVMs).
-
-    PHP may also be bridged with the Apache Cocoon XML Publishing
-    Framework. [2]
-
-    A suitably configured system will invoke the PHP binaries through
-    JNI and the output of the page will be processed through the
-    configured XML parser and placed into the pipeline for processing
-    by such filters as XSLT. This enables PHP developers to access the
-    powers of Cocoon to separate their content, style, and logic
-    without requiring them to write a single line of Java code.
-
-    While this code is intended to be able to run on any servlet
-    engine, it has only been tested on Apache's Jakarta Tomcat to
-    date. Bug reports, success stories and/or patches required to get
-    this code to run on other engines would be appreciated; please
-    send them to the PHP Development Mailinglist [3].
-
-    Note: PHP has a habit of changing the working directory. The Java
-    Servlet SAPI Module will eventually change it back, but while PHP
-    is running the servlet engine may not be able to load any classes
-    from the CLASSPATH which are specified using a relative directory
-    syntax, or find the work directory used for administration and JSP
-    compilation tasks.
-
-
-  Installing PHP as a Servlet into Apache's Jakarta Tomcat [*]
-
-    1.) Build the PHP 4 Java Servlet SAPI Module
-
-        The javax.servlet package should be in your CLASSPATH. If you're
-        using Tomcat, adding servlet.jar to your CLASSPATH is sufficient.
-
-        UNIX
-
-          o ./configure --with-servlet --with-java
-
-          o Add directory containing libphp4.so to LD_LIBRARY_PATH.
-
-        Windows
-
-          o Build ext/java/java.dsp, copy php_java.dll to your
-            extension_dir directory and enable the extension in the
-            php.ini.
-
-          o Build sapi/servlet/servlet.dsp.
-
-          o Add the directory containing php4ts.dll and phpsrvlt.dll to
-            the PATH environment variable.
-
-    2.) Copy phpsrvlt.jar into your $TOMCAT_HOME/shared/lib directory.
-
-    3.) Merge the configuration directives from web.xml file that
-        comes with the Java Servlet SAPI Module into your
-        $TOMCAT_HOME/conf/web.xml configuration file.
-
-        Make sure that the element ordering of the web.xml is legal
-        with Tomcat and put all the <servlet> declarations first,
-        followed by all the <servlet-mapping> declarations.
-
-        Add
-
-          <welcome-file>index.php</welcome-file>
-
-        to the
-
-          <welcome-file-list>
-            ...
-          </welcome-file-list>
-
-        block of your $TOMCAT_HOME/conf/web.xml configuration file.
-
-    4.) Test your installation by creating a test.php file in your
-        $TOMCAT_HOME/webapps/ROOT directory with
-
-          <?php phpinfo(); ?>
-
-        in it.
-
-        Access this file in your browser at
-
-          http://localhost:8080/test.php
-
-        and you should see the familiar output of phpinfo().
-
-
-  Installing PHP as a Generator into Apache's Cocoon2 Framework
-
-    1.) Build the Java Servlet SAPI Module as described above.
-
-    2.) Get the Cocoon2 source tree, either by CVS or from a release
-        archive; a binary distribution does not suffice. Copy the
-        phpsrvlet.jar file into your xml-cocoon2/lib/optional directory
-        and build Cocoon.
-
--- 
- [*] The instructions herein have been tested with Tomcat 4.1.12.
-
- [1] http://jakarta.apache.org/tomcat/
- [2] http://xml.apache.org/cocoon2/
- [3] http://www.php.net/support.php
diff --git a/sapi/servlet/config.m4 b/sapi/servlet/config.m4
deleted file mode 100644 (file)
index 05ebd70..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-dnl
-dnl $Id$
-dnl
-
-AC_MSG_CHECKING(for Servlet support)
-AC_ARG_WITH(servlet,
-[  --with-servlet[=DIR]    Include servlet support. DIR is the base install
-                          directory for the JSDK.  This SAPI prereqs the
-                          java extension must be built as a shared dl.],
-[
-  if test "$withval" != "no"; then
-
-    if test "$withval" = "yes"; then
-      SERVLET_CLASSPATH=.
-    else
-      if test -f $withval/lib/servlet.jar; then
-        SERVLET_CLASSPATH=$withval/lib/servlet.jar
-      fi
-
-      if test -f $withval/lib/jsdk.jar; then
-        SERVLET_CLASSPATH=$withval/lib/jsdk.jar
-      fi
-
-      if test -d $withval/javax; then
-        SERVLET_CLASSPATH=$withval
-      fi
-
-      if test -z "$SERVLET_CLASSPATH"; then
-        AC_MSG_RESULT(no)
-        AC_MSG_ERROR(unable to find servlet libraries)
-      fi
-    fi
-
-    AC_DEFINE(SAPI_SERVLET, 1, [Whether you use Servlet])
-
-    INSTALL_IT="\$(mkinstalldirs) \$(libdir)"
-    INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 \$(top_srcdir)/sapi/servlet/phpsrvlt.jar \$(libdir)"
-    INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 $SAPI_SHARED \$(libdir)"
-    PHP_SAPI=servlet
-    PHP_BUILD_THREAD_SAFE
-    EXTRA_INCLUDES="$EXTRA_INCLUDES \$(JAVA_INCLUDE)"
-    PHP_SELECT_SAPI(servlet, shared, servlet.c)
-    PHP_ADD_SOURCES(/sapi/servlet, java.c,, sapi)
-    PHP_ADD_MAKEFILE_FRAGMENT(sapi/servlet/Makefile.frag)
-
-    AC_MSG_RESULT(yes)
-  else
-    AC_MSG_RESULT(no)
-  fi
-],[
-  AC_MSG_RESULT(no)
-])
-
-PHP_SUBST(SERVLET_CLASSPATH)
diff --git a/sapi/servlet/cookies.php b/sapi/servlet/cookies.php
deleted file mode 100644 (file)
index bcc4c40..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<html>
-<body bgcolor="white">
-<head>
-<title>Cookies Example</title>
-</head>
-<body>
-<h3>Cookies Example</h3>
-
-<?
-  $cookies = $request->cookies;
-  // print out cookies
-
-  if (!current($cookies)) {
-    echo "Your browser isn't sending any cookies\n";
-  } else {
-    echo "Your browser is sending the following cookies:<br>\n";
-
-    foreach ($cookies as $cookie) {
-      echo "Cookie Name: $cookie->name<br>Cookie value: $cookie->value<br>\n";
-    }
-  }
-
-  // set a cookie
-
-  if ($cookieName) {
-    $response->addCookie(new Java("javax.servlet.http.Cookie", $cookieName, $cookieValue));
-    echo "<p>You just sent the following cookie to your browser:<br>\n";
-    echo "Name: $cookieName<br>Value: $cookieValue<P>\n";
-  }
-
-?>
-<P>
-Create a cookie to send to your browser<br>
-<form action="<?PHP echo $PHP_SELF ?>" method=POST>
-Name:  <input type=text length=20 name=cookieName><br>
-Value:  <input type=text length=20 name=cookieValue><br>
-<input type=submit></form>
-</body>
-</html>
-
diff --git a/sapi/servlet/date.php b/sapi/servlet/date.php
deleted file mode 100644 (file)
index 1146d31..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<html>
-<!--
-  Copyright (c) 1999 The Apache Software Foundation.  All rights 
-  reserved.
--->
-
-<body bgcolor="white">
-<?php $clock=new Java("dates.JspCalendar"); ?>
-
-<font size=4>
-<ul>
-<li>   Day of month: is  <?php echo $clock->dayOfMonth ?>
-<li>   Year: is  <?php echo $clock->year ?>
-<li>   Month: is  <?php echo $clock->month ?>
-<li>   Time: is  <?php echo $clock->time ?>
-<li>   Date: is  <?php echo $clock->date ?>
-<li>   Day: is  <?php echo $clock->day ?>
-<li>   Day Of Year: is  <?php echo $clock->dayOfYear ?>
-<li>   Week Of Year: is  <?php echo $clock->weekOfYear ?>
-<li>   era: is  <?php echo $clock->era ?>
-<li>   DST Offset: is  <?php echo $clock->dSTOffset ?>
-<li>   Zone Offset: is  <?php echo $clock->zoneOffset ?>
-</ul>
-</font>
-
-</body>
-</html>
-
diff --git a/sapi/servlet/formatter.java b/sapi/servlet/formatter.java
deleted file mode 100644 (file)
index dfb722f..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-   +----------------------------------------------------------------------+
-   | PHP Version 4                                                        |
-   +----------------------------------------------------------------------+
-   | Copyright (c) 1997-2002 The PHP Group                                |
-   +----------------------------------------------------------------------+
-   | This source file is subject to version 3.0 of the PHP license,       |
-   | that is bundled with this package in the file LICENSE, and is        |
-   | available through the world-wide-web at the following url:           |
-   | http://www.php.net/license/3_0.txt.                                  |
-   | If you did not receive a copy of the PHP license and are unable to   |
-   | obtain it through the world-wide-web, please send a note to          |
-   | license@php.net so we can mail you a copy immediately.               |
-   +----------------------------------------------------------------------+
-   | Author: Sam Ruby (rubys@us.ibm.com)                                  |
-   +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-package net.php;
-
-import javax.servlet.*;
-import javax.servlet.http.*;
-
-public class formatter extends servlet {
-  public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException {
-    display_source_mode = true;
-    super.service(request, response);
-  }
-}
diff --git a/sapi/servlet/jinfo.php b/sapi/servlet/jinfo.php
deleted file mode 100644 (file)
index f20bbfb..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<?
-
-  phpinfo();
-
-?>
diff --git a/sapi/servlet/jver.php b/sapi/servlet/jver.php
deleted file mode 100644 (file)
index e5e029c..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<html>
-<?
-
-  $system = new Java("java.lang.System");
-  print "Java version=".$system->getProperty("java.version")." <br>\n";
-  print "Java vendor=".$system->getProperty("java.vendor")." <p>\n\n";
-  print "OS=".$system->getProperty("os.name")." ".
-             $system->getProperty("os.version")." on ".
-             $system->getProperty("os.arch")." <br>\n";
-
-  $formatter = new Java("java.text.SimpleDateFormat",
-                       "EEEE, MMMM dd, yyyy 'at' h:mm:ss a zzzz");
-
-  print $formatter->format(new Java("java.util.Date"))."\n";
-
-?>
-</html>
diff --git a/sapi/servlet/reqheaders.php b/sapi/servlet/reqheaders.php
deleted file mode 100644 (file)
index db04aed..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<html>
-<body bgcolor="white">
-<head>
-<title>Request Header Example</title>
-</head>
-<body>
-<h3>Request Header Example</h3>
-<table border=0>
-
-<?php
-
-   $e = $request->headerNames;
-   while ($e->hasMoreElements()) {
-     $name = $e->nextElement();
-     $value = $request->getHeader($name);
-     print "<tr><td bgcolor=\"#CCCCCC\">$name\n";
-     print "</td><td>$value</td></tr>\n";
-    }
-
-?>
-
-</table>
-</body>
-</html>
diff --git a/sapi/servlet/reqinfo.php b/sapi/servlet/reqinfo.php
deleted file mode 100644 (file)
index 37d453b..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<html>
-<body>
-<head>
-<title>Request Information Example</title>
-</head>
-<body bgcolor="white">
-<h3>Request Information Example</h3>
-<table border=0><tr><td>
-Method:
-</td><td>
-<?php print $request->method ?>
-</td></tr><tr><td>
-Request URI:
-</td><td>
-<?php print $request->requestURI ?>
-</td></tr><tr><td>
-Protocol:
-</td><td>
-<?php print $request->protocol ?>
-</td></tr><tr><td>
-Path Info:
-</td><td>
-<?php print $request->pathInfo ?>
-</td></tr><tr><td>
-Remote Address:
-</td><td>
-<?php print $request->remoteAddr ?>
-</table>
-
diff --git a/sapi/servlet/reqparams.php b/sapi/servlet/reqparams.php
deleted file mode 100644 (file)
index f968b27..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<html>
-<body>
-<head>
-<title>Request Parameters Example</title>
-</head>
-<body bgcolor="white">
-<h3>Request Parameters Example</h3>
-Parameters in this request:<br>
-<?php
-  $e = $request->getParameterNames();
-
-  if (!$e->hasMoreElements()) {
-    echo "No Parameters, Please enter some"; 
-  }
-
-  while ($e->hasMoreElements()) {
-    $name = $e->nextElement();
-    $value = $request->getParameter($name);
-    echo "$name = $value<br>\n";
-  }
-
-?>
-<P>
-<form action="<?php echo $PHP_SELF ?>" method=POST>
-First Name:
-<input type=text size=20 name=firstname>
-<br>
-Last Name:
-<input type=text size=20 name=lastname>
-<br>
-<input type=submit>
-</form>
-</body>
-</html>
-
diff --git a/sapi/servlet/servlet.c b/sapi/servlet/servlet.c
deleted file mode 100644 (file)
index ebc0d83..0000000
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
-   +----------------------------------------------------------------------+
-   | PHP Version 4                                                        |
-   +----------------------------------------------------------------------+
-   | Copyright (c) 1997-2003 The PHP Group                                |
-   +----------------------------------------------------------------------+
-   | This source file is subject to version 3.0 of the PHP license,       |
-   | that is bundled with this package in the file LICENSE, and is        |
-   | available through the world-wide-web at the following url:           |
-   | http://www.php.net/license/3_0.txt.                                  |
-   | If you did not receive a copy of the PHP license and are unable to   |
-   | obtain it through the world-wide-web, please send a note to          |
-   | license@php.net so we can mail you a copy immediately.               |
-   +----------------------------------------------------------------------+
-   | Author: Sam Ruby (rubys@us.ibm.com)                                  |
-   +----------------------------------------------------------------------+
-*/
-
-#include <jni.h>
-
-#include "php.h"
-#include "php_globals.h"
-
-#include "SAPI.h"
-
-#include <stdio.h>
-#include "php.h"
-#ifdef PHP_WIN32
-#include "win32/time.h"
-#include "win32/signal.h"
-#include <process.h>
-#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#if HAVE_SETLOCALE
-#include <locale.h>
-#endif
-#include "zend.h"
-#include "php_ini.h"
-#include "php_globals.h"
-#include "php_main.h"
-#include "fopen_wrappers.h"
-#include "ext/standard/php_standard.h"
-#include "ext/standard/php_dir.h"
-#ifdef PHP_WIN32
-#include <io.h>
-#include <fcntl.h>
-#include "win32/php_registry.h"
-#endif
-
-#include "zend_compile.h"
-#include "zend_execute.h"
-#include "zend_highlight.h"
-#include "zend_indent.h"
-
-JNIEXPORT void JNICALL Java_net_php_reflect_setEnv
-  (JNIEnv *newJenv, jclass self TSRMLS_DC);
-
-typedef struct {
-       JNIEnv *jenv;
-       jobject servlet;
-       char *cookies;
-} servlet_request;
-
-extern zend_module_entry java_module_entry;
-
-/***************************************************************************/
-
-/*
- * JNI convenience utilities
- */
-
-#define SETSTRING(target, source) \
-       { const char *UTFString; \
-       if (source) { \
-       UTFString = (*jenv)->GetStringUTFChars(jenv, source, 0); \
-       target = estrdup(UTFString); \
-       (*jenv)->ReleaseStringUTFChars(jenv, source, UTFString); \
-       } else { \
-       target = 0; \
-       } }
-
-#define FREESTRING(target) \
-       { if (target) { efree(target); target=0; } }
-
-void ThrowIOException (JNIEnv *jenv, char *msg) {
-       jclass iox = (*jenv)->FindClass (jenv, "java/io/IOException");
-       (*jenv)->ThrowNew (jenv, iox, (msg?msg:"null") );
-}
-
-void ThrowServletException (JNIEnv *jenv, char *msg) {
-       jclass sx = (*jenv)->FindClass (jenv, "javax/servlet/ServletException");
-       (*jenv)->ThrowNew (jenv, sx, msg);
-}
-
-/***************************************************************************/
-
-/*
- * sapi callbacks
- */
-
-static int sapi_servlet_ub_write(const char *str, uint str_length TSRMLS_DC)
-{
-       if (!SG(server_context)) {
-               fprintf(stderr, "%s", str);
-               return 0;
-       }
-
-       {
-       JNIEnv *jenv = ((servlet_request*)SG(server_context))->jenv;
-       jobject servlet = ((servlet_request*)SG(server_context))->servlet;
-
-       jclass servletClass = (*jenv)->GetObjectClass(jenv, servlet);
-       jmethodID write = (*jenv)->GetMethodID(jenv, servletClass, "write",
-               "(Ljava/lang/String;)V");
-       char *copy = malloc(str_length+1);
-       jstring arg;
-       memcpy(copy, str, str_length);
-       copy[str_length] = 0;
-       arg=(*jenv)->NewStringUTF(jenv, copy);
-       free(copy);
-       (*jenv)->CallVoidMethod(jenv, servlet, write, arg);
-       (*jenv)->DeleteLocalRef(jenv, arg);
-       return str_length;
-       }
-}
-
-
-static void sapi_servlet_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC)
-{
-       if (!sapi_header) return;
-       if (!SG(server_context)) return;
-
-       {
-       JNIEnv *jenv = ((servlet_request*)SG(server_context))->jenv;
-       jobject servlet = ((servlet_request*)SG(server_context))->servlet;
-
-       jclass servletClass = (*jenv)->GetObjectClass(jenv, servlet);
-       jmethodID header = (*jenv)->GetMethodID(jenv, servletClass, "header",
-               "(Ljava/lang/String;)V");
-       jstring arg=(*jenv)->NewStringUTF(jenv, sapi_header->header);
-       (*jenv)->CallVoidMethod(jenv, servlet, header, arg);
-       (*jenv)->DeleteLocalRef(jenv, arg);
-       }
-}
-
-
-static int sapi_servlet_read_post(char *buffer, uint count_bytes TSRMLS_DC)
-{
-       if (count_bytes == 0) {
-               return 0;
-       } else {
-               JNIEnv *jenv = ((servlet_request*)SG(server_context))->jenv;
-               jobject servlet = ((servlet_request*)SG(server_context))->servlet;
-
-               jclass servletClass = (*jenv)->GetObjectClass(jenv, servlet);
-               jmethodID readPost = (*jenv)->GetMethodID(jenv, servletClass, 
-                       "readPost", "(I)Ljava/lang/String;");
-               jstring post = (*jenv)->CallObjectMethod(jenv, servlet, readPost, 
-                       count_bytes);
-       
-               const char *postAsUTF = (*jenv)->GetStringUTFChars(jenv, post, 0);
-               uint read_bytes=(*jenv)->GetStringLength(jenv, post);
-               if (read_bytes>count_bytes) read_bytes=count_bytes;
-       
-               memcpy(buffer, postAsUTF, read_bytes);
-               if (read_bytes<count_bytes) buffer[read_bytes]=0;
-       
-               (*jenv)->ReleaseStringUTFChars(jenv, post, postAsUTF);
-       
-               return read_bytes;
-       }
-}
-
-
-static char *sapi_servlet_read_cookies(TSRMLS_D)
-{
-       JNIEnv *jenv = ((servlet_request*)SG(server_context))->jenv;
-       jobject servlet = ((servlet_request*)SG(server_context))->servlet;
-
-       jclass servletClass = (*jenv)->GetObjectClass(jenv, servlet);
-       jmethodID readCookies = (*jenv)->GetMethodID(jenv, servletClass, 
-               "readCookies", "()Ljava/lang/String;");
-       jstring cookies = (*jenv)->CallObjectMethod(jenv, servlet, readCookies);
-
-       SETSTRING( ((servlet_request*)SG(server_context))->cookies, cookies);
-
-       return ((servlet_request*)SG(server_context))->cookies;
-}
-
-/***************************************************************************/
-
-
-/*
- * sapi maintenance
- */
-
-static int php_servlet_startup(sapi_module_struct *sapi_module)
-{
-       if (php_module_startup(sapi_module, NULL, 0)==FAILURE) {
-               return FAILURE;
-       } else {
-               return SUCCESS;
-       }
-}
-
-static sapi_module_struct servlet_sapi_module = {
-       "java_servlet",                                 /* name */
-       "Java Servlet",                                 /* pretty name */
-                                                                       
-       php_servlet_startup,                            /* startup */
-       php_module_shutdown_wrapper,    /* shutdown */
-
-       NULL,                                                   /* activate */
-       NULL,                                                   /* deactivate */
-
-       sapi_servlet_ub_write,                  /* unbuffered write */
-       NULL,                                                   /* flush */
-       NULL,                                                   /* get uid */
-       NULL,                                                   /* getenv */
-
-       php_error,                                              /* error handler */
-
-       NULL,                                                   /* header handler */
-       NULL,                                                   /* send headers handler */
-       sapi_servlet_send_header,               /* send header handler */
-
-       sapi_servlet_read_post,                 /* read POST data */
-       sapi_servlet_read_cookies,              /* read Cookies */
-
-       NULL,                                                   /* register server variables */
-       NULL,                                                   /* Log message */
-
-       STANDARD_SAPI_MODULE_PROPERTIES
-};
-
-
-JNIEXPORT void JNICALL Java_net_php_servlet_startup
-       (JNIEnv *jenv, jobject self)
-{
-
-#ifdef ZTS
-       tsrm_startup(1, 1, 0, NULL);
-#endif
-
-       sapi_startup(&servlet_sapi_module);
-
-       if (php_module_startup(&servlet_sapi_module, &java_module_entry, 1)==FAILURE) {
-               ThrowServletException(jenv,"module startup failure");
-               return;
-       }
-}
-
-
-JNIEXPORT void JNICALL Java_net_php_servlet_shutdown
-       (JNIEnv *jenv, jobject self)
-{
-       TSRMLS_FETCH();
-
-       php_module_shutdown(TSRMLS_C);
-#ifdef ZTS
-       tsrm_shutdown();
-#endif
-       return;
-}
-
-/***************************************************************************/
-
-/*
- * define a Java object to PHP
- */
-
-JNIEXPORT jlong JNICALL Java_net_php_servlet_define
-       (JNIEnv *jenv, jobject self, jstring name) 
-{
-       pval *pzval;
-       jlong addr = 0;
-       const char *nameAsUTF = (*jenv)->GetStringUTFChars(jenv, name, 0);
-       TSRMLS_FETCH();
-
-       MAKE_STD_ZVAL(pzval);
-       addr = (jlong)(long) pzval;
-
-       zend_hash_add(&EG(symbol_table), (char*)nameAsUTF, 
-               strlen(nameAsUTF)+1, &pzval, sizeof(pval *), NULL);
-       (*jenv)->ReleaseStringUTFChars(jenv, name, nameAsUTF);
-
-       return addr;
-}
-
-/*
- * execute a script
- */
-
-JNIEXPORT void JNICALL Java_net_php_servlet_send
-       (JNIEnv *jenv, jobject self, 
-        jstring requestMethod, jstring queryString,
-        jstring requestURI, jstring pathTranslated,
-        jstring contentType, jint contentLength, 
-        jstring authUser, jboolean display_source_mode)
-{
-       zend_file_handle file_handle;
-       int retval;
-#ifndef VIRTUAL_DIR
-       char cwd[MAXPATHLEN];
-#endif
-       TSRMLS_FETCH();
-
-       zend_first_try {
-               SG(server_context) = emalloc(sizeof(servlet_request));
-               ((servlet_request*)SG(server_context))->jenv=jenv;
-               ((servlet_request*)SG(server_context))->servlet=self;
-               ((servlet_request*)SG(server_context))->cookies=0;
-
-               /*
-                * Initialize the request
-                */
-
-               SETSTRING( SG(request_info).auth_user, authUser );
-               SETSTRING( SG(request_info).request_method, requestMethod );
-               SETSTRING( SG(request_info).query_string, queryString );
-               SETSTRING( SG(request_info).request_uri, requestURI );
-               SETSTRING( SG(request_info).content_type, contentType );
-               SG(sapi_headers).http_response_code = 200;
-               SG(request_info).content_length = contentLength;
-               SG(request_info).auth_password = NULL;
-               if (php_request_startup(TSRMLS_C)==FAILURE) {
-                       ThrowServletException(jenv,"request startup failure");
-                       return;
-               }
-
-               /*
-                * Parse the file
-                */
-               SETSTRING( SG(request_info).path_translated, pathTranslated );
-#ifdef VIRTUAL_DIR
-               retval = php_fopen_primary_script(&file_handle TSRMLS_CC);
-#else
-               /*
-                * The java runtime doesn't like the working directory to be
-                * changed, so save it and change it back as quickly as possible
-                * in the hopes that Java doesn't notice.
-                */
-               getcwd(cwd, MAXPATHLEN);
-               retval = php_fopen_primary_script(&file_handle TSRMLS_CC);
-               chdir(cwd);
-#endif
-               
-               if (retval == FAILURE) {
-                       php_request_shutdown((void *) 0);
-                       php_module_shutdown(TSRMLS_C);
-                       ThrowIOException(jenv, file_handle.filename);
-                       return;
-               }
-
-               /*
-                * Execute the request
-                */
-               Java_net_php_reflect_setEnv(jenv, 0 TSRMLS_CC);
-
-               if (display_source_mode) {
-                       zend_syntax_highlighter_ini syntax_highlighter_ini;
-
-                       if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) {
-                               php_get_highlight_struct(&syntax_highlighter_ini);
-                               sapi_send_headers(TSRMLS_C);
-                               zend_highlight(&syntax_highlighter_ini TSRMLS_CC);
-                       }
-               } else {
-                       php_execute_script(&file_handle TSRMLS_CC);
-                       php_header(TSRMLS_C);                   /* Make sure headers have been sent */
-               }
-
-               /*
-                * Clean up
-                */
-               
-               FREESTRING(SG(request_info).query_string);
-               FREESTRING(SG(request_info).request_uri);
-               FREESTRING(SG(request_info).path_translated);
-               FREESTRING(((servlet_request*)SG(server_context))->cookies);    
-               efree(SG(server_context));
-               SG(server_context)=0;
-
-               if (!display_source_mode) php_request_shutdown((void *) 0);
-       } zend_catch {
-               ThrowServletException(jenv,"bailout");
-       } zend_end_try();
-}
-
diff --git a/sapi/servlet/servlet.dsp b/sapi/servlet/servlet.dsp
deleted file mode 100644 (file)
index 4691b87..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-# Microsoft Developer Studio Project File - Name="servlet" - Package Owner=<4>\r
-# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
-# ** DO NOT EDIT **\r
-\r
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102\r
-\r
-CFG=servlet - Win32 Debug_TS\r
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
-!MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "servlet.mak".\r
-!MESSAGE \r
-!MESSAGE You can specify a configuration when running NMAKE\r
-!MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "servlet.mak" CFG="servlet - Win32 Debug_TS"\r
-!MESSAGE \r
-!MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
-!MESSAGE "servlet - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")\r
-!MESSAGE "servlet - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")\r
-!MESSAGE "servlet - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")\r
-!MESSAGE "servlet - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")\r
-!MESSAGE \r
-\r
-# Begin Project\r
-# PROP AllowPerConfigDependencies 0\r
-# PROP Scc_ProjName ""\r
-# PROP Scc_LocalPath ""\r
-CPP=cl.exe\r
-MTL=midl.exe\r
-RSC=rc.exe\r
-\r
-!IF  "$(CFG)" == "servlet - Win32 Release"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 0\r
-# PROP BASE Output_Dir "..\..\Release"\r
-# PROP BASE Intermediate_Dir "..\..\Release"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 0\r
-# PROP Output_Dir "..\..\Release"\r
-# PROP Intermediate_Dir "Release"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\main" /I "$(JAVA_HOME)\include\win32" /I "$(JAVA_HOME)\include" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D ZEND_DEBUG=0 /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL" /YX /FD /c\r
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
-# ADD BASE RSC /l 0x40d /d "NDEBUG"\r
-# ADD RSC /l 0x40d /d "NDEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386\r
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /dll /machine:I386 /out:"..\..\Release/phpsrvlt.dll" /libpath:"$(JAVA_HOME)\lib" /libpath:"..\..\Release"\r
-\r
-!ELSEIF  "$(CFG)" == "servlet - Win32 Debug"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 1\r
-# PROP BASE Output_Dir "..\..\Debug"\r
-# PROP BASE Intermediate_Dir "..\..\Debug"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "..\..\Debug"\r
-# PROP Intermediate_Dir "Debug"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\main" /I "$(JAVA_HOME)\include\win32" /I "$(JAVA_HOME)\include" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D ZEND_DEBUG=1 /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL" /FR /YX /FD /GZ /c\r
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
-# ADD BASE RSC /l 0x40d /d "_DEBUG"\r
-# ADD RSC /l 0x40d /d "_DEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /dll /debug /machine:I386 /out:"..\..\Debug/phpsrvlt.dll" /pdbtype:sept /libpath:"$(JAVA_HOME)\lib" /libpath:"..\..\Debug"\r
-\r
-!ELSEIF  "$(CFG)" == "servlet - Win32 Debug_TS"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 1\r
-# PROP BASE Output_Dir "..\..\Debug_TS"\r
-# PROP BASE Intermediate_Dir "..\..\Debug_TS"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 1\r
-# PROP Output_Dir "..\..\Debug_TS"\r
-# PROP Intermediate_Dir "Debug_TS"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\..\Zend" /I "..\..\main" /I "$(JAVA_HOME)\include\win32" /I "$(JAVA_HOME)\include" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL" /FR /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\TSRM" /I "..\..\Zend" /I "..\..\main" /I "$(JAVA_HOME)\include\win32" /I "$(JAVA_HOME)\include" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D ZEND_DEBUG=1 /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL" /D "ZTS" /FR /YX /FD /GZ /c\r
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
-# ADD BASE RSC /l 0x40d /d "_DEBUG"\r
-# ADD RSC /l 0x40d /d "_DEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /dll /debug /machine:I386 /out:"..\..\Debug_TS/phpsrvlt.dll" /pdbtype:sept /libpath:"$(JAVA_HOME)\lib" /libpath:"..\..\Debug_TS"\r
-\r
-!ELSEIF  "$(CFG)" == "servlet - Win32 Release_TS"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 0\r
-# PROP BASE Output_Dir "..\..\Release_TS"\r
-# PROP BASE Intermediate_Dir "..\..\Release_TS"\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 0\r
-# PROP Output_Dir "..\..\Release_TS"\r
-# PROP Intermediate_Dir "Release_TS"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\main" /I "$(JAVA_HOME)\include\win32" /I "$(JAVA_HOME)\include" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\TSRM" /I "..\..\Zend" /I "..\..\main" /I "$(JAVA_HOME)\include\win32" /I "$(JAVA_HOME)\include" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D ZEND_DEBUG=0 /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL" /D "ZTS" /YX /FD /c\r
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
-# ADD BASE RSC /l 0x40d /d "NDEBUG"\r
-# ADD RSC /l 0x40d /d "NDEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386\r
-# ADD LINK32 php4ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:4.0 /dll /machine:I386 /out:"..\..\Release_TS/phpsrvlt.dll" /libpath:"$(JAVA_HOME)\lib" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"\r
-\r
-!ENDIF \r
-\r
-# Begin Target\r
-\r
-# Name "servlet - Win32 Release"\r
-# Name "servlet - Win32 Debug"\r
-# Name "servlet - Win32 Debug_TS"\r
-# Name "servlet - Win32 Release_TS"\r
-# Begin Group "Source Files"\r
-\r
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
-# Begin Source File\r
-\r
-SOURCE=..\..\ext\rpc\java\java.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\servlet.c\r
-# End Source File\r
-# End Group\r
-# Begin Group "Header Files"\r
-\r
-# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
-# End Group\r
-# Begin Group "Java Files"\r
-\r
-# PROP Default_Filter "java"\r
-# Begin Source File\r
-\r
-SOURCE=.\servlet.java\r
-\r
-!IF  "$(CFG)" == "servlet - Win32 Release"\r
-\r
-USERDEP__SERVL="..\..\ext\rpc\java\reflect.java"       \r
-# Begin Custom Build\r
-OutDir=.\..\..\Release\r
-InputPath=.\servlet.java\r
-\r
-"$(OutDir)\phpsrvlt.jar" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       if not exist net mkdir net \r
-       if not exist net\php mkdir net\php \r
-       copy *.java net\php > nul \r
-       copy ..\..\ext\rpc\java\reflect.java net\php > nul \r
-       echo library=phpsrvlt>net/php/reflect.properties \r
-       echo library=phpsrvlt>net/php/servlet.properties \r
-       cd net\php \r
-       $(JAVA_HOME)\bin\javac -O *.java \r
-       cd ..\.. \r
-       $(JAVA_HOME)\bin\jar c0f $(OutDir)\phpsrvlt.jar net\php\*.class net\php\*.properties \r
-       erase net\php\servlet.* \r
-       erase net\php\formatter.* \r
-       erase net\php\reflect.* \r
-       rmdir net\php \r
-       rmdir net \r
-       \r
-# End Custom Build\r
-\r
-!ELSEIF  "$(CFG)" == "servlet - Win32 Debug"\r
-\r
-USERDEP__SERVL="..\..\ext\rpc\java\reflect.java"       \r
-# Begin Custom Build\r
-OutDir=.\..\..\Debug\r
-InputPath=.\servlet.java\r
-\r
-"$(OutDir)\phpsrvlt.jar" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       if not exist net mkdir net \r
-       if not exist net\php mkdir net\php \r
-       copy *.java net\php > nul \r
-       copy ..\..\ext\rpc\java\reflect.java net\php > nul \r
-       echo library=phpsrvlt>net/php/reflect.properties \r
-       echo library=phpsrvlt>net/php/servlet.properties \r
-       cd net\php \r
-       $(JAVA_HOME)\bin\javac -g *.java \r
-       cd ..\.. \r
-       $(JAVA_HOME)\bin\jar c0f $(OutDir)\phpsrvlt.jar net\php\*.class net\php\*.properties \r
-       erase net\php\servlet.* \r
-       erase net\php\formatter.* \r
-       erase net\php\reflect.* \r
-       rmdir net\php \r
-       rmdir net \r
-       \r
-# End Custom Build\r
-\r
-!ELSEIF  "$(CFG)" == "servlet - Win32 Debug_TS"\r
-\r
-USERDEP__SERVL="..\..\ext\rpc\java\reflect.java"       \r
-# Begin Custom Build\r
-OutDir=.\..\..\Debug_TS\r
-InputPath=.\servlet.java\r
-\r
-"$(OutDir)\phpsrvlt.jar" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       if not exist net mkdir net \r
-       if not exist net\php mkdir net\php \r
-       copy *.java net\php > nul \r
-       copy ..\..\ext\rpc\java\reflect.java net\php > nul \r
-       echo library=phpsrvlt>net/php/reflect.properties \r
-       echo library=phpsrvlt>net/php/servlet.properties \r
-       cd net\php \r
-       $(JAVA_HOME)\bin\javac -g *.java \r
-       cd ..\.. \r
-       $(JAVA_HOME)\bin\jar c0f $(OutDir)\phpsrvlt.jar net\php\*.class net\php\*.properties \r
-       erase net\php\servlet.* \r
-       erase net\php\formatter.* \r
-       erase net\php\reflect.* \r
-       rmdir net\php \r
-       rmdir net \r
-       \r
-# End Custom Build\r
-\r
-!ELSEIF  "$(CFG)" == "servlet - Win32 Release_TS"\r
-\r
-USERDEP__SERVL="..\..\ext\rpc\java\reflect.java"       \r
-# Begin Custom Build\r
-OutDir=.\..\..\Release_TS\r
-InputPath=.\servlet.java\r
-\r
-"$(OutDir)\phpsrvlt.jar" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       if not exist net mkdir net \r
-       if not exist net\php mkdir net\php \r
-       copy *.java net\php > nul \r
-       copy ..\..\ext\rpc\java\reflect.java net\php > nul \r
-       echo library=phpsrvlt>net/php/reflect.properties \r
-       echo library=phpsrvlt>net/php/servlet.properties \r
-       cd net\php \r
-       $(JAVA_HOME)\bin\javac -O *.java \r
-       cd ..\.. \r
-       $(JAVA_HOME)\bin\jar c0f $(OutDir)\phpsrvlt.jar net\php\*.class net\php\*.properties \r
-       erase net\php\servlet.* \r
-       erase net\php\formatter.* \r
-       erase net\php\reflect.* \r
-       rmdir net\php \r
-       rmdir net \r
-       \r
-# End Custom Build\r
-\r
-!ENDIF \r
-\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\servlet.java\r
-# End Source File\r
-# End Group\r
-# Begin Source File\r
-\r
-SOURCE=.\jtest.php\r
-# End Source File\r
-# End Target\r
-# End Project\r
diff --git a/sapi/servlet/servlet.java b/sapi/servlet/servlet.java
deleted file mode 100644 (file)
index 813366e..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
-   +----------------------------------------------------------------------+
-   | PHP Version 4                                                        |
-   +----------------------------------------------------------------------+
-   | Copyright (c) 1997-2002 The PHP Group                                |
-   +----------------------------------------------------------------------+
-   | This source file is subject to version 3.0 of the PHP license,       |
-   | that is bundled with this package in the file LICENSE, and is        |
-   | available through the world-wide-web at the following url:           |
-   | http://www.php.net/license/3_0.txt.                                  |
-   | If you did not receive a copy of the PHP license and are unable to   |
-   | obtain it through the world-wide-web, please send a note to          |
-   | license@php.net so we can mail you a copy immediately.               |
-   +----------------------------------------------------------------------+
-   | Author: Sam Ruby (rubys@us.ibm.com)                                  |
-   +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-package net.php;
-
-import java.io.IOException;
-import java.net.URLEncoder;
-import java.util.Enumeration;
-import javax.servlet.*;
-import javax.servlet.http.*;
-
-import java.lang.reflect.Method;
-
-public class servlet extends HttpServlet {
-  char slash = System.getProperty("file.separator").charAt(0);
-
-  HttpServletRequest  request;
-  HttpServletResponse response;
-  ServletInputStream  stream;
-
-  static int startup_count = 0;
-
-  protected boolean display_source_mode = false;
-  private Method addHeader;
-
-  // Native methods
-
-  public native void startup();
-  public native long define(String name);
-  public native void send(String  requestMethod,
-                          String  queryString,
-                          String  pathInfo,
-                          String  pathTranslated,
-                          String  contentType,
-                          int     contentLength,
-                          String  authUser,
-                          boolean display_source_mode
-                         );
-  public native void shutdown();
-
-  // SAPI Callbacks
-
-  public String readPost(int bytes) {
-    String result;
-
-    if (!request.getMethod().equals("POST")) {
-      result = request.getQueryString();
-    } else { 
-      Enumeration enum = request.getParameterNames();
-      String concat = "";
-      result = "";
-
-      while (enum.hasMoreElements()) {
-        String name  = (String)enum.nextElement();
-        String value = request.getParameter(name);
-
-        try {
-          result += concat + name + "=" + URLEncoder.encode(value, "UTF-8");
-        }
-
-        catch (Exception e) {
-          e.printStackTrace(System.err);
-        }
-
-        concat = "&";
-      }
-    }
-
-    if (result == null) return "";
-
-    return result; 
-  }
-
-  public String readCookies() {
-     reflect.setResult(define("request"),  request);
-     reflect.setResult(define("response"), response);
-     reflect.setResult(define("PHP_SELF"), request.getRequestURI());
-
-     return request.getHeader("cookie");
-  }
-
-  public void header(String data) {
-    // try to send the header using the most specific servlet API
-    // as possible (some servlet engines will add a content type
-    // header unless the setContentType method is called).
-    try {
-      if (data.startsWith("Content-type: ")) {
-        response.setContentType(data.substring(data.indexOf(" ") + 1));
-      }
-
-      else if (data.startsWith("Location: ")) {
-        response.sendRedirect(data.substring(data.indexOf(" ") + 1));
-      } else if (data.startsWith("HTTP/1")) {
-       return; // this one is added from servlet container (Tomcat 4.1), we have to check for others
-      }
-
-      else {
-        int colon = data.indexOf(": ");
-
-        if (colon > 0) {
-          try {
-            addHeader.invoke(response, new Object[]
-              { data.substring(0, colon), data.substring(colon + 2) } );
-          }
-
-          catch (Exception e) {
-            e.printStackTrace(System.err);
-          }
-        }
-
-        else {
-          write(data);
-        }
-      }
-    }
-
-    catch (IOException e) {
-      e.printStackTrace(System.err);
-    }
-  }
-
-  public void write(String data) {
-    try {
-      response.getWriter().print(data);
-    }
-
-    catch (IOException e) {
-      e.printStackTrace(System.err);
-    }
-  }
-
-  // Servlet interface
-
-  public void init(ServletConfig config)
-  throws ServletException {
-    super.init(config);
-
-    // first time in, initialize native code
-    if (0 == startup_count++) {
-      reflect.loadLibrary("servlet");
-      startup();
-    }
-
-    // try to find the addHeader method (added in the servlet API 2.2)
-    // otherwise settle for the setHeader method
-
-    try {
-      Class c = Class.forName("javax.servlet.http.HttpServletResponse");
-      Method method[] = c.getDeclaredMethods();
-
-      for (int i = 0; i < method.length; i++) {
-        if (method[i].getName().equals("addHeader")) {
-          addHeader = method[i];
-          break;
-        }
-
-        if (method[i].getName().equals("setHeader")) {
-          addHeader = method[i];
-        }
-      }
-    }
-
-    catch (Exception e) {
-      e.printStackTrace(System.err);
-    }
-  }
-
-  public void service(HttpServletRequest request, HttpServletResponse response, String contextPath)
-  throws ServletException {
-    this.request  = request;
-    this.response = response;
-
-    send(request.getMethod(),
-         request.getQueryString(),
-         request.getRequestURI(),
-         contextPath,
-         request.getContentType(),
-         request.getContentLength(),
-         request.getRemoteUser(),
-         display_source_mode
-        );
-
-    try {
-      if (stream != null) stream.close();
-    }
-
-    catch (IOException e) {
-      throw new ServletException(e.toString());
-    }
-  }
-
-  public void service(HttpServletRequest request, HttpServletResponse response)
-  throws ServletException {
-    String servletPath = request.getServletPath();
-    String contextPath = getServletContext().getRealPath(servletPath);
-
-    service(request, response, contextPath);
-  }
-
-  public void destroy() {
-    if (0 == --startup_count) shutdown();
-    super.destroy();
-  }
-}
diff --git a/sapi/servlet/sessions.php b/sapi/servlet/sessions.php
deleted file mode 100644 (file)
index 463b1b5..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<html>
-<body bgcolor="white">
-<head>
-<title>Sessions Example</title>
-</head>
-<body>
-<h3>Sessions Example</h3>
-<?php
-
-  // print session info 
-
-  $session  = $request->session;
-  $created  = new Java("java.util.Date", $session->creationTime);
-  $accessed = new Java("java.util.Date", $session->lastAccessedTime);
-
-  print "Session ID: $session->id<br>\n";
-  print "Created: " . $created->toString() . "<br>\n";
-  print "Last Accessed: " . $accessed->toString() . "<br>\n";
-
-  // set session info if needed
-
-  if ($dataName) $session->setAttribute($dataName, $dataValue);
-
-  // print session contents
-
-  print "<P>\n";
-  print "The following data is in your session:<br>\n";
-  $e = $session->attributeNames;
-  while ($e->hasMoreElements()) {
-    $name = $e->nextElement();
-    $value = $session->getAttribute($name);
-    print "$name = $value<br>\n";
-  }
-
-?>
-<P>
-<form action="<?php echo $PHP_SELF ?>" method=POST>
-Name of Session Attribute:
-<input type=text size=20 name=dataName>
-<br>
-Value of Session Attribute:
-<input type=text size=20 name=dataValue>
-<br>
-<input type=submit>
-</form>
-<P>GET based form:<br>
-<form action="<?php echo $PHP_SELF ?>" method=GET>
-Name of Session Attribute:
-<input type=text size=20 name=dataName>
-<br>
-Value of Session Attribute:
-<input type=text size=20 name=dataValue>
-<br>
-<input type=submit>
-</form>
-<p><a href="<?php echo $PHP_SELF ?>?dataName=foo&dataValue=bar" >URL encoded </a>
-</body>
-</html>
-</body>
-</html>
diff --git a/sapi/servlet/web.xml b/sapi/servlet/web.xml
deleted file mode 100644 (file)
index b0703a3..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<!DOCTYPE web-app
-    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
-    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
-
-<web-app>
-  <servlet>
-    <servlet-name>
-      php
-    </servlet-name>
-    <servlet-class>
-      net.php.servlet
-    </servlet-class>
-  </servlet>
-  <servlet>
-    <servlet-name>
-      php-formatter
-    </servlet-name>
-    <servlet-class>
-      net.php.formatter
-    </servlet-class>
-  </servlet>
-  <servlet-mapping>
-    <servlet-name>
-      php
-    </servlet-name>
-    <url-pattern>
-      *.php
-    </url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>
-      php-formatter
-    </servlet-name>
-    <url-pattern>
-      *.phps
-    </url-pattern>
-  </servlet-mapping>
-</web-app>