php.java.bridge.http
Interface IFCGIProcessFactory

All Known Implementing Classes:
ContextLoaderListener, FastCGIProxy

public interface IFCGIProcessFactory

Implementing classes are able to use the FastCGI machinery. Currently implemented by FastCGIServlet and FastCGIProxy


Method Summary
 boolean canStartFCGI()
          Used for debugging only.
 IFCGIProcess createFCGIProcess(java.lang.String[] args, boolean includeJava, java.io.File home, java.util.Map env)
          Create a FastCGI Process
 java.lang.String getCgiDir()
          The full path to the pear dir.
 java.util.HashMap getEnvironment()
          Get the process environment map used for PHP.
 java.lang.String getPearDir()
          The full path to the pear dir.
 java.lang.String getPhp()
          Get the path to the PHP binary.
 java.lang.String getPhpConnectionPoolSize()
          Get the connection pool size, usually FCGIUtil#PHP_FCGI_CONNECTION_POOL_SIZE
 boolean getPhpIncludeJava()
          Get the value of the php_include_java option from the WEB-INF/web.xml.
 java.lang.String getPhpMaxRequests()
          Get the max requests value, usually FCGIUtil.PHP_FCGI_MAX_REQUESTS
 java.lang.String getWebInfDir()
          The full path to the web-inf dir.
 void log(java.lang.String msg)
          Log message through preferred log mechanism, for example servlet.log()
 

Method Detail

log

void log(java.lang.String msg)
Log message through preferred log mechanism, for example servlet.log()

Parameters:
msg - The message to log

createFCGIProcess

IFCGIProcess createFCGIProcess(java.lang.String[] args,
                               boolean includeJava,
                               java.io.File home,
                               java.util.Map env)
                               throws java.io.IOException
Create a FastCGI Process

Parameters:
args - The PHP arguments
webInfDir - The web inf dir
pearDir - The bear dir
cgiDir - The cgi dir
includeJava - automatically include Java.inc in each script
home - The PHP home dir or null
env - The process environment
Returns:
a FastCGI process object
Throws:
java.io.IOException

getPhpConnectionPoolSize

java.lang.String getPhpConnectionPoolSize()
Get the connection pool size, usually FCGIUtil#PHP_FCGI_CONNECTION_POOL_SIZE

Returns:
The connection pool size

getPhpMaxRequests

java.lang.String getPhpMaxRequests()
Get the max requests value, usually FCGIUtil.PHP_FCGI_MAX_REQUESTS

Returns:
The connection pool size

getPhp

java.lang.String getPhp()
Get the path to the PHP binary. For example "/usr/bin/php-cgi".

Returns:
The path or the name of the PHP FastCGI binary or null (defaults to php-cgi or php-cgi.exe on the PATH)

getPhpIncludeJava

boolean getPhpIncludeJava()
Get the value of the php_include_java option from the WEB-INF/web.xml. Should return true in most cases.

Returns:
the php_include_java option

getEnvironment

java.util.HashMap getEnvironment()
Get the process environment map used for PHP.

Returns:
the process environment.

canStartFCGI

boolean canStartFCGI()
Used for debugging only. Should always return true.

Returns:
true

getCgiDir

java.lang.String getCgiDir()
The full path to the pear dir. Defaults to WEB-INF/cgi. Use TMPDIR for a standalone runner.

Returns:
the full path to the cgi dir

getPearDir

java.lang.String getPearDir()
The full path to the pear dir. Defaults to WEB-INF/pear. Use TMPDIR for a standalone runner.

Returns:
the full path to the pear dir

getWebInfDir

java.lang.String getWebInfDir()
The full path to the web-inf dir. Defaults to WEB-INF. Use TMPDIR for a standalone runner.

Returns:
the full path to the WEB-INF dir