com.caucho.quercus.lib
Class OutputModule

java.lang.Object
  extended by com.caucho.quercus.module.AbstractQuercusModule
      extended by com.caucho.quercus.lib.OutputModule
All Implemented Interfaces:
ModuleStartupListener, QuercusModule

public class OutputModule
extends AbstractQuercusModule
implements ModuleStartupListener

PHP output routines.


Field Summary
static int PHP_OUTPUT_HANDLER_CONT
           
static int PHP_OUTPUT_HANDLER_END
           
static int PHP_OUTPUT_HANDLER_START
           
 
Fields inherited from class com.caucho.quercus.module.AbstractQuercusModule
PHP_INI_ALL, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_USER
 
Constructor Summary
OutputModule()
           
 
Method Summary
 Value flush(Env env)
          Flushes the original output buffer.
 IniDefinitions getIniDefinitions()
          Returns the default php.ini values.
static Value ob_clean(Env env)
          Clears the output buffer.
static boolean ob_end_clean(Env env)
          Pops the output buffer, discarding the contents.
static boolean ob_end_flush(Env env)
          Pops the output buffer.
static Value ob_flush(Env env)
          Flushes this output buffer into the next one on the stack or to the default "output buffer" if no next output buffer exists.
static Value ob_get_clean(Env env)
          Returns the contents of the output buffer, emptying it afterwards.
static Value ob_get_contents(Env env)
          Returns the contents of the current output buffer.
static Value ob_get_flush(Env env)
          Pops the output buffer and returns the contents.
static Value ob_get_length(Env env)
          Pushes the output buffer
static Value ob_get_level(Env env)
          Gets the nesting level of the current output buffer
static Value ob_get_status(Env env, boolean full_status)
          Gets the status of the current output buffer(s)
static Value ob_gzhandler(Env env, StringValue buffer, int state)
          Output buffering compatible callback that automatically compresses the output.
static Value ob_implicit_flush(Env env, boolean flag)
          Makes the original "output buffer" flush on every write.
static Value ob_list_handlers(Env env)
          Returns a list of all the output handlers in use.
static boolean ob_start(Env env, Callable callback, int chunkSize, boolean erase)
          Pushes the output buffer
static boolean output_add_rewrite_var(Env env, java.lang.String name, java.lang.String value)
          Adds a variable to the list for rewritten URLs.
static boolean output_reset_rewrite_vars(Env env)
          Clears the list of variables for rewritten URLs.
static UrlRewriterCallback pushUrlRewriter(Env env)
          Pushes a new UrlRewriter callback onto the output buffer stack if one does not already exist.
 void startup(Env env)
           
 
Methods inherited from class com.caucho.quercus.module.AbstractQuercusModule
addConstant, addConstant, addConstant, getConstMap, getLoadedExtensions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.caucho.quercus.module.QuercusModule
getConstMap, getLoadedExtensions
 

Field Detail

PHP_OUTPUT_HANDLER_START

public static final int PHP_OUTPUT_HANDLER_START
See Also:
Constant Field Values

PHP_OUTPUT_HANDLER_CONT

public static final int PHP_OUTPUT_HANDLER_CONT
See Also:
Constant Field Values

PHP_OUTPUT_HANDLER_END

public static final int PHP_OUTPUT_HANDLER_END
See Also:
Constant Field Values
Constructor Detail

OutputModule

public OutputModule()
Method Detail

getIniDefinitions

public IniDefinitions getIniDefinitions()
Returns the default php.ini values.

Specified by:
getIniDefinitions in interface QuercusModule
Overrides:
getIniDefinitions in class AbstractQuercusModule

startup

public void startup(Env env)
Specified by:
startup in interface ModuleStartupListener

flush

public Value flush(Env env)
Flushes the original output buffer.


ob_clean

public static Value ob_clean(Env env)
Clears the output buffer.


ob_end_clean

public static boolean ob_end_clean(Env env)
Pops the output buffer, discarding the contents.


ob_end_flush

public static boolean ob_end_flush(Env env)
Pops the output buffer.


ob_get_clean

public static Value ob_get_clean(Env env)
Returns the contents of the output buffer, emptying it afterwards. From the PHP Docs: Gets the current buffer contents and delete current output buffer. ob_get_clean() essentially executes both ob_get_contents() and ob_end_clean()


ob_get_contents

public static Value ob_get_contents(Env env)
Returns the contents of the current output buffer.


ob_get_flush

public static Value ob_get_flush(Env env)
Pops the output buffer and returns the contents.


ob_flush

public static Value ob_flush(Env env)
Flushes this output buffer into the next one on the stack or to the default "output buffer" if no next output buffer exists. The callback associated with this buffer is also called with appropriate parameters.


ob_get_length

public static Value ob_get_length(Env env)
Pushes the output buffer


ob_get_level

public static Value ob_get_level(Env env)
Gets the nesting level of the current output buffer


ob_list_handlers

public static Value ob_list_handlers(Env env)
Returns a list of all the output handlers in use.


ob_get_status

public static Value ob_get_status(Env env,
                                  boolean full_status)
Gets the status of the current output buffer(s)


ob_implicit_flush

public static Value ob_implicit_flush(Env env,
                                      boolean flag)
Makes the original "output buffer" flush on every write.


ob_start

public static boolean ob_start(Env env,
                               Callable callback,
                               int chunkSize,
                               boolean erase)
Pushes the output buffer


pushUrlRewriter

public static UrlRewriterCallback pushUrlRewriter(Env env)
Pushes a new UrlRewriter callback onto the output buffer stack if one does not already exist.


output_add_rewrite_var

public static boolean output_add_rewrite_var(Env env,
                                             java.lang.String name,
                                             java.lang.String value)
Adds a variable to the list for rewritten URLs.


output_reset_rewrite_vars

public static boolean output_reset_rewrite_vars(Env env)
Clears the list of variables for rewritten URLs.


ob_gzhandler

public static Value ob_gzhandler(Env env,
                                 StringValue buffer,
                                 int state)
Output buffering compatible callback that automatically compresses the output. The output of this function depends on the value of state. Specifically, if the PHP_OUTPUT_HANDLER_START bit is on in the state field, the function supplies a header with the output and initializes a gzip/deflate stream which will be used for subsequent calls.