Git Product home page Git Product logo

php-java-bridge's Introduction

PHP Java bridge

Build Status Maven Central License (develop branch: Build Status)

The soluble PHPJavaBridge server fork allows PHP/JVM interoperability through a local network protocol between both runtimes.

Disclaimer: Unofficial fork !!!

This fork was initially made on the sourceforge version made by Jost Boekemeier as its development seemed to have stopped after version 6.2.1.

Be aware that since the project have been forked, the official repo looks to be alive again with recent versions supporting PHP7. Unfortunately most of the the fixes and enhancements made on this fork have not been merged in upstream version.

Feel free to choose which version you install (fork or official). To keep a track of differences, you can refer to the fork status page.

Note that this fork have been specifically designed for PHP -> Java integration, so so if you intend to use it from Java -> PHP, the best is to use the official version as it looks better tested for that scenario.

Installation

This repository can be used to develop, test and and build the JavaBridge server.

Be sure to consult the soluble-japha website where you'll find more information relative to php/java integration.

Documentation

Older documentation can be found in the PHP/Java bridge site

Releases

  • You can download pre-compiled java bridge binaries on the releases page (jdk8).

  • Major releases are published on Maven central.

    With maven:

    <dependency>
       <groupId>io.soluble.pjb</groupId>
        <artifactId>php-java-bridge</artifactId>
       <version>x.y.z</version>
    </dependency>
    

    or gradle

    compile 'io.soluble.pjb:php-java-bridge:x.y.z'
    

To register the PHPJavaServlet, you can have a look to the example web.xml file.

Build the project

Requirements

  • Oracle JDK 7,8
  • Optionally ant for old Java.inc generation

Get the sources

You can either clone the project with:

$ git clone https://github.com/belgattitude/php-java-bridge.git

or download a zip tarball from the github page.

Gradle build

Build the project with the provided gradle wrapper:

$ cd php-java-bridge
$ ./gradlew build 

The generated files are available in the /build/libs folder:

File Description
php-java-bridge-<VERSION>.jar JavaBridge library (servlet and standalone).
php-java-bridge-<VERSION>-sources.jar Source code.
php-java-bridge-<VERSION>-javadoc.jar Generated api doc.

Additionally a generic template file is automatically generated:

File Description
JavaBridgeTemplate.war A ready to deploy war example file.

Adding deps to the builded '.war'

Instead of modifying directly the main build.gradle file, you should consider using init-scripts. Examples can be found on the init-scripts doc.

Usage

Currently only tested on Tomcat 7/8, should be running on any servlet 2.5 compatible container.

Servlet registration

You can have a look to the web.xml default configuration for the servlet configuration settings.

Deploy

Ensure you have a Tomcat server installed.

And copy the ready to run JavaBridgeTemplate.war in the tomcat webapps folder:

$ sudo cp ./build/libs/JavaBridgeTemplate.war /var/lib/tomcat8/webapps/JavaBridgeTemplate.war

Wait few seconds for deployment and point your browser to http://localhost:8080/JavaBridgeTemplate, you should see the bridge landing page :

Have a look to the error log if needed:

$ cat /var/log/tomcat8/catalina.out

Develop

For development, the use of the ./gradlew tomcatRun and ./gradlew tomcatStop allows testing without the need of deployment.

Dependencies can be added in the build.gradle file.

FAQ

OutOfMemory errors under Tomcat

If you get OutOfMemory errors, you can increase the java heap tomcat:

$ sudo vi /etc/default/tomcat8

Look for the Xmx default at 128m and increase

JAVA_OPTS="-Djava.awt.headless=true -Xmx512m -XX:+UseConcMarkSweepGC"

and restart

$ sudo service tomcat8 restart

Contribute

Feel free to fork and submit pull requests :)

Credits

Original developers:

  • Jost Boekemeier
  • Andre Felipe Machado,
  • Sam Ruby,
  • Kai Londenberg,
  • Nandika Jayawardana,
  • Sanka Samaranayake,

Forked version

See the CREDITS.md for an up to date of list of contributors.

php-java-bridge's People

Contributors

belgattitude avatar cplerch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

php-java-bridge's Issues

Landing page additions

As of the 6.2.11-rc-2 version, the landing page is pretty minimal, see index.jsp.

Could be nice to provide a enhanced version... Some ideas:

  • System informations like 'JAVA version JDK home...'
  • If possible display included libraries (mysql:mysql-connector, ...) to help debugging

The pjb-starter-springboot contains some design prototype for inspiration but requires thymeleaf and spring to run (let's avoid too many deps in the php-java-bridge version)

As I'm not used to jsp... I would really appreciate if someone can make a preliminary concept (css, index.jsp and system info). I can eventually rework on design later one.

Upstream policy with the official repo (open discussion)

Recently the original project seems to be active again.

see http://php-java-bridge.cvs.sourceforge.net/viewvc/php-java-bridge/php-java-bridge/ChangeLog?view=log

With the official v7.0.0, it looks there's mainly work on the client part (Java.inc) and PHP7 support. *(From the fork perspective, the soluble-japha is the recommended way, and can be updated to support both implementations).

But I hope there will be some work on the server part as well... In this case it can interesting to keep in contact with Jost Bökemeier @jbk123456. And see if we can imagine convergence... Personally I would love to and, although I initiate the fork, I don't feel ownership on it, neither technical capabilities.

I'll try contact Jost and will probably merge upstream changes to keep versions in line (if there's some improvements on the server part).

Just created to ticket for reference, feel free to comment.

Upgrade gradle-wrapper to > 5.0 to support JDK 11

Gradle added support for JDK11 in 5.0.

Currently, using ./gradlew with default-jdk (openjdk-11-jdk) on Debian GNU/Linux bullseye/sid gives the following error:

Unzipping /root/.gradle/wrapper/dists/gradle-3.5-bin/daoimhu7k5rlo48ntmxw2ok3e/gradle-3.5-bin.zip to /root/.gradle/wrapper/dists/gradle-3.5-bin/daoimhu7k5rlo48ntmxw2ok3e
Set executable permissions for: /root/.gradle/wrapper/dists/gradle-3.5-bin/daoimhu7k5rlo48ntmxw2ok3e/gradle-3.5/bin/gradle

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '11.0.9.1'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Remove embedded php cgi binaries

Removal of obsolete php-cgi binaries in the WEB-INF/cgi directory. They're too outdated and newer versions can be easily installed on any platform.

For example on ubuntu

$sudo apt-get install php-cgi

This solve issues with the .war bundle being too big.

For deployment, please ensure your web.xml use your system php-cgi binary. Check for <param-name>prefer_system_php_exec</param-name> in context-param. See an example below:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
    <!-- support for JEE cluster, remove this line if you want to put non-serializable objects into the java_session() -->
    <distributable/>

    <context-param>

        <param-name>prefer_system_php_exec</param-name>
        <param-value>On</param-value>

        <param-name>php_exec</param-name>
        <param-value>/usr/bin/php-cgi</param-value>

    </context-param>

    <!-- Handle PHP urls which cannot be expressed using a standard servlet spec 2.2 url-pattern, 
    e.g.: *.php/delete/from?what=that You may remove this and the filter-mapping below -->
    <filter>
        <filter-name>PhpCGIFilter</filter-name>
        <filter-class>php.java.servlet.PhpCGIFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>PhpCGIFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!-- Attach the JSR223 script factory to the servlet context -->
    <listener>
        <listener-class>php.java.servlet.ContextLoaderListener</listener-class>
    </listener>

    <!-- PHP Servlet: back-end for Apache or IIS -->
    <servlet>
        <servlet-name>PhpJavaServlet</servlet-name>
        <servlet-class>php.java.servlet.PhpJavaServlet</servlet-class>
    </servlet>

    <!-- PHP CGI servlet: when IIS or Apache are not available -->
    <servlet>
        <servlet-name>PhpCGIServlet</servlet-name>
        <servlet-class>php.java.servlet.fastcgi.FastCGIServlet</servlet-class>
    </servlet>

    <!-- PHP Servlet Mapping -->
    <servlet-mapping>
        <servlet-name>PhpJavaServlet</servlet-name>
        <url-pattern>*.phpjavabridge</url-pattern>
    </servlet-mapping>

    <!-- PHP CGI Servlet Mapping -->
    <servlet-mapping>
        <servlet-name>PhpCGIServlet</servlet-name>
        <url-pattern>*.php</url-pattern>
    </servlet-mapping>

    <!-- Welcome files -->
    <welcome-file-list>
        <welcome-file>index.php</welcome-file>
    </welcome-file-list>
</web-app>

Don't know how to turn off directoryindex

Sorry if this is out of context here, but I noticed that the running instance is serving up a directoryIndex. How can I turn this off? It is less of a concern if I can count on runner.getContextServer().isPromiscuous() == false (not sure where to set that!). Are these settings accessible from the JavaBridgeRunner instance, or??

Thanks in advance.

Building Java.inc does not work in PHP7+

The buildJavaInc.php is silently failing with with PHP7+ versions.

The Java.inc client is not required to run the php-java-bridge, but the current ant build process still requires it. It's gonna be replaced in the future by the the soluble-japha client and should not be included anymore.

Still for the current version, those fixes are temporarily needed:

  • The ant building process should fail with a message for PHP7+ versions.
  • Document how to install multiple php versions (see below)
  • The ant build.xml contains a php_exec property that you can use to select the required php executable. For example:
    $ ant build -Dphp_exec=/usr/bin/php5.6

Tips to install pre-php7 version on Ubuntu:

In many distributions, multiple PHP versions can coexists: on Ubuntu for example, you can install a ppa

sudo add-apt-repository -y ppa:ondrej/php;
sudo apt-get update;

Then install a different php interpreter:

sudo apt-get install php5.6-cli php5.6-mbstring php5.6-zip php5.6-intl php5.6-common php5.6-xml

Once done, run you ant build with

$ ant build -Dphp_exec=/usr/bin/php5.6

License Problems

Hi,

README.md states that you distribute your code under the MIT license.

However, your source code contains at least two files (PhpDebugger.php and PhpDebugger.inc) which are covered by the GUILE (GPL+CP exception) License.

Please either change the license to GPL or remove those files.

Open discussion for status and future enhancements

Here's a special issue to share ideas about the future of the project...

To the current point (6.2.10 - Jan 17):

the PHPJavaBridge showed stable and robust... Can successfully be compiled with recent JDK > (7 and 8 tested) and deployed on a modern Tomcat (7 and 8 tested). It also reveals possible to
convert it on a servlet 3.0 spec container and embrace modern ecosystem (see example of the
pjb-starter-gradle.

The client Java.inc was completely refactored to support PHP7 and HHVM and embrace more
more modern practices that showed up in the PHP ecosystem (like composer, psr4 autoloading...)
The client project lives now in a separate repository named soluble-japha.
Don't use the Java.incway anymore or use the compatibility layer soluble-japha-pjb62-compat if you have to migrate code.

Also note the conversion from sourceforge CVS to github which offers a better infrastructure and facilitate contributions.

So what would be the next steps ?

To my point of view, I would think about infrastucture work before implementing features:

1. Some refactorings :

  • Drop the Java.inc code (still bundled when building)
  • Convert or drop PHP scripts that were used to build the server (see ./server/*.php)
  • Remove the building of the JavaBridge.war (>40Mb) template (will help to remove completely ./unsupported directory. This was was created as a sort of test-everything (Birt reports....) but requires tons of outdated deps. We can keep the minimal JavaBridgeTemplate.war.
  • Drop the inclusion of script-api.jar, its was made available for pre-Java 6.
  • Drop of all ./debian directory (Too old)
  • Drop of all ./security (example of SELINUX policies for Fedora 4)
  • Publish on Maven, make an artifact (Anyone with experience ?)

2. Unit testing:

Currently I didn't spend time to really how to run them...

  • PHPtests: I suggest to convert and drop PHP remaining (non php-)unit tests found in ./test.php5 and put them in the soluble-japha client project. See some example here and a specific file here. I think it's already made 90%, still some cases to review before dropping. Reviewers welcome !

  • JavaTests Help and suggestions welcomed !! Anybody with time to figure out, explain and propose a solution?

3. Quality

  • Add a build target on travis (will possibly require to first drop php requirement in the build)

I think this would be the first steps before thinking about additions (had some ideas about replacing XML by protocol-buffers... fun work but let's see)

Share your ideas... or create referenced issues.

php.java.fastcgi.ConnectionException

php version 7.3.5
OS centos amd64
php-java-bridge version 7.2.1
After a period of use, the error occurs

13-May-2019 03:01:46.262 SEVERE [http-nio-8080-exec-12] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [PhpCGIServlet] in context with path [/php_project] threw exception
 php.java.fastcgi.ConnectionException
	at php.java.fastcgi.FCGIInputStream.read(FCGIInputStream.java:31)
	at php.java.fastcgi.FCGIHeaderParser.parseBody(FCGIHeaderParser.java:82)
	at php.java.servlet.fastcgi.FastCGIServlet.doExecute(FastCGIServlet.java:424)
	at php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:516)
	at php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:527)
	at php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:555)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at php.java.servlet.PhpCGIFilter.doFilter(PhpCGIFilter.java:126)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Protocol error
	at php.java.fastcgi.FCGIInputStream.doRead(FCGIInputStream.java:56)
	at php.java.fastcgi.FCGIInputStream.read(FCGIInputStream.java:29)
	... 32 more

Ensure version compat, merge upstream 7.0.1 changes

From the 7.0.1 changelog

7.0.1 2017-02-25 jostb@intern 7.0.1

This release includes work on PHPDebugger which was removed from the soluble fork
for licence issue. It was relicensed upstream to GPL+Classpath exception...
Changed linked to it have been skipped. If support needed open an issue.

  • skipped PhpDebugger.inc: Removed
  • merged_in_legacy Client.inc: Warning fixed.
  • skipped skipped PHPDebugger.php changes due to licensing (GPL+classpath)
  • skipped skipped changes about debugger inclusion -> Util.java, FCGIConnectionFactory.java, IFCGIProcessFactory.java, NPChannelFactory.java, SocketChannelFactory.java, CGIRunner.java, FCGIProcess.java, FastCGIProxy.java, ContextLoaderListener.java, FCGIProcess.java, FastCGIServlet.java: Use PHPDebuger.php

6.2.2 2017-02-01 jostb@intern

  • merged BUGFIX - WriterOutputStream.java: Fixed crash.

6.2.2 2017-01-30 jostb@intern

  • merged_in_legacy Protocol.inc, PHPDebugger.php, PHPDebugger.inc, Parser.inc, Options.inc, NativeParser.inc, JavaProxy.inc, JavaBridge.inc, GlobalRef.inc, Client.inc: Changed constructor

Changed files

File php-java-bridge/CVS_RELEASE.sh changed from revision 1.31 to 1.38
File php-java-bridge/ChangeLog changed from revision 1.238 to 1.241
File php-java-bridge/NEWS changed from revision 1.89 to 1.92
File php-java-bridge/VERSION changed from revision 1.152 to 1.155
File php-java-bridge/build.xml changed from revision 1.13 to 1.14
File php-java-bridge/php-java-bridge.spec changed from revision 1.173 to 1.179
File php-java-bridge/security/module/php-java-bridge-tomcat.te changed from revision 1.2 to 1.3
File php-java-bridge/security/module/php-java-bridge.te changed from revision 1.6 to 1.7
File php-java-bridge/server/META-INF/java/Client.inc changed from revision 1.35 to 1.37
File php-java-bridge/server/META-INF/java/GlobalRef.inc changed from revision 1.5 to 1.6
File php-java-bridge/server/META-INF/java/JavaProxy.inc changed from revision 1.41 to 1.43
File php-java-bridge/server/META-INF/java/NativeParser.inc changed from revision 1.10 to 1.11
File php-java-bridge/server/META-INF/java/PHPDebugger.inc is removed; 2015.12.31.23.00.00 revision 1.12
File php-java-bridge/server/META-INF/java/PHPDebugger.php changed from revision 1.17 to 1.18
File php-java-bridge/server/META-INF/java/Parser.inc changed from revision 1.5 to 1.6
File php-java-bridge/server/META-INF/java/Protocol.inc changed from revision 1.51 to 1.52
File php-java-bridge/server/META-INF/java/SimpleParser.inc changed from revision 1.9 to 1.10
File php-java-bridge/server/php/java/bridge/Util.java changed from revision 1.115 to 1.116
File php-java-bridge/server/php/java/bridge/http/FCGIConnectionFactory.java changed from revision 1.6 to 1.7
File php-java-bridge/server/php/java/bridge/http/IFCGIProcessFactory.java changed from revision 1.7 to 1.8
File php-java-bridge/server/php/java/bridge/http/NPChannelFactory.java changed from revision 1.6 to 1.7
File php-java-bridge/server/php/java/bridge/http/SocketChannelFactory.java changed from revision 1.5 to 1.6
File php-java-bridge/server/php/java/bridge/http/WriterOutputStream.java changed from revision 1.2 to 1.3
File php-java-bridge/server/php/java/script/CGIRunner.java changed from revision 1.36 to 1.37
File php-java-bridge/server/php/java/script/FCGIProcess.java changed from revision 1.3 to 1.4
File php-java-bridge/server/php/java/script/FastCGIProxy.java changed from revision 1.12 to 1.13
File php-java-bridge/server/php/java/servlet/ContextLoaderListener.java changed from revision 1.24 to 1.25
File php-java-bridge/server/php/java/servlet/fastcgi/FCGIProcess.java changed from revision 1.8 to 1.9
File php-java-bridge/server/php/java/servlet/fastcgi/FastCGIServlet.java changed from revision 1.44 to 1.45

Gradle build: allow selection of a customized web.xml

Currently the gradle build includes by default the web.xml stored in the webapp folder.

By doing so the build register the PHPCGIServlet for every build (which requires a php-cgi binary installed and make the install more difficult).

As the PHPCGIServlet is not technically required for common usage, it should be possible to pass a parameter to the gradle command to select a different web.xml (without registration of PHPCGIServlet) for building the war and document it.

Preliminary support for gradle

Preliminary support for gradle (still rely on build.xml by importing ant tasks)

$ gradle all -Dphp_exec=/usr/bin/php5.6

Warning: Due to ant task wrapping, the ant clean command has been rename to cleanBuild

Compatibility issue with Tomcat7 7.0.109

Trying to use it in my tomcat7 app, I get the error below. It works ok with original (but rebuilt) php-java-bridget 7.2.1

java.lang.ClassCastException: class java.io.ObjectStreamClass$Caches$1 cannot be cast to class java.util.Map (java.io.ObjectStreamClass$Caches$1 and java.util.Map are in module java.base of loader 'bootstrap')
at org.apache.catalina.loader.WebappClassLoaderBase.clearCache(WebappClassLoaderBase.java:3121)
at org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesObjectStreamClassCaches(WebappClassLoaderBase.java:3080)
at org.apache.catalina.loader.WebappClassLoaderBase.clearReferences(WebappClassLoaderBase.java:2289)
at org.apache.catalina.loader.WebappClassLoaderBase.stop(WebappClassLoaderBase.java:2182)
at org.apache.catalina.loader.WebappLoader.stopInternal(WebappLoader.java:690)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5910)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1705)
at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1694)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1589)

License inconsistencies and future

The original project seems to be dual licensed (MIT/LGPL) as stated on the sourceforge page:

image

The original CVS repo contains reference to the GPL (in the file COPYING) which I believe was let in the repo but seems not to reflect authors updated views... see the website ((LGPL/MIT) or comments in sources or the website:

/*
 * Copyright (C) 2003-2007 Jost Boekemeier
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */

With an exception of the file Base64EncodingOutputBuffer.java which refers to Apache License 2.0.

Not a lawyer, but I guess being clear on that is important. So keeping a LICENSE.md with either the the LGPLv2 or MIT (keeping copyright to Jost Boekemeier) should be included in the project.

Anyone on this ?

PS: see also https://en.wikipedia.org/wiki/Comparison_of_free_and_open-source_software_licenses

Support for javax.servlet:javax.servlet-api:3.1.0

Current release 6.2.11 run under servlet api 2.5 and 3.0.1 specs...

Can be a nice addition to refactor the code to support the 3.1.0 as well

In order to test, update the gradle providedCompile section with

providedCompile('javax.servlet:javax.servlet-api:3.0.1')

Currently this gives this error:


/path/php-java-bridge/src/main/java/io/soluble/pjb/servlet/RemoteHttpServletResponse.java:69: error: <anonymous io.soluble.pjb.servlet.RemoteHttpServletResponse$1> is not abstract and does not override abstract method setWriteListener(WriteListener) in ServletOutputStream
        return out = new ServletOutputStream() {
                                               ^
/path/php-java-bridge/src/main/java/io/soluble/pjb/servlet/VoidInputHttpServletRequest.java:29: error: <anonymous io.soluble.pjb.servlet.VoidInputHttpServletRequest$1> is not abstract and does not override abstract method setReadListener(ReadListener) in ServletInputStream
        return in = new ServletInputStream() {

Cleanup Java code related to removed PHPDebugger files

The PHPDebugger for Eclipse feature has been discontinued and files PHPDebugger.php and PHPDebugger.inc have already been removed. The code however still references these files. The respective (now dead) code fragments should also be removed.

FastCGI sets SERVER_PORT to the local port instead of the server port

In

, which in turns call , FastGCI sets SERVER_PORT to the local port. This does not work when the container is behind a proxy or a NAT.
If for example you are natting your more router so that the external port is 80, but you run your service on a tomcat on port 8080, SERVER_PORT should be set 80, not 8080. To do so, FastCGI should pic the server port (req.getServerPort()) and may be fall back on req.getLocalPort(), not the other way around.

Poorly checked doGet method in PhpJavaServlet.java

I let it for future review:

As seen in PhpJavaServlet.java.

    /**
     * For backward compatibility
     */
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse res)
            throws ServletException, IOException {
        String uri = req.getRequestURI();
        req.getRequestDispatcher(uri.substring(0, uri.length() - 10)).forward(req, res);
    }

Figure out why and how to ensure that uri.length() - 10 not breaking everyhting...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.