### php.java.script

# Class PhpScriptContext

- `java.lang.Object`

- `javax.script.SimpleScriptContext`

- `php.java.script.PhpScriptContext`

Implemented Interfaces:
  Invocable, IPhpScriptContext, ScriptContext

`public class PhpScriptContext`
`extends SimpleScriptContext`
`implements IPhpScriptContext`

This class implements a simple script context for PHP. It starts a standalone `JavaBridgeRunner` which listens for requests from php instances.

In a servlet environment please use a `php.java.script.PhpSimpleHttpScriptContext` instead.

Author:
  jostb

See Also:
  `PhpSimpleHttpScriptContext`, `JavaBridgeRunner`

### Fields inherited from interface javax.script.ScriptContext

`ENGINE_SCOPE`, `GLOBAL_SCOPE`

## Constructor Summary

`PhpScriptContext()`
  Create a standalone PHP script context.

## Method Summary

`boolean`

`call(PhpProcedureProxy kont)`

`ContextFactory`

`getContextManager()`

`java.util.Map`

`getEnvironment()`

`java.io.Writer`

`getWriter()`
  Retrieves an instance of java.io.Writer which can be used by scripts to display their output.

`void`

`setContinuation(HttpProxy kont)`
  Set the php continuation

### Methods inherited from class javax.script.SimpleScriptContext

`getAttribute`, `getAttribute`, `getAttributesScope`, `getBindings`, `getWriter`, `removeAttribute`, `setAttribute`, `setBindings`

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

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

## Constructor Details

### PhpScriptContext

    public PhpScriptContext()

> Create a standalone PHP script context.

## Method Details

### call

    public boolean call(PhpProcedureProxy kont)
                throws java.lang.InterruptedException

> Specified by:
>   call in interface Invocable

### getContextManager

    public ContextFactory getContextManager()

> Specified by:
>   getContextManager in interface IPhpScriptContext

> Returns:
>   the context manager

### getEnvironment

    public java.util.Map getEnvironment()

> Specified by:
>   getEnvironment in interface IPhpScriptContext

> Returns:
>   the environment

### getWriter

    public java.io.Writer getWriter()

> Retrieves an instance of java.io.Writer which can be used by scripts to display their output.
> Specified by:
>   getWriter in interface IPhpScriptContext
>   getWriter in interface ScriptContext
> Overrides:
>   getWriter in interface SimpleScriptContext

> Returns:
>   an instance of java.io.Writer

### setContinuation

    public void setContinuation(HttpProxy kont)

> Set the php continuation
> Specified by:
>   setContinuation in interface IPhpScriptContext

> Parameters:
>   `kont` - - The continuation.