### php.java.script

# Class CGIRunner

- `java.lang.Object`

- `java.lang.Thread`

- `php.java.script.CGIRunner`

Implemented Interfaces:
  java.lang.Runnable

Known Direct Subclasses:
  HttpProxy

`public abstract class CGIRunner`
`extends java.lang.Thread`

This class can be used to run a PHP CGI binary. Useful during development when there's no Apache/IIS or Servlet engine available to run PHP scripts.

Author:
  jostb

## Field Summary

### Fields inherited from class java.lang.Thread

`MAX_PRIORITY`, `MIN_PRIORITY`, `NORM_PRIORITY`

## Method Summary

`void`

`call(PhpProcedureProxy script)`
  The PHP script must call this function with the current continuation as an argument.

`PhpProcedureProxy`

`getPhpScript()`
  One must call this function if one is interested in the php continuation.

`void`

`release()`
  This function must be called to release the allocated php continuation.

`void`

`run()`
  The method of Thread that will be run if there is no Runnable object associated with the Thread.

### Methods inherited from class java.lang.Thread

`activeCount`, `checkAccess`, `countStackFrames`, `currentThread`, `destroy`, `dumpStack`, `enumerate`, `getContextClassLoader`, `getName`, `getPriority`, `getThreadGroup`, `holdsLock`, `interrupt`, `interrupted`, `isAlive`, `isDaemon`, `isInterrupted`, `join`, `join`, `join`, `resume`, `run`, `setContextClassLoader`, `setDaemon`, `setName`, `setPriority`, `sleep`, `sleep`, `start`, `stop`, `stop`, `suspend`, `toString`, `yield`

### Methods inherited from class java.lang.Object

`equals`, `getClass`, `hashCode`, `notify`, `notifyAll`, `toString`, `wait`, `wait`, `wait`

## Method Details

### call

    public void call(PhpProcedureProxy script)
                throws java.lang.InterruptedException

> The PHP script must call this function with the current continuation as an argument.

> Example:

> `java_context()->call(java_closure());
> `

> Parameters:
>   `script` - - The php continuation

> Throws:
>   `java.lang.InterruptedException` -

### getPhpScript

    public PhpProcedureProxy getPhpScript()
                throws java.lang.InterruptedException

> One must call this function if one is interested in the php continuation.

> Returns:
>   The php continuation.

> Throws:
>   `java.lang.InterruptedException` -

### release

    public void release()

> This function must be called to release the allocated php continuation.

### run

    public void run()

> The method of Thread that will be run if there is no Runnable object associated with the Thread. Thread's implementation does nothing at all.
> Specified by:
>   run in interface java.lang.Runnable
> Overrides:
>   run in interface java.lang.Thread

> See Also:
>   `start()`, `Thread(ThreadGroup, Runnable, String)`