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

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

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

Environment.getDefaultBuffer介绍

暂无

代码示例

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

  1. public static void flush(Environment env) throws Throwable {
  2. OutputBuffer root = env.getDefaultBuffer();
  3. if (root != null) {
  4. root.flush();
  5. }
  6. }

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

  1. public void decLock(){
  2. if (isRoot())
  3. lock--;
  4. else
  5. environment.getDefaultBuffer().decLock();
  6. }

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

  1. public void incLock(){
  2. if (isRoot())
  3. lock++;
  4. else
  5. environment.getDefaultBuffer().incLock();
  6. }

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

  1. public static void catchThrowable(Throwable e, Environment environment) {
  2. if (e instanceof BaseBaseException) {
  3. BaseBaseException baseException = (BaseBaseException) e;
  4. baseException.getEnvironment().catchUncaught(baseException);
  5. return;
  6. } else if (e instanceof Exception) {
  7. Environment env = environment == null ? null : environment;
  8. if (env != null) {
  9. try {
  10. env.catchUncaught((Exception) e);
  11. } catch (RuntimeException e2) {
  12. if (env.getDefaultBuffer() == null || env.getDefaultBuffer().getOutput() == null) {
  13. e2.printStackTrace();
  14. } else {
  15. e2.getCause().printStackTrace(new PrintStream(env.getDefaultBuffer().getOutput()));
  16. }
  17. }
  18. return;
  19. }
  20. }
  21. Environment env = environment == null ? null : environment;
  22. if (env != null) {
  23. e.printStackTrace(new PrintStream(env.getDefaultBuffer().getOutput()));
  24. } else {
  25. e.printStackTrace();
  26. }
  27. }

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

  1. public boolean isLock(){
  2. return isRoot() ? lock > 0 : environment.getDefaultBuffer().isLock();
  3. }

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

  1. @Signature(@Arg("callback"))
  2. public Memory onOutput(Environment env, Memory... args) {
  3. if (args[0].isNull()) {
  4. Invoker invoker = Invoker.valueOf(this.environment, null, args[0]);
  5. if (invoker == null) {
  6. env.exception("Argument 1 must be callable in environment");
  7. return Memory.NULL;
  8. }
  9. invoker.setTrace(env.trace());
  10. this.environment.getDefaultBuffer().setCallback(args[0], invoker);
  11. } else {
  12. this.environment.getDefaultBuffer().setCallback(null);
  13. }
  14. return Memory.NULL;
  15. }

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

  1. environment.getDefaultBuffer().setImplicitFlush(true);

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

  1. public static void ob_implicit_flush(Environment env, TraceInfo trace, Memory value){
  2. OutputBuffer root = env.getDefaultBuffer();
  3. switch (value.getRealType()){
  4. case ARRAY:
  5. case STRING:
  6. case OBJECT:
  7. env.warning(trace,
  8. "ob_implicit_flush() expects parameter 1 to be long, " + value.getRealType().toString() + " given"
  9. );
  10. return;
  11. }
  12. if (root != null)
  13. root.setImplicitFlush(value.toBoolean());
  14. }

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

  1. scope = new CompileScope();
  2. env = new ConcurrentEnvironment(scope, System.out);
  3. env.getDefaultBuffer().setImplicitFlush(true);

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

  1. @Signature({
  2. @Arg(value = "parent", nativeType = WrapEnvironment.class, optional = @Optional("NULL")),
  3. @Arg(value = "flags", optional = @Optional(value = "0", type = HintType.INT))
  4. })
  5. public Memory __construct(Environment env, Memory... args){
  6. CompileScope scope = env.scope;
  7. int flags = args[1].toInteger();
  8. boolean hotReload = (flags & HOT_RELOAD) == HOT_RELOAD;
  9. boolean concurrent = (flags & CONCURRENT) == CONCURRENT;
  10. if (hotReload) {
  11. scope = new CompileScope(scope);
  12. }
  13. if (args[0].isNull()) {
  14. if (concurrent)
  15. setEnvironment(new ConcurrentEnvironment(scope, env.getDefaultBuffer().getOutput()));
  16. else
  17. setEnvironment(new Environment(scope, env.getDefaultBuffer().getOutput()));
  18. } else {
  19. if (hotReload)
  20. env.exception("Environment cannot be hot-reloadable with parent");
  21. if (concurrent)
  22. setEnvironment(new ConcurrentEnvironment(args[0].toObject(WrapEnvironment.class).getWrapEnvironment()));
  23. else
  24. setEnvironment(new Environment(args[0].toObject(WrapEnvironment.class).getWrapEnvironment()));
  25. }
  26. return Memory.NULL;
  27. }

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

  1. public JPHPScriptEngine() {
  2. super();
  3. Launcher launcher = new Launcher();
  4. try {
  5. launcher.run(false);
  6. } catch (Throwable e) {
  7. //pass
  8. }
  9. environment = new Environment(launcher.getCompileScope(), System.out);
  10. environment.getDefaultBuffer().setImplicitFlush(true);
  11. JPHPContext ctx = new JPHPContext();
  12. ctx.setBindings(createBindings(), ScriptContext.ENGINE_SCOPE);
  13. setContext(ctx);
  14. put(LANGUAGE_VERSION, __LANGUAGE_VERSION__);
  15. put(LANGUAGE, __LANGUAGE__);
  16. put(ENGINE, __NAME__);
  17. put(ENGINE_VERSION, __ENGINE_VERSION__);
  18. put(NAME, __SHORT_NAME__);
  19. }

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

  1. environment.getErrorReportHandler().onFatal(e);
  2. try {
  3. environment.getDefaultBuffer().flush();
  4. } catch (Throwable throwable) {
  5. throw new RuntimeException(throwable);

相关文章