com.caucho.quercus.lib
Class VariableModule

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

public class VariableModule
extends AbstractQuercusModule

Information about PHP variables.


Field Summary
 
Fields inherited from class com.caucho.quercus.module.AbstractQuercusModule
PHP_INI_ALL, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_USER
 
Constructor Summary
VariableModule()
           
 
Method Summary
static Value constant(Env env, java.lang.String name)
          Returns a constant
static Value debug_zval_dump(Env env, Value v)
          Prints a debug version of the variable
static Value define(Env env, StringValue name, Value value, boolean isCaseInsensitive)
          Defines a constant
static boolean defined(Env env, java.lang.String name)
          Returns true if the constant is defined.
static Value doubleval(Value v)
          Converts to a double
static boolean empty(Value v)
          Returns true for an empty variable.
static Value floatval(Value v)
          Converts to a double
static Value get_defined_vars(Env env)
          Returns the defined variables in the current scope.
static java.lang.String get_resource_type(Env env, Value v)
           
static java.lang.String gettype(Value v)
          Returns the type string for the variable
static boolean import_request_variables(Env env, java.lang.String types, java.lang.String prefix)
          Imports request variables
static Value intval(Value v)
          Converts to a long
static long intval(Value v, int base)
          Converts to a long
static boolean is_array(Value v)
          Returns true for an array.
static Value is_bool(Value v)
          Returns true for a boolean
static boolean is_callable(Env env, Value v, boolean isSyntaxOnly, Value nameRef)
          Returns the type string for the variable
static boolean is_double(Value v)
          Returns true for a double
static boolean is_float(Value v)
          Returns true for a double
static Value is_int(Value v)
          Returns true for an integer
static Value is_integer(Value v)
          Returns true for an integer
static Value is_long(Value v)
          Returns true for an integer
static boolean is_null(Value v)
          Returns true for null
static boolean is_numeric(Env env, Value v)
          Returns true for numeric
static boolean is_object(Env env, Value v)
          Returns true for an object
static boolean is_real(Value v)
          Returns true for a real
 boolean is_resource(Value value)
          Returns true if the value is a resource
static boolean is_scalar(Value v)
          Returns true for a scalar
 boolean is_string(Value value)
          Returns true if the value is a string
static boolean isset(Value... vList)
          Returns the type string for the variable
static Value print_r(Env env, Value v, boolean isReturn)
          Prints a value.
static java.lang.String serialize(Env env, Value v)
          Serializes the value to a string.
static boolean settype(Env env, Value var, java.lang.String type)
          Converts the variable to a specified tyep.
static Value strval(Env env, Value v)
          Converts to a string
static Value unserialize(Env env, StringValue s)
          Unserializes the value from a string.
static Value var_dump(Env env, Value v, Value[] args)
          Prints a debug version of the variable
static Value var_export(Env env, Value v, boolean isReturn)
          Serializes the value to a string.
 
Methods inherited from class com.caucho.quercus.module.AbstractQuercusModule
addConstant, addConstant, addConstant, getConstMap, getIniDefinitions, getLoadedExtensions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableModule

public VariableModule()
Method Detail

constant

public static Value constant(Env env,
                             java.lang.String name)
Returns a constant

Parameters:
env - the quercus calling environment
name - the constant name

debug_zval_dump

public static Value debug_zval_dump(Env env,
                                    Value v)
Prints a debug version of the variable

Parameters:
env - the quercus calling environment
v - the variable to print
Returns:
the escaped stringPhp

define

public static Value define(Env env,
                           StringValue name,
                           Value value,
                           boolean isCaseInsensitive)
Defines a constant

Parameters:
env - the quercus calling environment
name - the constant name
value - the constant value

defined

public static boolean defined(Env env,
                              java.lang.String name)
Returns true if the constant is defined.

Parameters:
env - the quercus calling environment
name - the constant name

doubleval

public static Value doubleval(Value v)
Converts to a double

Parameters:
v - the variable to convert
Returns:
the double value

empty

public static boolean empty(Value v)
Returns true for an empty variable.

Parameters:
v - the value to test
Returns:
true if the value is empty

floatval

public static Value floatval(Value v)
Converts to a double

Parameters:
v - the variable to convert
Returns:
the double value

get_defined_vars

public static Value get_defined_vars(Env env)
Returns the defined variables in the current scope.


get_resource_type

public static java.lang.String get_resource_type(Env env,
                                                 Value v)

gettype

public static java.lang.String gettype(Value v)
Returns the type string for the variable


import_request_variables

public static boolean import_request_variables(Env env,
                                               java.lang.String types,
                                               java.lang.String prefix)
Imports request variables

Parameters:
types - the variables to import
prefix - the prefix

intval

public static Value intval(Value v)
Converts to a long

Parameters:
v - the variable to convert
Returns:
the double value

intval

public static long intval(Value v,
                          int base)
Converts to a long

Parameters:
v - the variable to convert
Returns:
the double value

is_array

public static boolean is_array(Value v)
Returns true for an array.

Parameters:
v - the value to test
Returns:
true for an array

is_bool

public static Value is_bool(Value v)
Returns true for a boolean

Parameters:
v - the value to test
Returns:
true for a boolean

is_callable

public static boolean is_callable(Env env,
                                  Value v,
                                  boolean isSyntaxOnly,
                                  Value nameRef)
Returns the type string for the variable


is_double

public static boolean is_double(Value v)
Returns true for a double

Parameters:
v - the value to test
Returns:
true for a double

is_float

public static boolean is_float(Value v)
Returns true for a double

Parameters:
v - the value to test
Returns:
true for a double

is_int

public static Value is_int(Value v)
Returns true for an integer

Parameters:
v - the value to test
Returns:
true for a double

is_integer

public static Value is_integer(Value v)
Returns true for an integer

Parameters:
v - the value to test
Returns:
true for a double

is_long

public static Value is_long(Value v)
Returns true for an integer

Parameters:
v - the value to test
Returns:
true for a double

is_null

public static boolean is_null(Value v)
Returns true for null

Parameters:
v - the value to test
Returns:
true for null

is_numeric

public static boolean is_numeric(Env env,
                                 Value v)
Returns true for numeric

Parameters:
env - the calling environment
v - the value to test
Returns:
true for numeric

is_object

public static boolean is_object(Env env,
                                Value v)
Returns true for an object

Parameters:
env - the calling environment
v - the value to test
Returns:
true for object

is_real

public static boolean is_real(Value v)
Returns true for a real

Parameters:
v - the value to test
Returns:
true for a real

is_resource

public boolean is_resource(Value value)
Returns true if the value is a resource


is_scalar

public static boolean is_scalar(Value v)
Returns true for a scalar

Parameters:
v - the value to test
Returns:
true for a scalar

is_string

public boolean is_string(Value value)
Returns true if the value is a string


isset

public static boolean isset(Value... vList)
Returns the type string for the variable


print_r

public static Value print_r(Env env,
                            Value v,
                            boolean isReturn)
Prints a value. If isReturn is true, then returns what was supposed to be printed as a string instead.

Parameters:
env - the quercus calling environment
v - the variable to print
isReturn - set to true if returning instead of printing value
Returns:
the string that was supposed to be printed, or true

serialize

public static java.lang.String serialize(Env env,
                                         Value v)
Serializes the value to a string.


settype

public static boolean settype(Env env,
                              Value var,
                              java.lang.String type)
Converts the variable to a specified tyep.


strval

public static Value strval(Env env,
                           Value v)
Converts to a string

Parameters:
env - the quercus calling environment
v - the variable to convert
Returns:
the double value

unserialize

public static Value unserialize(Env env,
                                StringValue s)
Unserializes the value from a string.


var_dump

public static Value var_dump(Env env,
                             Value v,
                             Value[] args)
Prints a debug version of the variable

Parameters:
env - the quercus calling environment
v - the variable to print
Returns:
the escaped stringPhp

var_export

public static Value var_export(Env env,
                               Value v,
                               boolean isReturn)
Serializes the value to a string.