belgattitude / php-java-bridge

Soluble PHP/Java bridge server (unofficial fork)
Other
45 stars 10 forks source link

Gradle build: allow selection of a customized web.xml #32

Closed belgattitude closed 7 years ago

belgattitude commented 7 years ago

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.

cplerch commented 7 years ago

What exactly is the proplem with PHPCGIServlet? I'm asking because the javadocs say that it will fail gracefully whenever there is no FastCGI server available:

     * Create a new FastCGI servlet which connects to a PHP FastCGI server using a connection pool.
     * <p>
     * If the JavaBridge context exists and the JavaBridge context can
     * start a FastCGI server and the current context is configured to
     * connect to a FastCGI server, the current context connects to
     * the JavaBridge context to start the server and then uses this
     * server for all subsequent requests until the server is
     * stopped. When FastCGI is not available (anymore), the parent
     * CGI servlet is used instead.
belgattitude commented 7 years ago

Yes it should, but from stackoverflow, looks like it doesn't...

And most installation problems comes from a missing 'php-cgi'... I'll make a test soon to confirm. So let's wait a bit.

cplerch commented 7 years ago

If it doesn't do its duty as documented in the code, then its a bug and we should try to find and fix it, rather than artificially excluding the servlet.

2017-02-16 14:12 GMT+01:00 Sébastien Vanvelthem notifications@github.com:

Yes it should, but from stackoverflow, looks like it doesn't...

And most installation problems comes from a missing 'php-cgi'... I'll make a test soon to confirm. So let's wait a bit.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/belgattitude/php-java-bridge/issues/32#issuecomment-280326686, or mute the thread https://github.com/notifications/unsubscribe-auth/AIA126AtakNJEn_5WdYHSgi225MJKB1cks5rdEtZgaJpZM4MB-hT .

belgattitude commented 7 years ago

Yes I got it, but my point is a bit different:

  1. It should complain/error if the php-cgi is missing and the PHPCGIServlet is enabled. Otherwise it becomes very difficult to determine error (on my experience, who's reading the log ?). The idea is to keep the error as it is probably right now... The reasoning behind:

    • Easy to help if I someone open an issue on github, about it. The message is clear... no 'Can I see your log ? Maybe it's that or this' questions needed ;)
  2. The possibility to build without the PHPCGIServlet. (I suppose most will do). thus no missing php-cgi complain.

That's why I think the possibility should be offered when building (gradle.build). This way it also help me to product clear documentation...