php.runtime.env.Environment.doFinal()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(175)

本文整理了Java中php.runtime.env.Environment.doFinal()方法的一些代码示例,展示了Environment.doFinal()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.doFinal()方法的具体详情如下:
包路径:php.runtime.env.Environment
类名称:Environment
方法名:doFinal

Environment.doFinal介绍

暂无

代码示例

代码示例来源:origin: jphp-group/jphp

  1. @Signature
  2. public Memory __destruct(Environment env, Memory... args) throws Throwable {
  3. environment.doFinal();
  4. return Memory.NULL;
  5. }

代码示例来源:origin: jphp-group/jphp

  1. @Override
  2. public Object eval(ScriptContext context) throws ScriptException {
  3. try {
  4. try {
  5. return module.include(environment);
  6. } catch (Exception e) {
  7. environment.catchUncaught(e);
  8. } catch (Throwable throwable) {
  9. throw new RuntimeException(throwable);
  10. } finally {
  11. try {
  12. environment.doFinal();
  13. } catch (Throwable throwable) {
  14. throw new RuntimeException(throwable);
  15. }
  16. }
  17. } catch (Throwable e) {
  18. throw new ScriptException(new Exception(e));
  19. }
  20. return null;
  21. }

代码示例来源:origin: jphp-group/jphp

  1. environment.doFinal();
  2. } catch (Throwable throwable) {
  3. throw new LaunchException(throwable);

代码示例来源:origin: jphp-group/jphp

  1. @SuppressWarnings("unchecked")
  2. protected Memory includeResource(String name, ArrayMemory globals){
  3. ByteArrayOutputStream output = new ByteArrayOutputStream();
  4. Environment environment;
  5. if (isConcurrent()) {
  6. environment = new ConcurrentEnvironment(newScope(), output);
  7. } else {
  8. environment = new Environment(newScope(), output);
  9. }
  10. File file = new File(Thread.currentThread().getContextClassLoader().getResource("resources/" + name).getFile());
  11. Context context = new Context(file);
  12. JvmCompiler compiler = new JvmCompiler(environment, context, getSyntax(context));
  13. ModuleEntity module = compiler.compile();
  14. environment.getScope().loadModule(module);
  15. try {
  16. environment.registerModule(module);
  17. } catch (Throwable throwable) {
  18. throw new RuntimeException(throwable);
  19. }
  20. if (globals != null)
  21. environment.getGlobals().putAll(globals);
  22. Memory memory = module.includeNoThrow(environment, environment.getGlobals());
  23. try {
  24. environment.doFinal();
  25. } catch (Throwable throwable) {
  26. throw new RuntimeException(throwable);
  27. }
  28. lastOutput = output.toString();
  29. return memory;
  30. }

代码示例来源:origin: jphp-group/jphp

  1. environment.doFinal();
  2. } catch (ErrorException e){
  3. if (withErrors) {

相关文章