Example #1
0
        /**
         * Execute the program as top-level, i.e. not included.
         *
         * @param env the calling environment
         */
        public Value executeTop(Env env)
        {
            QuercusPage compile = getCompiledPage();

            string oldPwd = env.getPwd();

            string pwd = getPwd(env);

            env.setPwd(pwd);
            try {
                if (compile != null)
                {
                    return(compile.executeTop(env));
                }

                return(execute(env));
            } catch (QuercusLanguageException e) {
                if (env.getExceptionHandler() != null)
                {
                    try {
                        env.getExceptionHandler().call(env, e.getValue());
                    }
                    catch (QuercusLanguageException e2) {
                        uncaughtExceptionError(env, e2);
                    }
                }
                else
                {
                    uncaughtExceptionError(env, e);
                }

                return(NullValue.NULL);
            } finally {
                env.setPwd(oldPwd);
            }
        }
Example #2
0
 /**
  * Sets the profiling page, if any
  */
 public void setProfilePage(QuercusPage profilePage)
 {
     _profilePage = profilePage;
 }