com.caucho.quercus
Class QuercusContext

java.lang.Object
  extended by com.caucho.quercus.QuercusContext
Direct Known Subclasses:
GoogleQuercus, ProQuercus, Quercus, ResinQuercus

public class QuercusContext
extends java.lang.Object

Facade for the PHP language.


Field Summary
protected  long _envTimeout
           
protected  IntMap _functionNameMap
           
protected static long ENV_TIMEOUT_UPDATE_INTERVAL
           
static IniDefinition INI_ALWAYS_POPULATE_RAW_POST_DATA
           
static IniDefinition INI_INCLUDE_PATH
           
static IniDefinition INI_REGISTER_LONG_ARRAYS
           
static IniDefinition INI_UNICODE_FALLBACK_ENCODING
           
static IniDefinition INI_UNICODE_FROM_ERROR_MODE
           
static IniDefinition INI_UNICODE_FROM_ERROR_SUBST_CHAR
           
static IniDefinition INI_UNICODE_HTTP_INPUT_ENCODING
           
static IniDefinition INI_UNICODE_OUTPUT_ENCODING
           
static IniDefinition INI_UNICODE_RUNTIME_ENCODING
           
static IniDefinition INI_UNICODE_SCRIPT_ENCODING
           
static IniDefinition INI_UNICODE_SEMANTICS
           
 
Constructor Summary
QuercusContext()
          Constructor.
 
Method Summary
 void addImplClass(java.lang.String name, java.lang.Class type)
          Adds a impl class
 void addJavaClass(java.lang.String name, java.lang.Class type)
          Adds a java class
 void addJavaClass(java.lang.String phpName, java.lang.String className)
          Adds a java class
 int addLowerConstantId(StringValue name)
          Returns the id for a constant
 void addModule(QuercusModule module)
           
protected  void addModuleInfo(ModuleInfo info)
           
 void clearDefinitionCache()
          Clears the definition cache.
 void close()
           
 void completeEnv(Env env)
           
 Env createEnv(QuercusPage page, WriteStream out, HttpServletRequest request, HttpServletResponse response)
           
 ExprFactory createExprFactory()
           
protected  ModuleContext createModuleContext(ModuleContext parent, java.lang.ClassLoader loader)
           
protected  PageManager createPageManager()
           
protected  QuercusSessionManager createSessionManager()
           
 StringValue createStaticName()
           
 StringValue createString(java.lang.String name)
          Creates a string.
 UnicodeBuilderValue createUnicodeString(java.lang.String name)
          Creates a string.
 void destroySession(java.lang.String sessionId)
          Removes the session from the backing.
protected  void extendFunctionMap(java.lang.String name, int id)
           
 ClassDef findClass(java.lang.String name)
          Returns the class with the given name.
 int findClassId(java.lang.String name)
          Returns the id for a function name.
 javax.sql.DataSource findDatabase(java.lang.String driver, java.lang.String url)
          Gets the default data source.
 AbstractFunction findFunction(java.lang.String name)
          Returns the function with the given name.
 int findFunctionId(java.lang.String name)
          Returns the id for a function name.
 AbstractFunction findFunctionImpl(java.lang.String name)
          Returns the function with the given name.
 ClassDef findJavaClassWrapper(java.lang.String name)
          Finds the java class wrapper.
 AbstractFunction findLowerFunctionImpl(java.lang.String lowerName)
          Returns the function with the given name.
 QuercusModule findModule(java.lang.String name)
          Returns the module with the given name.
protected  java.util.Map<Env,Env> getActiveEnvSet()
           
 QuercusClass getCachedClass(int id)
          Returns the undefined functions
 QuercusClass[] getClassCacheMap()
          Returns the undefined functions
 ClassDef getClassDef(int id)
          Returns the class def with the given index.
 ClassDef[] getClassDefMap()
          Returns the undefined functions
 int getClassId(java.lang.String className)
          Returns the id for a class name.
 int getClassIdCount()
          Returns the number of classes
 java.util.HashMap<java.lang.String,ClassDef> getClassMap()
          Returns the class maps.
 java.lang.String getClassName(int id)
           
 java.lang.String getClassName(Path path)
          Returns the relative path.
 java.lang.ClassLoader getCompileClassLoader()
          Returns the compile classloader
 java.sql.Connection getConnection(java.sql.Connection conn)
          Unwrap connection if necessary.
 Value getConstant(int id)
          Returns a named constant.
 int getConstantId(java.lang.String name)
          Returns the id for a constant
 int getConstantId(StringValue name)
          Returns the id for a constant
 int getConstantIdCount()
          Returns the number of defined constants
 int getConstantLower(int id)
          Returns the name map.
 int getConstantLowerId(java.lang.String name)
          Returns the constant id.
 Value[] getConstantMap()
          Returns the name map.
 Value getConstantName(int id)
          Returns the name map.
 java.lang.String getCookieName()
           
 long getCurrentTime()
          Returns the current time.
 javax.sql.DataSource getDatabase()
          Gets the default data source.
 long getDefCacheHitCount()
          Returns the definition cache hit count.
 long getDefCacheMissCount()
          Returns the definition cache miss count.
 ArrayValue getDefinedFunctions()
          Returns an array of the defined functions.
 long getDependencyCheckInterval()
           
 long getExactTime()
          Returns the exact current time in milliseconds.
 long getExactTimeNanoseconds()
          Returns the current time in nanoseconds.
 Value getExtensionFuncs(java.lang.String name)
          Returns true if an extension is loaded.
 int getFunctionId(java.lang.String name)
          Returns the id for a function name.
 int getFunctionIdCount()
          Returns the number of functions
 AbstractFunction[] getFunctionMap()
          Returns the undefined functions
 Path getIncludeCache(StringValue include, java.lang.String includePath, Path pwd, Path scriptPwd)
          Returns an include path.
 int getIncludeCacheMax()
           
 long getIncludeCacheTimeout()
           
 boolean getIniBoolean(java.lang.String name)
          Returns an ini value.
 IniDefinitions getIniDefinitions()
          Returns the IniDefinitions for all ini that have been defined by modules.
 Path getIniFile()
          Returns the ini file.
 long getIniLong(java.lang.String name)
          Returns an ini value as a long.
 java.util.HashMap<java.lang.String,Value> getIniMap(boolean create)
          Returns a map of the ini values that have been explicitly set.
 Value getIniValue(java.lang.String name)
          Returns an ini value.
 JavaClassDef getJavaClassDefinition(java.lang.Class<?> type, java.lang.String className)
          Adds a java class
 JavaClassDef getJavaClassDefinition(java.lang.String className)
          Adds a java class
 java.util.HashSet<java.lang.String> getLoadedExtensions()
          Returns the loaded extensions.
 ModuleContext getLocalContext()
          Returns the context for this class loader.
 ModuleContext getLocalContext(java.lang.ClassLoader loader)
           
 ModuleContext getModuleContext()
          Returns the module context.
 java.util.Collection<ModuleInfo> getModules()
           
 java.util.HashSet<ModuleStartupListener> getModuleStartupListeners()
          Returns a list of the modules that have some startup code to run.
 java.lang.String getMysqlVersion()
           
 int getPageCacheSize()
           
 java.lang.String getPhpVersion()
           
 StringValue getPhpVersionValue()
           
 int getProfileIndex(java.lang.String name)
           
 Path getPwd()
          Returns the working directory.
 QuercusSessionManager getQuercusSessionManager()
           
 int getRegexpCacheSize()
           
 java.lang.String getSapiName()
          Returns the SAPI (Server API) name.
 java.lang.String getScriptEncoding()
           
 Value getServerEnv(StringValue name)
          Gets a server env value.
 java.util.HashMap<Value,Value> getServerEnvMap()
          Returns the server env map.
 ServletContext getServletContext()
           
 Cache getSessionCache()
           
 java.lang.Object getSpecial(java.lang.String key)
          Loads a special value
 java.sql.Statement getStatement(java.sql.Statement stmt)
          Unwrap statement if necessary.
 QuercusClass getStdClass()
          Returns the stdClass definition.
 java.lang.String getVersion()
           
 java.lang.String getVersionDate()
           
 Path getWorkDir()
           
 boolean includeExists(Path path)
          Returns true if a precompiled page exists
 void init()
          Initialize the engine
protected  void initLocal()
          Initialize local configuration, e.g.
 boolean isAllowUrlFopen()
           
 boolean isAllowUrlInclude()
           
protected  boolean isClosed()
           
 boolean isCompile()
          true if the pages should be compiled.
 boolean isConnectionPool()
           
 boolean isExtensionLoaded(java.lang.String name)
          Returns true if an extension is loaded.
 boolean isLooseParse()
          Gets the loose mode.
 boolean isPro()
          Returns true if this is the Professional version.
 boolean isProfile()
           
 boolean isRequireSource()
           
 boolean isResin()
          Returns true if Quercus is running under Resin.
 boolean isStrict()
          Gets the strict mode.
static boolean isSuperGlobal(StringValue name)
          Returns true if the variable is a superglobal.
 boolean isUnicodeSemantics()
          Returns true if unicode.semantics is on.
 SessionArrayValue loadSession(Env env, java.lang.String sessionId)
          Loads the session from the backing.
 void markForPoolRemoval(java.sql.Connection conn)
           
static Value objectToValue(java.lang.Object obj)
           
 QuercusPage parse(Path path)
          Parses a quercus program.
 QuercusPage parse(Path path, java.lang.String fileName, int line)
          Parses a quercus program.
 QuercusPage parse(ReadStream is)
          Parses a quercus program.
 QuercusProgram parseCode(java.lang.String code)
          Parses a quercus string.
 QuercusProgram parseEvalExpr(java.lang.String code)
          Parses a quercus string.
 AbstractFunction parseFunction(java.lang.String name, java.lang.String args, java.lang.String code)
          Parses a function.
 void putIncludeCache(StringValue include, java.lang.String includePath, Path pwd, Path scriptPwd, Path path)
          Adds an include path.
 void saveSession(Env env, SessionArrayValue session)
          Saves the session to the backing.
 void setCachedClass(int id, QuercusClass qClass)
          Returns the undefined functions
 void setCompile(boolean isCompile)
          Set true if pages should be compiled.
 void setCompileClassLoader(java.lang.ClassLoader loader)
          Sets the compile classloader
 void setCompileFailover(boolean isCompileFailover)
           
 void setConnectionPool(boolean isEnable)
           
 void setDatabase(javax.sql.DataSource database)
          Sets the default data source.
 int setFunction(java.lang.String name, AbstractFunction fun)
           
 void setIncludeCacheMax(int cacheMax)
           
 void setIncludeCacheTimeout(long timeout)
           
 void setIni(java.lang.String name, java.lang.String value)
          Sets an ini value.
 void setIni(java.lang.String name, StringValue value)
          Sets an ini value.
 void setIniFile(Path path)
          Sets an ini file.
 void setLazyCompile(boolean isCompile)
          Set true if pages should be compiled.
 void setLooseParse(boolean isLoose)
          Sets the loose mode.
 void setMysqlVersion(java.lang.String version)
           
 void setPageCacheSize(int size)
           
 void setPhpVersion(java.lang.String version)
           
 void setProfileProbability(double probability)
           
 void setPwd(Path path)
          Sets the working directory.
 void setRegexpCacheSize(int size)
           
 void setRequireSource(boolean isRequireSource)
           
 void setScriptEncoding(java.lang.String encoding)
           
 void setServerEnv(java.lang.String name, java.lang.String value)
          Sets a server env value.
 void setServerEnv(StringValue name, StringValue value)
          Sets a server env value.
 void setServletContext(ServletContext servletContext)
           
 void setSessionTimeout(long sessionTimeout)
           
 void setSpecial(java.lang.String key, java.lang.Object value)
          Saves a special value
 void setStrict(boolean isStrict)
          Sets the strict mode.
 void setUnicodeSemantics(boolean isUnicode)
           
 void setWorkDir(Path workDir)
           
 void start()
           
 void startEnv(Env env)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_functionNameMap

protected IntMap _functionNameMap

_envTimeout

protected long _envTimeout

ENV_TIMEOUT_UPDATE_INTERVAL

protected static final long ENV_TIMEOUT_UPDATE_INTERVAL
See Also:
Constant Field Values

INI_INCLUDE_PATH

public static final IniDefinition INI_INCLUDE_PATH

INI_REGISTER_LONG_ARRAYS

public static final IniDefinition INI_REGISTER_LONG_ARRAYS

INI_ALWAYS_POPULATE_RAW_POST_DATA

public static final IniDefinition INI_ALWAYS_POPULATE_RAW_POST_DATA

INI_UNICODE_SEMANTICS

public static final IniDefinition INI_UNICODE_SEMANTICS

INI_UNICODE_FALLBACK_ENCODING

public static final IniDefinition INI_UNICODE_FALLBACK_ENCODING

INI_UNICODE_FROM_ERROR_MODE

public static final IniDefinition INI_UNICODE_FROM_ERROR_MODE

INI_UNICODE_FROM_ERROR_SUBST_CHAR

public static final IniDefinition INI_UNICODE_FROM_ERROR_SUBST_CHAR

INI_UNICODE_HTTP_INPUT_ENCODING

public static final IniDefinition INI_UNICODE_HTTP_INPUT_ENCODING

INI_UNICODE_OUTPUT_ENCODING

public static final IniDefinition INI_UNICODE_OUTPUT_ENCODING

INI_UNICODE_RUNTIME_ENCODING

public static final IniDefinition INI_UNICODE_RUNTIME_ENCODING

INI_UNICODE_SCRIPT_ENCODING

public static final IniDefinition INI_UNICODE_SCRIPT_ENCODING
Constructor Detail

QuercusContext

public QuercusContext()
Constructor.

Method Detail

getCurrentTime

public long getCurrentTime()
Returns the current time.


getExactTimeNanoseconds

public long getExactTimeNanoseconds()
Returns the current time in nanoseconds.


getExactTime

public long getExactTime()
Returns the exact current time in milliseconds.


getPwd

public Path getPwd()
Returns the working directory.


setPwd

public void setPwd(Path path)
Sets the working directory.


getWorkDir

public Path getWorkDir()

setWorkDir

public void setWorkDir(Path workDir)

getCookieName

public java.lang.String getCookieName()

getDependencyCheckInterval

public long getDependencyCheckInterval()

getIncludeCacheMax

public int getIncludeCacheMax()

setIncludeCacheMax

public void setIncludeCacheMax(int cacheMax)

setIncludeCacheTimeout

public void setIncludeCacheTimeout(long timeout)

getIncludeCacheTimeout

public long getIncludeCacheTimeout()

getVersion

public java.lang.String getVersion()

getVersionDate

public java.lang.String getVersionDate()

getSapiName

public java.lang.String getSapiName()
Returns the SAPI (Server API) name.


isProfile

public boolean isProfile()

getProfileIndex

public int getProfileIndex(java.lang.String name)

setProfileProbability

public void setProfileProbability(double probability)

createPageManager

protected PageManager createPageManager()

createSessionManager

protected QuercusSessionManager createSessionManager()

getLocalContext

public final ModuleContext getLocalContext()
Returns the context for this class loader.


getLocalContext

public ModuleContext getLocalContext(java.lang.ClassLoader loader)

createModuleContext

protected ModuleContext createModuleContext(ModuleContext parent,
                                            java.lang.ClassLoader loader)

getModuleContext

public ModuleContext getModuleContext()
Returns the module context.


getQuercusSessionManager

public QuercusSessionManager getQuercusSessionManager()

isCompile

public boolean isCompile()
true if the pages should be compiled.


isPro

public boolean isPro()
Returns true if this is the Professional version.


isResin

public boolean isResin()
Returns true if Quercus is running under Resin.


setUnicodeSemantics

public void setUnicodeSemantics(boolean isUnicode)

isUnicodeSemantics

public boolean isUnicodeSemantics()
Returns true if unicode.semantics is on.


isAllowUrlInclude

public boolean isAllowUrlInclude()

isAllowUrlFopen

public boolean isAllowUrlFopen()

setCompile

public void setCompile(boolean isCompile)
Set true if pages should be compiled.


setLazyCompile

public void setLazyCompile(boolean isCompile)
Set true if pages should be compiled.


setCompileFailover

public void setCompileFailover(boolean isCompileFailover)

getScriptEncoding

public java.lang.String getScriptEncoding()

setScriptEncoding

public void setScriptEncoding(java.lang.String encoding)

getMysqlVersion

public java.lang.String getMysqlVersion()

setMysqlVersion

public void setMysqlVersion(java.lang.String version)

getPhpVersion

public java.lang.String getPhpVersion()

setPhpVersion

public void setPhpVersion(java.lang.String version)

getPhpVersionValue

public StringValue getPhpVersionValue()

setServletContext

public void setServletContext(ServletContext servletContext)

getServletContext

public ServletContext getServletContext()

setDatabase

public void setDatabase(javax.sql.DataSource database)
Sets the default data source.


getDatabase

public javax.sql.DataSource getDatabase()
Gets the default data source.


findDatabase

public javax.sql.DataSource findDatabase(java.lang.String driver,
                                         java.lang.String url)
Gets the default data source.


markForPoolRemoval

public void markForPoolRemoval(java.sql.Connection conn)

getConnection

public java.sql.Connection getConnection(java.sql.Connection conn)
Unwrap connection if necessary.


getStatement

public java.sql.Statement getStatement(java.sql.Statement stmt)
Unwrap statement if necessary.


setStrict

public void setStrict(boolean isStrict)
Sets the strict mode.


isStrict

public boolean isStrict()
Gets the strict mode.


setLooseParse

public void setLooseParse(boolean isLoose)
Sets the loose mode.


isLooseParse

public boolean isLooseParse()
Gets the loose mode.


getPageCacheSize

public int getPageCacheSize()

setPageCacheSize

public void setPageCacheSize(int size)

getRegexpCacheSize

public int getRegexpCacheSize()

setRegexpCacheSize

public void setRegexpCacheSize(int size)

setRequireSource

public void setRequireSource(boolean isRequireSource)

isRequireSource

public boolean isRequireSource()

setConnectionPool

public void setConnectionPool(boolean isEnable)

isConnectionPool

public boolean isConnectionPool()

addJavaClass

public void addJavaClass(java.lang.String name,
                         java.lang.Class type)
                  throws ConfigException
Adds a java class

Throws:
ConfigException

addJavaClass

public void addJavaClass(java.lang.String phpName,
                         java.lang.String className)
Adds a java class


addImplClass

public void addImplClass(java.lang.String name,
                         java.lang.Class type)
                  throws ConfigException
Adds a impl class

Throws:
ConfigException

getJavaClassDefinition

public JavaClassDef getJavaClassDefinition(java.lang.Class<?> type,
                                           java.lang.String className)
Adds a java class


getJavaClassDefinition

public JavaClassDef getJavaClassDefinition(java.lang.String className)
Adds a java class


findJavaClassWrapper

public ClassDef findJavaClassWrapper(java.lang.String name)
Finds the java class wrapper.


setIniFile

public void setIniFile(Path path)
Sets an ini file.


getIniFile

public Path getIniFile()
Returns the ini file.


getIniDefinitions

public IniDefinitions getIniDefinitions()
Returns the IniDefinitions for all ini that have been defined by modules.


getIniMap

public java.util.HashMap<java.lang.String,Value> getIniMap(boolean create)
Returns a map of the ini values that have been explicitly set.


setIni

public void setIni(java.lang.String name,
                   StringValue value)
Sets an ini value.


setIni

public void setIni(java.lang.String name,
                   java.lang.String value)
Sets an ini value.


getIniBoolean

public boolean getIniBoolean(java.lang.String name)
Returns an ini value.


getIniLong

public long getIniLong(java.lang.String name)
Returns an ini value as a long.


getIniValue

public Value getIniValue(java.lang.String name)
Returns an ini value.


setServerEnv

public void setServerEnv(java.lang.String name,
                         java.lang.String value)
Sets a server env value.


setServerEnv

public void setServerEnv(StringValue name,
                         StringValue value)
Sets a server env value.


getServerEnv

public Value getServerEnv(StringValue name)
Gets a server env value.


getServerEnvMap

public java.util.HashMap<Value,Value> getServerEnvMap()
Returns the server env map.


getCompileClassLoader

public java.lang.ClassLoader getCompileClassLoader()
Returns the compile classloader


setCompileClassLoader

public void setCompileClassLoader(java.lang.ClassLoader loader)
Sets the compile classloader


getClassName

public final java.lang.String getClassName(Path path)
Returns the relative path.


getIncludeCache

public Path getIncludeCache(StringValue include,
                            java.lang.String includePath,
                            Path pwd,
                            Path scriptPwd)
Returns an include path.


putIncludeCache

public void putIncludeCache(StringValue include,
                            java.lang.String includePath,
                            Path pwd,
                            Path scriptPwd,
                            Path path)
Adds an include path.


getDefCacheHitCount

public long getDefCacheHitCount()
Returns the definition cache hit count.


getDefCacheMissCount

public long getDefCacheMissCount()
Returns the definition cache miss count.


clearDefinitionCache

public void clearDefinitionCache()
Clears the definition cache.


includeExists

public boolean includeExists(Path path)
Returns true if a precompiled page exists


parse

public QuercusPage parse(Path path)
                  throws java.io.IOException
Parses a quercus program.

Parameters:
path - the source file path
Returns:
the parsed program
Throws:
java.io.IOException

parse

public QuercusPage parse(Path path,
                         java.lang.String fileName,
                         int line)
                  throws java.io.IOException
Parses a quercus program.

Parameters:
path - the source file path
Returns:
the parsed program
Throws:
java.io.IOException

parse

public QuercusPage parse(ReadStream is)
                  throws java.io.IOException
Parses a quercus program.

Parameters:
path - the source file path
Returns:
the parsed program
Throws:
java.io.IOException

parseCode

public QuercusProgram parseCode(java.lang.String code)
                         throws java.io.IOException
Parses a quercus string.

Parameters:
code - the source code
Returns:
the parsed program
Throws:
java.io.IOException

parseEvalExpr

public QuercusProgram parseEvalExpr(java.lang.String code)
                             throws java.io.IOException
Parses a quercus string.

Parameters:
code - the source code
Returns:
the parsed program
Throws:
java.io.IOException

parseFunction

public AbstractFunction parseFunction(java.lang.String name,
                                      java.lang.String args,
                                      java.lang.String code)
                               throws java.io.IOException
Parses a function.

Parameters:
args - the arguments
code - the source code
Returns:
the parsed program
Throws:
java.io.IOException

findFunction

public AbstractFunction findFunction(java.lang.String name)
Returns the function with the given name.


findFunctionImpl

public AbstractFunction findFunctionImpl(java.lang.String name)
Returns the function with the given name.


findLowerFunctionImpl

public AbstractFunction findLowerFunctionImpl(java.lang.String lowerName)
Returns the function with the given name.


getDefinedFunctions

public ArrayValue getDefinedFunctions()
Returns an array of the defined functions.


getFunctionId

public int getFunctionId(java.lang.String name)
Returns the id for a function name.


extendFunctionMap

protected void extendFunctionMap(java.lang.String name,
                                 int id)

findFunctionId

public int findFunctionId(java.lang.String name)
Returns the id for a function name.


getFunctionIdCount

public int getFunctionIdCount()
Returns the number of functions


getFunctionMap

public AbstractFunction[] getFunctionMap()
Returns the undefined functions


setFunction

public int setFunction(java.lang.String name,
                       AbstractFunction fun)

getClassId

public int getClassId(java.lang.String className)
Returns the id for a class name.


getClassName

public java.lang.String getClassName(int id)

findClassId

public int findClassId(java.lang.String name)
Returns the id for a function name.


getClassIdCount

public int getClassIdCount()
Returns the number of classes


getClassDefMap

public ClassDef[] getClassDefMap()
Returns the undefined functions


getClassDef

public ClassDef getClassDef(int id)
Returns the class def with the given index.


getClassCacheMap

public QuercusClass[] getClassCacheMap()
Returns the undefined functions


getCachedClass

public QuercusClass getCachedClass(int id)
Returns the undefined functions


setCachedClass

public void setCachedClass(int id,
                           QuercusClass qClass)
Returns the undefined functions


getConstantId

public int getConstantId(java.lang.String name)
Returns the id for a constant


getConstantId

public int getConstantId(StringValue name)
Returns the id for a constant


addLowerConstantId

public int addLowerConstantId(StringValue name)
Returns the id for a constant


getConstantLower

public int getConstantLower(int id)
Returns the name map.


getConstantLowerId

public int getConstantLowerId(java.lang.String name)
Returns the constant id.


getConstantName

public Value getConstantName(int id)
Returns the name map.


getConstantMap

public Value[] getConstantMap()
Returns the name map.


getConstantIdCount

public int getConstantIdCount()
Returns the number of defined constants


isSuperGlobal

public static boolean isSuperGlobal(StringValue name)
Returns true if the variable is a superglobal.


getStdClass

public QuercusClass getStdClass()
Returns the stdClass definition.


findClass

public ClassDef findClass(java.lang.String name)
Returns the class with the given name.


getClassMap

public java.util.HashMap<java.lang.String,ClassDef> getClassMap()
Returns the class maps.


findModule

public QuercusModule findModule(java.lang.String name)
Returns the module with the given name.


getModuleStartupListeners

public java.util.HashSet<ModuleStartupListener> getModuleStartupListeners()
Returns a list of the modules that have some startup code to run.


isExtensionLoaded

public boolean isExtensionLoaded(java.lang.String name)
Returns true if an extension is loaded.


getLoadedExtensions

public java.util.HashSet<java.lang.String> getLoadedExtensions()
Returns the loaded extensions.


getExtensionFuncs

public Value getExtensionFuncs(java.lang.String name)
Returns true if an extension is loaded.


getModules

public java.util.Collection<ModuleInfo> getModules()

init

public void init()
Initialize the engine


addModule

public void addModule(QuercusModule module)

addModuleInfo

protected void addModuleInfo(ModuleInfo info)

createUnicodeString

public UnicodeBuilderValue createUnicodeString(java.lang.String name)
Creates a string. Because these strings are typically Java constants, they fit into a lru cache.


createString

public StringValue createString(java.lang.String name)
Creates a string. Because these strings are typically Java constants, they fit into a lru cache.


getConstant

public Value getConstant(int id)
Returns a named constant.


createStaticName

public StringValue createStaticName()

getSessionCache

public Cache getSessionCache()

setSessionTimeout

public void setSessionTimeout(long sessionTimeout)

loadSession

public SessionArrayValue loadSession(Env env,
                                     java.lang.String sessionId)
Loads the session from the backing.


saveSession

public void saveSession(Env env,
                        SessionArrayValue session)
Saves the session to the backing.


destroySession

public void destroySession(java.lang.String sessionId)
Removes the session from the backing.


getSpecial

public java.lang.Object getSpecial(java.lang.String key)
Loads a special value


setSpecial

public void setSpecial(java.lang.String key,
                       java.lang.Object value)
Saves a special value


objectToValue

public static Value objectToValue(java.lang.Object obj)

initLocal

protected void initLocal()
Initialize local configuration, e.g. finding the PHP and PEAR libraries


start

public void start()

createEnv

public Env createEnv(QuercusPage page,
                     WriteStream out,
                     HttpServletRequest request,
                     HttpServletResponse response)

createExprFactory

public ExprFactory createExprFactory()

getActiveEnvSet

protected java.util.Map<Env,Env> getActiveEnvSet()

startEnv

public void startEnv(Env env)

completeEnv

public void completeEnv(Env env)

isClosed

protected boolean isClosed()

close

public void close()