Package com.caucho.quercus

Examples of com.caucho.quercus.Quercus


    throws IOException
  {
    if (log.isLoggable(Level.FINER))
      log.finer(code);

    Quercus quercus = getQuercus();

    QuercusProgram program = quercus.parseEvalExpr(code);

    Value value = program.execute(this);
   
    if (value == null)
      return NullValue.NULL;
View Full Code Here


  @UsesSymbolTable(replace=false)
  @Name("assert")
  public static Value q_assert(Env env, String code)
  {
    try {
      Quercus quercus = env.getQuercus();
     
      QuercusProgram program = quercus.parseCode(code);

      program = program.createExprReturn();
     
      Value value = program.execute(env);
View Full Code Here

  /**
   * Creates a new Quercus, which can be overridden for security issues.
   */
  protected Quercus createQuercus()
  {
    Quercus quercus = new Quercus();
   
    quercus.init();
   
    return quercus;
  }
View Full Code Here

  private QuercusScriptEngineFactory _factory;
  private final Quercus _quercus;

  QuercusScriptEngine(QuercusScriptEngineFactory factory)
  {
    this(factory, new Quercus());
  }
View Full Code Here

      }
    }
   
    private static String getContentType(Env env, String name)
    {
      Quercus quercus = env.getQuercus();
     
      ServletContext context = quercus.getServletContext();
     
      if (context != null) {
        String mimeType = context.getMimeType(name);
       
        if (mimeType != null)
View Full Code Here

     
      ws = new WriteStream(out);
     
      ws.setNewlineString("\n");

      Quercus quercus = getQuercus();
      quercus.setServletContext(_servletContext);
     
      env = quercus.createEnv(page, ws, request, response);
      try {
        env.start();
       
        env.setScriptGlobal("request", request);
        env.setScriptGlobal("response", response);
        env.setScriptGlobal("servletContext", _servletContext);

        StringValue prepend
          = quercus.getIniValue("auto_prepend_file").toStringValue(env);
        if (prepend.length() > 0) {
          Path prependPath = env.lookup(prepend);
         
          if (prependPath == null)
            env.error(L.l("auto_prepend_file '{0}' not found.", prepend));
          else {
            QuercusPage prependPage = getQuercus().parse(prependPath);
            prependPage.executeTop(env);
          }
        }

        env.executeTop();

        StringValue append
          = quercus.getIniValue("auto_append_file").toStringValue(env);
        if (append.length() > 0) {
          Path appendPath = env.lookup(append);
         
          if (appendPath == null)
            env.error(L.l("auto_append_file '{0}' not found.", append));
View Full Code Here

   */
  protected Quercus getQuercus()
  {
    synchronized (this) {
      if (_quercus == null)
        _quercus = new Quercus(isProduction());
    }

    return _quercus;
  }
View Full Code Here

  public void setCompile(String isCompile)
    throws ConfigException
  {
    _isCompileSet = true;

    Quercus quercus = getQuercus();

    if ("true".equals(isCompile) || "".equals(isCompile)) {
      quercus.setCompile(true);
      quercus.setLazyCompile(false);
    } else if ("false".equals(isCompile)) {
      quercus.setCompile(false);
      quercus.setLazyCompile(false);
    } else if ("lazy".equals(isCompile)) {
      quercus.setLazyCompile(true);
    } else
      throw new ConfigException(L.l(
        "'{0}' is an unknown compile value.  Values are 'true', 'false', or 'lazy'.",
        isCompile));
  }
View Full Code Here

   * Set true interpreted pages should be used for pages that fail to compile.
   */
  public void setCompileFailover(String isCompileFailover)
    throws ConfigException
  {
    Quercus quercus = getQuercus();

    if ("true".equals(isCompileFailover) || "".equals(isCompileFailover)) {
      quercus.setCompileFailover(true);
    } else if ("false".equals(isCompileFailover)) {
      quercus.setCompileFailover(false);
    } else
      throw new ConfigException(L.l(
        "'{0}' is an unknown compile-failover value.  Values are 'true', 'false', or 'lazy'.",
        isCompileFailover));
  }
View Full Code Here

      } catch (Exception e) {
        throw new ServletException(e);
      }
    }
    else if ("ini-file".equals(paramName)) {
      Quercus quercus = getQuercus();

      String realPath = getServletContext().getRealPath(paramValue);

      Path path = quercus.getPwd().lookup(realPath);

      setIniFile(path);
    }
    else if ("mysql-version".equals(paramName)) {
      setMysqlVersion(paramValue);
View Full Code Here

TOP

Related Classes of com.caucho.quercus.Quercus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.