Quercus: Env

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
 
 
Line 2: Line 2:
  
 
The <code>Env</code> class, <code>com.caucho.quercus.env.Env</code> is the main access to the PHP runtime environment.
 
The <code>Env</code> class, <code>com.caucho.quercus.env.Env</code> is the main access to the PHP runtime environment.
 +
 +
 +
 +
The Env class is useful to retreive things from the servlet context. To obtain an instance of the Env class in your module, include it
 +
as the first argument of your method. i.e.:
 +
 +
 +
  public Object getrequestattribute(Env env, String attribute)
 +
  {
 +
      //Env gives you access to the HttpServletRequest and HttpServletResponse objects and a host of other objects
 +
      return env.getRequest().getAttribute(attribute);
 +
  }

Latest revision as of 09:43, 16 May 2006


The Env class, com.caucho.quercus.env.Env is the main access to the PHP runtime environment.


The Env class is useful to retreive things from the servlet context. To obtain an instance of the Env class in your module, include it as the first argument of your method. i.e.:


 public Object getrequestattribute(Env env, String attribute) 
 {
     //Env gives you access to the HttpServletRequest and HttpServletResponse objects and a host of other objects
     return env.getRequest().getAttribute(attribute);
 }
Personal tools