本文整理了Java中php.runtime.env.Environment.getDefaultBuffer()
方法的一些代码示例,展示了Environment.getDefaultBuffer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.getDefaultBuffer()
方法的具体详情如下:
包路径:php.runtime.env.Environment
类名称:Environment
方法名:getDefaultBuffer
暂无
代码示例来源:origin: jphp-group/jphp
public static void flush(Environment env) throws Throwable {
OutputBuffer root = env.getDefaultBuffer();
if (root != null) {
root.flush();
}
}
代码示例来源:origin: jphp-group/jphp
public void decLock(){
if (isRoot())
lock--;
else
environment.getDefaultBuffer().decLock();
}
代码示例来源:origin: jphp-group/jphp
public void incLock(){
if (isRoot())
lock++;
else
environment.getDefaultBuffer().incLock();
}
代码示例来源:origin: jphp-group/jphp
public static void catchThrowable(Throwable e, Environment environment) {
if (e instanceof BaseBaseException) {
BaseBaseException baseException = (BaseBaseException) e;
baseException.getEnvironment().catchUncaught(baseException);
return;
} else if (e instanceof Exception) {
Environment env = environment == null ? null : environment;
if (env != null) {
try {
env.catchUncaught((Exception) e);
} catch (RuntimeException e2) {
if (env.getDefaultBuffer() == null || env.getDefaultBuffer().getOutput() == null) {
e2.printStackTrace();
} else {
e2.getCause().printStackTrace(new PrintStream(env.getDefaultBuffer().getOutput()));
}
}
return;
}
}
Environment env = environment == null ? null : environment;
if (env != null) {
e.printStackTrace(new PrintStream(env.getDefaultBuffer().getOutput()));
} else {
e.printStackTrace();
}
}
代码示例来源:origin: jphp-group/jphp
public boolean isLock(){
return isRoot() ? lock > 0 : environment.getDefaultBuffer().isLock();
}
代码示例来源:origin: jphp-group/jphp
@Signature(@Arg("callback"))
public Memory onOutput(Environment env, Memory... args) {
if (args[0].isNull()) {
Invoker invoker = Invoker.valueOf(this.environment, null, args[0]);
if (invoker == null) {
env.exception("Argument 1 must be callable in environment");
return Memory.NULL;
}
invoker.setTrace(env.trace());
this.environment.getDefaultBuffer().setCallback(args[0], invoker);
} else {
this.environment.getDefaultBuffer().setCallback(null);
}
return Memory.NULL;
}
代码示例来源:origin: jphp-group/jphp
environment.getDefaultBuffer().setImplicitFlush(true);
代码示例来源:origin: jphp-group/jphp
public static void ob_implicit_flush(Environment env, TraceInfo trace, Memory value){
OutputBuffer root = env.getDefaultBuffer();
switch (value.getRealType()){
case ARRAY:
case STRING:
case OBJECT:
env.warning(trace,
"ob_implicit_flush() expects parameter 1 to be long, " + value.getRealType().toString() + " given"
);
return;
}
if (root != null)
root.setImplicitFlush(value.toBoolean());
}
代码示例来源:origin: jphp-group/jphp
scope = new CompileScope();
env = new ConcurrentEnvironment(scope, System.out);
env.getDefaultBuffer().setImplicitFlush(true);
代码示例来源:origin: jphp-group/jphp
@Signature({
@Arg(value = "parent", nativeType = WrapEnvironment.class, optional = @Optional("NULL")),
@Arg(value = "flags", optional = @Optional(value = "0", type = HintType.INT))
})
public Memory __construct(Environment env, Memory... args){
CompileScope scope = env.scope;
int flags = args[1].toInteger();
boolean hotReload = (flags & HOT_RELOAD) == HOT_RELOAD;
boolean concurrent = (flags & CONCURRENT) == CONCURRENT;
if (hotReload) {
scope = new CompileScope(scope);
}
if (args[0].isNull()) {
if (concurrent)
setEnvironment(new ConcurrentEnvironment(scope, env.getDefaultBuffer().getOutput()));
else
setEnvironment(new Environment(scope, env.getDefaultBuffer().getOutput()));
} else {
if (hotReload)
env.exception("Environment cannot be hot-reloadable with parent");
if (concurrent)
setEnvironment(new ConcurrentEnvironment(args[0].toObject(WrapEnvironment.class).getWrapEnvironment()));
else
setEnvironment(new Environment(args[0].toObject(WrapEnvironment.class).getWrapEnvironment()));
}
return Memory.NULL;
}
代码示例来源:origin: jphp-group/jphp
public JPHPScriptEngine() {
super();
Launcher launcher = new Launcher();
try {
launcher.run(false);
} catch (Throwable e) {
//pass
}
environment = new Environment(launcher.getCompileScope(), System.out);
environment.getDefaultBuffer().setImplicitFlush(true);
JPHPContext ctx = new JPHPContext();
ctx.setBindings(createBindings(), ScriptContext.ENGINE_SCOPE);
setContext(ctx);
put(LANGUAGE_VERSION, __LANGUAGE_VERSION__);
put(LANGUAGE, __LANGUAGE__);
put(ENGINE, __NAME__);
put(ENGINE_VERSION, __ENGINE_VERSION__);
put(NAME, __SHORT_NAME__);
}
代码示例来源:origin: jphp-group/jphp
environment.getErrorReportHandler().onFatal(e);
try {
environment.getDefaultBuffer().flush();
} catch (Throwable throwable) {
throw new RuntimeException(throwable);
内容来源于网络,如有侵权,请联系作者删除!