Package com.dotcms.repackage.com.caucho.vfs

Examples of com.dotcms.repackage.com.caucho.vfs.Path


    return v;
  }
 
  public Object eval(String source, int lineNo, int columnNo, Object oscript) throws BSFException {
    String scriptText = oscript.toString();
    Path path;
    PHPEvalWrapper wrapper = new PHPEvalWrapper();
    if(source.endsWith(".php")){
      String filePath = source.substring(source.indexOf('/'),source.length());
      path = buildRootPath(source).lookup(filePath);
      if(UtilMethods.isSet(scriptText)){
View Full Code Here


    php.setWorkDir(getPath(request));
    Env env = null;
    WriteStream ws = null;

    try {
      Path path = getPath(request);

      QuercusPage page;

      try {
        page = php.parse(path);
      }
      catch (FileNotFoundException ex) {

        Logger.warn(this, ex.getMessage());
        Logger.debug(this, ex.getMessage(), ex);
        response.sendError(HttpServletResponse.SC_NOT_FOUND);

        return;
      }catch (NullPointerException ex) {
        Logger.warn(this, ex.getMessage());
        Logger.debug(this, ex.getMessage(), ex);
        response.sendError(HttpServletResponse.SC_NOT_FOUND);

        return;
      }

      StreamImpl out;

      try {
        out = new VfsStream(null, response.getOutputStream());
      }
      catch (IllegalStateException e) {
        WriterStreamImpl writer = new WriterStreamImpl();
        writer.setWriter(response.getWriter());

        out = writer;
      }

      ws = new WriteStream(out);

      ws.setNewlineString("\n");


      php.setServletContext(_servletContext);

      env = php.createEnv(page, ws, request, response);
      try {
        env.start();
        env.setPwd(path);
        env.setGlobalValue("request", env.wrapJava(request));
        env.setGlobalValue("response", env.wrapJava(response));
        env.setGlobalValue("session", env.wrapJava(request.getSession()));
        env.setGlobalValue("servletContext", env.wrapJava(_servletContext));

        String prepend = env.getIniString("auto_prepend_file");
        if (prepend != null) {
          Path prependPath = env.lookup(env.createString(prepend));

          if (prependPath == null)
            env.error("auto_prepend_file '{0}' not found.", prepend);
          else {
            QuercusPage prependPage = php.parse(prependPath);
            prependPage.executeTop(env);
          }
        }

        page.executeTop(env);

        String append = env.getIniString("auto_append_file");
        if (append != null) {
          Path appendPath = env.lookup(env.createString(append));

          if (appendPath == null)
            env.error("auto_append_file '{0}' not found.", append);
          else {
            QuercusPage appendPage = php.parse(appendPath);
View Full Code Here

    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

  private Path getPath(HttpServletRequest req)
  {
    String scriptPath = QuercusRequestAdapter.getPageServletPath(req);
    String pathInfo = QuercusRequestAdapter.getPagePathInfo(req);
    Path pwd;
    try {
      pwd = new DotCMSPHPCauchoVFS(WebAPILocator.getHostWebAPI().getCurrentHost(req));
    } catch (Exception e) {
      Logger.error(PHPServlet.class,e.getMessage(),e);
      throw new DotRuntimeException(e.getMessage(), e);
    }
    Path path = pwd.lookup(scriptPath);
    return path;
  }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.com.caucho.vfs.Path

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.