From 231c48a57b76038f6021cf605ddea60e684337c0 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Fri, 20 Jan 2017 13:47:34 +0100 Subject: [PATCH 01/75] minor corrections & additions --- .gitignore | 15 ++++++++------- build.gradle | 8 +++----- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 15b53f8..166629e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,12 @@ -.idea +.idea/ *.iml -/dist -/bin -/nbproject -/doc/API -/.classpath +*.lock +dist/ +bin/ +nbproject/ +doc/API/ +.classpath/ +.projectKnowledge/ /server/META-INF/java/JavaProxy.php /server/META-INF/java/Java.inc /server/php/java/bridge/JavaProxy.java @@ -15,4 +17,3 @@ /server/php/java/bridge/JavaInc.java /server/php/java/bridge/LauncherWindows4.java /server/php/java/bridge/PhpDebuggerPHP.java - diff --git a/build.gradle b/build.gradle index f549050..ff5b479 100644 --- a/build.gradle +++ b/build.gradle @@ -1,22 +1,20 @@ group 'io.soluble.php-java-bridge' -version '6.1.11-SNAPSHOT' +version '6.2.11-SNAPSHOT' ant.importBuild 'build.xml' apply plugin: 'java' -sourceCompatibility = 1.7 +sourceCompatibility = 1.8 repositories { mavenCentral() } dependencies { - testCompile group: 'junit', name: 'junit', version: '4.11' + testCompile group: 'junit', name: 'junit', version: '3.8.2' // the project still uses this junit API } clean { dependsOn cleanBuild } - - From a5e586460f2c2a16944ccfeba2c8985cc51ffdec Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Fri, 20 Jan 2017 13:50:30 +0100 Subject: [PATCH 02/75] Revert "minor corrections & additions" This reverts commit 231c48a57b76038f6021cf605ddea60e684337c0. --- .gitignore | 15 +++++++-------- build.gradle | 8 +++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 166629e..15b53f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,10 @@ -.idea/ +.idea *.iml -*.lock -dist/ -bin/ -nbproject/ -doc/API/ -.classpath/ -.projectKnowledge/ +/dist +/bin +/nbproject +/doc/API +/.classpath /server/META-INF/java/JavaProxy.php /server/META-INF/java/Java.inc /server/php/java/bridge/JavaProxy.java @@ -17,3 +15,4 @@ doc/API/ /server/php/java/bridge/JavaInc.java /server/php/java/bridge/LauncherWindows4.java /server/php/java/bridge/PhpDebuggerPHP.java + diff --git a/build.gradle b/build.gradle index ff5b479..f549050 100644 --- a/build.gradle +++ b/build.gradle @@ -1,20 +1,22 @@ group 'io.soluble.php-java-bridge' -version '6.2.11-SNAPSHOT' +version '6.1.11-SNAPSHOT' ant.importBuild 'build.xml' apply plugin: 'java' -sourceCompatibility = 1.8 +sourceCompatibility = 1.7 repositories { mavenCentral() } dependencies { - testCompile group: 'junit', name: 'junit', version: '3.8.2' // the project still uses this junit API + testCompile group: 'junit', name: 'junit', version: '4.11' } clean { dependsOn cleanBuild } + + From 3ac2b7cbdcd9fc9f1cacd474e1f129727a30a98c Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Fri, 20 Jan 2017 13:52:56 +0100 Subject: [PATCH 03/75] correct project version, elevate code compatibiliy, correct junit version --- build.gradle | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index f549050..ff5b479 100644 --- a/build.gradle +++ b/build.gradle @@ -1,22 +1,20 @@ group 'io.soluble.php-java-bridge' -version '6.1.11-SNAPSHOT' +version '6.2.11-SNAPSHOT' ant.importBuild 'build.xml' apply plugin: 'java' -sourceCompatibility = 1.7 +sourceCompatibility = 1.8 repositories { mavenCentral() } dependencies { - testCompile group: 'junit', name: 'junit', version: '4.11' + testCompile group: 'junit', name: 'junit', version: '3.8.2' // the project still uses this junit API } clean { dependsOn cleanBuild } - - From ae145a896c2238405aba1eda5c7485f0f87a8466 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Fri, 20 Jan 2017 13:53:55 +0100 Subject: [PATCH 04/75] minor corrections & additions --- .gitignore | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 15b53f8..166629e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,12 @@ -.idea +.idea/ *.iml -/dist -/bin -/nbproject -/doc/API -/.classpath +*.lock +dist/ +bin/ +nbproject/ +doc/API/ +.classpath/ +.projectKnowledge/ /server/META-INF/java/JavaProxy.php /server/META-INF/java/Java.inc /server/php/java/bridge/JavaProxy.java @@ -15,4 +17,3 @@ /server/php/java/bridge/JavaInc.java /server/php/java/bridge/LauncherWindows4.java /server/php/java/bridge/PhpDebuggerPHP.java - From a326cbaa01bdfc6af13b19eb02480fe111f9153e Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sun, 22 Jan 2017 20:35:24 +0100 Subject: [PATCH 05/75] configure gradle build properties --- build.gradle | 26 ++++++++++++++++++++---- gradle.properties | 1 + gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 gradle.properties diff --git a/build.gradle b/build.gradle index ff5b479..ea18461 100644 --- a/build.gradle +++ b/build.gradle @@ -1,20 +1,38 @@ -group 'io.soluble.php-java-bridge' -version '6.2.11-SNAPSHOT' +group 'io.soluble.pjb' +version '6.2.11' ant.importBuild 'build.xml' apply plugin: 'java' -sourceCompatibility = 1.8 +compileJava.options.encoding = 'UTF-8' +compileTestJava.options.encoding = 'UTF-8' + +sourceCompatibility = 1.7 +targetCompatibility = 1.7 repositories { mavenCentral() } dependencies { + compileOnly group: 'javax.servlet', name: 'servlet-api', version: '2.5' testCompile group: 'junit', name: 'junit', version: '3.8.2' // the project still uses this junit API } +jar { + manifest { + attributes("Main-Class": "io.soluble.pjb.Standalone", + "Implementation-Title": "php-java-bridge.jar", + "Implementation-Version": version) + } +} + clean { - dependsOn cleanBuild + dependsOn genClean } + +compileJava { + dependsOn genAll +} + diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..e110e41 --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +org.gradle.jvmargs='-Dfile.encoding=UTF-8' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f55f0a9..b9e6aae 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip From c8d83d22f7377f23f4d9c86486ca7b9c0409e3f3 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sun, 22 Jan 2017 20:36:10 +0100 Subject: [PATCH 06/75] misc updates --- .gitignore | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 166629e..9a2cd63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,24 @@ .idea/ -*.iml -*.lock +.gradle/ +.projectKnowledge/ +build/ dist/ bin/ +lib/ nbproject/ doc/API/ -.classpath/ -.projectKnowledge/ -/server/META-INF/java/JavaProxy.php -/server/META-INF/java/Java.inc -/server/php/java/bridge/JavaProxy.java -/server/php/java/bridge/LauncherWindows.java -/server/php/java/bridge/LauncherWindows2.java -/server/php/java/bridge/LauncherWindows3.java -/server/php/java/bridge/LauncherUnix.java -/server/php/java/bridge/JavaInc.java -/server/php/java/bridge/LauncherWindows4.java -/server/php/java/bridge/PhpDebuggerPHP.java +server/META-INF/java/JavaProxy.php +server/META-INF/java/Java.inc +server/php/java/bridge/JavaProxy.java +server/php/java/bridge/LauncherWindows.java +server/php/java/bridge/LauncherWindows2.java +server/php/java/bridge/LauncherWindows3.java +server/php/java/bridge/LauncherUnix.java +server/php/java/bridge/JavaInc.java +server/php/java/bridge/LauncherWindows4.java +server/php/java/bridge/PhpDebuggerPHP.java +.classpath +nbbuild.xml +*.iml +*.lock +*.log From c069d954aa7c48013477e6db6b39b119da68c9e8 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sun, 22 Jan 2017 20:37:46 +0100 Subject: [PATCH 07/75] adjust ant targets for generating sources with new project layout --- build.xml | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 94 insertions(+), 6 deletions(-) diff --git a/build.xml b/build.xml index a802cb9..3fe8006 100644 --- a/build.xml +++ b/build.xml @@ -1,5 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -40,7 +127,6 @@ - @@ -285,4 +371,6 @@ depends="JavaBridgeTemplateWar,JavaBridgeWar"> + --> + From a8f5e915ce44d13c484a8261fec669a8cee2902c Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sun, 22 Jan 2017 20:48:00 +0100 Subject: [PATCH 08/75] cleanup --- server/.classpath | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 server/.classpath diff --git a/server/.classpath b/server/.classpath deleted file mode 100644 index 9c3470c..0000000 --- a/server/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - From 471c3ead3c4cd13488df99b239b611530e534b9a Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sun, 22 Jan 2017 20:49:18 +0100 Subject: [PATCH 09/75] remove superfluous package javax.script (included in JRE since 1.6) --- server/javax/script/AbstractScriptEngine.java | 189 ------------ server/javax/script/Bindings.java | 39 --- server/javax/script/Compilable.java | 42 --- server/javax/script/CompiledScript.java | 64 ----- server/javax/script/Invocable.java | 69 ----- server/javax/script/ScriptContext.java | 163 ----------- server/javax/script/ScriptEngine.java | 213 -------------- server/javax/script/ScriptEngineFactory.java | 117 -------- server/javax/script/ScriptEngineManager.java | 270 ------------------ .../javax/script/ScriptEngineManager.java.in | 249 ---------------- server/javax/script/ScriptException.java | 152 ---------- server/javax/script/SimpleBindings.java | 154 ---------- server/javax/script/SimpleScriptContext.java | 266 ----------------- server/javax/script/package.html | 8 - 14 files changed, 1995 deletions(-) delete mode 100644 server/javax/script/AbstractScriptEngine.java delete mode 100644 server/javax/script/Bindings.java delete mode 100644 server/javax/script/Compilable.java delete mode 100644 server/javax/script/CompiledScript.java delete mode 100644 server/javax/script/Invocable.java delete mode 100644 server/javax/script/ScriptContext.java delete mode 100644 server/javax/script/ScriptEngine.java delete mode 100644 server/javax/script/ScriptEngineFactory.java delete mode 100644 server/javax/script/ScriptEngineManager.java delete mode 100644 server/javax/script/ScriptEngineManager.java.in delete mode 100644 server/javax/script/ScriptException.java delete mode 100644 server/javax/script/SimpleBindings.java delete mode 100644 server/javax/script/SimpleScriptContext.java delete mode 100644 server/javax/script/package.html diff --git a/server/javax/script/AbstractScriptEngine.java b/server/javax/script/AbstractScriptEngine.java deleted file mode 100644 index a0bee54..0000000 --- a/server/javax/script/AbstractScriptEngine.java +++ /dev/null @@ -1,189 +0,0 @@ -package javax.script; - -import java.io.Reader; - -/** - * GenericScriptEngine is an abstarct class which implements the ScriptEngine - * interface and it contains default implementations for several eval() methods. - * - * @author Nandika Jayawardana - * @author Sanka Samaranayake - */ -public abstract class AbstractScriptEngine implements ScriptEngine { - - private ScriptContext ctx; - - /** - * Constructs a ScriptEngine using an uninitialized - * SimpleNamespace. - */ - public AbstractScriptEngine() { - ctx = new SimpleScriptContext(); - } - - /** - * Constructs a ScriptEngine using the specified namespace as its - * ENGINE_SCOPE. - * - * @param namespace the namespace to be used as the ENGINE_SCOPE - */ - public AbstractScriptEngine(Bindings namespace) { - this(); - ctx.setBindings(namespace, ScriptContext.ENGINE_SCOPE); - } - - /** - * Set a new context. - * - * @param ctx The context - */ - public void setContext(ScriptContext ctx) { - this.ctx = ctx; - } - - /** - * Return the script context. - * - * @return The script context. - */ - public ScriptContext getContext() { - return ctx; - } - - /** - * Evaluates a piece of script obtained using the specified - * reader as the script source. Returns null for non-returning - * scripts. - * - * @param reader the reader form which the script is obtained - * @return the value of the evaluated script - * @throws ScriptException if an error occurs - */ - public Object eval(Reader reader) throws ScriptException { - return eval(reader, ctx); - } - - /** - * Evaluates a piece of scripts obtained using a reader as the - * script source and using the specified namespace as the - * SCRIPT_SCOPE. Returns null for non-returning scripts. - * - * @param reader the reader from which the script is obtained - * @param nameSpace the namespace to be used as SCRIPT_SCOPE - * @return the value of the evaluated script - * @throws ScriptException if an error occurs - */ - public Object eval(Reader reader, Bindings nameSpace) - throws ScriptException { - return eval(reader, ctx); - } - - /** - * Evaluates a piece of script and returns the resultant object. - * Returns null for non-returning scripts. - * - * @param script the String representation of the script - * @return the value of the evaluated script - * @throws ScriptException if an error occurs - */ - public Object eval(String script) throws ScriptException { - return eval(script, ctx); - } - - /** - * Evaluates a piece of script using the specified namespace as - * its SCRIPT_SCOPE. Returns null for non-returning scripts. - * - * @param script the String representation of the script - * @param nameSpace the namespace to be used as the SCRIPT_SCOPE - * @return the value of the evaluated script - * @throws ScriptException if an error occurs - */ - public Object eval(String script, Bindings nameSpace) throws ScriptException { - return eval(script, getScriptContext(nameSpace)); - } - - /** - * Retrieves the associated value with the specified key - * ScriptEngine namespace. Returns null if no such value exists. - * - * @param key the associated key of the value - * @return the value associated with the specified key in - * ScriptEngine namespace - */ - public Object get(String key) { - return getBindings(ScriptContext.ENGINE_SCOPE).get(key); - } - - /** - * Retrieves a reference to the associated namespace for the - * specified level of scope. - * - * @param scope the specified level of scope - * @return associated namespace for the specified level of scope - * @throws IllegalArgumentException if the scope is invalid - */ - public Bindings getBindings(int scope) { - return ctx.getBindings(scope); - } - - - /** - * Retrieves an instance of ScriptContext with namespaces - * associated with all the level of scopes and the specified - * namespace associated with SCRIPT_SCOPE. - * - * @param namespace the namespace to be associated with - * SCRIPT_SCOPE - * @return an instance of ScriptContext with all namespaces of - * all scopes - */ - protected ScriptContext getScriptContext(Bindings namespace) { - - ScriptContext scriptContext = new SimpleScriptContext(); - - if (namespace == null) namespace = createBindings(); - scriptContext.setBindings(namespace, ScriptContext.ENGINE_SCOPE); - scriptContext.setBindings(ctx.getBindings(ScriptContext.GLOBAL_SCOPE), - ScriptContext.GLOBAL_SCOPE); - - return scriptContext; - } - - /** - * Associates a key and a value in the ScriptEngine namespace. - * - * @param key String value which uniquely identifies the value - * @param value value which is to be associated with the - * specified key - * @throws IllegalArgumentException if the key is null - */ - public void put(String key, Object value) { - if (key == null) { - throw new IllegalArgumentException("invalid scope"); - } - getBindings(ScriptContext.ENGINE_SCOPE).put(key, value); - } - - /** - * Associates a namespace with a specified level of scope. - * - * @param namespace the namespace to be associated with specified scope - * @param scope the level of scope of the specified namespace - * @throws UnsupportedOperationException - * @throws IllegalArgumentException if scope is invalid - */ - public void setBindings(Bindings namespace, int scope) - throws UnsupportedOperationException { - switch (scope) { - case ScriptContext.ENGINE_SCOPE: - ctx.setBindings(namespace, ScriptContext.ENGINE_SCOPE); - break; - case ScriptContext.GLOBAL_SCOPE: - ctx.setBindings(namespace, ScriptContext.GLOBAL_SCOPE); - break; - default: - throw new IllegalArgumentException("invalid scope"); - } - } -} diff --git a/server/javax/script/Bindings.java b/server/javax/script/Bindings.java deleted file mode 100644 index 044dc7d..0000000 --- a/server/javax/script/Bindings.java +++ /dev/null @@ -1,39 +0,0 @@ -package javax.script; - -import java.util.Map; - -/** - * Namespace is an interface which exposes a collectoin of key-value - * pairs. - * - * @author Nandika Jayawardana - * @author Sanka Samaranayake - */ -public interface Bindings extends Map { - - /** - * Associates the specified value with the specified key in a - * java.util.Map. If the map previously contained a mapping for - * this key, the old value is replaced. - * - * @param key the String value which uniquely identifies the - * object - * @param value the object to be stored. - * @return The old value - * @throws IllegalArgumentException if the key is null not an - * instance of java.lang.String - */ - public Object put(Object key, Object value) throws IllegalArgumentException; - - - /** - * Copies all of the mappings from the specified map to this map. - * These mappings will replace any mappings that this map had for - * any of the keys currently in the specified map. - * - * @param toMerge mappings to be stored in the map. - * @throws IllegalArgumentException if a key is null or is not an - * instance of java.lang.String - */ - public void putAll(Map toMerge) throws IllegalArgumentException; -} diff --git a/server/javax/script/Compilable.java b/server/javax/script/Compilable.java deleted file mode 100644 index 6ab48fd..0000000 --- a/server/javax/script/Compilable.java +++ /dev/null @@ -1,42 +0,0 @@ -package javax.script; - -import java.io.Reader; - -/** - * Compilable -- an optional interface contains methods which support - * the re-execution of intermediate code retained from previous - * script compilations. - * - * @author Nandika Jayawardana - * @author Sanka Samaranayake - */ -public interface Compilable { - - /** - * Retrieves a CompileScript implementation for the given piece - * of script which is a abstraction for the intermediate code - * produced by the compilation. - * - * @param script the source of the script represented as String - * @return an implementation of CompileScript which can be used - * to re-execute intermediate code produced by the - * compilation of script - * @throws ScriptException if the compilation fials due to any - * reason - */ - public CompiledScript compile(String script) throws ScriptException; - - /** - * Retrieves a CompileScript implementation for the script - * obtained using java.io.Reader as the script source. - * - * @param reader the reader form which the script source is - * obtained - * @return an implementation of CompileScript which can be used - * to re-execute intermediate code produced by the - * compilation of script - * @throws ScriptException if the compilation fials due to any - * reason - */ - public CompiledScript compile(Reader reader) throws ScriptException; -} \ No newline at end of file diff --git a/server/javax/script/CompiledScript.java b/server/javax/script/CompiledScript.java deleted file mode 100644 index 2e41617..0000000 --- a/server/javax/script/CompiledScript.java +++ /dev/null @@ -1,64 +0,0 @@ - -package javax.script; - -/** - * ComplieScript interface is an abstraction for the intermediate - * code produced by the compilation and contains methods which allow - * the re-execution of the intermediate code retained. - * - * @author Nandika Jayawardana - * @author Sanka Samaranayake - */ -public abstract class CompiledScript { - - public CompiledScript() { - } - - /** - * Re-evaluates the pre-compiled script - * - * @return resultant object after the re-evaluation - * @throws ScriptException if the re-evaluation fails due to any - * reason - */ - public Object eval() throws ScriptException { - return eval(getEngine().getContext()); - } - - /** - * Re-evaluates the pre-compiled script using the specified - * namespace as the SCRIPT_SCOPE and using ENGINE_SCOPE, - * GLOBAL_SCOPE of the associated ScriptEngine. - * - * @param namespace the namespace to be used as the SCRIPT_SCOPE - * @return resultant object after the re-evaluation - * @throws ScriptException if the re-evaluation fails due to any - * reason - */ - public Object eval(Bindings namespace) throws ScriptException { - getEngine().getContext().setBindings(namespace, ScriptContext.ENGINE_SCOPE); - return eval(getEngine().getContext()); - } - - /** - * Re-evaluates the recompiled script using the specified - * ScriptContext. - * - * @param context A ScriptContext to be used in the re-evalution - * of the script - * @return resultant object after the re-evaluation - * @throws ScriptException if the re-evaluation fails due to any - * reason - */ - public abstract Object eval(ScriptContext context) throws ScriptException; - - /** - * Retrieves a reference to the ScriptEngine whose methods - * created this CompiledScript object. - * - * @return the ScriptEngine which created this CompiledScript - * object - */ - public abstract ScriptEngine getEngine(); - -} diff --git a/server/javax/script/Invocable.java b/server/javax/script/Invocable.java deleted file mode 100644 index 96fd03f..0000000 --- a/server/javax/script/Invocable.java +++ /dev/null @@ -1,69 +0,0 @@ - -package javax.script; - -/** - * The Invocable interface (optional) contains methods which allow - * the Java application to invoke intermediate codes in the - * underlying scripting interpreter. - * - * @author Nandika Jayawardana - * @author Sanka Samaranayake - */ -public interface Invocable { - - /** - * Invokes a scripting procedure with the given name using the - * array of objects as its arguments set. - * - * @param methodName name of the scripting procedure - * @param args arguments set for the scripting procedure - * @return resultant object after the execution of the procedure - * @throws ScriptException if the invocation of the scripting procedure - * fails - * @throws NoSuchMethodException - */ - public Object invokeFunction(String methodName, Object[] args) - throws ScriptException, NoSuchMethodException; - - /** - * Invokes a procedure on an object which already defined in the - * script using the array of objects as its arguments set. - * - * @param methodName name of the procedure to be invoked - * @param thiz object on which the procedure is called - * @param args arguments set for the procedure - * @return resultant object after the execution of the - * procedure - * @throws ScriptException if the invocation of the procedure - * fails - * @throws NoSuchMethodException - */ - public Object invokeMethod(Object thiz, String methodName, Object[] args) throws - ScriptException, NoSuchMethodException; - - /** - * Retrieves an instance of java class whose methods are - * impelemented using procedures in script which are in the - * intermediate code repository in the underlying interpreter. - * - * @param thiz object on which the procedure is called - * @param clasz an interface which the returned class must - * implement - * @return an instance of the class which implement the specified - * interface - */ - public Object getInterface(Object thiz, Class clasz); - - /** - * Retrieves an instance of java class whose methods are - * impelemented using procedures in script which are in the - * intermediate code repository in the underlying interpreter. - * - * @param clasz an interface which the returned class must - * implement - * @return an instance of the class which implement the specified - * interface - */ - public Object getInterface(Class clasz); - -} \ No newline at end of file diff --git a/server/javax/script/ScriptContext.java b/server/javax/script/ScriptContext.java deleted file mode 100644 index 1067589..0000000 --- a/server/javax/script/ScriptContext.java +++ /dev/null @@ -1,163 +0,0 @@ - -package javax.script; - -import java.io.Reader; -import java.io.Writer; -import java.util.List; - -/** - * The ScriptContext interface exposes the key-value pairs in various - * scopes. - * - * @author Nandika Jayawardana - * @author Sanka Samaranayake - */ -public interface ScriptContext { - - /** - * defines an integer for the level of scope, ENGINE_SCOPE - */ - public static final int ENGINE_SCOPE = 100; - - /** - * defines an integer for the level of scope, GLOBAL_SCOPE - */ - public static final int GLOBAL_SCOPE = 200; - - /** - * Retrieves the value of the getAttribute(String, int) for the - * lowest scope in which it returns a non-null value. Returns - * null if there is no such value exists in any scope. - * - * @param name the name of the attribute - * @return the associated value with the specified name - * @throws IllegalArgumentException if the name is null - */ - public Object getAttribute(String name) throws IllegalArgumentException; - - /** - * Retrieves the value of an attribute in the specified scope. - * Returns null if the no such value exists in the specified - * scope. - * - * @param name the name of the attribute - * @param scope the value of the scope - * @return the associated value for the specified name - * @throws IllegalArgumentException if the name is null or the - * scope is invalid - */ - public Object getAttribute(String name, int scope) throws - IllegalArgumentException; - - /** - * Retrieves the lowest value of the scope for which the - * attribute is defined. - * - * @param name the name of attribute - * @return the value corresponding to lowest value of the scope - * or -1 if no associated value exist in any scope - */ - public int getAttributesScope(String name); - - /** - * Retrieves the Namespace instance associated with the gieve - * scope. Returns null if no namespace is assoicited with - * specified level of scope. - * - * @param scope the level of the scope - * @return the Namespace associated with the specified levle of - * scope - */ - public Bindings getBindings(int scope); - - /** - * Removes the given attribute form the specified scope. Returns - * the removed object or null if no value is associated with the - * specified key in specified level of scope. - * - * @param name the name of the attribute - * @param scope the level of scope which inherit the attribute - * @return previous value associated with specified name - * @throws IllegalArgumentException if the name is null or if the - * scope is invalid - */ - public Object removeAttribute(String name, int scope) throws - IllegalArgumentException; - - /** - * Associates a specified value with the specifed name in the - * specified scope. - * - * @param key the name of the attribute - * @param value the value of the attribute - * @param scope the level of the scope - * @throws IllegalArgumentException if the name is null or the - * scope is invalid - */ - public void setAttribute(String key, Object value, int scope) throws - IllegalArgumentException; - - /** - * Associates the specified namespace with the specified scope. - * - * @param namespace the namespace to be associated with the - * specified level of scope - * @param scope the specified level of scope - * @throws IllegalArgumentException if the scope is invalid - */ - public void setBindings(Bindings namespace, int scope) throws - IllegalArgumentException; - - /** - * Returns the Writer for scripts to use when displaying output. - * - * @return The Writer. - */ - public Writer getWriter(); - - - /** - * Returns the Writer used to display error output. - * - * @return The Writer - */ - public Writer getErrorWriter(); - - /** - * Sets the Writer for scripts to use when displaying output. - * - * @param writer The new Writer. - */ - public void setWriter(Writer writer); - - /** - * Sets the Writer used to display error output. - * - * @param writer The Writer. - */ - public void setErrorWriter(Writer writer); - - /** - * Returns a Reader to be used by the script to read - * input. - * - * @return The Reader. - */ - public Reader getReader(); - - /** - * Sets the Reader for scripts to read input - * . - * - * @param reader The new Reader. - */ - public void setReader(Reader reader); - - /** - * Returns immutable List of all the valid values for - * scope in the ScriptContext. - * - * @return list of scope values - */ - public List getScopes(); -} diff --git a/server/javax/script/ScriptEngine.java b/server/javax/script/ScriptEngine.java deleted file mode 100644 index 44e170c..0000000 --- a/server/javax/script/ScriptEngine.java +++ /dev/null @@ -1,213 +0,0 @@ - -package javax.script; - -import java.io.Reader; - -/** - * The ScriptEngine interfaces contains only the methods which are expected to - * be fully functional in every Java ScriptEngine. - * - * @author Nandika Jayawardana - * @author Sanka Samaranayake - */ -public interface ScriptEngine { - - /** - * Reserved key associated with an object array which is used to - * pass set of positional parameters to the ScriptEngines. - */ - public static final String ARGV = "javax.script.argv"; - - /** - * Reserved key associated with name of the file which contains - * the source of the script. - */ - public static final String FILENAME = "javax.script.filename"; - - /** - * Reserved key associated with the name of the Java - * ScriptEngine - */ - public static final String ENGINE = "javax.script.engine"; - - /** - * Reserved key associated with the version of the Java - * ScriptEngine - */ - public static final String ENGINE_VERSION = "javax.script.engine.version"; - - /** - * Reserved key associated with the name of the supported - * scripting language - */ - public static final String LANGUAGE = "javax.script.language"; - - /** - * Reserved key associated with the version of the supported - * scripting language - */ - public static final String LANGUAGE_VERSION = "javax,script.language_version"; - - /** - * Reserved key associated with the named value which identifies - * the short name of the supported language - */ - public static final String NAME = "javax.script.name"; - - /** - * Retrieves an uninitailized namespace which can be used as the scope of - * the ScriptEngine. - * - * @return an initialzed namespace which can be used to repalce the state - * of the ScriptEngine - */ - public Bindings createBindings(); - - /** - * Evaluates a piece of script obtained using the specified - * reader as the script source. Returns null for non-returning - * scripts. - * - * @param reader the source of the script - * @return the value of the evaluated script - * @throws ScriptException if an error occurs - */ - public Object eval(Reader reader) throws ScriptException; - - /** - * Evaluates a piece of scripts obtained using a reader as the - * script source and using the specified namespace as the - * SCRIPT_SCOPE. Returns null for non-returning scripts. - * - * @param reader the script source used to obtained the script - * @param namespace the namespace to be used as SCRIPT_SCOPE - * @return the value of the evaluated script - * @throws ScriptException if an error occurs - */ - public Object eval(Reader reader, Bindings namespace) - throws ScriptException; - - /** - * Evaluates a script obtained using the specified reader as the - * script source and using the namespaces in the specifed - * ScriptContext. Returns null for non-returning scripts - * - * @param reader the script source - * @param context the context contianing different namespace for - * script evaluation - * @return the value of the evaluated script - * @throws ScriptException if an error occurs - */ - public Object eval(Reader reader, ScriptContext context) - throws ScriptException; - - /** - * Evaluates a piece of script and returns the resultant object. - * Returns null for non-returning scripts. - * - * @param script the String representation of the script - * @return the value of the evaluated script - * @throws ScriptException if an error occurs - */ - public Object eval(String script) throws ScriptException; - - /** - * Evaluates a piece of script using the specified namespace as - * the SCRIPT_SCOPE. Retruns null for non-returning scripts. - * - * @param script the String representation of the script - * @param namespace the namespace to be used as the SCRIPT_SCOPE - * @return the value of the evaluated script - * @throws ScriptException if an error occurs - */ - public Object eval(String script, Bindings namespace) - throws ScriptException; - - /** - * Evaluates a script using the namespaces in the specifed - * ScriptContext. Return null for non-returning scripts. - * - * @param script the String representation of the script - * @param context tbe ScriptContext containing namespaces for the - * script evaluation - * @return the value of the evaluated script - * @throws ScriptException if an error occurs - */ - public Object eval(String script, ScriptContext context) - throws ScriptException; - - /** - * Retrieves the value which is associated with the specified key - * in the state of the ScriptEngine. - * - * @param key the key associated with value. - * @return an object value which is associated with the key - */ - public Object get(String key); - - /** - * Retrieves a ScriptEngineFactory for the class to which - * describes the underlying ScriptEngine. - * - * @return an instance of ScriptEngineFactory which describes the - * underlying ScriptEngine - */ - public ScriptEngineFactory getFactory(); - - /** - * Retrieves a reference to the associated namespace for the - * specified level of scope. - *

- * Possible scopes are: - *

- * GLOBAL_SCOPE : - * if the ScriptEngine was created by ScriptingEngineManager - * then GLOBAL_SCOPE of it is returned (or null if there is no - * GLOBAL_SCOPE stored in the ScriptEngine). - *

- * ENGINE_SCOPE : - * the set of key-value pairs stored in the ScriptEngine is - * returned. - * - * @param scope the specified level of scope - * @return associated namespace for the specified level of scope - * @throws IllegalArgumentException if the scope is invalid - */ - public Bindings getBindings(int scope) throws IllegalArgumentException; - - /** - * Associates a key and a value in the ScriptEngine namespace. - * - * @param key the specified key associated with the value - * @param value value which is to be associated with the - * specified key - * @throws IllegalArgumentException if the key is null - */ - public void put(String key, Object value) throws IllegalArgumentException; - - /** - * Associates the specified namespace with the specified level of - * scope. - * - * @param namespace namespace to be associated with the specified - * level of scope - * @param scope level of scope for which the namespace should - * be associated with - * @throws IllegalArgumentException if the scope is invalid - */ - public void setBindings(Bindings namespace, int scope) throws - IllegalArgumentException; - - - /** - * @return the default ScriptContext. - */ - public ScriptContext getContext(); - - /** - * Set the default ScriptContext - * - * @param ctx The context - */ - public void setContext(ScriptContext ctx); -} diff --git a/server/javax/script/ScriptEngineFactory.java b/server/javax/script/ScriptEngineFactory.java deleted file mode 100644 index 42c9747..0000000 --- a/server/javax/script/ScriptEngineFactory.java +++ /dev/null @@ -1,117 +0,0 @@ - -package javax.script; - -import java.util.List; - -/** - * ScriptEngineFactory is used to describe a ScriptEngine instance. - * Each ScriptEngine class implementing ScriptEngine has a - * corresponding factory which exposes metadata describing the engine - * class. - *

- * Nandika Jayawardana - * Sanka Samaranayake - */ -public interface ScriptEngineFactory { - - /** - * Retrieves the full name of the ScriptEngine. - * - * @return the name of the Script Engine - */ - public String getEngineName(); - - /** - * Retrieves the version of the Script Engine. - * - * @return the version of the Script Engine - */ - public String getEngineVersion(); - - /** - * Retrieves the name of the language supported by the - * ScriptEngine. - * - * @return the name of the supported language - */ - public String getLanguageName(); - - /** - * Retrieves the version of the language supported by the - * ScriptEngine. - * - * @return the version of the supported language - */ - public String getLanguageVersion(); - - /** - * Retrieves an array of Strings which are file extensions - * tipically used for files containing scripts written in the - * language supported by the ScriptEngine. - * - * @return string array of supported file extensions - */ - public List getExtensions(); - - /** - * Retrieves an array of Strings containing MIME types describing - * the content which can be processed using the Script Engine. - * - * @return string array of MIME types - */ - public List getMimeTypes(); - - /** - * Retrieves an array of short descriptive names such as - * {"javascript", "rhino"} describing the language supported by - * the Script Engine. - * - * @return an array of short descriptive names describing the - * language supported by the ScriptEngine - */ - public List getNames(); - - /** - * Retrieves an associated value for the specified key. Returns - * null if the ScriptEngine does not have an associated value for - * the key. - * - * @param key The key - * @return associated value for the specified key - */ - public Object getParameter(String key); - - /** - * Retrieves an instance of the associated ScriptEngine. - * - * @return an instance of the associated ScriptEngine - */ - public ScriptEngine getScriptEngine(); - - /** - * Return a syntax string for method calls - * - * @param obj The call object - * @param m The methods - * @param args The arguments - * @return A syntax string - */ - public String getMethodCallSyntax(String obj, String m, String[] args); - - /** - * Return the output syntax - * - * @param toDisplay The output string - * @return the output syntax - */ - public String getOutputStatement(String toDisplay); - - /** - * Return the program syntax - * - * @param statements The statement sequence - * @return The program syntax - */ - public String getProgram(String[] statements); - -} diff --git a/server/javax/script/ScriptEngineManager.java b/server/javax/script/ScriptEngineManager.java deleted file mode 100644 index 6ee24f9..0000000 --- a/server/javax/script/ScriptEngineManager.java +++ /dev/null @@ -1,270 +0,0 @@ - -package javax.script; - - -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - - -/** - * ScriptEngineManager implements a discovery and instantiation - * mechanisams for ScriptEngine class. It also contains a collection - * of key-value pairs which storing state shared by all engines - * created by manager. - *

- * Nandika Jayawardana - * Sanka Samaranayake - */ -public class ScriptEngineManager { - - /** - * Stores all instances of classes which implements - * ScriptEngineFactory which are found in resources - * META-INF/services/javax.script.ScriptEngineFactory - */ - protected HashSet engineSpis = new HashSet(); - - /** - * Stores language names with an associated - * ScriptEngineFactory - */ - protected HashMap nameAssociations = new HashMap(); - - /** - * Stores file extensions with an associated - * ScriptEngineFactory - */ - protected HashMap extensionAssocitions = new HashMap(); - - /** - * Stores MIME types with an associated ScriptEngineFactory - */ - protected HashMap mimeTypeAssociations = new HashMap(); - - /** - * Stores the namespace associated with GLOBAL_SCOPE - */ - protected Bindings globalscope = new SimpleBindings(); - - private Iterator getServiceProviders() { - Iterator i = null; - try { - Class c = Class.forName("gnu.classpath.ServiceFactory"); - Method m = c.getMethod("lookupProviders", new Class[]{java.lang.Class.class}); - try { - m.setAccessible(true); - } catch (Throwable tt) {/*ignore*/} - i = (Iterator) m.invoke(c, new Object[]{ScriptEngineFactory.class}); - } catch (Throwable ex) {/*ignore*/} - if (i != null) return i; - try { - Class c = Class.forName("sun.misc.Service"); - Method m = c.getMethod("providers", new Class[]{java.lang.Class.class}); - try { - m.setAccessible(true); - } catch (Throwable tt) {/*ignore*/} - i = (Iterator) m.invoke(c, new Object[]{ScriptEngineFactory.class}); - } catch (Throwable ex) {/*ignore*/} - return i; - } - - /** - * Constructs ScriptEngineManager and initializes it. - */ - public ScriptEngineManager() { - - Iterator iterator = getServiceProviders(); - - while (iterator.hasNext()) { - ScriptEngineFactory factory = (ScriptEngineFactory) iterator.next(); - engineSpis.add(factory); - - String[] data = (String[]) factory.getNames().toArray(new String[]{}); - // gets all descriptinve names for Scripting Engine - for (int i = 0; i < data.length; i++) { - nameAssociations.put(data[i], factory); - } - // gets all supported extensions - data = (String[]) factory.getExtensions().toArray(new String[]{}); - for (int i = 0; i < data.length; i++) { - extensionAssocitions.put(data[i], factory); - } - // gets all supported MIME types - data = (String[]) factory.getMimeTypes().toArray(new String[]{}); - for (int i = 0; i < data.length; i++) { - mimeTypeAssociations.put(data[i], factory); - } - } - } - - /** - * Retrieves the associated value for the spefied key in the - * GLOBAL_SCOPE - * - * @param key the associated key of the value stored in the - * GLOBAL_SCOPE - * @return the value associated with the specifed key - */ - public Object get(String key) { - return globalscope.get(key); - } - - /** - * Retrieves a new instance of a ScriptingEngine for the - * specified extension of a scirpt file. Returns null if no - * suitable ScriptingEngine is found. - * - * @param extension the specified extension of a script file - * @return a new instance of a ScriptingEngine which supports the - * specified script file extension - */ - public ScriptEngine getEngineByExtension(String extension) { - - ScriptEngine engine = null; - - ScriptEngineFactory factory = - (ScriptEngineFactory) extensionAssocitions.get(extension); - - if (factory != null) { - // gets a new instance of the Scripting Engine - engine = factory.getScriptEngine(); - // sets the GLOBAL SCOPE - engine.setBindings(globalscope, ScriptContext.GLOBAL_SCOPE); - } - - return engine; - } - - /** - * Retrieves new instance the ScriptingEngine for a specifed MIME - * type. Returns null if no suitable ScriptingEngine is found. - * - * @param mimeType the specified MIME type - * @return a new instance of a ScriptingEngine which supports the - * specified MIME type - */ - public ScriptEngine getEngineByMimeType(String mimeType) { - - ScriptEngine engine = null; - ScriptEngineFactory factory = - (ScriptEngineFactory) mimeTypeAssociations.get(mimeType); - - if (factory != null) { - // gets a new instance of the Scripting Engine - engine = factory.getScriptEngine(); - // sets the GLOBAL SCOPE - engine.setBindings(globalscope, ScriptContext.GLOBAL_SCOPE); - } - - return engine; - } - - /** - * Retrieves a new instance of a ScriptEngine the specified - * descriptieve name. Returns null if no suitable ScriptEngine is - * found. - * - * @param name the descriptive name - * @return a new instance of a ScriptEngine which supports the - * specifed descriptive name - */ - public ScriptEngine getEngineByName(String name) { - - ScriptEngine engine = null; - ScriptEngineFactory factory = - (ScriptEngineFactory) nameAssociations.get(name); - - if (factory != null) { - engine = factory.getScriptEngine(); - engine.setBindings(globalscope, ScriptContext.GLOBAL_SCOPE); - } - - return engine; - } - - /** - * Retrieves an array of instances of ScriptEngineFactory class - * which are found by the discovery mechanism. - * - * @return an array of all discovered ScriptEngineFactory - * instances - */ - public List getEngineFactories() { - return Collections.unmodifiableList(Arrays.asList(engineSpis.toArray())); - } - - /** - * Retrieves the namespace corresponds to GLOBAL_SCOPE. - * - * @return the namespace of GLOBAL_SCOPE - */ - public Bindings getBindings() { - return globalscope; - } - - /** - * Associates the specifed value with the specified key in - * GLOBAL_SCOPE. - * - * @param key the associated key for specified value - * @param value the associated value for the specified key - */ - public void put(String key, Object value) { - globalscope.put(key, value); - } - - /** - * Register a extension with a ScriptEngineFactory class. It - * overrides any such association discovered previously. - * - * @param extension the extension associated with the specified - * ScriptEngineFactory class - * @param factory the ScriptEngineFactory class associated with - * the specified extension - */ - public void registerEngineExtension(String extension, Class factory) { - extensionAssocitions.put(extension, factory); - } - - /** - * Registers descriptive name with a ScriptEngineFactory class. - * It overrides any associations discovered previously. - * - * @param name a descriptive name associated with the specifed - * ScriptEngineFactory class - * @param factory the ScriptEngineFactory class associated with - * the specified descriptive name - */ - public void registerEngineName(String name, Class factory) { - nameAssociations.put(name, factory); - } - - /** - * Registers a MIME type with a ScriptEngineFactory class. It - * overrides any associations discovered previously. - * - * @param mimeType the MIME type associated with specified - * ScriptEngineFactory class - * @param factory the ScriptEngineFactory associated with the - * specified MIME type - */ - public void registerEngineMimeType(String mimeType, Class factory) { - mimeTypeAssociations.put(mimeType, factory); - } - - /** - * Sets the GLOBAL_SCOPE value to the specified namespace. - * - * @param namespace the namespace to be stored in GLOBAL_SCOPE - */ - public void setBindings(Bindings namespace) { - globalscope = namespace; - } - - -} diff --git a/server/javax/script/ScriptEngineManager.java.in b/server/javax/script/ScriptEngineManager.java.in deleted file mode 100644 index 112c683..0000000 --- a/server/javax/script/ScriptEngineManager.java.in +++ /dev/null @@ -1,249 +0,0 @@ - -package javax.script; - - -import gnu.classpath.ServiceFactory; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; - - -/** - * ScriptEngineManager implements a discovery and instantiation - * mechanisams for ScriptEngine class. It also contains a collection - * of key-value pairs which storing state shared by all engines - * created by manager. - * - * Nandika Jayawardana - * Sanka Samaranayake - */ -public class ScriptEngineManager { - /** - * GNU java needs ServiceFactory, sun java needs sun.mist.Service - */ - private static final boolean GNU_JAVA=@GNU_JAVA@; - - /** Stores all instances of classes which implements - * ScriptEngineFactory which are found in resources - * META-INF/services/javax.script.ScriptEngineFactory - */ - protected HashSet engineSpis = new HashSet(); - - /** - * Stores language names with an associated - * ScriptEngineFactory - */ - protected HashMap nameAssociations = new HashMap(); - - /** - * Stores file extensions with an associated - * ScriptEngineFactory - */ - protected HashMap extensionAssocitions = new HashMap(); - - /** Stores MIME types with an associated ScriptEngineFactory */ - protected HashMap mimeTypeAssociations = new HashMap(); - - /** Stores the namespace associated with GLOBAL_SCOPE */ - protected Bindings globalscope = new SimpleBindings(); - /** - * Constructs ScriptEngineManager and initializes it. - */ - public ScriptEngineManager() { - - Iterator iterator = null; - if(!GNU_JAVA) { - iterator = sun.misc.Service.providers(ScriptEngineFactory.class); - } else { - iterator = ServiceFactory.lookupProviders(ScriptEngineFactory.class); - } - - while (iterator.hasNext()) { - ScriptEngineFactory factory = (ScriptEngineFactory) iterator.next(); - engineSpis.add(factory); - - String[] data = factory.getNames(); - // gets all descriptinve names for Scripting Engine - for (int i=0; i - * @author Sanka Samaranayake - */ -public class ScriptException extends Exception { - - /** - * - */ - private static final long serialVersionUID = 3689065132168917297L; - - /** - * Stroes the file name of the script - */ - protected String fileName = null; - - /** - * Stores the line number of the script in which the error has - * occured - */ - protected int lineNumber = -1; - - /** - * Stores the column number of the script in which the error has - * occured - */ - protected int columnNumber = -1; - - /** - * Stores the message which describes the cause of error - */ - protected String message; - - /** - * Constructs a new exception with the specified cause. - * - * @param exception the cause of exception - */ - public ScriptException(Exception exception) { - super(exception); - } - - /** - * Constructs a new exception with the specified detailed - * message. - * - * @param message the datailed message which caused the - * exception - */ - public ScriptException(String message) { - super(message); - this.message = message; - } - - /** - * Constructs a new exception with the spcified detailed message - * of cause, the file name of the source of script and the line - * number of the script where the error has occured. - * - * @param message the detailed message of cause of exception - * @param fileName the file name which contains the script - * @param lineNumber the line number of the script where the error has - * occured - */ - public ScriptException(String message, String fileName, int lineNumber) { - super(message); - this.message = message; - this.fileName = fileName; - this.lineNumber = lineNumber; - } - - /** - * Constructs a new exception using the detailed message of - * cause, file name which contains the script, line number and - * column number in which the error has occured. - * - * @param message the detailed message of the cause of - * exception - * @param fileName the name of the file which contains the - * script - * @param lineNumber the line number of the script where the - * error has occured - * @param columnNumber the column number of the script where the - * error has occured - */ - public ScriptException(String message, String fileName, int lineNumber, int columnNumber) { - super(message); - this.message = message; - this.fileName = fileName; - this.lineNumber = lineNumber; - this.columnNumber = columnNumber; - } - - /** - * Retrieves the file name in which the script is contained. - * - * @return Returns the file name in which the script is contained - */ - public String getFileName() { - return fileName; - } - - /** - * Retrieves the column number of the script where the error has - * occured. If the information is not available, returns -1. - * - * @return Returns the column number of the script where the - * error has occured - */ - public int getColumnNumber() { - return columnNumber; - } - - /** - * Retrieves the line number of the script where the error has - * occured. If the information is not available, returns -1. - * - * @return Returns the line number of the script where the error - * has occured - */ - public int getLineNumber() { - return lineNumber; - } - - /** - * Retrieves a String describing the cause of error. - * - * @return a String describing the cause of error - */ - public String getMessage() { - StringBuffer buffer = new StringBuffer(); - buffer.append(message); - if (fileName != null) { - buffer.append("in: " + fileName); - } - if (lineNumber != -1) { - buffer.append("at line no: " + lineNumber); - } - if (columnNumber != -1) { - buffer.append("at column number: " + columnNumber); - } - return buffer.toString(); - } -} diff --git a/server/javax/script/SimpleBindings.java b/server/javax/script/SimpleBindings.java deleted file mode 100644 index 10217d0..0000000 --- a/server/javax/script/SimpleBindings.java +++ /dev/null @@ -1,154 +0,0 @@ -package javax.script; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -/** - * SimpleNamespace is an implementation of Namespace using an - * instance of java.util.HashMap or another Map passed in a - * constructor to store and expose key-pair values. - * - * @author Nandika Jayawardana - * @author Sanka Samaranayake - */ -public class SimpleBindings implements Bindings { - - /** - * In which the key-value pairs are stored. - */ - protected Map map; - - /** - * Constructs a SimpleNamespace. - */ - public SimpleBindings() { - map = new HashMap(); - } - - /** - * Constructs a SimpleNamespace and initializes it using a - * specified map. - * - * @param map a map which is used to initialize the - * SimpleNamespace - */ - public SimpleBindings(Map map) { - this.map = map; - } - - /** - * Associates the specified value with the specified key in a - * java.util.Map. If the map previously contained a mapping for - * this key, the old value is replaced. - * - * @param key the String value which uniquely identifies the - * object - * @param value the object to be stored. - * @return The old object - * @throws IllegalArgumentException if the key is null or is not - * java.lang.String type - */ - public Object put(Object key, Object value) - throws IllegalArgumentException { - if ((key == null) || !(key instanceof java.lang.String)) { - throw new IllegalArgumentException("key is null or not a String"); - } - return map.put(key, value); - } - - /** - * Copies all of the mappings from the specified map to this map. - * These mappings will replace any mappings that this map had for - * any of the keys currently in the specified map. - * - * @param toMerge mappings to be stored in the map. - * @throws IllegalArgumentException if a key is null or is not - * java.lang.String type in the specified map - */ - public void putAll(Map toMerge) throws IllegalArgumentException { - - Set keySet = toMerge.keySet(); - Iterator keys = keySet.iterator(); - - while (keys.hasNext()) { - if (keys.next() instanceof String) { - throw new IllegalArgumentException("a key is not a String"); - } - } - - map.putAll(toMerge); - } - - /** - * {@inheritDoc} - */ - public int size() { - return map.size(); - } - - /** - * {@inheritDoc} - */ - public void clear() { - map.clear(); - } - - /** - * {@inheritDoc} - */ - public boolean isEmpty() { - return map.isEmpty(); - } - - /** - * {@inheritDoc} - */ - public boolean containsKey(Object key) { - return map.containsKey(key); - } - - /** - * {@inheritDoc} - */ - public boolean containsValue(Object value) { - return map.containsValue(value); - } - - /** - * {@inheritDoc} - */ - public Collection values() { - return map.values(); - } - - /** - * {@inheritDoc} - */ - public Set entrySet() { - return map.entrySet(); - } - - /** - * {@inheritDoc} - */ - public Object get(Object key) { - return map.get(key); - } - - /** - * {@inheritDoc} - */ - public Set keySet() { - return map.keySet(); - } - - /** - * {@inheritDoc} - */ - public Object remove(Object key) { - return map.remove(key); - } -} diff --git a/server/javax/script/SimpleScriptContext.java b/server/javax/script/SimpleScriptContext.java deleted file mode 100644 index 5409bd2..0000000 --- a/server/javax/script/SimpleScriptContext.java +++ /dev/null @@ -1,266 +0,0 @@ -package javax.script; - -import java.io.InputStreamReader; -import java.io.PrintWriter; -import java.io.Reader; -import java.io.Writer; -import java.util.Arrays; -import java.util.List; - -/** - * The GenericScriptContext is a simple implementation of ScriptContext. - * - * @author Nandika Jayawardana - * @author Sanka Samaranayake - */ -public class SimpleScriptContext implements ScriptContext { - - /** - * namespace of the scope of level GLOBAL_SCOPE - */ - protected Bindings globalScope; - - /** - * namespace of the scope of level ENGINE_SCOPE - */ - protected Bindings engineScope; - - /** - * Create a simple script context - */ - public SimpleScriptContext() { - engineScope = new SimpleBindings(); - } - - /** - * Retrieves the value for getAttribute(String, int) for the - * lowest scope in which it returns a non-null value. - * - * @param name the name of the attribute - * @return the value of the attribute - * @throws IllegalArgumentException - */ - public Object getAttribute(String name) throws IllegalArgumentException { - - if (name == null) { - throw new IllegalArgumentException("name cannot be null"); - } - - if (engineScope.get(name) != null) { - return engineScope.get(name); - } else if (globalScope.get(name) != null) { - return globalScope.get(name); - } else { - return null; - } - } - - /** - * Retrieves the value associated with specified name in the - * specified level of scope. Returns null if no value is - * associated with specified key in specified level of scope. - * - * @param name the name of the attribute - * @param scope the level of scope - * @return the value value associated with the specified name in - * specified level of scope - * @throws IllegalArgumentException - */ - public Object getAttribute(String name, int scope) - throws IllegalArgumentException { - - if (name == null) { - throw new IllegalArgumentException("name cannot be null"); - } - - switch (scope) { - case ENGINE_SCOPE: - return engineScope.get(name); - case GLOBAL_SCOPE: - return globalScope.get(name); - default: - throw new IllegalArgumentException("invalid scope"); - } - } - - /** - * Retrieves the lowest value of scopes for which the attribute - * is defined. If there is no associate scope with the given - * attribute (-1) is returned. - * - * @param name the name of attribute - * @return the value of level of scope - */ - public int getAttributesScope(String name) { - if (engineScope.containsKey(name)) { - return ENGINE_SCOPE; - } else if (globalScope.containsKey(name)) { - return GLOBAL_SCOPE; - } - - return -1; - } - - /** - * Retrieves the Namespace instance associated with the specified - * level of scope. - * - * @param scope the level of the scope - * @return the namespace associated with the specified level of - * scope - */ - public Bindings getBindings(int scope) { - - switch (scope) { - case ENGINE_SCOPE: - return engineScope; - case GLOBAL_SCOPE: - return globalScope; - default: - return null; - } - } - - /** - * Removes the specified attribute form the specified level of - * scope. - * - * @param name the name of the attribute - * @param scope the level of scope - * @return value which is removed - * @throws IllegalArgumentException - */ - public Object removeAttribute(String name, int scope) - throws IllegalArgumentException { - - if (name == null) { - throw new IllegalArgumentException("name is null"); - } - - switch (scope) { - case ENGINE_SCOPE: - return engineScope.remove(name); - case GLOBAL_SCOPE: - return globalScope.remove(name); - default: - throw new IllegalArgumentException("invalid scope"); - } - } - - /** - * Sets an attribute specified by the name in specified level of - * scope. - * - * @param name the name of the attribute - * @param value the value of the attribute - * @param scope the level of the scope - * @throws IllegalArgumentException if the name is null scope is - * invalid - */ - public void setAttribute(String name, Object value, int scope) - throws IllegalArgumentException { - - if (name == null) { - throw new IllegalArgumentException("name is null"); - } - - switch (scope) { - case ENGINE_SCOPE: - engineScope.put(name, value); - break; - case GLOBAL_SCOPE: - globalScope.put(name, value); - break; - default: - throw new IllegalArgumentException("invalid scope"); - } - } - - /** - * Associates the specified namespace with specified level of - * scope. - * - * @param namespace the namespace to be associated with specified - * level of scope - * @param scope the level of scope - * @throws IllegalArgumentException - */ - public void setBindings(Bindings namespace, int scope) - throws IllegalArgumentException { - - switch (scope) { - case ENGINE_SCOPE: - engineScope = namespace; - break; - case GLOBAL_SCOPE: - globalScope = namespace; - break; - default: - throw new IllegalArgumentException("invalid scope"); - - } - } - - private static final List scopes = Arrays.asList(new Integer[]{new Integer(ENGINE_SCOPE), new Integer(GLOBAL_SCOPE)}); - - /** - * {@inheritDoc} - */ - public List getScopes() { - return scopes; - } - - protected Writer errorWriter; - - /** - * {@inheritDoc} - */ - public Writer getErrorWriter() { - if (this.errorWriter == null) return this.errorWriter = new PrintWriter(System.err, true); - return errorWriter; - } - - /** - * {@inheritDoc} - */ - public void setErrorWriter(Writer writer) { - this.errorWriter = writer; - } - - protected Reader reader; - - /** - * {@inheritDoc} - */ - public Reader getReader() { - if (this.reader == null) return new InputStreamReader(System.in); - return reader; - } - - /** - * {@inheritDoc} - */ - public void setReader(Reader reader) { - this.reader = reader; - } - - protected Writer writer; - - /** - * {@inheritDoc} - */ - public Writer getWriter() { - // autoflush is true so that I can see the output immediately - if (writer == null) { - writer = new PrintWriter(System.out, true); - } - return writer; - } - - /** - * {@inheritDoc} - */ - public void setWriter(Writer writer) { - this.writer = writer; - } -} diff --git a/server/javax/script/package.html b/server/javax/script/package.html deleted file mode 100644 index 68be312..0000000 --- a/server/javax/script/package.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - -JSR 223 classes and interfaces. - - From 532d6dd86f07494205d49def5707f5df4a371b02 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sun, 22 Jan 2017 20:51:21 +0100 Subject: [PATCH 10/75] move to test sources --- .../java/io/soluble/pjb/script/TestUtf8.java | 56 ++++++++++++++++++ .../test/java/tests_jsr223}/test/README | 0 .../java/tests_jsr223}/test/SwingTest.java | 8 +-- .../java/tests_jsr223}/test/SwingTest.php | 0 tests.jsr223/test/Utf8.java | 59 ------------------- 5 files changed, 60 insertions(+), 63 deletions(-) create mode 100644 src/test/java/io/soluble/pjb/script/TestUtf8.java rename {tests.jsr223 => src/test/java/tests_jsr223}/test/README (100%) rename {tests.jsr223 => src/test/java/tests_jsr223}/test/SwingTest.java (77%) rename {tests.jsr223 => src/test/java/tests_jsr223}/test/SwingTest.php (100%) delete mode 100644 tests.jsr223/test/Utf8.java diff --git a/src/test/java/io/soluble/pjb/script/TestUtf8.java b/src/test/java/io/soluble/pjb/script/TestUtf8.java new file mode 100644 index 0000000..0cba08d --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestUtf8.java @@ -0,0 +1,56 @@ +/*-*- mode: Java; tab-width:8 -*-*/ + +package io.soluble.pjb.script; + +import java.io.StringReader; + +import javax.script.Invocable; +import javax.script.ScriptException; + +/** + * @author jostb + * + * Call this example with -Dfile.encoding=UTF-8 + */ +public class TestUtf8 { + + public static void main(String[] args) throws ScriptException, NoSuchMethodException { + int result = 0; + + System.setProperty("io.soluble.pjb.bridge.default_log_level", "4"); + System.setProperty("io.soluble.pjb.bridge.default_log_file", ""); + System.setProperty("io.soluble.pjb.bridge.php_exec", "php-cgi"); + + String utf8 = + "Cześć! -- שלום -- Grüß Gott -- Dobrý deň -- Dobrý den -- こんにちは, コンニチハ"; + + String phpCode = + "call(java_closure()); \n"+ + "?>"; + + InvocablePhpScriptEngine engine = new InvocablePhpScriptEngine(); + StringReader reader = new StringReader(phpCode); + engine.eval(reader); + + Invocable i = (Invocable)engine; + String utf82 = i.getInterface(null).toString(); + + if(!utf82.equals(utf8)) { + System.out.println("ERROR"); + System.out.println(utf82); + System.out.println(utf8); + result = 1; + } else { + System.out.println("test okay"); + } + + engine.release(); + System.exit(result); + } +} diff --git a/tests.jsr223/test/README b/src/test/java/tests_jsr223/test/README similarity index 100% rename from tests.jsr223/test/README rename to src/test/java/tests_jsr223/test/README diff --git a/tests.jsr223/test/SwingTest.java b/src/test/java/tests_jsr223/test/SwingTest.java similarity index 77% rename from tests.jsr223/test/SwingTest.java rename to src/test/java/tests_jsr223/test/SwingTest.java index 8359df9..e2626ce 100644 --- a/tests.jsr223/test/SwingTest.java +++ b/src/test/java/tests_jsr223/test/SwingTest.java @@ -10,7 +10,7 @@ import javax.script.ScriptException; import javax.swing.SwingUtilities; -import php.java.script.InvocablePhpScriptEngine; +import io.soluble.pjb.script.InvocablePhpScriptEngine; /** * @author jostb @@ -22,9 +22,9 @@ private interface SwingApplication extends Runnable { public void init(); } public static void main(String s[]) throws FileNotFoundException, ScriptException, InterruptedException, InvocationTargetException { - System.setProperty("php.java.bridge.default_log_level", "5"); - System.setProperty("php.java.bridge.default_log_file", ""); - System.setProperty("php.java.bridge.php_exec", "/usr/bin/php-cgi"); + System.setProperty("io.soluble.pjb.bridge.default_log_level", "5"); + System.setProperty("io.soluble.pjb.bridge.default_log_file", ""); + System.setProperty("io.soluble.pjb.bridge.php_exec", "/usr/bin/php-cgi"); InvocablePhpScriptEngine engine = new InvocablePhpScriptEngine(); engine.eval(new FileReader("test/SwingTest.php")); diff --git a/tests.jsr223/test/SwingTest.php b/src/test/java/tests_jsr223/test/SwingTest.php similarity index 100% rename from tests.jsr223/test/SwingTest.php rename to src/test/java/tests_jsr223/test/SwingTest.php diff --git a/tests.jsr223/test/Utf8.java b/tests.jsr223/test/Utf8.java deleted file mode 100644 index 70cda09..0000000 --- a/tests.jsr223/test/Utf8.java +++ /dev/null @@ -1,59 +0,0 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package test; - -import java.io.StringReader; - -import javax.script.Invocable; -import javax.script.ScriptException; - -import php.java.script.InvocablePhpScriptEngine; -import php.java.script.PhpScriptEngine; - -/** - * @author jostb - * - * Call this example with -Dfile.encoding=UTF-8 - */ -public class Utf8 { - - public static void main(String[] args) throws ScriptException, NoSuchMethodException { - int result = 0; - - System.setProperty("php.java.bridge.default_log_level", "4"); - System.setProperty("php.java.bridge.default_log_file", ""); - System.setProperty("php.java.bridge.php_exec", "php-cgi"); - - String utf8 = - "Cześć! -- שלום -- Grüß Gott -- Dobrý deň -- Dobrý den -- こんにちは, コンニチハ"; - - String phpCode = - "call(java_closure()); \n"+ - "?>"; - - InvocablePhpScriptEngine engine = new InvocablePhpScriptEngine(); - StringReader reader = new StringReader(phpCode); - engine.eval(reader); - - Invocable i = (Invocable)engine; - String utf82 = i.getInterface(null).toString(); - - if(!utf82.equals(utf8)) { - System.out.println("ERROR"); - System.out.println(utf82); - System.out.println(utf8); - result = 1; - } else { - System.out.println("test okay"); - } - - engine.release(); - System.exit(result); - } -} From 8539788c94506d3d958a9f7e4745ad2960240ebd Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sun, 22 Jan 2017 20:53:13 +0100 Subject: [PATCH 11/75] moved to resources --- .../io/soluble/pjb/bridge/global.properties | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/main/resources/io/soluble/pjb/bridge/global.properties diff --git a/src/main/resources/io/soluble/pjb/bridge/global.properties b/src/main/resources/io/soluble/pjb/bridge/global.properties new file mode 100644 index 0000000..81ad4e3 --- /dev/null +++ b/src/main/resources/io/soluble/pjb/bridge/global.properties @@ -0,0 +1,20 @@ +## auto-generated variables +## do not edit +BACKEND_VERSION = 6.2.11 + +## You can adjust and enable the following properties: +## + +# The name of the library, usually JavaBridge or MonoBridge +EXTENSION_DISPLAY_NAME = JavaBridge + +# A white space delimited list of environment entries; NOT to be passed to PHP +PHP_ENV_BLACKLIST = PHPRC + +# BASE = +# THREADS = 20 +# DEFAULT_LOG_LEVEL = 3 +# DEFAULT_LOG_FILE = +# PHP_EXEC = /usr/bin/php-cgi +# PHP_EXEC_ARGS = -d allow_url_include=On -d display_errors=Off -d log_errors=On -d java.persistent_servlet_connections=On +# MAX_WAIT = 15000 From 9446d7a6ed8e7a2db971c2b0a3409f3d121dccc5 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sun, 22 Jan 2017 20:54:01 +0100 Subject: [PATCH 12/75] moved to test sources --- .../java/io/soluble/pjb/script/AllTests.java | 32 ++++ .../soluble/pjb/script/SimpleCompileable.java | 33 ++++ .../io/soluble/pjb/script/TestBindings.java | 121 +++++++++++++ .../java/io/soluble/pjb/script/TestCli.java | 71 ++++++++ .../io/soluble/pjb/script/TestDiscovery.java | 43 +++++ .../io/soluble/pjb/script/TestException.java | 43 +++++ .../pjb/script/TestExceptionInvocable.java | 51 ++++++ .../pjb/script/TestExceptionInvocable2.java | 68 ++++++++ .../soluble/pjb/script/TestGetInterface.java | 67 ++++++++ .../io/soluble/pjb/script/TestGetResult.java | 49 ++++++ .../script/TestInteractiveRequestAbort.java | 46 +++++ .../io/soluble/pjb/script/TestInvocable.java | 39 +++++ .../script/TestInvocablePhpScriptEngine.java | 162 ++++++++++++++++++ .../pjb/script/TestPhpScriptEngine.java | 104 +++++++++++ .../io/soluble/pjb/script/TestScript.java | 42 +++++ .../io/soluble/pjb/script/TestSetWriter.java | 66 +++++++ .../pjb/script/TestSimpleInvocation.java | 42 +++++ .../io/soluble/pjb/script/TestURLReader.java | 46 +++++ 18 files changed, 1125 insertions(+) create mode 100644 src/test/java/io/soluble/pjb/script/AllTests.java create mode 100644 src/test/java/io/soluble/pjb/script/SimpleCompileable.java create mode 100644 src/test/java/io/soluble/pjb/script/TestBindings.java create mode 100644 src/test/java/io/soluble/pjb/script/TestCli.java create mode 100644 src/test/java/io/soluble/pjb/script/TestDiscovery.java create mode 100644 src/test/java/io/soluble/pjb/script/TestException.java create mode 100644 src/test/java/io/soluble/pjb/script/TestExceptionInvocable.java create mode 100644 src/test/java/io/soluble/pjb/script/TestExceptionInvocable2.java create mode 100644 src/test/java/io/soluble/pjb/script/TestGetInterface.java create mode 100644 src/test/java/io/soluble/pjb/script/TestGetResult.java create mode 100644 src/test/java/io/soluble/pjb/script/TestInteractiveRequestAbort.java create mode 100644 src/test/java/io/soluble/pjb/script/TestInvocable.java create mode 100644 src/test/java/io/soluble/pjb/script/TestInvocablePhpScriptEngine.java create mode 100644 src/test/java/io/soluble/pjb/script/TestPhpScriptEngine.java create mode 100644 src/test/java/io/soluble/pjb/script/TestScript.java create mode 100644 src/test/java/io/soluble/pjb/script/TestSetWriter.java create mode 100644 src/test/java/io/soluble/pjb/script/TestSimpleInvocation.java create mode 100644 src/test/java/io/soluble/pjb/script/TestURLReader.java diff --git a/src/test/java/io/soluble/pjb/script/AllTests.java b/src/test/java/io/soluble/pjb/script/AllTests.java new file mode 100644 index 0000000..3669dc1 --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/AllTests.java @@ -0,0 +1,32 @@ +package io.soluble.pjb.script; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class AllTests { + + public static Test suite() { + TestSuite suite = new TestSuite("Test for io.soluble.pjb.test"); + //$JUnit-BEGIN$ + suite.addTestSuite(TestException.class); + suite.addTestSuite(TestGetResult.class); + suite.addTestSuite(SimpleCompileable.class); + suite.addTestSuite(TestGetInterface.class); + suite.addTestSuite(TestScript.class); + suite.addTestSuite(TestInvocablePhpScriptEngine.class); + suite.addTestSuite(TestExceptionInvocable.class); + suite.addTestSuite(TestSetWriter.class); + suite.addTestSuite(TestInteractiveRequestAbort.class); + suite.addTestSuite(TestExceptionInvocable2.class); + suite.addTestSuite(TestSimpleInvocation.class); + suite.addTestSuite(TestInvocable.class); + suite.addTestSuite(TestURLReader.class); + suite.addTestSuite(TestCli.class); + suite.addTestSuite(TestPhpScriptEngine.class); + suite.addTestSuite(TestDiscovery.class); + suite.addTestSuite(TestBindings.class); + //$JUnit-END$ + return suite; + } + +} diff --git a/src/test/java/io/soluble/pjb/script/SimpleCompileable.java b/src/test/java/io/soluble/pjb/script/SimpleCompileable.java new file mode 100644 index 0000000..46c8222 --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/SimpleCompileable.java @@ -0,0 +1,33 @@ +package io.soluble.pjb.script; + +import javax.script.Compilable; +import javax.script.CompiledScript; +import javax.script.ScriptEngineManager; + +import junit.framework.TestCase; + +public class SimpleCompileable extends TestCase { + + private CompiledScript script; + + public SimpleCompileable(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + script = ((Compilable) (new ScriptEngineManager().getEngineByName("php"))).compile( + "get('hello').'!'; ?>"); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void test() throws Exception { + script.getEngine().put("hello", "world!"); + script.eval(); + script.getEngine().put("hello", String.valueOf(this)); + script.eval(); + } +} diff --git a/src/test/java/io/soluble/pjb/script/TestBindings.java b/src/test/java/io/soluble/pjb/script/TestBindings.java new file mode 100644 index 0000000..3678a50 --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestBindings.java @@ -0,0 +1,121 @@ +package io.soluble.pjb.script; + +import java.io.ByteArrayOutputStream; +import java.io.Closeable; +import java.io.File; +import java.io.OutputStreamWriter; +import java.io.Reader; +import java.io.StringReader; + +import javax.script.Bindings; +import javax.script.Compilable; +import javax.script.CompiledScript; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; +import javax.script.SimpleBindings; + +import junit.framework.TestCase; + +public class TestBindings extends TestCase { + + private ScriptEngine e; + private ScriptEngine e2; + private Bindings b; + private String script; + private ScriptEngineManager m; + + public TestBindings(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + m = new ScriptEngineManager(); + e = m.getEngineByName("php"); + e2 = m.getEngineByName("php"); + e.put("javax.script.argv", new String[]{"1", "2", "3"}); + + b = new SimpleBindings(); + b.put("javax.script.argv", new String[]{"1", "2", "3"}); + + script = "get('javax.script.argv');" + + "$result = (string)$argv[0]+ (string)$argv[1]+ (string)$argv[2];" + + "exit($result);" + + "?>"; + } + + protected void tearDown() throws Exception { + super.tearDown(); + ((Closeable) e).close(); + } + + public void testEvalReader() { + try { + Reader r = new StringReader(script); + assertTrue("6".equals(String.valueOf(e.eval(r)))); + r.close(); + } catch (Exception e) { + fail(String.valueOf(e)); + } + } + + public void testEvalReaderBindings() { + try { + Reader r = new StringReader(script); + assertTrue("6".equals(String.valueOf(e2.eval(r, b)))); + r.close(); + } catch (Exception e) { + fail(String.valueOf(e)); + } + } + + public void testEvalString() { + try { + assertTrue("6".equals(String.valueOf(e.eval(script)))); + } catch (ScriptException e) { + fail(String.valueOf(e)); + } + } + + public void testEvalStringBindings() { + try { + assertTrue("6".equals(String.valueOf(e2.eval(script, b)))); + } catch (ScriptException e) { + fail(String.valueOf(e)); + } + } + + public void testEvalCompilableString() { + System.out.println("testEvalCompilableString"); + try { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + OutputStreamWriter writer = new OutputStreamWriter(out); + ScriptEngine e = m.getEngineByName("php"); + + e.put("javax.script.argv", new String[]{"1", "2", "3"}); + e.getContext().setWriter(writer); + ((java.io.FileFilter) e).accept(new File(System.getProperty("java.io.tmpdir", "/tmp") + File.separator + "test.php")); + CompiledScript s = ((Compilable) e).compile("get('javax.script.argv');" + + "$result = (string)$argv[0]+ (string)$argv[1]+ (string)$argv[2];" + + "echo($result);" + + "?>"); + + long t1 = System.currentTimeMillis(); + //for (int i = 0; i < 100; i++) { // loop fails on second iteration !? + s.eval(); + final String result = out.toString(); + System.out.println("Result: " + result); + assertTrue("6".equals(result)); + out.reset(); + //} + long t2 = System.currentTimeMillis(); + System.out.println("testEvalCompilableString time:" + (t2 - t1)); + + } catch (Exception e) { + fail(String.valueOf(e)); + } + } +} diff --git a/src/test/java/io/soluble/pjb/script/TestCli.java b/src/test/java/io/soluble/pjb/script/TestCli.java new file mode 100644 index 0000000..db3663f --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestCli.java @@ -0,0 +1,71 @@ +package io.soluble.pjb.script; + +import java.io.ByteArrayOutputStream; +import java.io.Closeable; +import java.io.OutputStreamWriter; +import java.io.Writer; + +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; + +import junit.framework.TestCase; + +public class TestCli extends TestCase { + + public TestCli(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void testSimple() { + try { + ByteArrayOutputStream errOut = new ByteArrayOutputStream(); + Writer err = new OutputStreamWriter(errOut); + ScriptEngine eng = (new ScriptEngineManager()).getEngineByName("php-interactive"); + eng.getContext().setErrorWriter(err); + eng.eval("$a=new java('java.util.Vector');"); + eng.eval("$a->add(1);"); + eng.eval("$a->add(2);"); + eng.eval("$a->add(3);"); + eng.eval("class C{function toString() {return 'foo';}}"); + eng.eval("$a->add(java_closure(new C()));"); + eng.eval("$b=new java('java.util.Vector');"); + eng.eval("$b->add(1);"); + eng.eval("$b->add(2);"); + eng.eval("$b->add(3);"); + assertTrue("[1, 2, 3]".equals(eng.eval("echo $b"))); + assertTrue("[1, 2, 3, foo]".equals(eng.eval("echo $a"))); + ((Closeable) eng).close(); + } catch (Exception e) { + fail(String.valueOf(e)); + } + } + + public void testClosure() { + try { + ByteArrayOutputStream errOut = new ByteArrayOutputStream(); + Writer err = new OutputStreamWriter(errOut); + ScriptEngine eng = (new ScriptEngineManager()).getEngineByName("php-interactive"); + eng.getContext().setErrorWriter(err); + eng.eval("$a=new java('java.util.Vector');"); + eng.eval("$a->add(1);"); + eng.eval("$a->add(2);"); + try { + eng.eval("die();"); + } catch (Exception e) { + assertTrue(e.getMessage().equals("io.soluble.pjb.bridge.Request$AbortException")); + } + assertTrue(eng.eval("echo $a").equals("[1, 2]")); + ((Closeable) eng).close(); + } catch (Exception e) { + fail(String.valueOf(e)); + } + } +} diff --git a/src/test/java/io/soluble/pjb/script/TestDiscovery.java b/src/test/java/io/soluble/pjb/script/TestDiscovery.java new file mode 100644 index 0000000..a4940f1 --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestDiscovery.java @@ -0,0 +1,43 @@ +package io.soluble.pjb.script; + +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; + +import junit.framework.TestCase; + +public class TestDiscovery extends TestCase { + + public TestDiscovery(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void testDiscovery() { + try { + StringBuffer s = new StringBuffer(); + ScriptEngineManager manager = new ScriptEngineManager(); + ScriptEngine e = manager.getEngineByName("php"); + e.put("hello", new StringBuffer("hello world")); + e.put("s", s); + e.eval("getAttribute('s');" + + "$s->append(java_values(java_context()->getAttribute('hello')));" + + "/*echo java_values($s);*/" + + "java_context()->setAttribute('hello', '!', 100);" + + "?>"); + s.append(e.get("hello")); + if (!(s.toString().equals("hello world!"))) { + fail("ERROR"); + } + } catch (Exception e) { + fail(String.valueOf(e)); + } + } +} diff --git a/src/test/java/io/soluble/pjb/script/TestException.java b/src/test/java/io/soluble/pjb/script/TestException.java new file mode 100644 index 0000000..62d25e2 --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestException.java @@ -0,0 +1,43 @@ +package io.soluble.pjb.script; + +import java.io.ByteArrayOutputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; + +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; + +import junit.framework.TestCase; + +public class TestException extends TestCase { + + public TestException(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void test() throws Exception { + ScriptEngineManager manager = new ScriptEngineManager(); + ScriptEngine e = manager.getEngineByName("php"); + OutputStream out = new ByteArrayOutputStream(); + Writer w = new OutputStreamWriter(out); + e.getContext().setWriter(w); + e.getContext().setErrorWriter(w); + try { + e.eval(""); + } catch (ScriptException ex) { + if (out.toString().length() == 0) throw new Exception("test failed"); + return; + } + fail("test failed"); + } +} diff --git a/src/test/java/io/soluble/pjb/script/TestExceptionInvocable.java b/src/test/java/io/soluble/pjb/script/TestExceptionInvocable.java new file mode 100644 index 0000000..479a0a6 --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestExceptionInvocable.java @@ -0,0 +1,51 @@ +package io.soluble.pjb.script; + +import java.io.ByteArrayOutputStream; +import java.io.Closeable; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; + +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; + +import junit.framework.TestCase; + +public class TestExceptionInvocable extends TestCase { + + public TestExceptionInvocable(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void test() throws Exception { + ScriptEngineManager manager = new ScriptEngineManager(); + ScriptEngine e = manager.getEngineByName("php-invocable"); + OutputStream out = new ByteArrayOutputStream(); + Writer w = new OutputStreamWriter(out); + e.getContext().setWriter(w); + e.getContext().setErrorWriter(w); + e.eval(""); + + Invocable i = (Invocable) e; + try { + i.invokeFunction("f", new Object[]{}); + } catch (ScriptException ex) { + ((Closeable) e).close(); + if (out.toString().length() != 0) throw new Exception("test failed"); + return; + } + ((Closeable) e).close(); + fail("test failed"); + } + +} diff --git a/src/test/java/io/soluble/pjb/script/TestExceptionInvocable2.java b/src/test/java/io/soluble/pjb/script/TestExceptionInvocable2.java new file mode 100644 index 0000000..4b2ed98 --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestExceptionInvocable2.java @@ -0,0 +1,68 @@ +package io.soluble.pjb.script; + +import java.io.ByteArrayOutputStream; +import java.io.Closeable; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; + +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; + +import junit.framework.TestCase; + +public class TestExceptionInvocable2 extends TestCase { + + public TestExceptionInvocable2(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void test() throws Exception { + ScriptEngineManager manager = new ScriptEngineManager(); + ScriptEngine e = manager.getEngineByName("php-invocable"); + OutputStream out = new ByteArrayOutputStream(); + Writer w = new OutputStreamWriter(out); + e.getContext().setWriter(w); + e.getContext().setErrorWriter(w); + e.eval("setAttribute('c', java_closure(new c()), 100); " + + "?>"); + + Invocable i = (Invocable) e; + try { + assertTrue("f ok".equals(i.invokeFunction("f", new Object[]{}))); + } catch (Throwable ex) { + fail("2"); + } + try { + i.invokeFunction("g", new Object[]{}); + System.err.println("test failed"); + fail("3"); + } catch (NoSuchMethodException ex) { +// ex.printStackTrace(System.out); + } + try { + assertTrue("c::p ok".equals(i.invokeMethod(e.get("c"), "p", new Object[]{}))); + } catch (NoSuchMethodException ex) { + fail("4"); + } + try { + i.invokeMethod(e.get("c"), "g", new Object[]{}); + fail("5"); + } catch (NoSuchMethodException ex) { + //ex.printStackTrace(System.out); + } + ((Closeable) e).close(); + if (out.toString().length() != 0) throw new Exception("test failed"); + } +} diff --git a/src/test/java/io/soluble/pjb/script/TestGetInterface.java b/src/test/java/io/soluble/pjb/script/TestGetInterface.java new file mode 100644 index 0000000..f7e1077 --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestGetInterface.java @@ -0,0 +1,67 @@ +package io.soluble.pjb.script; + +import java.io.ByteArrayOutputStream; +import java.io.Closeable; +import java.io.OutputStreamWriter; + +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; + +import junit.framework.TestCase; + +public class TestGetInterface extends TestCase { + + public TestGetInterface(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + private ScriptEngine scriptEngine; + + String classA = "class A{function toString(){return '::A';} function invokeA($b){$b->invokeB();}}\n"; + String classB = "class B{function toString(){return '::B';} function invokeB(){echo '::B';}}\n"; + String test = "getAttribute('thiz');\n$thiz->call(java_closure(new A()), java_closure(new B())); ?>"; + + public void test() throws Exception { + scriptEngine = new ScriptEngineManager().getEngineByName("php-invocable"); + scriptEngine.put("thiz", this); + ByteArrayOutputStream out; + OutputStreamWriter writer; + scriptEngine.getContext().setWriter(writer = new OutputStreamWriter(out = new ByteArrayOutputStream())); + scriptEngine.eval(test); + ((Closeable) scriptEngine).close(); + + writer.close(); + if (!"::B".equals(out.toString())) { + fail("test failed"); + } + return; + } + + interface IA { + public void invokeA(IB ccb); + } + + ; + + interface IB { + public void invokeB(); + } + + ; + + public void call(Object $cca, Object $ccb) { + IA cca = (IA) ((Invocable) scriptEngine).getInterface($cca, IA.class); + IB ccb = (IB) ((Invocable) scriptEngine).getInterface($ccb, IB.class); + cca.invokeA(ccb); + } + +} diff --git a/src/test/java/io/soluble/pjb/script/TestGetResult.java b/src/test/java/io/soluble/pjb/script/TestGetResult.java new file mode 100644 index 0000000..0d5207d --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestGetResult.java @@ -0,0 +1,49 @@ +package io.soluble.pjb.script; + +import java.io.ByteArrayOutputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; + +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; + +import junit.framework.TestCase; + +public class TestGetResult extends TestCase { + + public TestGetResult(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void testDiscovery() { + try { + ScriptEngine e = new ScriptEngineManager().getEngineByName("php"); + String result = String.valueOf(e.eval(""); + result = String.valueOf(o); // note that this releases the engine, the next invoke will implicitly call eval() with an empty script + ((Invocable) e).invokeFunction("phpinfo", new Object[]{}); + if (!result.equals("16")) throw new ScriptException("test failed"); + if (out.toString().length() == 0) throw new ScriptException("test failed"); + } catch (Exception e1) { + fail(String.valueOf(e1)); + } + } +} diff --git a/src/test/java/io/soluble/pjb/script/TestInteractiveRequestAbort.java b/src/test/java/io/soluble/pjb/script/TestInteractiveRequestAbort.java new file mode 100644 index 0000000..6c03ff2 --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestInteractiveRequestAbort.java @@ -0,0 +1,46 @@ +package io.soluble.pjb.script; + +import java.io.File; +import java.io.FileWriter; + +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; + +import junit.framework.TestCase; +import io.soluble.pjb.bridge.Request.AbortException; + +public class TestInteractiveRequestAbort extends TestCase { + + public TestInteractiveRequestAbort(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void test() throws Exception { + String devNull = new File("/dev/null").exists() ? "/dev/null" : "devNull"; + ScriptEngineManager m = new ScriptEngineManager(); + ScriptEngine e = m.getEngineByName("php-interactive"); + e.getContext().setErrorWriter(new FileWriter(new File(devNull))); + e.getContext().setWriter(new FileWriter(new File(devNull))); + + try { + e.eval("function toString() {return 'hello'; }; echo java_closure(); echo new JavaException('java.lang.Exception', 'hello'); echo JavaException('foo')"); + } catch (ScriptException ex) { + Throwable orig = ex.getCause(); + if (orig instanceof AbortException) { + return; + } + } + + fail("test failed"); + } + +} diff --git a/src/test/java/io/soluble/pjb/script/TestInvocable.java b/src/test/java/io/soluble/pjb/script/TestInvocable.java new file mode 100644 index 0000000..94ca207 --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestInvocable.java @@ -0,0 +1,39 @@ +package io.soluble.pjb.script; + +import java.io.Reader; + +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; + +import junit.framework.TestCase; + +public class TestInvocable extends TestCase { + + public TestInvocable(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void test() throws Exception { + + ScriptEngineManager manager = new ScriptEngineManager(); + ScriptEngine e = manager.getEngineByName("php-invocable"); + + e.eval("setAttribute('f', java_closure(new f()), 100); ?>"); + + Invocable i = (Invocable) e; + Object f = e.getContext().getAttribute("f", 100); + assertTrue(2 == (Integer) i.invokeMethod(f, "a", new Object[]{new Integer(1)})); + + e.eval((Reader) null); + } +} diff --git a/src/test/java/io/soluble/pjb/script/TestInvocablePhpScriptEngine.java b/src/test/java/io/soluble/pjb/script/TestInvocablePhpScriptEngine.java new file mode 100644 index 0000000..c1f37a7 --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestInvocablePhpScriptEngine.java @@ -0,0 +1,162 @@ +package io.soluble.pjb.script; + +import java.io.ByteArrayOutputStream; +import java.io.Closeable; +import java.io.File; +import java.io.OutputStreamWriter; +import java.io.Reader; +import java.io.StringReader; + +import javax.script.Bindings; +import javax.script.Compilable; +import javax.script.CompiledScript; +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; +import javax.script.SimpleBindings; + +import junit.framework.TestCase; + +public class TestInvocablePhpScriptEngine extends TestCase { + + private ScriptEngine e; + private Bindings b; + private String script; + private ScriptEngineManager m; + private String invocableScript; + + public TestInvocablePhpScriptEngine(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + + m = new ScriptEngineManager(); + e = m.getEngineByName("php-invocable"); + b = new SimpleBindings(); + script = ""; + invocableScript = ""; // no exit() + + } + + protected void tearDown() throws Exception { + super.tearDown(); + ((Closeable) e).close(); + } + + public void testEvalReader() { + try { + Reader r = new StringReader(script); + assertTrue("3".equals(String.valueOf(e.eval(r)))); + r.close(); + } catch (Exception e) { + fail(String.valueOf(e)); + } + } + + public void testEvalReaderBindings() { + try { + Reader r = new StringReader(script); + assertTrue("3".equals(String.valueOf(e.eval(r, b)))); + r.close(); + } catch (Exception e) { + fail(String.valueOf(e)); + } + } + + public void testEvalString() { + try { + assertTrue("3".equals(String.valueOf(e.eval(script)))); + } catch (ScriptException e) { + fail(String.valueOf(e)); + } + } + + public void testEvalStringBindings() { + try { + assertTrue("3".equals(String.valueOf(e.eval(script, b)))); + } catch (ScriptException e) { + fail(String.valueOf(e)); + } + } + + public void testEvalCompilableString() { + try { + ScriptEngine e = m.getEngineByName("php-invocable"); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + OutputStreamWriter writer = new OutputStreamWriter(out); + e.getContext().setWriter(writer); + e.getContext().getWriter(); + ((java.io.FileFilter) e).accept(new File(System.getProperty("java.io.tmpdir", "/tmp") + File.separator + "test.php")); + CompiledScript s = ((Compilable) e).compile(""); + + long t1 = System.currentTimeMillis(); + //for (int i = 0; i < 100; i++) { // loop fails on second iteration !? + s.eval(); + ((Closeable) e).close(); + assertTrue("3".equals(out.toString())); + out.reset(); + //} + long t2 = System.currentTimeMillis(); + System.out.println("testEvalInvocableCompilableString time:" + (t2 - t1)); + + } catch (Exception e) { + fail(String.valueOf(e)); + } + } + + public void testInvokeFunction() { + try { + ScriptEngine e = m.getEngineByName("php-invocable"); + e.eval(invocableScript); + assertTrue(6 == (Integer) ((Invocable) e).invokeFunction("f", new Object[]{"5"})); + ((Closeable) e).close(); + } catch (Exception e) { + fail(String.valueOf(e)); + } + } + + public void testInvokeFunctionCompiled() { + try { + ScriptEngine e = m.getEngineByName("php-invocable"); + ((java.io.FileFilter) e).accept(new File(System.getProperty("java.io.tmpdir", "/tmp") + File.separator + "test.php")); + CompiledScript c = ((Compilable) e).compile(invocableScript); + c.eval(); + assertTrue(6 == (Integer) ((Invocable) e).invokeFunction("f", new Object[]{"5"})); + c.eval(); + assertTrue(6 == (Integer) ((Invocable) e).invokeFunction("f", new Object[]{"5"})); + ((Closeable) e).close(); + } catch (Exception e) { + fail(String.valueOf(e)); + } + } + +// public void testInvokeMethod() { +// fail("Not yet implemented"); +// } +// +// public void testGetInterfaceClass() { +// fail("Not yet implemented"); +// } +// +// public void testGetInterfaceObjectClass() { +// fail("Not yet implemented"); +// } +// public void testInvokeFunctionCompiled() { +// fail("Not yet implemented"); +// } +// +// public void testInvokeMethodCompiled() { +// fail("Not yet implemented"); +// } +// +// public void testGetInterfaceClassCompiled() { +// fail("Not yet implemented"); +// } +// +// public void testGetInterfaceObjectClassCompiled() { +// fail("Not yet implemented"); +// } +} diff --git a/src/test/java/io/soluble/pjb/script/TestPhpScriptEngine.java b/src/test/java/io/soluble/pjb/script/TestPhpScriptEngine.java new file mode 100644 index 0000000..e98593f --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestPhpScriptEngine.java @@ -0,0 +1,104 @@ +package io.soluble.pjb.script; + +import java.io.ByteArrayOutputStream; +import java.io.Closeable; +import java.io.File; +import java.io.OutputStreamWriter; +import java.io.Reader; +import java.io.StringReader; + +import javax.script.Bindings; +import javax.script.Compilable; +import javax.script.CompiledScript; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; +import javax.script.SimpleBindings; + +import junit.framework.TestCase; + +public class TestPhpScriptEngine extends TestCase { + + private ScriptEngine e; + private Bindings b; + private String script; + private ScriptEngineManager m; + + public TestPhpScriptEngine(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + m = new ScriptEngineManager(); + e = m.getEngineByName("php"); + b = new SimpleBindings(); + script = ""; + } + + protected void tearDown() throws Exception { + super.tearDown(); + ((Closeable) e).close(); + } + + public void testEvalReader() { + try { + Reader r = new StringReader(script); + assertTrue("3".equals(String.valueOf(e.eval(r)))); + r.close(); + } catch (Exception e) { + fail(String.valueOf(e)); + } + } + + public void testEvalReaderBindings() { + try { + Reader r = new StringReader(script); + assertTrue("3".equals(String.valueOf(e.eval(r, b)))); + r.close(); + } catch (Exception e) { + fail(String.valueOf(e)); + } + } + + public void testEvalString() { + try { + assertTrue("3".equals(String.valueOf(e.eval(script)))); + } catch (ScriptException e) { + fail(String.valueOf(e)); + } + } + + public void testEvalStringBindings() { + try { + assertTrue("3".equals(String.valueOf(e.eval(script, b)))); + } catch (ScriptException e) { + fail(String.valueOf(e)); + } + } + + public void testEvalCompilableString() { + try { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + OutputStreamWriter writer = new OutputStreamWriter(out); + ScriptEngine e = m.getEngineByName("php"); + + e.getContext().setWriter(writer); + ((java.io.FileFilter) e).accept(new File(System.getProperty("java.io.tmpdir", "/tmp") + File.separator + "test.php")); + CompiledScript s = ((Compilable) e).compile(""); + + long t1 = System.currentTimeMillis(); + //for (int i = 0; i < 100; i++) { // loop fails on second iteration !? + s.eval(); + assertTrue("3".equals(out.toString())); + out.reset(); + //} + long t2 = System.currentTimeMillis(); + System.out.println("testEvalCompilableString time:" + (t2 - t1)); + + } catch (Exception e) { + fail(String.valueOf(e)); + } + } + +} diff --git a/src/test/java/io/soluble/pjb/script/TestScript.java b/src/test/java/io/soluble/pjb/script/TestScript.java new file mode 100644 index 0000000..6fb8d3b --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestScript.java @@ -0,0 +1,42 @@ +package io.soluble.pjb.script; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; + +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; + +import junit.framework.TestCase; + +public class TestScript extends TestCase { + + public TestScript(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void test() throws IOException, ScriptException { + ScriptEngine eng = (new ScriptEngineManager()).getEngineByName("php"); + OutputStream out = new ByteArrayOutputStream(); + Writer w = new OutputStreamWriter(out); + eng.getContext().setWriter(w); + eng.getContext().setErrorWriter(w); + + eng.eval("call(java_closure()))) print('test okay'); ?>"); + eng.eval((String) null); + + assertTrue("test okay".equals(String.valueOf(out))); + } + +} diff --git a/src/test/java/io/soluble/pjb/script/TestSetWriter.java b/src/test/java/io/soluble/pjb/script/TestSetWriter.java new file mode 100644 index 0000000..a467312 --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestSetWriter.java @@ -0,0 +1,66 @@ +package io.soluble.pjb.script; + +import java.io.IOException; +import java.io.Reader; +import java.io.Writer; + +import javax.script.ScriptContext; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; + +import junit.framework.TestCase; + +public class TestSetWriter extends TestCase { + + public TestSetWriter(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public static class TestWriter extends Writer { + + public void close() throws IOException { + throw new RuntimeException("failed"); + } + + public void flush() throws IOException { + + } + + public void write(char[] cbuf, int off, int len) throws IOException { + assertTrue("3".equals(new String(cbuf, off, len))); + } + + } + + public static class TestReader extends Reader { + + public void close() throws IOException { + throw new RuntimeException("failed"); + } + + public int read(char[] cbuf, int off, int len) throws IOException { + return 0; + } + + } + + public void test() throws Exception { + ScriptEngineManager m = new ScriptEngineManager(); + ScriptEngine e = m.getEngineByName("php"); + ScriptContext c = e.getContext(); + c.setWriter(new TestWriter()); + c.setErrorWriter(new TestWriter()); + c.setReader(new TestReader()); + e.eval(""); + + } + +} diff --git a/src/test/java/io/soluble/pjb/script/TestSimpleInvocation.java b/src/test/java/io/soluble/pjb/script/TestSimpleInvocation.java new file mode 100644 index 0000000..4d8b2da --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestSimpleInvocation.java @@ -0,0 +1,42 @@ +package io.soluble.pjb.script; + +import java.io.ByteArrayOutputStream; +import java.io.Closeable; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; + +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; + +import junit.framework.TestCase; + +public class TestSimpleInvocation extends TestCase { + + public TestSimpleInvocation(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void test() throws Exception { + ScriptEngineManager m = new ScriptEngineManager(); + ScriptEngine e = m.getEngineByName("php-invocable"); + OutputStream out = new ByteArrayOutputStream(); + Writer w = new OutputStreamWriter(out); + e.getContext().setWriter(w); + e.getContext().setErrorWriter(w); + Invocable i = (Invocable) e; + i.invokeFunction("phpinfo", new Object[0]); + if (out.toString().length() == 0) throw new ScriptException("test failed"); + ((Closeable) e).close(); + } +} diff --git a/src/test/java/io/soluble/pjb/script/TestURLReader.java b/src/test/java/io/soluble/pjb/script/TestURLReader.java new file mode 100644 index 0000000..6f65e35 --- /dev/null +++ b/src/test/java/io/soluble/pjb/script/TestURLReader.java @@ -0,0 +1,46 @@ +package io.soluble.pjb.script; + +import java.io.ByteArrayOutputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.net.URL; + +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; + +import junit.framework.TestCase; +import io.soluble.pjb.script.IPhpScriptContext; +import io.soluble.pjb.script.URLReader; + +public class TestURLReader extends TestCase { + + public TestURLReader(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void test() throws Exception { + ScriptEngine e = new ScriptEngineManager().getEngineByName("php-invocable"); + + // Note: don't use the following line in your own code + // URLReader should be used to connect to a real HTTP server, usually running on port 80 + e.eval(new URLReader(new URL("http://localhost:" + ((IPhpScriptContext) e.getContext()).getSocketName() + "/JavaBridge/java/JavaProxy.php"))); + + OutputStream out = new ByteArrayOutputStream(); + Writer w = new OutputStreamWriter(out); + e.getContext().setWriter(w); + e.getContext().setErrorWriter(w); + String result = String.valueOf(((Invocable) e).invokeFunction("addslashes", new Object[]{"Is your name O'reilly?"})); + assertTrue(out.toString().length() == 0); + assertTrue("Is your name O\\'reilly?".equals(result)); + } +} From 2f3580ec68bf3a4b61295fc1979f4e8dd0573125 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sun, 22 Jan 2017 21:00:26 +0100 Subject: [PATCH 13/75] moved from server/ to resources --- .../META-INF/SSLServerSocketHelperKeystore | Bin 0 -> 1364 bytes .../services/javax.script.ScriptEngineFactory | 9 +++++++++ 2 files changed, 9 insertions(+) create mode 100644 src/main/resources/META-INF/SSLServerSocketHelperKeystore create mode 100644 src/main/resources/META-INF/services/javax.script.ScriptEngineFactory diff --git a/src/main/resources/META-INF/SSLServerSocketHelperKeystore b/src/main/resources/META-INF/SSLServerSocketHelperKeystore new file mode 100644 index 0000000000000000000000000000000000000000..93686a92f22b9b7c84f8d86afa3293d67a436047 GIT binary patch literal 1364 zcmezO_TO6u1_mY|W&~r_+{*0KN+3^r5{I)fP-eG56VrABJ~l3GHbxdkEha%mMpg!v zCZ@$A(oHN@8+P|w=gfV$vi|E5pFG~)jJWkX_ZM&AyW$d9RdT{mr)S-P2kY}VuU|MU zoO)R#_~1*E8>SVKyDeU8-=3|WE9Z8Op;P6j%#Ez+GijBU zL1+2)w8ogcHEuiGUwu|%m7c~M=CsVFBDDO}y2u5hb=lFYrw1;(5%EMW$6-_6)Rx5S zAw8deIQ=NxRbZ31HuH1mZHBFKXE$d5sNrzq(qA2Hv@oAJ@{$xUkHm?%+INfRPyfB7 z?d!$~CsntVyAw@s;xu$Mz3DY zcbECqzZw0y58q+RI&1GRjd{J_??OjOwWZRv(FvROT~apz3}cZ9vE>#=?7<_eXmeA=`(zu4JrtjHpyy6d)Y_Gm zI50%mF+{j9M7S|TnBgJ@a^k#(28IR(mWJj==7y$GKrV=H4&~C>HI4I;Lj#!0nHzf< z3>rI`8XFnTE)kb3lX;lW(D7QWf^YtP)mw*zeP3Que|F^ghu5yxyF(7lGQ7(Y&;DK` z=AYOrljfAWj*m7xNxY<;_^UTp_s5&;UH9+ye4V#PIXz8~>!_2fPwhgDo$q5yPEEg_ zzLaCeH<9NP?iQ9WKghLPGu_{qL-%;}H8yJ54klH3WcxT zO#iXvbxVtNR*I2NK>w@E&HK-3*k8AN%gb0GRk6rWw|!E7y0*1c!rFH=4z4+I?1%21 zpLyos51F3#?J=9Zir4<0zh#C_d+oQ2C%4Y}Zoz+zsqoI_7l-^lFvhTYZP>iVxT1Co E0GK*4A^-pY literal 0 HcmV?d00001 diff --git a/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory b/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory new file mode 100644 index 0000000..5dd16c8 --- /dev/null +++ b/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory @@ -0,0 +1,9 @@ +# list of script engine factories +# +# php => io.soluble.pjb.script.PhpScriptEngineFactory +# php-invocable => io.soluble.pjb.script.InvocablePhpScriptEngineFactory +# php-interactive => io.soluble.pjb.script.InteractivePhpScriptEngineFactory + +io.soluble.pjb.script.PhpScriptEngineFactory +io.soluble.pjb.script.InvocablePhpScriptEngineFactory +io.soluble.pjb.script.InteractivePhpScriptEngineFactory From bc1cb714735965f7da8707e0d9ddfdd7647f7830 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Mon, 23 Jan 2017 09:42:56 +0100 Subject: [PATCH 14/75] add jacoco code coverage plugin --- build.gradle | 13 +++++++++++-- server/php/java/bridge/.cvsignore | 8 -------- 2 files changed, 11 insertions(+), 10 deletions(-) delete mode 100644 server/php/java/bridge/.cvsignore diff --git a/build.gradle b/build.gradle index ea18461..83968ff 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,7 @@ version '6.2.11' ant.importBuild 'build.xml' apply plugin: 'java' +apply plugin: 'jacoco' compileJava.options.encoding = 'UTF-8' compileTestJava.options.encoding = 'UTF-8' @@ -16,8 +17,8 @@ repositories { } dependencies { - compileOnly group: 'javax.servlet', name: 'servlet-api', version: '2.5' - testCompile group: 'junit', name: 'junit', version: '3.8.2' // the project still uses this junit API + compileOnly('javax.servlet:servlet-api:2.5') + testCompile('junit:junit:3.8.2') // the project still uses this junit API } jar { @@ -36,3 +37,11 @@ compileJava { dependsOn genAll } +jacocoTestReport { + group = "Reporting" + reports { + xml.enabled true + csv.enabled false + html.destination "${buildDir}/reports/coverage" + } +} \ No newline at end of file diff --git a/server/php/java/bridge/.cvsignore b/server/php/java/bridge/.cvsignore deleted file mode 100644 index 9e70c09..0000000 --- a/server/php/java/bridge/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -JavaProxy.java -LauncherWindows.java -LauncherWindows2.java -LauncherWindows3.java -LauncherUnix.java -JavaInc.java -LauncherWindows4.java -PhpDebuggerPHP.java \ No newline at end of file From bb4025bccb592c9a31d596192690b0ed02638d56 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Mon, 23 Jan 2017 09:43:42 +0100 Subject: [PATCH 15/75] another round... --- .gitignore | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 9a2cd63..bada022 100644 --- a/.gitignore +++ b/.gitignore @@ -7,18 +7,19 @@ bin/ lib/ nbproject/ doc/API/ -server/META-INF/java/JavaProxy.php -server/META-INF/java/Java.inc -server/php/java/bridge/JavaProxy.java -server/php/java/bridge/LauncherWindows.java -server/php/java/bridge/LauncherWindows2.java -server/php/java/bridge/LauncherWindows3.java -server/php/java/bridge/LauncherUnix.java -server/php/java/bridge/JavaInc.java -server/php/java/bridge/LauncherWindows4.java -server/php/java/bridge/PhpDebuggerPHP.java +META-INF/java/JavaProxy.php +META-INF/java/Java.inc +bridge/JavaProxy.java +bridge/LauncherWindows.java +bridge/LauncherWindows2.java +bridge/LauncherWindows3.java +bridge/LauncherUnix.java +bridge/JavaInc.java +bridge/LauncherWindows4.java +bridge/PhpDebuggerPHP.java .classpath nbbuild.xml +manifest.mf *.iml *.lock *.log From 22c3cfa11d60385e5b624a8707991db8f17ea1ac Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Mon, 23 Jan 2017 09:52:21 +0100 Subject: [PATCH 16/75] moved from server/php/java to src/main/java/io/soluble/pjb --- server/php/java/test/AllTests.java | 32 ------------- server/php/java/test/SimpleCompileable.java | 33 ------------- .../io/soluble/pjb}/bridge/AppThreadPool.java | 6 +-- .../bridge/Base64EncodingOutputBuffer.java | 2 +- .../soluble/pjb}/bridge/ChainsawLogger.java | 8 ++-- .../soluble/pjb}/bridge/ConstructorCache.java | 2 +- .../soluble/pjb}/bridge/DefaultOptions.java | 7 +-- .../io/soluble/pjb}/bridge/FileLogger.java | 6 +-- .../io/soluble/pjb}/bridge/GlobalRef.java | 2 +- .../soluble/pjb}/bridge/HexOutputBuffer.java | 5 +- .../io/soluble/pjb}/bridge/IDocHandler.java | 2 +- .../pjb}/bridge/IJavaBridgeFactory.java | 9 ++-- .../java/io/soluble/pjb}/bridge/ILogger.java | 6 +-- .../java/io/soluble/pjb}/bridge/IManaged.java | 4 +- .../java/io/soluble/pjb}/bridge/ISession.java | 3 +- .../soluble/pjb}/bridge/ISocketFactory.java | 3 +- .../pjb}/bridge/IntegerComparator.java | 3 +- .../io/soluble/pjb}/bridge/Invocable.java | 4 +- .../io/soluble/pjb}/bridge/JavaBridge.java | 16 +++---- .../pjb}/bridge/JavaBridgeFactory.java | 8 ++-- .../JavaBridgeIllegalArgumentException.java | 4 +- .../JavaBridgeIllegalStateException.java | 4 +- .../soluble/pjb}/bridge/JavaBridgeRunner.java | 18 +++---- .../bridge/JavaBridgeSecurityManager.java | 6 +-- .../io/soluble/pjb}/bridge/MethodCache.java | 3 +- .../pjb}/bridge/NoSuchConstantException.java | 4 +- .../pjb}/bridge/NoSuchProcedureException.java | 4 +- .../pjb}/bridge/NotImplementedException.java | 4 +- .../java/io/soluble/pjb}/bridge/Options.java | 5 +- .../java/io/soluble/pjb}/bridge/Parser.java | 2 +- .../io/soluble/pjb}/bridge/ParserString.java | 2 +- .../io/soluble/pjb}/bridge/ParserTag.java | 4 +- .../java/io/soluble/pjb}/bridge/PhpArray.java | 2 +- .../soluble/pjb}/bridge/PhpExactNumber.java | 4 +- .../java/io/soluble/pjb}/bridge/PhpMap.java | 3 +- .../soluble/pjb}/bridge/PhpParserString.java | 2 +- .../io/soluble/pjb}/bridge/PhpProcedure.java | 2 +- .../io/soluble/pjb}/bridge/PhpString.java | 3 +- .../java/io/soluble/pjb}/bridge/Request.java | 4 +- .../java/io/soluble/pjb}/bridge/Response.java | 2 +- .../pjb}/bridge/SSLServerSocketHelper.java | 3 +- .../java/io/soluble/pjb}/bridge/Session.java | 2 +- .../soluble/pjb}/bridge/SessionFactory.java | 9 ++-- .../pjb}/bridge/SimpleLog4jLogger.java | 6 +-- .../soluble/pjb}/bridge/SimplePhpString.java | 4 +- .../io/soluble/pjb}/bridge/Standalone.java | 28 +++++------ .../io/soluble/pjb}/bridge/StringCache.java | 2 +- .../soluble/pjb}/bridge/TCPServerSocket.java | 3 +- .../io/soluble/pjb}/bridge/ThreadPool.java | 2 +- .../java/io/soluble/pjb}/bridge/Util.java | 48 +++++++++---------- .../pjb}/bridge/http/AbstractChannel.java | 2 +- .../pjb}/bridge/http/AbstractChannelName.java | 4 +- .../pjb}/bridge/http/ChunkedInputStream.java | 4 +- .../pjb}/bridge/http/ChunkedOutputStream.java | 4 +- .../io/soluble/pjb}/bridge/http/Context.java | 12 ++--- .../pjb}/bridge/http/ContextFactory.java | 16 +++---- .../pjb}/bridge/http/ContextRunner.java | 12 ++--- .../pjb}/bridge/http/ContextServer.java | 13 ++--- .../DefaultCharsetWriterOutputStream.java | 4 +- .../bridge/http/FCGIConnectException.java | 2 +- .../pjb}/bridge/http/FCGIConnection.java | 2 +- .../bridge/http/FCGIConnectionException.java | 4 +- .../bridge/http/FCGIConnectionFactory.java | 8 ++-- .../http/FCGIConnectionInputStream.java | 6 +-- .../http/FCGIConnectionOutputStream.java | 6 +-- .../pjb}/bridge/http/FCGIConnectionPool.java | 4 +- .../pjb}/bridge/http/FCGIIOFactory.java | 2 +- .../pjb}/bridge/http/FCGIInputStream.java | 4 +- .../pjb}/bridge/http/FCGIOutputStream.java | 6 +-- .../io/soluble/pjb}/bridge/http/FCGIUtil.java | 2 +- .../pjb}/bridge/http/HeaderParser.java | 4 +- .../soluble/pjb}/bridge/http/HttpRequest.java | 4 +- .../pjb}/bridge/http/HttpResponse.java | 6 +-- .../soluble/pjb}/bridge/http/HttpServer.java | 12 ++--- .../io/soluble/pjb}/bridge/http/IContext.java | 30 ++++++------ .../pjb}/bridge/http/IContextFactory.java | 12 ++--- .../bridge/http/IContextFactoryVisitor.java | 2 +- .../pjb}/bridge/http/IContextServer.java | 4 +- .../pjb}/bridge/http/IFCGIProcess.java | 2 +- .../pjb}/bridge/http/IFCGIProcessFactory.java | 2 +- .../soluble/pjb}/bridge/http/NPChannel.java | 2 +- .../pjb}/bridge/http/NPChannelFactory.java | 6 +-- .../pjb}/bridge/http/OutputStreamFactory.java | 2 +- .../http/RandomAccessFileInputStream.java | 2 +- .../http/RandomAccessFileOutputStream.java | 4 +- .../bridge/http/RemoteHttpContextFactory.java | 12 ++--- .../bridge/http/SimpleContextFactory.java | 10 ++-- .../pjb}/bridge/http/SimpleHeaderParser.java | 2 +- .../pjb}/bridge/http/SocketChannel.java | 2 +- .../bridge/http/SocketChannelFactory.java | 8 ++-- .../pjb}/bridge/http/SocketContextServer.java | 22 ++++----- .../pjb}/bridge/http/WriterOutputStream.java | 4 +- .../io/soluble/pjb}/bridge/http/package.html | 0 .../java/io/soluble/pjb}/bridge/package.html | 0 .../pjb}/script/AbstractPhpScriptContext.java | 8 ++-- .../pjb}/script/AbstractPhpScriptEngine.java | 20 ++++---- .../io/soluble/pjb}/script/CGIRunner.java | 16 +++---- .../soluble/pjb}/script/CloneableScript.java | 2 +- .../CloseableInteractivePhpScriptEngine.java | 2 +- .../CloseableInvocablePhpScriptEngine.java | 2 +- .../pjb}/script/CloseablePhpScriptEngine.java | 2 +- .../pjb}/script/CompiledPhpScript.java | 2 +- .../io/soluble/pjb}/script/Continuation.java | 12 ++--- .../io/soluble/pjb}/script/FCGIProcess.java | 6 +-- .../io/soluble/pjb}/script/FastCGIProxy.java | 30 ++++++------ .../io/soluble/pjb}/script/HttpProxy.java | 8 ++-- .../io/soluble/pjb}/script/IContinuation.java | 2 +- .../pjb}/script/IPhpScriptContext.java | 14 +++--- .../soluble/pjb}/script/IPhpScriptEngine.java | 2 +- .../io/soluble/pjb}/script/IScriptReader.java | 6 +-- .../InteractivePhpScriptContextFactory.java | 8 ++-- .../script/InteractivePhpScriptEngine.java | 10 ++-- .../InteractivePhpScriptEngineFactory.java | 2 +- .../pjb}/script/InvocablePhpScriptEngine.java | 11 +++-- .../InvocablePhpScriptEngineFactory.java | 2 +- .../pjb}/script/JavaBridgeScriptRunner.java | 12 ++--- .../pjb}/script/PhpCompiledScriptContext.java | 6 +-- .../PhpJavaBridgeRunnerScriptContext.java | 6 +-- .../soluble/pjb}/script/PhpScriptContext.java | 24 +++++----- .../script/PhpScriptContextDecorator.java | 10 ++-- .../pjb}/script/PhpScriptContextFactory.java | 10 ++-- .../soluble/pjb}/script/PhpScriptEngine.java | 6 +-- .../pjb}/script/PhpScriptEngineFactory.java | 4 +- .../pjb}/script/PhpScriptException.java | 2 +- .../soluble/pjb}/script/PhpScriptWriter.java | 2 +- .../pjb}/script/PhpSecureScriptContext.java | 2 +- .../io/soluble/pjb}/script/ResultProxy.java | 4 +- .../pjb}/script/ScriptContextDecorator.java | 2 +- .../io/soluble/pjb}/script/URLReader.java | 6 +-- .../java/io/soluble/pjb}/script/package.html | 0 .../pjb}/script/servlet/HttpFastCGIProxy.java | 22 ++++----- .../script/servlet/PhpHttpScriptContext.java | 38 +++++++-------- .../script/servlet/PhpScriptLogWriter.java | 8 ++-- .../soluble/pjb}/script/servlet/package.html | 0 .../pjb}/servlet/BufferedResponse.java | 2 +- .../pjb}/servlet/ContextLoaderListener.java | 46 +++++++++--------- .../io/soluble/pjb}/servlet/HttpContext.java | 12 ++--- .../pjb}/servlet/HttpContextRunner.java | 12 ++--- .../pjb}/servlet/HttpSessionFacade.java | 6 +-- .../java/io/soluble/pjb}/servlet/Logger.java | 4 +- .../io/soluble/pjb}/servlet/PhpCGIFilter.java | 4 +- .../soluble/pjb}/servlet/PhpJavaServlet.java | 14 +++--- .../soluble/pjb}/servlet/RemoteContext.java | 4 +- .../RemoteHttpServletContextFactory.java | 22 ++++----- .../servlet/RemoteHttpServletRequest.java | 2 +- .../servlet/RemoteHttpServletResponse.java | 2 +- .../servlet/RemoteServletContextFactory.java | 14 +++--- .../pjb}/servlet/ServletContextFactory.java | 10 ++-- .../io/soluble/pjb}/servlet/ServletUtil.java | 6 +-- .../servlet/SimpleHttpServletResponse.java | 2 +- .../servlet/SimpleServletContextFactory.java | 14 +++--- .../servlet/VoidInputHttpServletRequest.java | 2 +- .../pjb}/servlet/fastcgi/FCGIProcess.java | 6 +-- .../pjb}/servlet/fastcgi/FastCGIServlet.java | 30 ++++++------ .../soluble/pjb}/servlet/fastcgi/package.html | 0 .../java/io/soluble/pjb}/servlet/package.html | 0 156 files changed, 556 insertions(+), 610 deletions(-) delete mode 100644 server/php/java/test/AllTests.java delete mode 100644 server/php/java/test/SimpleCompileable.java rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/AppThreadPool.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/Base64EncodingOutputBuffer.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/ChainsawLogger.java (94%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/ConstructorCache.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/DefaultOptions.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/FileLogger.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/GlobalRef.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/HexOutputBuffer.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/IDocHandler.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/IJavaBridgeFactory.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/ILogger.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/IManaged.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/ISession.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/ISocketFactory.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/IntegerComparator.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/Invocable.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/JavaBridge.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/JavaBridgeFactory.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/JavaBridgeIllegalArgumentException.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/JavaBridgeIllegalStateException.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/JavaBridgeRunner.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/JavaBridgeSecurityManager.java (93%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/MethodCache.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/NoSuchConstantException.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/NoSuchProcedureException.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/NotImplementedException.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/Options.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/Parser.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/ParserString.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/ParserTag.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/PhpArray.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/PhpExactNumber.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/PhpMap.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/PhpParserString.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/PhpProcedure.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/PhpString.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/Request.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/Response.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/SSLServerSocketHelper.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/Session.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/SessionFactory.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/SimpleLog4jLogger.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/SimplePhpString.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/Standalone.java (90%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/StringCache.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/TCPServerSocket.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/ThreadPool.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/Util.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/AbstractChannel.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/AbstractChannelName.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/ChunkedInputStream.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/ChunkedOutputStream.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/Context.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/ContextFactory.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/ContextRunner.java (94%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/ContextServer.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/DefaultCharsetWriterOutputStream.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/FCGIConnectException.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/FCGIConnection.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/FCGIConnectionException.java (93%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/FCGIConnectionFactory.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/FCGIConnectionInputStream.java (94%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/FCGIConnectionOutputStream.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/FCGIConnectionPool.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/FCGIIOFactory.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/FCGIInputStream.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/FCGIOutputStream.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/FCGIUtil.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/HeaderParser.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/HttpRequest.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/HttpResponse.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/HttpServer.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/IContext.java (83%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/IContextFactory.java (93%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/IContextFactoryVisitor.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/IContextServer.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/IFCGIProcess.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/IFCGIProcessFactory.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/NPChannel.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/NPChannelFactory.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/OutputStreamFactory.java (90%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/RandomAccessFileInputStream.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/RandomAccessFileOutputStream.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/RemoteHttpContextFactory.java (94%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/SimpleContextFactory.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/SimpleHeaderParser.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/SocketChannel.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/SocketChannelFactory.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/SocketContextServer.java (93%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/WriterOutputStream.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/http/package.html (100%) rename {server/php/java => src/main/java/io/soluble/pjb}/bridge/package.html (100%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/AbstractPhpScriptContext.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/AbstractPhpScriptEngine.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/CGIRunner.java (92%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/CloneableScript.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/CloseableInteractivePhpScriptEngine.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/CloseableInvocablePhpScriptEngine.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/CloseablePhpScriptEngine.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/CompiledPhpScript.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/Continuation.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/FCGIProcess.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/FastCGIProxy.java (92%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/HttpProxy.java (93%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/IContinuation.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/IPhpScriptContext.java (90%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/IPhpScriptEngine.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/IScriptReader.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/InteractivePhpScriptContextFactory.java (92%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/InteractivePhpScriptEngine.java (94%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/InteractivePhpScriptEngineFactory.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/InvocablePhpScriptEngine.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/InvocablePhpScriptEngineFactory.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/JavaBridgeScriptRunner.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/PhpCompiledScriptContext.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/PhpJavaBridgeRunnerScriptContext.java (94%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/PhpScriptContext.java (90%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/PhpScriptContextDecorator.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/PhpScriptContextFactory.java (86%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/PhpScriptEngine.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/PhpScriptEngineFactory.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/PhpScriptException.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/PhpScriptWriter.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/PhpSecureScriptContext.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/ResultProxy.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/ScriptContextDecorator.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/URLReader.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/package.html (100%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/servlet/HttpFastCGIProxy.java (84%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/servlet/PhpHttpScriptContext.java (90%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/servlet/PhpScriptLogWriter.java (92%) rename {server/php/java => src/main/java/io/soluble/pjb}/script/servlet/package.html (100%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/BufferedResponse.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/ContextLoaderListener.java (94%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/HttpContext.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/HttpContextRunner.java (94%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/HttpSessionFacade.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/Logger.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/PhpCGIFilter.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/PhpJavaServlet.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/RemoteContext.java (97%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/RemoteHttpServletContextFactory.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/RemoteHttpServletRequest.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/RemoteHttpServletResponse.java (99%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/RemoteServletContextFactory.java (92%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/ServletContextFactory.java (92%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/ServletUtil.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/SimpleHttpServletResponse.java (98%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/SimpleServletContextFactory.java (93%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/VoidInputHttpServletRequest.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/fastcgi/FCGIProcess.java (95%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/fastcgi/FastCGIServlet.java (96%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/fastcgi/package.html (100%) rename {server/php/java => src/main/java/io/soluble/pjb}/servlet/package.html (100%) diff --git a/server/php/java/test/AllTests.java b/server/php/java/test/AllTests.java deleted file mode 100644 index 2b9b72c..0000000 --- a/server/php/java/test/AllTests.java +++ /dev/null @@ -1,32 +0,0 @@ -package php.java.test; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTests { - - public static Test suite() { - TestSuite suite = new TestSuite("Test for php.java.test"); - //$JUnit-BEGIN$ - suite.addTestSuite(TestException.class); - suite.addTestSuite(TestGetResult.class); - suite.addTestSuite(SimpleCompileable.class); - suite.addTestSuite(TestGetInterface.class); - suite.addTestSuite(TestScript.class); - suite.addTestSuite(TestInvocablePhpScriptEngine.class); - suite.addTestSuite(TestExceptionInvocable.class); - suite.addTestSuite(TestSetWriter.class); - suite.addTestSuite(TestInteractiveRequestAbort.class); - suite.addTestSuite(TestExceptionInvocable2.class); - suite.addTestSuite(TestSimpleInvocation.class); - suite.addTestSuite(TestInvocable.class); - suite.addTestSuite(TestURLReader.class); - suite.addTestSuite(TestCli.class); - suite.addTestSuite(TestPhpScriptEngine.class); - suite.addTestSuite(TestDiscovery.class); - suite.addTestSuite(TestBindings.class); - //$JUnit-END$ - return suite; - } - -} diff --git a/server/php/java/test/SimpleCompileable.java b/server/php/java/test/SimpleCompileable.java deleted file mode 100644 index 44e4139..0000000 --- a/server/php/java/test/SimpleCompileable.java +++ /dev/null @@ -1,33 +0,0 @@ -package php.java.test; - -import javax.script.Compilable; -import javax.script.CompiledScript; -import javax.script.ScriptEngineManager; - -import junit.framework.TestCase; - -public class SimpleCompileable extends TestCase { - - private CompiledScript script; - - public SimpleCompileable(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - script = ((Compilable) (new ScriptEngineManager().getEngineByName("php"))).compile( - "get('hello').'!'; ?>"); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void test() throws Exception { - script.getEngine().put("hello", "world!"); - script.eval(); - script.getEngine().put("hello", String.valueOf(this)); - script.eval(); - } -} diff --git a/server/php/java/bridge/AppThreadPool.java b/src/main/java/io/soluble/pjb/bridge/AppThreadPool.java similarity index 98% rename from server/php/java/bridge/AppThreadPool.java rename to src/main/java/io/soluble/pjb/bridge/AppThreadPool.java index 9688f1d..63a5ea2 100644 --- a/server/php/java/bridge/AppThreadPool.java +++ b/src/main/java/io/soluble/pjb/bridge/AppThreadPool.java @@ -1,7 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package php.java.bridge; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -24,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + /** * A specialized thread pool which automatically terminates all group threads at the end of the request. * When this thread pool is used, users cannot create long-running threads from PHP scripts diff --git a/server/php/java/bridge/Base64EncodingOutputBuffer.java b/src/main/java/io/soluble/pjb/bridge/Base64EncodingOutputBuffer.java similarity index 99% rename from server/php/java/bridge/Base64EncodingOutputBuffer.java rename to src/main/java/io/soluble/pjb/bridge/Base64EncodingOutputBuffer.java index 5f4d30e..27f5782 100644 --- a/server/php/java/bridge/Base64EncodingOutputBuffer.java +++ b/src/main/java/io/soluble/pjb/bridge/Base64EncodingOutputBuffer.java @@ -18,7 +18,7 @@ * limitations under the License. */ -package php.java.bridge; +package io.soluble.pjb.bridge; class Base64EncodingOutputBuffer extends HexOutputBuffer { static private final int LOOKUPLENGTH = 64; diff --git a/server/php/java/bridge/ChainsawLogger.java b/src/main/java/io/soluble/pjb/bridge/ChainsawLogger.java similarity index 94% rename from server/php/java/bridge/ChainsawLogger.java rename to src/main/java/io/soluble/pjb/bridge/ChainsawLogger.java index cd696e0..8f12fa6 100644 --- a/server/php/java/bridge/ChainsawLogger.java +++ b/src/main/java/io/soluble/pjb/bridge/ChainsawLogger.java @@ -22,7 +22,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package php.java.bridge; +package io.soluble.pjb.bridge; import java.lang.reflect.Constructor; import java.lang.reflect.Method; @@ -36,7 +36,7 @@ * Programming -> Chainsaw or via:

java -classpath * /usr/share/java/log4j.jar org.apache.log4j.chainsaw.Main
* and then start the PHP/Java Bridge:
- *
java -classpath /usr/share/java/log4j.jar:/usr/share/java/JavaBridge.jar php.java.bridge.JavaBridge
+ *
java -classpath /usr/share/java/log4j.jar:/usr/share/java/JavaBridge.jar io.soluble.pjb.bridge.JavaBridge
* or set the PHP .ini option
java.log_file=@127.0.0.1:4445
. */ public class ChainsawLogger extends SimpleLog4jLogger implements ILogger { @@ -90,7 +90,7 @@ protected void init() throws Exception { * Create a new chainsaw logger. * * @throws UnknownHostException If the host does not exist. - * @see php.java.bridge.Util#setDefaultLogger(ILogger) + * @see io.soluble.pjb.bridge.Util#setDefaultLogger(ILogger) */ protected ChainsawLogger() { super(); @@ -101,7 +101,7 @@ protected ChainsawLogger() { * * @return The chainsaw logger * @throws Exception If chainsaw isn't running. - * @see php.java.bridge.Util#setDefaultLogger(ILogger) + * @see io.soluble.pjb.bridge.Util#setDefaultLogger(ILogger) */ public static ChainsawLogger createChainsawLogger() throws Exception { ChainsawLogger logger = new ChainsawLogger(); diff --git a/server/php/java/bridge/ConstructorCache.java b/src/main/java/io/soluble/pjb/bridge/ConstructorCache.java similarity index 99% rename from server/php/java/bridge/ConstructorCache.java rename to src/main/java/io/soluble/pjb/bridge/ConstructorCache.java index 8cd14da..65671af 100644 --- a/server/php/java/bridge/ConstructorCache.java +++ b/src/main/java/io/soluble/pjb/bridge/ConstructorCache.java @@ -22,7 +22,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package php.java.bridge; +package io.soluble.pjb.bridge; import java.lang.reflect.Constructor; import java.util.HashMap; diff --git a/server/php/java/bridge/DefaultOptions.java b/src/main/java/io/soluble/pjb/bridge/DefaultOptions.java similarity index 96% rename from server/php/java/bridge/DefaultOptions.java rename to src/main/java/io/soluble/pjb/bridge/DefaultOptions.java index 9d97392..d33f741 100644 --- a/server/php/java/bridge/DefaultOptions.java +++ b/src/main/java/io/soluble/pjb/bridge/DefaultOptions.java @@ -1,8 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package php.java.bridge; - - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -25,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + /** * Exposes the request options. There is one Options instance for each request, but certain options may change for each packet. * For example if a user calls java_set_file_encoding(enc), the new file encoding becomes available in the next packet. diff --git a/server/php/java/bridge/FileLogger.java b/src/main/java/io/soluble/pjb/bridge/FileLogger.java similarity index 96% rename from server/php/java/bridge/FileLogger.java rename to src/main/java/io/soluble/pjb/bridge/FileLogger.java index 129bab1..b26bd86 100644 --- a/server/php/java/bridge/FileLogger.java +++ b/src/main/java/io/soluble/pjb/bridge/FileLogger.java @@ -22,7 +22,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package php.java.bridge; +package io.soluble.pjb.bridge; import java.io.FileNotFoundException; import java.util.Date; @@ -86,7 +86,7 @@ public void log(String s) { } /* (non-Javadoc) - * @see php.java.bridge.ILogger#printStackTrace(java.lang.Throwable) + * @see io.soluble.pjb.bridge.ILogger#printStackTrace(java.lang.Throwable) */ public void printStackTrace(Throwable t) { if (!isInit) init(); @@ -101,7 +101,7 @@ public void printStackTrace(Throwable t) { } /* (non-Javadoc) - * @see php.java.bridge.ILogger#log(int, java.lang.String) + * @see io.soluble.pjb.bridge.ILogger#log(int, java.lang.String) */ public void log(int level, String msg) { StringBuffer b = new StringBuffer(now()); diff --git a/server/php/java/bridge/GlobalRef.java b/src/main/java/io/soluble/pjb/bridge/GlobalRef.java similarity index 99% rename from server/php/java/bridge/GlobalRef.java rename to src/main/java/io/soluble/pjb/bridge/GlobalRef.java index a4cdc85..229b01f 100644 --- a/server/php/java/bridge/GlobalRef.java +++ b/src/main/java/io/soluble/pjb/bridge/GlobalRef.java @@ -22,7 +22,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package php.java.bridge; +package io.soluble.pjb.bridge; /** * A global array of object references that the client keeps during diff --git a/server/php/java/bridge/HexOutputBuffer.java b/src/main/java/io/soluble/pjb/bridge/HexOutputBuffer.java similarity index 98% rename from server/php/java/bridge/HexOutputBuffer.java rename to src/main/java/io/soluble/pjb/bridge/HexOutputBuffer.java index d544d81..6ad8862 100644 --- a/server/php/java/bridge/HexOutputBuffer.java +++ b/src/main/java/io/soluble/pjb/bridge/HexOutputBuffer.java @@ -1,6 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -23,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/server/php/java/bridge/IDocHandler.java b/src/main/java/io/soluble/pjb/bridge/IDocHandler.java similarity index 98% rename from server/php/java/bridge/IDocHandler.java rename to src/main/java/io/soluble/pjb/bridge/IDocHandler.java index a52dccf..20a4266 100644 --- a/server/php/java/bridge/IDocHandler.java +++ b/src/main/java/io/soluble/pjb/bridge/IDocHandler.java @@ -22,7 +22,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package php.java.bridge; +package io.soluble.pjb.bridge; import java.io.IOException; import java.io.InputStream; diff --git a/server/php/java/bridge/IJavaBridgeFactory.java b/src/main/java/io/soluble/pjb/bridge/IJavaBridgeFactory.java similarity index 96% rename from server/php/java/bridge/IJavaBridgeFactory.java rename to src/main/java/io/soluble/pjb/bridge/IJavaBridgeFactory.java index d44c74e..4b2cd43 100644 --- a/server/php/java/bridge/IJavaBridgeFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/IJavaBridgeFactory.java @@ -1,8 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package php.java.bridge; - - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -25,10 +20,12 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + import java.io.IOException; import java.io.InputStream; -import php.java.bridge.http.IContext; +import io.soluble.pjb.bridge.http.IContext; /** * Create {@link JavaBridge}, {@link IContext} and {@link ISession} instances. diff --git a/server/php/java/bridge/ILogger.java b/src/main/java/io/soluble/pjb/bridge/ILogger.java similarity index 97% rename from server/php/java/bridge/ILogger.java rename to src/main/java/io/soluble/pjb/bridge/ILogger.java index a0f8840..d200f38 100644 --- a/server/php/java/bridge/ILogger.java +++ b/src/main/java/io/soluble/pjb/bridge/ILogger.java @@ -1,7 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package php.java.bridge; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -24,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + /** * The log interface for the PHP/Java Bridge log. * diff --git a/server/php/java/bridge/IManaged.java b/src/main/java/io/soluble/pjb/bridge/IManaged.java similarity index 97% rename from server/php/java/bridge/IManaged.java rename to src/main/java/io/soluble/pjb/bridge/IManaged.java index faa174e..ebc7dd4 100644 --- a/server/php/java/bridge/IManaged.java +++ b/src/main/java/io/soluble/pjb/bridge/IManaged.java @@ -1,6 +1,8 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; + +import io.soluble.pjb.bridge.*; /* diff --git a/server/php/java/bridge/ISession.java b/src/main/java/io/soluble/pjb/bridge/ISession.java similarity index 99% rename from server/php/java/bridge/ISession.java rename to src/main/java/io/soluble/pjb/bridge/ISession.java index 8f04d0f..8b114a8 100644 --- a/server/php/java/bridge/ISession.java +++ b/src/main/java/io/soluble/pjb/bridge/ISession.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -24,6 +24,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +import io.soluble.pjb.bridge.*; import java.util.Map; /** diff --git a/server/php/java/bridge/ISocketFactory.java b/src/main/java/io/soluble/pjb/bridge/ISocketFactory.java similarity index 96% rename from server/php/java/bridge/ISocketFactory.java rename to src/main/java/io/soluble/pjb/bridge/ISocketFactory.java index 785a155..cb12a3a 100644 --- a/server/php/java/bridge/ISocketFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/ISocketFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -24,6 +24,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +import io.soluble.pjb.bridge.*; import java.io.IOException; import java.net.Socket; diff --git a/server/php/java/bridge/IntegerComparator.java b/src/main/java/io/soluble/pjb/bridge/IntegerComparator.java similarity index 95% rename from server/php/java/bridge/IntegerComparator.java rename to src/main/java/io/soluble/pjb/bridge/IntegerComparator.java index 83f94a5..e8a2445 100644 --- a/server/php/java/bridge/IntegerComparator.java +++ b/src/main/java/io/soluble/pjb/bridge/IntegerComparator.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -24,6 +24,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +import io.soluble.pjb.bridge.*; import java.util.Comparator; final class IntegerComparator implements Comparator { diff --git a/server/php/java/bridge/Invocable.java b/src/main/java/io/soluble/pjb/bridge/Invocable.java similarity index 96% rename from server/php/java/bridge/Invocable.java rename to src/main/java/io/soluble/pjb/bridge/Invocable.java index 9b64de4..60fbf6a 100644 --- a/server/php/java/bridge/Invocable.java +++ b/src/main/java/io/soluble/pjb/bridge/Invocable.java @@ -1,6 +1,8 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; + +import io.soluble.pjb.bridge.*; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/JavaBridge.java b/src/main/java/io/soluble/pjb/bridge/JavaBridge.java similarity index 99% rename from server/php/java/bridge/JavaBridge.java rename to src/main/java/io/soluble/pjb/bridge/JavaBridge.java index 46f0c2f..8f6ba42 100644 --- a/server/php/java/bridge/JavaBridge.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaBridge.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier and others. @@ -56,8 +56,8 @@ * @author Sam Ruby (methods coerce and select) * @author Kai Londenberg * @author Jost Boekemeier - * @see php.java.bridge.Standalone - * @see php.java.servlet.PhpJavaServlet + * @see io.soluble.pjb.bridge.Standalone + * @see io.soluble.pjb.servlet.PhpJavaServlet */ public class JavaBridge implements Runnable { @@ -289,7 +289,7 @@ static void initLog(String socket, int logLevel, String s[]) { Util.logMessage("default logLevel : " + Util.logLevel); Util.logMessage("socket : " + socket); Util.logMessage("java.ext.dirs : " + System.getProperty("java.ext.dirs")); - Util.logMessage("php.java.bridge.base: " + Util.JAVABRIDGE_BASE); + Util.logMessage("io.soluble.pjb.bridge.base: " + Util.JAVABRIDGE_BASE); Util.logMessage("thread pool size : " + Util.THREAD_POOL_MAX_SIZE); } catch (Throwable t) { throw new RuntimeException(t); @@ -304,7 +304,7 @@ static void init(ISocketFactory socket, int logLevel, String s[]) { String policy = System.getProperty("java.security.policy"); String base = Util.JAVABRIDGE_BASE; if (policy != null && base != null) { - SecurityManager manager = new php.java.bridge.JavaBridgeSecurityManager(); + SecurityManager manager = new JavaBridgeSecurityManager(); System.setSecurityManager(manager); Util.logMessage(Util.EXTENSION_NAME + " policy base : " + base); Util.logMessage(Util.EXTENSION_NAME + " security policy : " + policy); @@ -347,7 +347,7 @@ static void init(ISocketFactory socket, int logLevel, String s[]) { * * @param s an array of [socketname, level, logFile] * Use Standalone.main() - * @see php.java.bridge.Standalone#main(String[]) + * @see io.soluble.pjb.bridge.Standalone#main(String[]) */ public static void main(String s[]) { Standalone.main(s); @@ -1503,7 +1503,7 @@ protected JavaBridge(IJavaBridgeFactory factory) { * * @param value - The value which must be an array or implement Map or Collection. * @return The PHP map. - * @see php.java.bridge.PhpMap + * @see io.soluble.pjb.bridge.PhpMap */ public PhpMap getPhpMap(Object value) { return PhpMap.getPhpMap(value, this); @@ -1672,7 +1672,7 @@ public Object getContext() { * @param timeout session timeout in seconds. If timeout is <= 0, the session will never expire * @return The session context. * @throws Exception - * @see php.java.bridge.ISession + * @see io.soluble.pjb.bridge.ISession */ public ISession getSession(String name, short clientIsNew, int timeout) throws Exception { if (timeout == 0) timeout = -1; diff --git a/server/php/java/bridge/JavaBridgeFactory.java b/src/main/java/io/soluble/pjb/bridge/JavaBridgeFactory.java similarity index 95% rename from server/php/java/bridge/JavaBridgeFactory.java rename to src/main/java/io/soluble/pjb/bridge/JavaBridgeFactory.java index e0fe441..e0f5225 100644 --- a/server/php/java/bridge/JavaBridgeFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaBridgeFactory.java @@ -1,11 +1,11 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; import java.io.IOException; import java.io.InputStream; -import php.java.bridge.http.IContext; +import io.soluble.pjb.bridge.http.IContext; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -35,9 +35,9 @@ * * @author jostb * @see php.java.bridge.Session - * @see php.java.bridge.http.Context + * @see io.soluble.pjb.bridge.http.Context * @see php.java.servlet.HttpContext - * @see php.java.bridge.http.ContextFactory + * @see io.soluble.pjb.bridge.http.ContextFactory * @see php.java.servlet.ServletContextFactory * @see php.java.script.PhpScriptContextFactory */ diff --git a/server/php/java/bridge/JavaBridgeIllegalArgumentException.java b/src/main/java/io/soluble/pjb/bridge/JavaBridgeIllegalArgumentException.java similarity index 96% rename from server/php/java/bridge/JavaBridgeIllegalArgumentException.java rename to src/main/java/io/soluble/pjb/bridge/JavaBridgeIllegalArgumentException.java index 6d1c244..3fd8a05 100644 --- a/server/php/java/bridge/JavaBridgeIllegalArgumentException.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaBridgeIllegalArgumentException.java @@ -1,6 +1,8 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; + +import io.soluble.pjb.bridge.*; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/JavaBridgeIllegalStateException.java b/src/main/java/io/soluble/pjb/bridge/JavaBridgeIllegalStateException.java similarity index 96% rename from server/php/java/bridge/JavaBridgeIllegalStateException.java rename to src/main/java/io/soluble/pjb/bridge/JavaBridgeIllegalStateException.java index c0807b6..7407c1a 100644 --- a/server/php/java/bridge/JavaBridgeIllegalStateException.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaBridgeIllegalStateException.java @@ -1,6 +1,8 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; + +import io.soluble.pjb.bridge.*; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/JavaBridgeRunner.java b/src/main/java/io/soluble/pjb/bridge/JavaBridgeRunner.java similarity index 97% rename from server/php/java/bridge/JavaBridgeRunner.java rename to src/main/java/io/soluble/pjb/bridge/JavaBridgeRunner.java index 36168d8..d724f4d 100644 --- a/server/php/java/bridge/JavaBridgeRunner.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaBridgeRunner.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -38,14 +38,14 @@ import java.util.Iterator; import java.util.List; -import php.java.bridge.http.ChunkedInputStream; -import php.java.bridge.http.ChunkedOutputStream; -import php.java.bridge.http.ContextFactory; -import php.java.bridge.http.ContextServer; -import php.java.bridge.http.HttpRequest; -import php.java.bridge.http.HttpResponse; -import php.java.bridge.http.HttpServer; -import php.java.bridge.http.RemoteHttpContextFactory; +import io.soluble.pjb.bridge.http.ChunkedInputStream; +import io.soluble.pjb.bridge.http.ChunkedOutputStream; +import io.soluble.pjb.bridge.http.ContextFactory; +import io.soluble.pjb.bridge.http.ContextServer; +import io.soluble.pjb.bridge.http.HttpRequest; +import io.soluble.pjb.bridge.http.HttpResponse; +import io.soluble.pjb.bridge.http.HttpServer; +import io.soluble.pjb.bridge.http.RemoteHttpContextFactory; /** * This is the main entry point for the PHP/Java Bridge library. diff --git a/server/php/java/bridge/JavaBridgeSecurityManager.java b/src/main/java/io/soluble/pjb/bridge/JavaBridgeSecurityManager.java similarity index 93% rename from server/php/java/bridge/JavaBridgeSecurityManager.java rename to src/main/java/io/soluble/pjb/bridge/JavaBridgeSecurityManager.java index 644ab5d..5ed27a7 100644 --- a/server/php/java/bridge/JavaBridgeSecurityManager.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaBridgeSecurityManager.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -30,11 +30,11 @@ * A custom security manager for the PHP/Java Bridge. *

* Example:
- * PHP_HOME=/usr/lib/php/modules java -Dphp.java.bridge.base=${PHP_HOME} -Djava.security.policy=${PHP_HOME}/javabridge.policy -jar ${PHP_HOME}/JavaBridge.jar + * PHP_HOME=/usr/lib/php/modules java -Dio.soluble.pjb.bridge.base=${PHP_HOME} -Djava.security.policy=${PHP_HOME}/javabridge.policy -jar ${PHP_HOME}/JavaBridge.jar *
* Example options for eclipse:
* - * -Dphp.java.bridge.base=${workspace_loc}${project_path}/
+ * -Dio.soluble.pjb.bridge.base=${workspace_loc}${project_path}/
* -Djava.security.policy=${workspace_loc}${project_path}/javabridge.policy *

* diff --git a/server/php/java/bridge/MethodCache.java b/src/main/java/io/soluble/pjb/bridge/MethodCache.java similarity index 98% rename from server/php/java/bridge/MethodCache.java rename to src/main/java/io/soluble/pjb/bridge/MethodCache.java index 33a2fa4..f664594 100644 --- a/server/php/java/bridge/MethodCache.java +++ b/src/main/java/io/soluble/pjb/bridge/MethodCache.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -24,6 +24,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +import io.soluble.pjb.bridge.*; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; diff --git a/server/php/java/bridge/NoSuchConstantException.java b/src/main/java/io/soluble/pjb/bridge/NoSuchConstantException.java similarity index 96% rename from server/php/java/bridge/NoSuchConstantException.java rename to src/main/java/io/soluble/pjb/bridge/NoSuchConstantException.java index 1133350..08670e9 100644 --- a/server/php/java/bridge/NoSuchConstantException.java +++ b/src/main/java/io/soluble/pjb/bridge/NoSuchConstantException.java @@ -1,6 +1,8 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; + +import io.soluble.pjb.bridge.*; /* * Copyright (C) 2003-2007 Jost Boekemeier and others. diff --git a/server/php/java/bridge/NoSuchProcedureException.java b/src/main/java/io/soluble/pjb/bridge/NoSuchProcedureException.java similarity index 96% rename from server/php/java/bridge/NoSuchProcedureException.java rename to src/main/java/io/soluble/pjb/bridge/NoSuchProcedureException.java index f35b44b..c72ac40 100644 --- a/server/php/java/bridge/NoSuchProcedureException.java +++ b/src/main/java/io/soluble/pjb/bridge/NoSuchProcedureException.java @@ -1,6 +1,8 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; + +import io.soluble.pjb.bridge.*; /* * Copyright (C) 2003-2007 Jost Boekemeier and others. diff --git a/server/php/java/bridge/NotImplementedException.java b/src/main/java/io/soluble/pjb/bridge/NotImplementedException.java similarity index 96% rename from server/php/java/bridge/NotImplementedException.java rename to src/main/java/io/soluble/pjb/bridge/NotImplementedException.java index 4482a2c..faced7a 100644 --- a/server/php/java/bridge/NotImplementedException.java +++ b/src/main/java/io/soluble/pjb/bridge/NotImplementedException.java @@ -1,5 +1,7 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; + +import io.soluble.pjb.bridge.*; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/Options.java b/src/main/java/io/soluble/pjb/bridge/Options.java similarity index 98% rename from server/php/java/bridge/Options.java rename to src/main/java/io/soluble/pjb/bridge/Options.java index 1b87930..16ba91b 100644 --- a/server/php/java/bridge/Options.java +++ b/src/main/java/io/soluble/pjb/bridge/Options.java @@ -1,7 +1,4 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package php.java.bridge; - +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/Parser.java b/src/main/java/io/soluble/pjb/bridge/Parser.java similarity index 99% rename from server/php/java/bridge/Parser.java rename to src/main/java/io/soluble/pjb/bridge/Parser.java index d307db2..51f6335 100644 --- a/server/php/java/bridge/Parser.java +++ b/src/main/java/io/soluble/pjb/bridge/Parser.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/ParserString.java b/src/main/java/io/soluble/pjb/bridge/ParserString.java similarity index 99% rename from server/php/java/bridge/ParserString.java rename to src/main/java/io/soluble/pjb/bridge/ParserString.java index dcf9f70..b39b85f 100644 --- a/server/php/java/bridge/ParserString.java +++ b/src/main/java/io/soluble/pjb/bridge/ParserString.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/ParserTag.java b/src/main/java/io/soluble/pjb/bridge/ParserTag.java similarity index 95% rename from server/php/java/bridge/ParserTag.java rename to src/main/java/io/soluble/pjb/bridge/ParserTag.java index bc50fcc..f2f06ea 100644 --- a/server/php/java/bridge/ParserTag.java +++ b/src/main/java/io/soluble/pjb/bridge/ParserTag.java @@ -1,6 +1,8 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; + +import io.soluble.pjb.bridge.*; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/PhpArray.java b/src/main/java/io/soluble/pjb/bridge/PhpArray.java similarity index 98% rename from server/php/java/bridge/PhpArray.java rename to src/main/java/io/soluble/pjb/bridge/PhpArray.java index fe71272..f2d68ab 100644 --- a/server/php/java/bridge/PhpArray.java +++ b/src/main/java/io/soluble/pjb/bridge/PhpArray.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/PhpExactNumber.java b/src/main/java/io/soluble/pjb/bridge/PhpExactNumber.java similarity index 96% rename from server/php/java/bridge/PhpExactNumber.java rename to src/main/java/io/soluble/pjb/bridge/PhpExactNumber.java index 8683795..e43bf7b 100644 --- a/server/php/java/bridge/PhpExactNumber.java +++ b/src/main/java/io/soluble/pjb/bridge/PhpExactNumber.java @@ -1,6 +1,8 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; + +import io.soluble.pjb.bridge.*; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/PhpMap.java b/src/main/java/io/soluble/pjb/bridge/PhpMap.java similarity index 99% rename from server/php/java/bridge/PhpMap.java rename to src/main/java/io/soluble/pjb/bridge/PhpMap.java index e78566e..2168746 100644 --- a/server/php/java/bridge/PhpMap.java +++ b/src/main/java/io/soluble/pjb/bridge/PhpMap.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -24,6 +24,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +import io.soluble.pjb.bridge.*; import java.lang.reflect.Array; import java.util.Collection; import java.util.Iterator; diff --git a/server/php/java/bridge/PhpParserString.java b/src/main/java/io/soluble/pjb/bridge/PhpParserString.java similarity index 98% rename from server/php/java/bridge/PhpParserString.java rename to src/main/java/io/soluble/pjb/bridge/PhpParserString.java index 3ce47aa..7f0a6ca 100644 --- a/server/php/java/bridge/PhpParserString.java +++ b/src/main/java/io/soluble/pjb/bridge/PhpParserString.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/PhpProcedure.java b/src/main/java/io/soluble/pjb/bridge/PhpProcedure.java similarity index 99% rename from server/php/java/bridge/PhpProcedure.java rename to src/main/java/io/soluble/pjb/bridge/PhpProcedure.java index bb4bdd2..c66303b 100644 --- a/server/php/java/bridge/PhpProcedure.java +++ b/src/main/java/io/soluble/pjb/bridge/PhpProcedure.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/PhpString.java b/src/main/java/io/soluble/pjb/bridge/PhpString.java similarity index 96% rename from server/php/java/bridge/PhpString.java rename to src/main/java/io/soluble/pjb/bridge/PhpString.java index 7867a52..24330a5 100644 --- a/server/php/java/bridge/PhpString.java +++ b/src/main/java/io/soluble/pjb/bridge/PhpString.java @@ -1,6 +1,5 @@ -/*-*- mode: Java; tab-width:8 -*-*/ +package io.soluble.pjb.bridge; -package php.java.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/Request.java b/src/main/java/io/soluble/pjb/bridge/Request.java similarity index 99% rename from server/php/java/bridge/Request.java rename to src/main/java/io/soluble/pjb/bridge/Request.java index a356807..f8ac0d9 100644 --- a/server/php/java/bridge/Request.java +++ b/src/main/java/io/soluble/pjb/bridge/Request.java @@ -1,6 +1,4 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/Response.java b/src/main/java/io/soluble/pjb/bridge/Response.java similarity index 99% rename from server/php/java/bridge/Response.java rename to src/main/java/io/soluble/pjb/bridge/Response.java index 00c1c77..1ff345d 100644 --- a/server/php/java/bridge/Response.java +++ b/src/main/java/io/soluble/pjb/bridge/Response.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/SSLServerSocketHelper.java b/src/main/java/io/soluble/pjb/bridge/SSLServerSocketHelper.java similarity index 98% rename from server/php/java/bridge/SSLServerSocketHelper.java rename to src/main/java/io/soluble/pjb/bridge/SSLServerSocketHelper.java index 6e9d8de..b6b06c9 100644 --- a/server/php/java/bridge/SSLServerSocketHelper.java +++ b/src/main/java/io/soluble/pjb/bridge/SSLServerSocketHelper.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -24,6 +24,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +import io.soluble.pjb.bridge.*; import java.io.IOException; import java.io.InputStream; import java.net.InetAddress; diff --git a/server/php/java/bridge/Session.java b/src/main/java/io/soluble/pjb/bridge/Session.java similarity index 99% rename from server/php/java/bridge/Session.java rename to src/main/java/io/soluble/pjb/bridge/Session.java index 43166c5..6e8a08f 100644 --- a/server/php/java/bridge/Session.java +++ b/src/main/java/io/soluble/pjb/bridge/Session.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/SessionFactory.java b/src/main/java/io/soluble/pjb/bridge/SessionFactory.java similarity index 96% rename from server/php/java/bridge/SessionFactory.java rename to src/main/java/io/soluble/pjb/bridge/SessionFactory.java index d76b46d..10b2651 100644 --- a/server/php/java/bridge/SessionFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/SessionFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -30,17 +30,16 @@ import java.util.LinkedList; import java.util.List; -import php.java.bridge.Util.Thread; -import php.java.bridge.http.IContext; +import io.soluble.pjb.bridge.http.IContext; /** * Create new session instances * * @author jostb * @see php.java.bridge.Session - * @see php.java.bridge.http.Context + * @see io.soluble.pjb.bridge.http.Context * @see php.java.servlet.HttpContext - * @see php.java.bridge.http.ContextFactory + * @see io.soluble.pjb.bridge.http.ContextFactory * @see php.java.servlet.ServletContextFactory * @see php.java.script.PhpScriptContextFactory */ diff --git a/server/php/java/bridge/SimpleLog4jLogger.java b/src/main/java/io/soluble/pjb/bridge/SimpleLog4jLogger.java similarity index 95% rename from server/php/java/bridge/SimpleLog4jLogger.java rename to src/main/java/io/soluble/pjb/bridge/SimpleLog4jLogger.java index 30c85fc..87aa66a 100644 --- a/server/php/java/bridge/SimpleLog4jLogger.java +++ b/src/main/java/io/soluble/pjb/bridge/SimpleLog4jLogger.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -40,7 +40,7 @@ protected class LoggerProxy { protected LoggerProxy() throws Exception { Class c = Class.forName("org.apache.log4j.Logger"); Method m = c.getMethod("getLogger", new Class[]{String.class}); - logger = m.invoke(c, new Object[]{"php.java.bridge.JavaBridge"}); + logger = m.invoke(c, new Object[]{"io.soluble.pjb.bridge.JavaBridge"}); c = priority = Class.forName("org.apache.log4j.Priority"); fatal = c.getField("FATAL").get(c); error = c.getField("ERROR").get(c); @@ -85,7 +85,7 @@ public synchronized void log(int level, String msg) throws Exception { /** * Create a new log4j logger using the default appender. * - * @see php.java.bridge.Util#setDefaultLogger(ILogger) + * @see io.soluble.pjb.bridge.Util#setDefaultLogger(ILogger) */ protected SimpleLog4jLogger() { } diff --git a/server/php/java/bridge/SimplePhpString.java b/src/main/java/io/soluble/pjb/bridge/SimplePhpString.java similarity index 95% rename from server/php/java/bridge/SimplePhpString.java rename to src/main/java/io/soluble/pjb/bridge/SimplePhpString.java index c0ff2e7..7677234 100644 --- a/server/php/java/bridge/SimplePhpString.java +++ b/src/main/java/io/soluble/pjb/bridge/SimplePhpString.java @@ -1,6 +1,8 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; + +import io.soluble.pjb.bridge.*; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/Standalone.java b/src/main/java/io/soluble/pjb/bridge/Standalone.java similarity index 90% rename from server/php/java/bridge/Standalone.java rename to src/main/java/io/soluble/pjb/bridge/Standalone.java index 02e6bc3..df20174 100644 --- a/server/php/java/bridge/Standalone.java +++ b/src/main/java/io/soluble/pjb/bridge/Standalone.java @@ -1,5 +1,5 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -93,8 +93,8 @@ protected void javaUsage() { System.err.println("The certificate for example 3 can be created with e.g.: jdk1.6.0/bin/keytool -keystore mySrvKeystore -genkey -keyalg RSA"); System.err.println(""); System.err.println("Influential system properties: threads, daemon, php_exec, default_log_file, default_log_level, base."); - System.err.println("Example: java -Djava.awt.headless=\"true\" -Dphp.java.bridge.threads=50 -Dphp.java.bridge.base=/usr/lib/php/modules -Dphp.java.bridge.php_exec=/usr/local/bin/php-cgi -Dphp.java.bridge.default_log_file= -Dphp.java.bridge.default_log_level=5 -jar JavaBridge.jar"); - System.err.println("Example: java -Dphp.java.bridge.daemon=\"true\" -jar JavaBridge.jar"); + System.err.println("Example: java -Djava.awt.headless=\"true\" -Dio.soluble.pjb.bridge.threads=50 -Dio.soluble.pjb.bridge.base=/usr/lib/php/modules -Dio.soluble.pjb.bridge.php_exec=/usr/local/bin/php-cgi -Dio.soluble.pjb.bridge.default_log_file= -Dio.soluble.pjb.bridge.default_log_level=5 -jar JavaBridge.jar"); + System.err.println("Example: java -Dio.soluble.pjb.bridge.daemon=\"true\" -jar JavaBridge.jar"); } protected void usage() { @@ -183,7 +183,7 @@ protected void init(String s[]) { ISocketFactory socket = bind(logLevel, sockname); - if ("true".equals(System.getProperty("php.java.bridge.test.startup"))) System.exit(0); + if ("true".equals(System.getProperty("io.soluble.pjb.bridge.test.startup"))) System.exit(0); JavaBridge.initLog(String.valueOf(socket), logLevel, s); JavaBridge.init(socket, logLevel, s); } catch (Exception e) { @@ -209,10 +209,10 @@ private static boolean checkServlet(int logLevel, String sockname, String[] s) t if (sockname == null) return false; if (sockname.startsWith("SERVLET_LOCAL:") || sockname.startsWith("HTTP_LOCAL:") || sockname.startsWith("HTTPS_LOCAL:")) { Util.JAVABRIDGE_PROMISCUOUS = false; - System.setProperty("php.java.bridge.promiscuous", "false"); + System.setProperty("io.soluble.pjb.bridge.promiscuous", "false"); } else if (sockname.startsWith("SERVLET:") || sockname.startsWith("HTTP:") || sockname.startsWith("HTTPS:")) { Util.JAVABRIDGE_PROMISCUOUS = true; - System.setProperty("php.java.bridge.promiscuous", "true"); + System.setProperty("io.soluble.pjb.bridge.promiscuous", "true"); } else return false; @@ -225,7 +225,7 @@ private static boolean checkServlet(int logLevel, String sockname, String[] s) t Class runner = JavaBridgeRunner.class; JavaBridgeRunner r; try { - runner = Util.classForName("php.java.script.JavaBridgeScriptRunner"); + runner = Util.classForName("io.soluble.pjb.script.JavaBridgeScriptRunner"); Method m = runner.getMethod("getRequiredInstance", new Class[]{String.class, Boolean.TYPE}); r = (JavaBridgeRunner) m.invoke(runner, new Object[]{serverPort, new Boolean(isSecure)}); } catch (Throwable e) { @@ -256,18 +256,18 @@ private static final boolean checkGNUVM() { * @param s an array of [socketname, level, logFile] */ public static void main(String s[]) { - // check for -Dphp.java.bridge.daemon=true - if (!(System.getProperty("php.java.bridge.daemon", "false").equals("false"))) { + // check for -Dio.soluble.pjb.bridge.daemon=true + if (!(System.getProperty("io.soluble.pjb.bridge.daemon", "false").equals("false"))) { final String[] args = new String[s.length + 8]; - args[0] = System.getProperty("php.java.bridge.daemon"); + args[0] = System.getProperty("io.soluble.pjb.bridge.daemon"); if ("true".equals(args[0])) args[0] = "java"; args[1] = "-Djava.library.path=" + System.getProperty("java.library.path", "."); args[2] = "-Djava.ext.dirs=" + System.getProperty("java.ext.dirs", "."); args[3] = "-Djava.awt.headless=" + System.getProperty("java.awt.headless", "true"); - args[4] = "-Dphp.java.bridge.asDaemon=true"; + args[4] = "-Dio.soluble.pjb.bridge.asDaemon=true"; args[5] = "-classpath"; args[6] = System.getProperty("java.class.path", "."); - args[7] = "php.java.bridge.Standalone"; + args[7] = "io.soluble.pjb.bridge.Standalone"; for (int j = 0; j < s.length; j++) { args[j + 8] = s[j]; @@ -312,9 +312,9 @@ public void run() { String javaExec = sunJavaInstalled ? "/usr/java/default/bin/java" : "java"; if (s.length == 0 && - (System.getProperty("php.java.bridge.exec_sun_vm", "true").equals("true")) && + (System.getProperty("io.soluble.pjb.bridge.exec_sun_vm", "true").equals("true")) && ((sunJavaInstalled && checkGNUVM()) || isExecutableJavaBridgeJar)) { - Process p = Runtime.getRuntime().exec(new String[]{javaExec, "-Dphp.java.bridge.exec_sun_vm=false", "-classpath", cp, "php.java.bridge.Standalone"}, null, wd); + Process p = Runtime.getRuntime().exec(new String[]{javaExec, "-Dio.soluble.pjb.bridge.exec_sun_vm=false", "-classpath", cp, "io.soluble.pjb.bridge.Standalone"}, null, wd); if (p != null) System.exit(p.waitFor()); } } catch (Throwable t) {/*ignore*/} diff --git a/server/php/java/bridge/StringCache.java b/src/main/java/io/soluble/pjb/bridge/StringCache.java similarity index 99% rename from server/php/java/bridge/StringCache.java rename to src/main/java/io/soluble/pjb/bridge/StringCache.java index 564d9c3..c1669e0 100644 --- a/server/php/java/bridge/StringCache.java +++ b/src/main/java/io/soluble/pjb/bridge/StringCache.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/TCPServerSocket.java b/src/main/java/io/soluble/pjb/bridge/TCPServerSocket.java similarity index 98% rename from server/php/java/bridge/TCPServerSocket.java rename to src/main/java/io/soluble/pjb/bridge/TCPServerSocket.java index 85b24d1..be2a9b5 100644 --- a/server/php/java/bridge/TCPServerSocket.java +++ b/src/main/java/io/soluble/pjb/bridge/TCPServerSocket.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -24,6 +24,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +import io.soluble.pjb.bridge.*; import java.io.IOException; import java.net.InetAddress; import java.net.ServerSocket; diff --git a/server/php/java/bridge/ThreadPool.java b/src/main/java/io/soluble/pjb/bridge/ThreadPool.java similarity index 99% rename from server/php/java/bridge/ThreadPool.java rename to src/main/java/io/soluble/pjb/bridge/ThreadPool.java index ac30097..d36abd7 100644 --- a/server/php/java/bridge/ThreadPool.java +++ b/src/main/java/io/soluble/pjb/bridge/ThreadPool.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/Util.java b/src/main/java/io/soluble/pjb/bridge/Util.java similarity index 96% rename from server/php/java/bridge/Util.java rename to src/main/java/io/soluble/pjb/bridge/Util.java index c4951fc..22e979c 100644 --- a/server/php/java/bridge/Util.java +++ b/src/main/java/io/soluble/pjb/bridge/Util.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge; +package io.soluble.pjb.bridge; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -49,7 +49,7 @@ import java.util.Vector; import java.util.Map.Entry; -import php.java.bridge.http.FCGIConnectionPool; +import io.soluble.pjb.bridge.http.FCGIConnectionPool; /** @@ -83,7 +83,7 @@ protected Delegate createDelegate(String name) { /** * Used by the watchdog. After MAX_WAIT (default 1500ms) the ContextRunner times out. Raise this value if you want to debug the bridge. - * See also system property php.java.bridge.max_wait + * See also system property io.soluble.pjb.bridge.max_wait */ public static int MAX_WAIT; @@ -230,7 +230,7 @@ public void warn(String msg) { } /** - * The default PHP arguments. Can be passed via -Dphp.java.bridge.php_exec_args=list of urlencoded strings separated by space + * The default PHP arguments. Can be passed via -Dio.soluble.pjb.bridge.php_exec_args=list of urlencoded strings separated by space * Default: "-d display_errors=Off -d log_errors=On -d java.persistent_servlet_connections=On" */ private static String[] PHP_ARGS; @@ -298,7 +298,7 @@ public void warn(String msg) { /** * The max. number of threads in the thread pool. Default is 20. * - * @see System property php.java.bridge.threads + * @see System property io.soluble.pjb.bridge.threads */ public static String THREAD_POOL_MAX_SIZE; @@ -307,7 +307,7 @@ public void warn(String msg) { * overrides. Default is 3, if started via java -jar * JavaBridge.jar or 2, if started as a sub-process of Apache/IIS. * - * @see System property php.java.bridge.default_log_level + * @see System property io.soluble.pjb.bridge.default_log_level */ public static int DEFAULT_LOG_LEVEL; @@ -338,7 +338,7 @@ public void warn(String msg) { */ public static String VM_NAME; /** - * Set to true, if the Java VM has been started with -Dphp.java.bridge.promiscuous=true; + * Set to true, if the Java VM has been started with -Dio.soluble.pjb.bridge.promiscuous=true; */ public static boolean JAVABRIDGE_PROMISCUOUS; @@ -347,7 +347,7 @@ public void warn(String msg) { * sub-process of Apache/IIS or EXTENSION_NAME.log, * if started via java -jar JavaBridge.jar. * - * @see System property php.java.bridge.default_log_file + * @see System property io.soluble.pjb.bridge.default_log_file */ public static String DEFAULT_LOG_FILE; @@ -361,7 +361,7 @@ public void warn(String msg) { private static String getProperty(Properties p, String key, String defaultValue) { String s = null; if (p != null) s = p.getProperty(key); - if (s == null) s = System.getProperty("php.java.bridge." + String.valueOf(key).toLowerCase()); + if (s == null) s = System.getProperty("io.soluble.pjb.bridge." + String.valueOf(key).toLowerCase()); if (s == null) s = defaultValue; return s; } @@ -392,22 +392,22 @@ private static String getProperty(Properties p, String key, String defaultValue) private static void initGlobals() { try { - JAVA_INC = Class.forName("php.java.bridge.JavaInc"); + JAVA_INC = Class.forName("io.soluble.pjb.bridge.JavaInc"); } catch (Exception e) {/*ignore*/} try { - PHPDEBUGGER_PHP = Class.forName("php.java.bridge.PhpDebuggerPHP"); + PHPDEBUGGER_PHP = Class.forName("io.soluble.pjb.bridge.PhpDebuggerPHP"); } catch (Exception e) {/*ignore*/} try { - JAVA_PROXY = Class.forName("php.java.bridge.JavaProxy"); + JAVA_PROXY = Class.forName("io.soluble.pjb.bridge.JavaProxy"); } catch (Exception e) {/*ignore*/} try { - LAUNCHER_UNIX = Class.forName("php.java.bridge.LauncherUnix"); + LAUNCHER_UNIX = Class.forName("io.soluble.pjb.bridge.LauncherUnix"); } catch (Exception e) {/*ignore*/} try { - LAUNCHER_WINDOWS = Class.forName("php.java.bridge.LauncherWindows"); - LAUNCHER_WINDOWS2 = Class.forName("php.java.bridge.LauncherWindows2"); - LAUNCHER_WINDOWS3 = Class.forName("php.java.bridge.LauncherWindows3"); - LAUNCHER_WINDOWS4 = Class.forName("php.java.bridge.LauncherWindows4"); + LAUNCHER_WINDOWS = Class.forName("io.soluble.pjb.bridge.LauncherWindows"); + LAUNCHER_WINDOWS2 = Class.forName("io.soluble.pjb.bridge.LauncherWindows2"); + LAUNCHER_WINDOWS3 = Class.forName("io.soluble.pjb.bridge.LauncherWindows3"); + LAUNCHER_WINDOWS4 = Class.forName("io.soluble.pjb.bridge.LauncherWindows4"); } catch (Exception e) {/*ignore*/} Properties p = new Properties(); @@ -453,7 +453,7 @@ private static void initGlobals() { } catch (Exception e) { /*ignore*/ } } catch (Throwable xe) {/*ignore*/} try { - MAX_WAIT = Integer.parseInt(getProperty(p, "php.java.bridge.max_wait", "15000")); + MAX_WAIT = Integer.parseInt(getProperty(p, "io.soluble.pjb.bridge.max_wait", "15000")); } catch (Exception e) { MAX_WAIT = 15000; } @@ -463,7 +463,7 @@ private static void initGlobals() { HOME_DIR = null; } try { - JAVABRIDGE_BASE = getProperty(p, "php.java.bridge.base", System.getProperty("user.home")); + JAVABRIDGE_BASE = getProperty(p, "io.soluble.pjb.bridge.base", System.getProperty("user.home")); } catch (Exception e) { JAVABRIDGE_BASE = "."; } @@ -473,7 +473,7 @@ private static void initGlobals() { } catch (Exception e) {/*ignore*/} try { JAVABRIDGE_PROMISCUOUS = false; - JAVABRIDGE_PROMISCUOUS = getProperty(p, "php.java.bridge.promiscuous", "false").toLowerCase().equals("true"); + JAVABRIDGE_PROMISCUOUS = getProperty(p, "io.soluble.pjb.bridge.promiscuous", "false").toLowerCase().equals("true"); } catch (Exception e) {/*ignore*/} try { @@ -532,7 +532,7 @@ private static void initGlobals() { try { DEFAULT_LOG_FILE_SET = false; DEFAULT_LOG_FILE = getProperty(p, "DEFAULT_LOG_FILE", Util.EXTENSION_NAME + ".log"); - DEFAULT_LOG_FILE_SET = System.getProperty("php.java.bridge.default_log_file") != null; + DEFAULT_LOG_FILE_SET = System.getProperty("io.soluble.pjb.bridge.default_log_file") != null; } catch (Throwable t) {/*ignore*/} String separator = "/-+.,;: "; @@ -881,7 +881,7 @@ public static ILogger getLogger() { } /** - * Returns the string "127.0.0.1". If the system property "php.java.bridge.promiscuous" is "true", + * Returns the string "127.0.0.1". If the system property "io.soluble.pjb.bridge.promiscuous" is "true", * the real host address is returned. * * @return The host address as a string. @@ -1319,7 +1319,7 @@ protected Process(String[] args, boolean includeJava, String cgiDir, String pear /** * Starts a CGI process and returns the process handle. * - * @param args The args array, e.g.: new String[]{null, "-b", ...};. If args is null or if args[0] is null, the function looks for the system property "php.java.bridge.php_exec". + * @param args The args array, e.g.: new String[]{null, "-b", ...};. If args is null or if args[0] is null, the function looks for the system property "io.soluble.pjb.bridge.php_exec". * @param homeDir The home directory. If null, the current working directory is used. * @param env The CGI environment. If null, Util.DEFAULT_CGI_ENVIRONMENT is used. * @param tryOtherLocations true if we should check the DEFAULT_CGI_LOCATIONS first @@ -1484,7 +1484,7 @@ public synchronized int waitFor() throws InterruptedException { /** * Starts a CGI process and returns the process handle. * - * @param args The args array, e.g.: new String[]{null, "-b", ...};. If args is null or if args[0] is null, the function looks for the system property "php.java.bridge.php_exec". + * @param args The args array, e.g.: new String[]{null, "-b", ...};. If args is null or if args[0] is null, the function looks for the system property "io.soluble.pjb.bridge.php_exec". * @param homeDir The home directory. If null, the current working directory is used. * @param env The CGI environment. If null, Util.DEFAULT_CGI_ENVIRONMENT is used. * @param tryOtherLocations true if the should check DEFAULT_CGI_LOCATIONS diff --git a/server/php/java/bridge/http/AbstractChannel.java b/src/main/java/io/soluble/pjb/bridge/http/AbstractChannel.java similarity index 98% rename from server/php/java/bridge/http/AbstractChannel.java rename to src/main/java/io/soluble/pjb/bridge/http/AbstractChannel.java index 489ee3a..56c2de1 100644 --- a/server/php/java/bridge/http/AbstractChannel.java +++ b/src/main/java/io/soluble/pjb/bridge/http/AbstractChannel.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/AbstractChannelName.java b/src/main/java/io/soluble/pjb/bridge/http/AbstractChannelName.java similarity index 97% rename from server/php/java/bridge/http/AbstractChannelName.java rename to src/main/java/io/soluble/pjb/bridge/http/AbstractChannelName.java index bef8f7b..c6d1e0c 100644 --- a/server/php/java/bridge/http/AbstractChannelName.java +++ b/src/main/java/io/soluble/pjb/bridge/http/AbstractChannelName.java @@ -1,8 +1,8 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; -import php.java.bridge.ILogger; +import io.soluble.pjb.bridge.ILogger; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/ChunkedInputStream.java b/src/main/java/io/soluble/pjb/bridge/http/ChunkedInputStream.java similarity index 98% rename from server/php/java/bridge/http/ChunkedInputStream.java rename to src/main/java/io/soluble/pjb/bridge/http/ChunkedInputStream.java index b73fcf6..14d115f 100644 --- a/server/php/java/bridge/http/ChunkedInputStream.java +++ b/src/main/java/io/soluble/pjb/bridge/http/ChunkedInputStream.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -29,7 +29,7 @@ import java.io.IOException; import java.io.InputStream; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.Util; /** * An output stream which reads data in HTTP chunks. diff --git a/server/php/java/bridge/http/ChunkedOutputStream.java b/src/main/java/io/soluble/pjb/bridge/http/ChunkedOutputStream.java similarity index 97% rename from server/php/java/bridge/http/ChunkedOutputStream.java rename to src/main/java/io/soluble/pjb/bridge/http/ChunkedOutputStream.java index b823e48..d3237f9 100644 --- a/server/php/java/bridge/http/ChunkedOutputStream.java +++ b/src/main/java/io/soluble/pjb/bridge/http/ChunkedOutputStream.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -29,7 +29,7 @@ import java.io.IOException; import java.io.OutputStream; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.Util; /** * An output stream which writes data in HTTP chunks. diff --git a/server/php/java/bridge/http/Context.java b/src/main/java/io/soluble/pjb/bridge/http/Context.java similarity index 97% rename from server/php/java/bridge/http/Context.java rename to src/main/java/io/soluble/pjb/bridge/http/Context.java index dd34d95..73fa6ea 100644 --- a/server/php/java/bridge/http/Context.java +++ b/src/main/java/io/soluble/pjb/bridge/http/Context.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -35,10 +35,10 @@ import java.util.LinkedList; import java.util.Map; -import php.java.bridge.IManaged; -import php.java.bridge.Invocable; -import php.java.bridge.NotImplementedException; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.IManaged; +import io.soluble.pjb.bridge.Invocable; +import io.soluble.pjb.bridge.NotImplementedException; +import io.soluble.pjb.bridge.Util; /** @@ -310,7 +310,7 @@ public Object init(Object callable) throws Exception { * {@inheritDoc} */ public void onShutdown(Object closeable) { - php.java.bridge.http.Context.handleManaged(closeable); + io.soluble.pjb.bridge.http.Context.handleManaged(closeable); } /** diff --git a/server/php/java/bridge/http/ContextFactory.java b/src/main/java/io/soluble/pjb/bridge/http/ContextFactory.java similarity index 97% rename from server/php/java/bridge/http/ContextFactory.java rename to src/main/java/io/soluble/pjb/bridge/http/ContextFactory.java index 5596b0d..65ea2c0 100644 --- a/server/php/java/bridge/http/ContextFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/ContextFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -31,11 +31,11 @@ import java.util.HashMap; import java.util.Iterator; -import php.java.bridge.ISession; -import php.java.bridge.JavaBridge; -import php.java.bridge.Request; -import php.java.bridge.SessionFactory; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.ISession; +import io.soluble.pjb.bridge.JavaBridge; +import io.soluble.pjb.bridge.Request; +import io.soluble.pjb.bridge.SessionFactory; +import io.soluble.pjb.bridge.Util; /** @@ -80,7 +80,7 @@ *

* * @see php.java.servlet.ServletContextFactory - * @see php.java.bridge.http.ContextServer + * @see io.soluble.pjb.bridge.http.ContextServer * @see php.java.bridge.SessionFactory#TIMER_DURATION */ public final class ContextFactory extends SessionFactory implements IContextFactory { @@ -292,7 +292,7 @@ private static synchronized void destroyOrphaned() { * Remove all context factories from the classloader. * May only be called by the ContextServer. * - * @see php.java.bridge.http.ContextServer + * @see io.soluble.pjb.bridge.http.ContextServer */ public static synchronized void destroyAll() { for (Iterator ii = contexts.values().iterator(); ii.hasNext(); ) { diff --git a/server/php/java/bridge/http/ContextRunner.java b/src/main/java/io/soluble/pjb/bridge/http/ContextRunner.java similarity index 94% rename from server/php/java/bridge/http/ContextRunner.java rename to src/main/java/io/soluble/pjb/bridge/http/ContextRunner.java index 31ddc8d..e2a9ae9 100644 --- a/server/php/java/bridge/http/ContextRunner.java +++ b/src/main/java/io/soluble/pjb/bridge/http/ContextRunner.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -28,10 +28,10 @@ import java.io.InputStream; import java.io.OutputStream; -import php.java.bridge.ILogger; -import php.java.bridge.JavaBridge; -import php.java.bridge.Request; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.JavaBridge; +import io.soluble.pjb.bridge.Request; +import io.soluble.pjb.bridge.Util; /** * The ContextRunner usually represents the physical connection, it @@ -132,7 +132,7 @@ protected boolean init() throws IOException { String name = readName(); ctx = (IContextFactory) ContextFactory.get(name); if (ctx == null) - throw new IOException("No context available for: " + name + ". Please make sure that your script does not exceed php.java.bridge.max_wait, currently set to: " + Util.MAX_WAIT); + throw new IOException("No context available for: " + name + ". Please make sure that your script does not exceed io.soluble.pjb.bridge.max_wait, currently set to: " + Util.MAX_WAIT); JavaBridge bridge = ctx.getBridge(); if (Util.logLevel > 4) Util.logDebug(ctx + " created new thread"); diff --git a/server/php/java/bridge/http/ContextServer.java b/src/main/java/io/soluble/pjb/bridge/http/ContextServer.java similarity index 95% rename from server/php/java/bridge/http/ContextServer.java rename to src/main/java/io/soluble/pjb/bridge/http/ContextServer.java index 5ddac2b..80edd51 100644 --- a/server/php/java/bridge/http/ContextServer.java +++ b/src/main/java/io/soluble/pjb/bridge/http/ContextServer.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -24,9 +24,10 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -import php.java.bridge.AppThreadPool; -import php.java.bridge.ILogger; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.AppThreadPool; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.SessionFactory; +import io.soluble.pjb.bridge.Util; /** * A bridge pattern which either uses the PipeContextServer or the SocketContextServer, @@ -43,7 +44,7 @@ *

* * @author jostb - * @see php.java.bridge.http.SocketContextServer + * @see io.soluble.pjb.bridge.http.SocketContextServer */ public final class ContextServer { private String contextName; @@ -100,7 +101,7 @@ private synchronized static final void destroyContextServer() { sock = null; ContextFactory.destroyAll(); - php.java.bridge.SessionFactory.destroyTimer(); + SessionFactory.destroyTimer(); if (pool != null) pool.destroy(); pool = null; diff --git a/server/php/java/bridge/http/DefaultCharsetWriterOutputStream.java b/src/main/java/io/soluble/pjb/bridge/http/DefaultCharsetWriterOutputStream.java similarity index 95% rename from server/php/java/bridge/http/DefaultCharsetWriterOutputStream.java rename to src/main/java/io/soluble/pjb/bridge/http/DefaultCharsetWriterOutputStream.java index d8bd4b3..6225ccd 100644 --- a/server/php/java/bridge/http/DefaultCharsetWriterOutputStream.java +++ b/src/main/java/io/soluble/pjb/bridge/http/DefaultCharsetWriterOutputStream.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -28,7 +28,7 @@ import java.io.OutputStream; import java.io.Writer; -import php.java.bridge.NotImplementedException; +import io.soluble.pjb.bridge.NotImplementedException; /** * A PrintWriter backed by an OutputStream. diff --git a/server/php/java/bridge/http/FCGIConnectException.java b/src/main/java/io/soluble/pjb/bridge/http/FCGIConnectException.java similarity index 97% rename from server/php/java/bridge/http/FCGIConnectException.java rename to src/main/java/io/soluble/pjb/bridge/http/FCGIConnectException.java index d4e0457..89b9f62 100644 --- a/server/php/java/bridge/http/FCGIConnectException.java +++ b/src/main/java/io/soluble/pjb/bridge/http/FCGIConnectException.java @@ -1,5 +1,5 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/FCGIConnection.java b/src/main/java/io/soluble/pjb/bridge/http/FCGIConnection.java similarity index 98% rename from server/php/java/bridge/http/FCGIConnection.java rename to src/main/java/io/soluble/pjb/bridge/http/FCGIConnection.java index 0604c0b..ebebfe2 100644 --- a/server/php/java/bridge/http/FCGIConnection.java +++ b/src/main/java/io/soluble/pjb/bridge/http/FCGIConnection.java @@ -1,5 +1,5 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/FCGIConnectionException.java b/src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionException.java similarity index 93% rename from server/php/java/bridge/http/FCGIConnectionException.java rename to src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionException.java index f2f78c8..ff6d456 100644 --- a/server/php/java/bridge/http/FCGIConnectionException.java +++ b/src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionException.java @@ -1,5 +1,5 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -25,7 +25,7 @@ import java.io.IOException; -import php.java.bridge.http.FCGIConnectionPool.Connection; +import io.soluble.pjb.bridge.http.FCGIConnectionPool.Connection; /** * Thrown when an IO exception occurs diff --git a/server/php/java/bridge/http/FCGIConnectionFactory.java b/src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionFactory.java similarity index 97% rename from server/php/java/bridge/http/FCGIConnectionFactory.java rename to src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionFactory.java index 0eef167..a6608db 100644 --- a/server/php/java/bridge/http/FCGIConnectionFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionFactory.java @@ -1,5 +1,5 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; import java.io.IOException; import java.io.InputStream; @@ -7,9 +7,9 @@ import java.net.UnknownHostException; import java.util.Map; -import php.java.bridge.ILogger; -import php.java.bridge.Util; -import php.java.bridge.Util.Process; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.Util.Process; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/FCGIConnectionInputStream.java b/src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionInputStream.java similarity index 94% rename from server/php/java/bridge/http/FCGIConnectionInputStream.java rename to src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionInputStream.java index ad1ff06..4078098 100644 --- a/server/php/java/bridge/http/FCGIConnectionInputStream.java +++ b/src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionInputStream.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -27,8 +27,8 @@ import java.io.IOException; import java.io.InputStream; -import php.java.bridge.NotImplementedException; -import php.java.bridge.http.FCGIConnectionPool.Connection; +import io.soluble.pjb.bridge.NotImplementedException; +import io.soluble.pjb.bridge.http.FCGIConnectionPool.Connection; /** * Default InputStream used by the connection pool. diff --git a/server/php/java/bridge/http/FCGIConnectionOutputStream.java b/src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionOutputStream.java similarity index 95% rename from server/php/java/bridge/http/FCGIConnectionOutputStream.java rename to src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionOutputStream.java index 91a9542..a11d2d0 100644 --- a/server/php/java/bridge/http/FCGIConnectionOutputStream.java +++ b/src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionOutputStream.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -28,8 +28,8 @@ import java.io.IOException; import java.io.OutputStream; -import php.java.bridge.NotImplementedException; -import php.java.bridge.http.FCGIConnectionPool.Connection; +import io.soluble.pjb.bridge.NotImplementedException; +import io.soluble.pjb.bridge.http.FCGIConnectionPool.Connection; /** * Default OutputStream used by the connection pool. diff --git a/server/php/java/bridge/http/FCGIConnectionPool.java b/src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionPool.java similarity index 99% rename from server/php/java/bridge/http/FCGIConnectionPool.java rename to src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionPool.java index da7ff8d..3a1e41a 100644 --- a/server/php/java/bridge/http/FCGIConnectionPool.java +++ b/src/main/java/io/soluble/pjb/bridge/http/FCGIConnectionPool.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -31,7 +31,7 @@ import java.util.LinkedList; import java.util.List; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.Util; /** * A connection pool. Example:

diff --git a/server/php/java/bridge/http/FCGIIOFactory.java b/src/main/java/io/soluble/pjb/bridge/http/FCGIIOFactory.java similarity index 98% rename from server/php/java/bridge/http/FCGIIOFactory.java rename to src/main/java/io/soluble/pjb/bridge/http/FCGIIOFactory.java index f819126..bae4d11 100644 --- a/server/php/java/bridge/http/FCGIIOFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/FCGIIOFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/FCGIInputStream.java b/src/main/java/io/soluble/pjb/bridge/http/FCGIInputStream.java similarity index 98% rename from server/php/java/bridge/http/FCGIInputStream.java rename to src/main/java/io/soluble/pjb/bridge/http/FCGIInputStream.java index 4e80430..dcdc0a7 100644 --- a/server/php/java/bridge/http/FCGIInputStream.java +++ b/src/main/java/io/soluble/pjb/bridge/http/FCGIInputStream.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -26,7 +26,7 @@ import java.io.IOException; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.Util; /** * A FastCGI input stream diff --git a/server/php/java/bridge/http/FCGIOutputStream.java b/src/main/java/io/soluble/pjb/bridge/http/FCGIOutputStream.java similarity index 97% rename from server/php/java/bridge/http/FCGIOutputStream.java rename to src/main/java/io/soluble/pjb/bridge/http/FCGIOutputStream.java index 8cf0ca9..ecfc53a 100644 --- a/server/php/java/bridge/http/FCGIOutputStream.java +++ b/src/main/java/io/soluble/pjb/bridge/http/FCGIOutputStream.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -29,8 +29,8 @@ import java.util.Iterator; import java.util.Map; -import php.java.bridge.NotImplementedException; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.NotImplementedException; +import io.soluble.pjb.bridge.Util; /** * A FastCGI OutputStream diff --git a/server/php/java/bridge/http/FCGIUtil.java b/src/main/java/io/soluble/pjb/bridge/http/FCGIUtil.java similarity index 99% rename from server/php/java/bridge/http/FCGIUtil.java rename to src/main/java/io/soluble/pjb/bridge/http/FCGIUtil.java index 4a308e2..b319f01 100644 --- a/server/php/java/bridge/http/FCGIUtil.java +++ b/src/main/java/io/soluble/pjb/bridge/http/FCGIUtil.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/HeaderParser.java b/src/main/java/io/soluble/pjb/bridge/http/HeaderParser.java similarity index 98% rename from server/php/java/bridge/http/HeaderParser.java rename to src/main/java/io/soluble/pjb/bridge/http/HeaderParser.java index 9b226e9..a34ce79 100644 --- a/server/php/java/bridge/http/HeaderParser.java +++ b/src/main/java/io/soluble/pjb/bridge/http/HeaderParser.java @@ -1,12 +1,12 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.Util; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/HttpRequest.java b/src/main/java/io/soluble/pjb/bridge/http/HttpRequest.java similarity index 98% rename from server/php/java/bridge/http/HttpRequest.java rename to src/main/java/io/soluble/pjb/bridge/http/HttpRequest.java index c3cc2ac..d20937f 100644 --- a/server/php/java/bridge/http/HttpRequest.java +++ b/src/main/java/io/soluble/pjb/bridge/http/HttpRequest.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -29,7 +29,7 @@ import java.io.InputStream; import java.util.HashMap; -import php.java.bridge.NotImplementedException; +import io.soluble.pjb.bridge.NotImplementedException; /** * A simple HTTP request implementation. diff --git a/server/php/java/bridge/http/HttpResponse.java b/src/main/java/io/soluble/pjb/bridge/http/HttpResponse.java similarity index 97% rename from server/php/java/bridge/http/HttpResponse.java rename to src/main/java/io/soluble/pjb/bridge/http/HttpResponse.java index f3993b6..67afdb5 100644 --- a/server/php/java/bridge/http/HttpResponse.java +++ b/src/main/java/io/soluble/pjb/bridge/http/HttpResponse.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -31,8 +31,8 @@ import java.util.HashMap; import java.util.Iterator; -import php.java.bridge.NotImplementedException; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.NotImplementedException; +import io.soluble.pjb.bridge.Util; /** * A simple HTTP response implementation. diff --git a/server/php/java/bridge/http/HttpServer.java b/src/main/java/io/soluble/pjb/bridge/http/HttpServer.java similarity index 97% rename from server/php/java/bridge/http/HttpServer.java rename to src/main/java/io/soluble/pjb/bridge/http/HttpServer.java index a0c6826..6222d43 100644 --- a/server/php/java/bridge/http/HttpServer.java +++ b/src/main/java/io/soluble/pjb/bridge/http/HttpServer.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -30,9 +30,9 @@ import java.io.UnsupportedEncodingException; import java.net.Socket; -import php.java.bridge.ISocketFactory; -import php.java.bridge.AppThreadPool; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.ISocketFactory; +import io.soluble.pjb.bridge.AppThreadPool; +import io.soluble.pjb.bridge.Util; /** @@ -42,8 +42,8 @@ * scripts use a HttpProxy and URLReader instead. * * @author jostb - * @see php.java.bridge.http.HttpRequest - * @see php.java.bridge.http.HttpResponse + * @see io.soluble.pjb.bridge.http.HttpRequest + * @see io.soluble.pjb.bridge.http.HttpResponse * @see php.java.script.Continuation * @see php.java.script.URLReader * @see php.java.script.Continuation diff --git a/server/php/java/bridge/http/IContext.java b/src/main/java/io/soluble/pjb/bridge/http/IContext.java similarity index 83% rename from server/php/java/bridge/http/IContext.java rename to src/main/java/io/soluble/pjb/bridge/http/IContext.java index bfa044b..a35a551 100644 --- a/server/php/java/bridge/http/IContext.java +++ b/src/main/java/io/soluble/pjb/bridge/http/IContext.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -51,39 +51,39 @@ public interface IContext { /** * This key can be used to get the current continuation. - * Example: java_context->getAttribute("php.java.bridge.PhpProcedure"); + * Example: java_context->getAttribute("io.soluble.pjb.bridge.PhpProcedure"); */ - public static final String PHP_PROCEDURE = "php.java.bridge.PhpProcedure"; + public static final String PHP_PROCEDURE = "io.soluble.pjb.bridge.PhpProcedure"; /** * This key can be used to get the current JavaBridge instance. - * Example: java_context->getAttribute("php.java.bridge.JavaBridge"); + * Example: java_context->getAttribute("io.soluble.pjb.bridge.JavaBridge"); */ - public static final String JAVA_BRIDGE = "php.java.bridge.JavaBridge"; + public static final String JAVA_BRIDGE = "io.soluble.pjb.bridge.JavaBridge"; /** * This key can be used to get the current ServletContext instance. - * Example: java_context->getAttribute("php.java.servlet.ServletContext"); + * Example: java_context->getAttribute("io.soluble.pjb.servlet.ServletContext"); */ - public static final String SERVLET_CONTEXT = "php.java.servlet.ServletContext"; + public static final String SERVLET_CONTEXT = "io.soluble.pjb.servlet.ServletContext"; /** * This key can be used to get the current ServletConfig instance. - * Example: java_context->getAttribute("php.java.servlet.ServletConfig"); + * Example: java_context->getAttribute("io.soluble.pjb.servlet.ServletConfig"); */ - public static final String SERVLET_CONFIG = "php.java.servlet.ServletConfig"; + public static final String SERVLET_CONFIG = "io.soluble.pjb.servlet.ServletConfig"; /** * This key can be used to get the current Servlet instance. - * Example: java_context->getAttribute("php.java.servlet.Servlet"); + * Example: java_context->getAttribute("io.soluble.pjb.servlet.Servlet"); */ - public static final String SERVLET = "php.java.servlet.Servlet"; + public static final String SERVLET = "io.soluble.pjb.servlet.Servlet"; /** * This key can be used to get the current HttpServletRequest instance. - * Example: java_context->getAttribute("php.java.servlet.HttpServletRequest"); + * Example: java_context->getAttribute("io.soluble.pjb.servlet.HttpServletRequest"); */ - public static final String SERVLET_REQUEST = "php.java.servlet.HttpServletRequest"; + public static final String SERVLET_REQUEST = "io.soluble.pjb.servlet.HttpServletRequest"; /** * This key can be used to get the current HttpServletResponse instance. - * Example: java_context->getAttribute("php.java.servlet.HttpServletResponse"); + * Example: java_context->getAttribute("io.soluble.pjb.servlet.HttpServletResponse"); */ - public static final String SERVLET_RESPONSE = "php.java.servlet.HttpServletResponse"; + public static final String SERVLET_RESPONSE = "io.soluble.pjb.servlet.HttpServletResponse"; /** * Retrieves the value for getAttribute(String, int) for the diff --git a/server/php/java/bridge/http/IContextFactory.java b/src/main/java/io/soluble/pjb/bridge/http/IContextFactory.java similarity index 93% rename from server/php/java/bridge/http/IContextFactory.java rename to src/main/java/io/soluble/pjb/bridge/http/IContextFactory.java index 48a28ce..fde70ad 100644 --- a/server/php/java/bridge/http/IContextFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/IContextFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -24,8 +24,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -import php.java.bridge.IJavaBridgeFactory; -import php.java.bridge.ISession; +import io.soluble.pjb.bridge.IJavaBridgeFactory; +import io.soluble.pjb.bridge.ISession; /** * Interface that the ContextFactories must implement. @@ -62,7 +62,7 @@ public interface IContextFactory extends IJavaBridgeFactory { * For Apache/PHP initiated requests use a combination of #waitFor(long) and #release() instead. * * @throws InterruptedException - * @see php.java.bridge.http.ContextRunner + * @see io.soluble.pjb.bridge.http.ContextRunner */ public void releaseManaged() throws InterruptedException; @@ -71,7 +71,7 @@ public interface IContextFactory extends IJavaBridgeFactory { * * @param timeout The timeout * @throws InterruptedException - * @see php.java.bridge.http.ContextRunner + * @see io.soluble.pjb.bridge.http.ContextRunner */ public void waitFor(long timeout) throws InterruptedException; @@ -87,7 +87,7 @@ public interface IContextFactory extends IJavaBridgeFactory { * * @return The context * @see php.java.servlet.ServletContextFactory#getContext() - * @see php.java.bridge.http.Context + * @see io.soluble.pjb.bridge.http.Context */ public IContext getContext(); diff --git a/server/php/java/bridge/http/IContextFactoryVisitor.java b/src/main/java/io/soluble/pjb/bridge/http/IContextFactoryVisitor.java similarity index 97% rename from server/php/java/bridge/http/IContextFactoryVisitor.java rename to src/main/java/io/soluble/pjb/bridge/http/IContextFactoryVisitor.java index 5f6e9f8..d9d3d88 100644 --- a/server/php/java/bridge/http/IContextFactoryVisitor.java +++ b/src/main/java/io/soluble/pjb/bridge/http/IContextFactoryVisitor.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/IContextServer.java b/src/main/java/io/soluble/pjb/bridge/http/IContextServer.java similarity index 96% rename from server/php/java/bridge/http/IContextServer.java rename to src/main/java/io/soluble/pjb/bridge/http/IContextServer.java index f9285ae..8a61bde 100644 --- a/server/php/java/bridge/http/IContextServer.java +++ b/src/main/java/io/soluble/pjb/bridge/http/IContextServer.java @@ -1,8 +1,8 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; -import php.java.bridge.ILogger; +import io.soluble.pjb.bridge.ILogger; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/IFCGIProcess.java b/src/main/java/io/soluble/pjb/bridge/http/IFCGIProcess.java similarity index 98% rename from server/php/java/bridge/http/IFCGIProcess.java rename to src/main/java/io/soluble/pjb/bridge/http/IFCGIProcess.java index a4ed33c..20f5c28 100644 --- a/server/php/java/bridge/http/IFCGIProcess.java +++ b/src/main/java/io/soluble/pjb/bridge/http/IFCGIProcess.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/IFCGIProcessFactory.java b/src/main/java/io/soluble/pjb/bridge/http/IFCGIProcessFactory.java similarity index 99% rename from server/php/java/bridge/http/IFCGIProcessFactory.java rename to src/main/java/io/soluble/pjb/bridge/http/IFCGIProcessFactory.java index a0b25c2..82e3a9b 100644 --- a/server/php/java/bridge/http/IFCGIProcessFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/IFCGIProcessFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; import java.io.File; import java.io.IOException; diff --git a/server/php/java/bridge/http/NPChannel.java b/src/main/java/io/soluble/pjb/bridge/http/NPChannel.java similarity index 98% rename from server/php/java/bridge/http/NPChannel.java rename to src/main/java/io/soluble/pjb/bridge/http/NPChannel.java index cb221c0..a163bcb 100644 --- a/server/php/java/bridge/http/NPChannel.java +++ b/src/main/java/io/soluble/pjb/bridge/http/NPChannel.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/NPChannelFactory.java b/src/main/java/io/soluble/pjb/bridge/http/NPChannelFactory.java similarity index 98% rename from server/php/java/bridge/http/NPChannelFactory.java rename to src/main/java/io/soluble/pjb/bridge/http/NPChannelFactory.java index 4949369..075846b 100644 --- a/server/php/java/bridge/http/NPChannelFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/NPChannelFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; import java.io.File; import java.io.IOException; @@ -8,8 +8,8 @@ import java.net.UnknownHostException; import java.util.Map; -import php.java.bridge.Util; -import php.java.bridge.Util.Process; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.Util.Process; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/OutputStreamFactory.java b/src/main/java/io/soluble/pjb/bridge/http/OutputStreamFactory.java similarity index 90% rename from server/php/java/bridge/http/OutputStreamFactory.java rename to src/main/java/io/soluble/pjb/bridge/http/OutputStreamFactory.java index 5aba900..1b78bf8 100644 --- a/server/php/java/bridge/http/OutputStreamFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/OutputStreamFactory.java @@ -1,4 +1,4 @@ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; import java.io.IOException; import java.io.OutputStream; diff --git a/server/php/java/bridge/http/RandomAccessFileInputStream.java b/src/main/java/io/soluble/pjb/bridge/http/RandomAccessFileInputStream.java similarity index 98% rename from server/php/java/bridge/http/RandomAccessFileInputStream.java rename to src/main/java/io/soluble/pjb/bridge/http/RandomAccessFileInputStream.java index b582510..55f825d 100644 --- a/server/php/java/bridge/http/RandomAccessFileInputStream.java +++ b/src/main/java/io/soluble/pjb/bridge/http/RandomAccessFileInputStream.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/RandomAccessFileOutputStream.java b/src/main/java/io/soluble/pjb/bridge/http/RandomAccessFileOutputStream.java similarity index 96% rename from server/php/java/bridge/http/RandomAccessFileOutputStream.java rename to src/main/java/io/soluble/pjb/bridge/http/RandomAccessFileOutputStream.java index 084061d..302989a 100644 --- a/server/php/java/bridge/http/RandomAccessFileOutputStream.java +++ b/src/main/java/io/soluble/pjb/bridge/http/RandomAccessFileOutputStream.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -28,7 +28,7 @@ import java.io.OutputStream; import java.io.RandomAccessFile; -import php.java.bridge.NotImplementedException; +import io.soluble.pjb.bridge.NotImplementedException; class RandomAccessFileOutputStream extends OutputStream { private final NPChannel channel; diff --git a/server/php/java/bridge/http/RemoteHttpContextFactory.java b/src/main/java/io/soluble/pjb/bridge/http/RemoteHttpContextFactory.java similarity index 94% rename from server/php/java/bridge/http/RemoteHttpContextFactory.java rename to src/main/java/io/soluble/pjb/bridge/http/RemoteHttpContextFactory.java index 31f849d..d1c7c00 100644 --- a/server/php/java/bridge/http/RemoteHttpContextFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/RemoteHttpContextFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -29,17 +29,17 @@ import java.io.InputStream; import java.io.Serializable; -import php.java.bridge.ISession; -import php.java.bridge.Request; -import php.java.bridge.SessionFactory; +import io.soluble.pjb.bridge.ISession; +import io.soluble.pjb.bridge.Request; +import io.soluble.pjb.bridge.SessionFactory; /** * Create session contexts for servlets.

* This ContextFactory can be used in environments where no custom class loaders and no threads are allowed. * * @author jostb - * @see php.java.bridge.http.ContextFactory - * @see php.java.bridge.http.ContextServer + * @see io.soluble.pjb.bridge.http.ContextFactory + * @see io.soluble.pjb.bridge.http.ContextServer */ public class RemoteHttpContextFactory extends SessionFactory implements IContextFactory, Serializable { diff --git a/server/php/java/bridge/http/SimpleContextFactory.java b/src/main/java/io/soluble/pjb/bridge/http/SimpleContextFactory.java similarity index 97% rename from server/php/java/bridge/http/SimpleContextFactory.java rename to src/main/java/io/soluble/pjb/bridge/http/SimpleContextFactory.java index a6a28bb..bf4cdaf 100644 --- a/server/php/java/bridge/http/SimpleContextFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/SimpleContextFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -27,10 +27,10 @@ import java.io.IOException; import java.io.InputStream; -import php.java.bridge.ISession; -import php.java.bridge.JavaBridge; -import php.java.bridge.Request; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.ISession; +import io.soluble.pjb.bridge.JavaBridge; +import io.soluble.pjb.bridge.Request; +import io.soluble.pjb.bridge.Util; /** diff --git a/server/php/java/bridge/http/SimpleHeaderParser.java b/src/main/java/io/soluble/pjb/bridge/http/SimpleHeaderParser.java similarity index 97% rename from server/php/java/bridge/http/SimpleHeaderParser.java rename to src/main/java/io/soluble/pjb/bridge/http/SimpleHeaderParser.java index 03b08b4..b6882ad 100644 --- a/server/php/java/bridge/http/SimpleHeaderParser.java +++ b/src/main/java/io/soluble/pjb/bridge/http/SimpleHeaderParser.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* diff --git a/server/php/java/bridge/http/SocketChannel.java b/src/main/java/io/soluble/pjb/bridge/http/SocketChannel.java similarity index 97% rename from server/php/java/bridge/http/SocketChannel.java rename to src/main/java/io/soluble/pjb/bridge/http/SocketChannel.java index 23dcab9..13fb686 100644 --- a/server/php/java/bridge/http/SocketChannel.java +++ b/src/main/java/io/soluble/pjb/bridge/http/SocketChannel.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/SocketChannelFactory.java b/src/main/java/io/soluble/pjb/bridge/http/SocketChannelFactory.java similarity index 97% rename from server/php/java/bridge/http/SocketChannelFactory.java rename to src/main/java/io/soluble/pjb/bridge/http/SocketChannelFactory.java index ca5eb89..a447d63 100644 --- a/server/php/java/bridge/http/SocketChannelFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/SocketChannelFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; import java.io.File; import java.io.IOException; @@ -11,9 +11,9 @@ import java.net.UnknownHostException; import java.util.Map; -import php.java.bridge.ILogger; -import php.java.bridge.Util; -import php.java.bridge.Util.Process; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.Util.Process; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/bridge/http/SocketContextServer.java b/src/main/java/io/soluble/pjb/bridge/http/SocketContextServer.java similarity index 93% rename from server/php/java/bridge/http/SocketContextServer.java rename to src/main/java/io/soluble/pjb/bridge/http/SocketContextServer.java index eac456c..94fb17c 100644 --- a/server/php/java/bridge/http/SocketContextServer.java +++ b/src/main/java/io/soluble/pjb/bridge/http/SocketContextServer.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -33,16 +33,16 @@ import java.util.Iterator; import java.util.List; -import php.java.bridge.AppThreadPool; -import php.java.bridge.ILogger; -import php.java.bridge.ISocketFactory; -import php.java.bridge.JavaBridge; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.AppThreadPool; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.ISocketFactory; +import io.soluble.pjb.bridge.JavaBridge; +import io.soluble.pjb.bridge.Util; /** * This class manages the fallback physical connection for the * operating system which doesn't support named pipes, "Windows", or when the - * System property php.java.bridge.promiscuous is set to true. + * System property io.soluble.pjb.bridge.promiscuous is set to true. *

* When isAvailable() returns true, a server socket bound to the local * interface (127.0.0.1) has been created on a port in the range @@ -53,10 +53,10 @@ *

*

It is possible to switch * off this server by setting the VM property - * php.java.bridge.no_socket_server to true, e.g.: - * -Dphp.java.bridge.no_socket_server=true.

+ * io.soluble.pjb.bridge.no_socket_server to true, e.g.: + * -Dio.soluble.pjb.bridge.no_socket_server=true.

* - * @see php.java.bridge.http.ContextServer + * @see io.soluble.pjb.bridge.http.ContextServer */ public final class SocketContextServer implements Runnable, IContextServer { private AppThreadPool threadPool; @@ -215,7 +215,7 @@ private static boolean checkTestTunnel(String property) { } } - public static final boolean SOCKET_SERVER_AVAIL = checkTestTunnel("php.java.bridge.no_socket_server"); + public static final boolean SOCKET_SERVER_AVAIL = checkTestTunnel("io.soluble.pjb.bridge.no_socket_server"); /** * Check if the ContextServer is ready, i.e. it has created a server socket. diff --git a/server/php/java/bridge/http/WriterOutputStream.java b/src/main/java/io/soluble/pjb/bridge/http/WriterOutputStream.java similarity index 96% rename from server/php/java/bridge/http/WriterOutputStream.java rename to src/main/java/io/soluble/pjb/bridge/http/WriterOutputStream.java index 2d4f9ed..9fd3dd8 100644 --- a/server/php/java/bridge/http/WriterOutputStream.java +++ b/src/main/java/io/soluble/pjb/bridge/http/WriterOutputStream.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.bridge.http; +package io.soluble.pjb.bridge.http; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -27,7 +27,7 @@ import java.io.IOException; import java.io.Writer; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.Util; /** * A PrintWriter backed by an OutputStream. diff --git a/server/php/java/bridge/http/package.html b/src/main/java/io/soluble/pjb/bridge/http/package.html similarity index 100% rename from server/php/java/bridge/http/package.html rename to src/main/java/io/soluble/pjb/bridge/http/package.html diff --git a/server/php/java/bridge/package.html b/src/main/java/io/soluble/pjb/bridge/package.html similarity index 100% rename from server/php/java/bridge/package.html rename to src/main/java/io/soluble/pjb/bridge/package.html diff --git a/server/php/java/script/AbstractPhpScriptContext.java b/src/main/java/io/soluble/pjb/script/AbstractPhpScriptContext.java similarity index 95% rename from server/php/java/script/AbstractPhpScriptContext.java rename to src/main/java/io/soluble/pjb/script/AbstractPhpScriptContext.java index fb65036..94941be 100644 --- a/server/php/java/script/AbstractPhpScriptContext.java +++ b/src/main/java/io/soluble/pjb/script/AbstractPhpScriptContext.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -28,9 +28,9 @@ import javax.script.ScriptContext; -import php.java.bridge.Util; -import php.java.bridge.http.IContext; -import php.java.bridge.http.WriterOutputStream; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.IContext; +import io.soluble.pjb.bridge.http.WriterOutputStream; /** diff --git a/server/php/java/script/AbstractPhpScriptEngine.java b/src/main/java/io/soluble/pjb/script/AbstractPhpScriptEngine.java similarity index 97% rename from server/php/java/script/AbstractPhpScriptEngine.java rename to src/main/java/io/soluble/pjb/script/AbstractPhpScriptEngine.java index 0fbe411..5256b8e 100644 --- a/server/php/java/script/AbstractPhpScriptEngine.java +++ b/src/main/java/io/soluble/pjb/script/AbstractPhpScriptEngine.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -46,19 +46,19 @@ import javax.script.SimpleBindings; import javax.script.SimpleScriptContext; -import php.java.bridge.Util; -import php.java.bridge.http.AbstractChannelName; -import php.java.bridge.http.ContextServer; -import php.java.bridge.http.HeaderParser; -import php.java.bridge.http.IContext; -import php.java.bridge.http.IContextFactory; -import php.java.bridge.http.WriterOutputStream; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.AbstractChannelName; +import io.soluble.pjb.bridge.http.ContextServer; +import io.soluble.pjb.bridge.http.HeaderParser; +import io.soluble.pjb.bridge.http.IContext; +import io.soluble.pjb.bridge.http.IContextFactory; +import io.soluble.pjb.bridge.http.WriterOutputStream; /** * This class implements the ScriptEngine.

* - * @see php.java.script.InvocablePhpScriptEngine - * @see php.java.script.PhpScriptEngine + * @see io.soluble.pjb.script.InvocablePhpScriptEngine + * @see io.soluble.pjb.script.PhpScriptEngine */ abstract class AbstractPhpScriptEngine extends AbstractScriptEngine implements IPhpScriptEngine, Compilable, java.io.FileFilter, CloneableScript { diff --git a/server/php/java/script/CGIRunner.java b/src/main/java/io/soluble/pjb/script/CGIRunner.java similarity index 92% rename from server/php/java/script/CGIRunner.java rename to src/main/java/io/soluble/pjb/script/CGIRunner.java index f5ef49d..f6d66e5 100644 --- a/server/php/java/script/CGIRunner.java +++ b/src/main/java/io/soluble/pjb/script/CGIRunner.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -33,10 +33,10 @@ import java.io.Writer; import java.util.Map; -import php.java.bridge.ILogger; -import php.java.bridge.Util; -import php.java.bridge.http.HeaderParser; -import php.java.bridge.http.OutputStreamFactory; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.HeaderParser; +import io.soluble.pjb.bridge.http.OutputStreamFactory; /** * This class can be used to run a PHP CGI binary. Used only when @@ -44,9 +44,9 @@ * please use a HttpProxy and a URLReader instead. * * @author jostb - * @see php.java.bridge.http.HttpServer - * @see php.java.script.URLReader - * @see php.java.script.HttpProxy + * @see io.soluble.pjb.bridge.http.HttpServer + * @see io.soluble.pjb.script.URLReader + * @see io.soluble.pjb.script.HttpProxy */ public class CGIRunner extends Continuation { diff --git a/server/php/java/script/CloneableScript.java b/src/main/java/io/soluble/pjb/script/CloneableScript.java similarity index 97% rename from server/php/java/script/CloneableScript.java rename to src/main/java/io/soluble/pjb/script/CloneableScript.java index e00cb43..cced3a8 100644 --- a/server/php/java/script/CloneableScript.java +++ b/src/main/java/io/soluble/pjb/script/CloneableScript.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* diff --git a/server/php/java/script/CloseableInteractivePhpScriptEngine.java b/src/main/java/io/soluble/pjb/script/CloseableInteractivePhpScriptEngine.java similarity index 97% rename from server/php/java/script/CloseableInteractivePhpScriptEngine.java rename to src/main/java/io/soluble/pjb/script/CloseableInteractivePhpScriptEngine.java index 5d8f7ed..e600d2d 100644 --- a/server/php/java/script/CloseableInteractivePhpScriptEngine.java +++ b/src/main/java/io/soluble/pjb/script/CloseableInteractivePhpScriptEngine.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/script/CloseableInvocablePhpScriptEngine.java b/src/main/java/io/soluble/pjb/script/CloseableInvocablePhpScriptEngine.java similarity index 97% rename from server/php/java/script/CloseableInvocablePhpScriptEngine.java rename to src/main/java/io/soluble/pjb/script/CloseableInvocablePhpScriptEngine.java index 599cb19..62ad7cb 100644 --- a/server/php/java/script/CloseableInvocablePhpScriptEngine.java +++ b/src/main/java/io/soluble/pjb/script/CloseableInvocablePhpScriptEngine.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/script/CloseablePhpScriptEngine.java b/src/main/java/io/soluble/pjb/script/CloseablePhpScriptEngine.java similarity index 97% rename from server/php/java/script/CloseablePhpScriptEngine.java rename to src/main/java/io/soluble/pjb/script/CloseablePhpScriptEngine.java index 8fa755c..8251f56 100644 --- a/server/php/java/script/CloseablePhpScriptEngine.java +++ b/src/main/java/io/soluble/pjb/script/CloseablePhpScriptEngine.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/script/CompiledPhpScript.java b/src/main/java/io/soluble/pjb/script/CompiledPhpScript.java similarity index 98% rename from server/php/java/script/CompiledPhpScript.java rename to src/main/java/io/soluble/pjb/script/CompiledPhpScript.java index dd6f28b..e1aa760 100644 --- a/server/php/java/script/CompiledPhpScript.java +++ b/src/main/java/io/soluble/pjb/script/CompiledPhpScript.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; import javax.script.CompiledScript; import javax.script.ScriptContext; diff --git a/server/php/java/script/Continuation.java b/src/main/java/io/soluble/pjb/script/Continuation.java similarity index 95% rename from server/php/java/script/Continuation.java rename to src/main/java/io/soluble/pjb/script/Continuation.java index c0fe4bc..9f08b04 100644 --- a/server/php/java/script/Continuation.java +++ b/src/main/java/io/soluble/pjb/script/Continuation.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -28,17 +28,17 @@ import java.io.OutputStream; import java.util.Map; -import php.java.bridge.Util; -import php.java.bridge.http.HeaderParser; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.HeaderParser; /** * This class represents the logic to run PHP scripts through CGI, FastCGI or on a remote HTTP server * (accessed through URLReader). * * @author jostb - * @see php.java.bridge.http.HttpServer - * @see php.java.script.URLReader - * @see php.java.script.HttpProxy + * @see io.soluble.pjb.bridge.http.HttpServer + * @see io.soluble.pjb.script.URLReader + * @see io.soluble.pjb.script.HttpProxy */ public abstract class Continuation implements IContinuation, Runnable { diff --git a/server/php/java/script/FCGIProcess.java b/src/main/java/io/soluble/pjb/script/FCGIProcess.java similarity index 96% rename from server/php/java/script/FCGIProcess.java rename to src/main/java/io/soluble/pjb/script/FCGIProcess.java index 1f0d9e0..5752d76 100644 --- a/server/php/java/script/FCGIProcess.java +++ b/src/main/java/io/soluble/pjb/script/FCGIProcess.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -29,8 +29,8 @@ import java.util.LinkedList; import java.util.Map; -import php.java.bridge.Util; -import php.java.bridge.http.IFCGIProcess; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.IFCGIProcess; /** * Represents the FastCGI process. diff --git a/server/php/java/script/FastCGIProxy.java b/src/main/java/io/soluble/pjb/script/FastCGIProxy.java similarity index 92% rename from server/php/java/script/FastCGIProxy.java rename to src/main/java/io/soluble/pjb/script/FastCGIProxy.java index fbb79c5..79e9c18 100644 --- a/server/php/java/script/FastCGIProxy.java +++ b/src/main/java/io/soluble/pjb/script/FastCGIProxy.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -34,20 +34,20 @@ import java.util.HashMap; import java.util.Map; -import php.java.bridge.ILogger; -import php.java.bridge.Util; -import php.java.bridge.http.FCGIConnectException; -import php.java.bridge.http.FCGIConnection; -import php.java.bridge.http.FCGIConnectionFactory; -import php.java.bridge.http.FCGIConnectionPool; -import php.java.bridge.http.FCGIIOFactory; -import php.java.bridge.http.FCGIInputStream; -import php.java.bridge.http.FCGIOutputStream; -import php.java.bridge.http.FCGIUtil; -import php.java.bridge.http.HeaderParser; -import php.java.bridge.http.IFCGIProcess; -import php.java.bridge.http.IFCGIProcessFactory; -import php.java.bridge.http.OutputStreamFactory; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.FCGIConnectException; +import io.soluble.pjb.bridge.http.FCGIConnection; +import io.soluble.pjb.bridge.http.FCGIConnectionFactory; +import io.soluble.pjb.bridge.http.FCGIConnectionPool; +import io.soluble.pjb.bridge.http.FCGIIOFactory; +import io.soluble.pjb.bridge.http.FCGIInputStream; +import io.soluble.pjb.bridge.http.FCGIOutputStream; +import io.soluble.pjb.bridge.http.FCGIUtil; +import io.soluble.pjb.bridge.http.HeaderParser; +import io.soluble.pjb.bridge.http.IFCGIProcess; +import io.soluble.pjb.bridge.http.IFCGIProcessFactory; +import io.soluble.pjb.bridge.http.OutputStreamFactory; /** * This class can be used to run (and to connect to) a FastCGI server. diff --git a/server/php/java/script/HttpProxy.java b/src/main/java/io/soluble/pjb/script/HttpProxy.java similarity index 93% rename from server/php/java/script/HttpProxy.java rename to src/main/java/io/soluble/pjb/script/HttpProxy.java index cabf3fd..a285aec 100644 --- a/server/php/java/script/HttpProxy.java +++ b/src/main/java/io/soluble/pjb/script/HttpProxy.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -29,9 +29,9 @@ import java.io.Reader; import java.util.Map; -import php.java.bridge.ILogger; -import php.java.bridge.Util.Process.PhpException; -import php.java.bridge.http.HeaderParser; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.Util.Process.PhpException; +import io.soluble.pjb.bridge.http.HeaderParser; /** * Represents the script continuation. diff --git a/server/php/java/script/IContinuation.java b/src/main/java/io/soluble/pjb/script/IContinuation.java similarity index 97% rename from server/php/java/script/IContinuation.java rename to src/main/java/io/soluble/pjb/script/IContinuation.java index fdeb40f..d93d2b5 100644 --- a/server/php/java/script/IContinuation.java +++ b/src/main/java/io/soluble/pjb/script/IContinuation.java @@ -1,4 +1,4 @@ -package php.java.script; +package io.soluble.pjb.script; /** * Classes implementing this interface represent the script continuation; diff --git a/server/php/java/script/IPhpScriptContext.java b/src/main/java/io/soluble/pjb/script/IPhpScriptContext.java similarity index 90% rename from server/php/java/script/IPhpScriptContext.java rename to src/main/java/io/soluble/pjb/script/IPhpScriptContext.java index b8bd73c..2b3d1c4 100644 --- a/server/php/java/script/IPhpScriptContext.java +++ b/src/main/java/io/soluble/pjb/script/IPhpScriptContext.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -30,12 +30,12 @@ import javax.script.ScriptContext; -import php.java.bridge.ILogger; -import php.java.bridge.IManaged; -import php.java.bridge.Invocable; -import php.java.bridge.http.ContextServer; -import php.java.bridge.http.HeaderParser; -import php.java.bridge.http.IContext; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.IManaged; +import io.soluble.pjb.bridge.Invocable; +import io.soluble.pjb.bridge.http.ContextServer; +import io.soluble.pjb.bridge.http.HeaderParser; +import io.soluble.pjb.bridge.http.IContext; /** * Common methods for all PHP ScriptContexts diff --git a/server/php/java/script/IPhpScriptEngine.java b/src/main/java/io/soluble/pjb/script/IPhpScriptEngine.java similarity index 98% rename from server/php/java/script/IPhpScriptEngine.java rename to src/main/java/io/soluble/pjb/script/IPhpScriptEngine.java index 2051caa..dc3980a 100644 --- a/server/php/java/script/IPhpScriptEngine.java +++ b/src/main/java/io/soluble/pjb/script/IPhpScriptEngine.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/script/IScriptReader.java b/src/main/java/io/soluble/pjb/script/IScriptReader.java similarity index 95% rename from server/php/java/script/IScriptReader.java rename to src/main/java/io/soluble/pjb/script/IScriptReader.java index ddc0782..1b45c2a 100644 --- a/server/php/java/script/IScriptReader.java +++ b/src/main/java/io/soluble/pjb/script/IScriptReader.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier and others. @@ -29,8 +29,8 @@ import java.io.OutputStream; import java.util.Map; -import php.java.bridge.Util; -import php.java.bridge.http.HeaderParser; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.HeaderParser; /** * Read data from a URL or from a servlet and write the result to the output stream and a header parser. diff --git a/server/php/java/script/InteractivePhpScriptContextFactory.java b/src/main/java/io/soluble/pjb/script/InteractivePhpScriptContextFactory.java similarity index 92% rename from server/php/java/script/InteractivePhpScriptContextFactory.java rename to src/main/java/io/soluble/pjb/script/InteractivePhpScriptContextFactory.java index 0a0f934..f50e362 100644 --- a/server/php/java/script/InteractivePhpScriptContextFactory.java +++ b/src/main/java/io/soluble/pjb/script/InteractivePhpScriptContextFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -24,9 +24,9 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -import php.java.bridge.ISession; -import php.java.bridge.http.IContext; -import php.java.bridge.http.IContextFactory; +import io.soluble.pjb.bridge.ISession; +import io.soluble.pjb.bridge.http.IContext; +import io.soluble.pjb.bridge.http.IContextFactory; /** * A custom context factory, creates a ContextFactory for JSR223 contexts. sessions do not expire. diff --git a/server/php/java/script/InteractivePhpScriptEngine.java b/src/main/java/io/soluble/pjb/script/InteractivePhpScriptEngine.java similarity index 94% rename from server/php/java/script/InteractivePhpScriptEngine.java rename to src/main/java/io/soluble/pjb/script/InteractivePhpScriptEngine.java index 44cfe0e..ea18b3c 100644 --- a/server/php/java/script/InteractivePhpScriptEngine.java +++ b/src/main/java/io/soluble/pjb/script/InteractivePhpScriptEngine.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -31,8 +31,8 @@ import javax.script.ScriptContext; import javax.script.ScriptException; -import php.java.bridge.Util; -import php.java.bridge.http.IContext; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.IContext; /** * A convenience variant of the PHP script engine which can be used interactively.

@@ -49,7 +49,7 @@ public class InteractivePhpScriptEngine extends InvocablePhpScriptEngine { private static final String restoreState = "" + - "$javabridge_values=unserialize(java_values(java_context()->getAttribute('php.java.bridge.JAVABRIDGE_TMP_VALUES', 100)));" + + "$javabridge_values=unserialize(java_values(java_context()->getAttribute('io.soluble.pjb.bridge.JAVABRIDGE_TMP_VALUES', 100)));" + "if($javabridge_values)" + "foreach ($javabridge_values as $javabridge_key=>$javabridge_val) " + "{eval(\"\\$$javabridge_key=\\$javabridge_values[\\$javabridge_key];\");}\n"; @@ -57,7 +57,7 @@ public class InteractivePhpScriptEngine extends InvocablePhpScriptEngine { "foreach (get_defined_vars() as $javabridge_key=>$javabridge_val) " + "{if(in_array($javabridge_key, $javabridge_ignored_keys)) continue;" + "eval(\"\\$javabridge_values[\\$javabridge_key]=\\$$javabridge_key;\");};" + - "java_context()->setAttribute('php.java.bridge.JAVABRIDGE_TMP_VALUES', serialize($javabridge_values), 100);\n"; + "java_context()->setAttribute('io.soluble.pjb.bridge.JAVABRIDGE_TMP_VALUES', serialize($javabridge_values), 100);\n"; public InteractivePhpScriptEngine() { diff --git a/server/php/java/script/InteractivePhpScriptEngineFactory.java b/src/main/java/io/soluble/pjb/script/InteractivePhpScriptEngineFactory.java similarity index 98% rename from server/php/java/script/InteractivePhpScriptEngineFactory.java rename to src/main/java/io/soluble/pjb/script/InteractivePhpScriptEngineFactory.java index 55bd9c7..d4bfbf8 100644 --- a/server/php/java/script/InteractivePhpScriptEngineFactory.java +++ b/src/main/java/io/soluble/pjb/script/InteractivePhpScriptEngineFactory.java @@ -1,5 +1,5 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/script/InvocablePhpScriptEngine.java b/src/main/java/io/soluble/pjb/script/InvocablePhpScriptEngine.java similarity index 98% rename from server/php/java/script/InvocablePhpScriptEngine.java rename to src/main/java/io/soluble/pjb/script/InvocablePhpScriptEngine.java index c0703d4..ea31d29 100644 --- a/server/php/java/script/InvocablePhpScriptEngine.java +++ b/src/main/java/io/soluble/pjb/script/InvocablePhpScriptEngine.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -42,9 +42,10 @@ import javax.script.ScriptContext; import javax.script.ScriptException; -import php.java.bridge.PhpProcedure; -import php.java.bridge.Util; -import php.java.bridge.http.IContext; +import io.soluble.pjb.bridge.PhpProcedure; +import io.soluble.pjb.bridge.Request; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.IContext; /** * This class implements the ScriptEngine and the Invocable interface.

@@ -128,7 +129,7 @@ protected Object invoke(String methodName, Object[] args) } try { return invoke(scriptClosure, methodName, args); - } catch (php.java.bridge.Request.AbortException e) { + } catch (Request.AbortException e) { release(); throw new ScriptException(e); } catch (NoSuchMethodError e) { // conform to jsr223 diff --git a/server/php/java/script/InvocablePhpScriptEngineFactory.java b/src/main/java/io/soluble/pjb/script/InvocablePhpScriptEngineFactory.java similarity index 98% rename from server/php/java/script/InvocablePhpScriptEngineFactory.java rename to src/main/java/io/soluble/pjb/script/InvocablePhpScriptEngineFactory.java index 8bbfc68..27ae1b8 100644 --- a/server/php/java/script/InvocablePhpScriptEngineFactory.java +++ b/src/main/java/io/soluble/pjb/script/InvocablePhpScriptEngineFactory.java @@ -1,5 +1,5 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/script/JavaBridgeScriptRunner.java b/src/main/java/io/soluble/pjb/script/JavaBridgeScriptRunner.java similarity index 96% rename from server/php/java/script/JavaBridgeScriptRunner.java rename to src/main/java/io/soluble/pjb/script/JavaBridgeScriptRunner.java index 4f4019f..065dea8 100644 --- a/server/php/java/script/JavaBridgeScriptRunner.java +++ b/src/main/java/io/soluble/pjb/script/JavaBridgeScriptRunner.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -37,10 +37,10 @@ import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; -import php.java.bridge.JavaBridgeRunner; -import php.java.bridge.Util; -import php.java.bridge.http.HttpRequest; -import php.java.bridge.http.HttpResponse; +import io.soluble.pjb.bridge.JavaBridgeRunner; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.HttpRequest; +import io.soluble.pjb.bridge.http.HttpResponse; /** * This is the main entry point for the PHP/Java Bridge library. @@ -54,7 +54,7 @@ * }
* * @author jostb - * @see php.java.script.PhpScriptContext + * @see io.soluble.pjb.script.PhpScriptContext */ public class JavaBridgeScriptRunner extends JavaBridgeRunner { private ScriptEngineManager m = new ScriptEngineManager(); diff --git a/server/php/java/script/PhpCompiledScriptContext.java b/src/main/java/io/soluble/pjb/script/PhpCompiledScriptContext.java similarity index 95% rename from server/php/java/script/PhpCompiledScriptContext.java rename to src/main/java/io/soluble/pjb/script/PhpCompiledScriptContext.java index c0dd066..22a7745 100644 --- a/server/php/java/script/PhpCompiledScriptContext.java +++ b/src/main/java/io/soluble/pjb/script/PhpCompiledScriptContext.java @@ -1,13 +1,13 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; import java.io.OutputStream; import java.io.Reader; import java.util.Map; -import php.java.bridge.ILogger; -import php.java.bridge.http.HeaderParser; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.http.HeaderParser; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/script/PhpJavaBridgeRunnerScriptContext.java b/src/main/java/io/soluble/pjb/script/PhpJavaBridgeRunnerScriptContext.java similarity index 94% rename from server/php/java/script/PhpJavaBridgeRunnerScriptContext.java rename to src/main/java/io/soluble/pjb/script/PhpJavaBridgeRunnerScriptContext.java index 97afad0..459b895 100644 --- a/server/php/java/script/PhpJavaBridgeRunnerScriptContext.java +++ b/src/main/java/io/soluble/pjb/script/PhpJavaBridgeRunnerScriptContext.java @@ -1,11 +1,11 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; import javax.script.ScriptContext; -import php.java.bridge.JavaBridgeRunner; -import php.java.bridge.http.ContextServer; +import io.soluble.pjb.bridge.JavaBridgeRunner; +import io.soluble.pjb.bridge.http.ContextServer; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/script/PhpScriptContext.java b/src/main/java/io/soluble/pjb/script/PhpScriptContext.java similarity index 90% rename from server/php/java/script/PhpScriptContext.java rename to src/main/java/io/soluble/pjb/script/PhpScriptContext.java index c438a2d..ee6e74b 100644 --- a/server/php/java/script/PhpScriptContext.java +++ b/src/main/java/io/soluble/pjb/script/PhpScriptContext.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -32,13 +32,13 @@ import javax.script.ScriptContext; -import php.java.bridge.ILogger; -import php.java.bridge.JavaBridgeRunner; -import php.java.bridge.NotImplementedException; -import php.java.bridge.Util; -import php.java.bridge.http.ContextServer; -import php.java.bridge.http.HeaderParser; -import php.java.bridge.http.IContext; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.JavaBridgeRunner; +import io.soluble.pjb.bridge.NotImplementedException; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.ContextServer; +import io.soluble.pjb.bridge.http.HeaderParser; +import io.soluble.pjb.bridge.http.IContext; /** * This class implements a simple script context for PHP. It starts a standalone @@ -47,7 +47,7 @@ * In a servlet environment please use a php.java.script.http.PhpSimpleHttpScriptContext instead. * * @author jostb - * @see php.java.script.PhpScriptContext + * @see io.soluble.pjb.script.PhpScriptContext * @see php.java.bridge.JavaBridgeRunner */ @@ -60,14 +60,14 @@ public PhpScriptContext(ScriptContext ctx) { * {@inheritDoc} */ public Object init(Object callable) throws Exception { - return php.java.bridge.http.Context.getManageable(callable); + return io.soluble.pjb.bridge.http.Context.getManageable(callable); } /** * {@inheritDoc} */ public void onShutdown(Object closeable) { - php.java.bridge.http.Context.handleManaged(closeable); + io.soluble.pjb.bridge.http.Context.handleManaged(closeable); } /** @@ -119,7 +119,7 @@ public Object getServletConfig() { * {@inheritDoc} */ public String getRealPath(String path) { - return php.java.bridge.http.Context.getRealPathInternal(path); + return io.soluble.pjb.bridge.http.Context.getRealPathInternal(path); } /** diff --git a/server/php/java/script/PhpScriptContextDecorator.java b/src/main/java/io/soluble/pjb/script/PhpScriptContextDecorator.java similarity index 97% rename from server/php/java/script/PhpScriptContextDecorator.java rename to src/main/java/io/soluble/pjb/script/PhpScriptContextDecorator.java index db08a2d..99e28dc 100644 --- a/server/php/java/script/PhpScriptContextDecorator.java +++ b/src/main/java/io/soluble/pjb/script/PhpScriptContextDecorator.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -32,10 +32,10 @@ import javax.script.Bindings; -import php.java.bridge.ILogger; -import php.java.bridge.NotImplementedException; -import php.java.bridge.http.ContextServer; -import php.java.bridge.http.HeaderParser; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.NotImplementedException; +import io.soluble.pjb.bridge.http.ContextServer; +import io.soluble.pjb.bridge.http.HeaderParser; /** * Abstract class for IPhpScriptContexts. The abstract class itself provides default methods that pass diff --git a/server/php/java/script/PhpScriptContextFactory.java b/src/main/java/io/soluble/pjb/script/PhpScriptContextFactory.java similarity index 86% rename from server/php/java/script/PhpScriptContextFactory.java rename to src/main/java/io/soluble/pjb/script/PhpScriptContextFactory.java index 7b2d595..fd8f2aa 100644 --- a/server/php/java/script/PhpScriptContextFactory.java +++ b/src/main/java/io/soluble/pjb/script/PhpScriptContextFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -24,16 +24,16 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -import php.java.bridge.http.ContextFactory; -import php.java.bridge.http.IContext; -import php.java.bridge.http.IContextFactory; +import io.soluble.pjb.bridge.http.ContextFactory; +import io.soluble.pjb.bridge.http.IContext; +import io.soluble.pjb.bridge.http.IContextFactory; /** * A custom context factory, creates a ContextFactory for JSR223 contexts. * * @author jostb */ -public class PhpScriptContextFactory extends php.java.bridge.http.SimpleContextFactory { +public class PhpScriptContextFactory extends io.soluble.pjb.bridge.http.SimpleContextFactory { /** * Add the PhpScriptContext diff --git a/server/php/java/script/PhpScriptEngine.java b/src/main/java/io/soluble/pjb/script/PhpScriptEngine.java similarity index 98% rename from server/php/java/script/PhpScriptEngine.java rename to src/main/java/io/soluble/pjb/script/PhpScriptEngine.java index e9851ba..a6ea00b 100644 --- a/server/php/java/script/PhpScriptEngine.java +++ b/src/main/java/io/soluble/pjb/script/PhpScriptEngine.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -37,8 +37,8 @@ import javax.script.ScriptContext; import javax.script.ScriptException; -import php.java.bridge.Util; -import php.java.bridge.http.IContext; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.IContext; /** * This class implements the ScriptEngine.

diff --git a/server/php/java/script/PhpScriptEngineFactory.java b/src/main/java/io/soluble/pjb/script/PhpScriptEngineFactory.java similarity index 98% rename from server/php/java/script/PhpScriptEngineFactory.java rename to src/main/java/io/soluble/pjb/script/PhpScriptEngineFactory.java index 839aa0d..cde77f9 100644 --- a/server/php/java/script/PhpScriptEngineFactory.java +++ b/src/main/java/io/soluble/pjb/script/PhpScriptEngineFactory.java @@ -1,5 +1,5 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -29,7 +29,7 @@ import javax.script.ScriptEngine; import javax.script.ScriptEngineFactory; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.Util; /** * Create a standalone PHP script engines. diff --git a/server/php/java/script/PhpScriptException.java b/src/main/java/io/soluble/pjb/script/PhpScriptException.java similarity index 98% rename from server/php/java/script/PhpScriptException.java rename to src/main/java/io/soluble/pjb/script/PhpScriptException.java index 2ca230d..ce983ae 100644 --- a/server/php/java/script/PhpScriptException.java +++ b/src/main/java/io/soluble/pjb/script/PhpScriptException.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/script/PhpScriptWriter.java b/src/main/java/io/soluble/pjb/script/PhpScriptWriter.java similarity index 98% rename from server/php/java/script/PhpScriptWriter.java rename to src/main/java/io/soluble/pjb/script/PhpScriptWriter.java index bc90763..a7e7306 100644 --- a/server/php/java/script/PhpScriptWriter.java +++ b/src/main/java/io/soluble/pjb/script/PhpScriptWriter.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/script/PhpSecureScriptContext.java b/src/main/java/io/soluble/pjb/script/PhpSecureScriptContext.java similarity index 98% rename from server/php/java/script/PhpSecureScriptContext.java rename to src/main/java/io/soluble/pjb/script/PhpSecureScriptContext.java index 14d3686..b5edba4 100644 --- a/server/php/java/script/PhpSecureScriptContext.java +++ b/src/main/java/io/soluble/pjb/script/PhpSecureScriptContext.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; import javax.script.ScriptContext; diff --git a/server/php/java/script/ResultProxy.java b/src/main/java/io/soluble/pjb/script/ResultProxy.java similarity index 98% rename from server/php/java/script/ResultProxy.java rename to src/main/java/io/soluble/pjb/script/ResultProxy.java index ae40f68..f0f2831 100644 --- a/server/php/java/script/ResultProxy.java +++ b/src/main/java/io/soluble/pjb/script/ResultProxy.java @@ -1,10 +1,10 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; import java.io.IOException; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.Util; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/script/ScriptContextDecorator.java b/src/main/java/io/soluble/pjb/script/ScriptContextDecorator.java similarity index 99% rename from server/php/java/script/ScriptContextDecorator.java rename to src/main/java/io/soluble/pjb/script/ScriptContextDecorator.java index c4061e1..83b2597 100644 --- a/server/php/java/script/ScriptContextDecorator.java +++ b/src/main/java/io/soluble/pjb/script/ScriptContextDecorator.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/script/URLReader.java b/src/main/java/io/soluble/pjb/script/URLReader.java similarity index 98% rename from server/php/java/script/URLReader.java rename to src/main/java/io/soluble/pjb/script/URLReader.java index 65af051..d2856b3 100644 --- a/server/php/java/script/URLReader.java +++ b/src/main/java/io/soluble/pjb/script/URLReader.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script; +package io.soluble.pjb.script; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -48,8 +48,8 @@ import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.X509TrustManager; -import php.java.bridge.Util; -import php.java.bridge.http.HeaderParser; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.HeaderParser; /** * This class can be used to connect to a HTTP server to allocate and to invoke php scripts. diff --git a/server/php/java/script/package.html b/src/main/java/io/soluble/pjb/script/package.html similarity index 100% rename from server/php/java/script/package.html rename to src/main/java/io/soluble/pjb/script/package.html diff --git a/server/php/java/script/servlet/HttpFastCGIProxy.java b/src/main/java/io/soluble/pjb/script/servlet/HttpFastCGIProxy.java similarity index 84% rename from server/php/java/script/servlet/HttpFastCGIProxy.java rename to src/main/java/io/soluble/pjb/script/servlet/HttpFastCGIProxy.java index dcaae87..d6229f1 100644 --- a/server/php/java/script/servlet/HttpFastCGIProxy.java +++ b/src/main/java/io/soluble/pjb/script/servlet/HttpFastCGIProxy.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script.servlet; +package io.soluble.pjb.script.servlet; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -28,21 +28,21 @@ import java.io.OutputStream; import java.util.Map; -import php.java.bridge.Util; -import php.java.bridge.http.FCGIConnectionPool; -import php.java.bridge.http.FCGIInputStream; -import php.java.bridge.http.FCGIOutputStream; -import php.java.bridge.http.FCGIUtil; -import php.java.bridge.http.HeaderParser; -import php.java.bridge.http.OutputStreamFactory; -import php.java.script.Continuation; -import php.java.script.ResultProxy; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.FCGIConnectionPool; +import io.soluble.pjb.bridge.http.FCGIInputStream; +import io.soluble.pjb.bridge.http.FCGIOutputStream; +import io.soluble.pjb.bridge.http.FCGIUtil; +import io.soluble.pjb.bridge.http.HeaderParser; +import io.soluble.pjb.bridge.http.OutputStreamFactory; +import io.soluble.pjb.script.Continuation; +import io.soluble.pjb.script.ResultProxy; /** * This class can be used to connect to a FastCGI server. * * @author jostb - * @see php.java.script.FastCGIProxy + * @see io.soluble.pjb.script.FastCGIProxy */ public class HttpFastCGIProxy extends Continuation { diff --git a/server/php/java/script/servlet/PhpHttpScriptContext.java b/src/main/java/io/soluble/pjb/script/servlet/PhpHttpScriptContext.java similarity index 90% rename from server/php/java/script/servlet/PhpHttpScriptContext.java rename to src/main/java/io/soluble/pjb/script/servlet/PhpHttpScriptContext.java index d9e6709..9ba50d3 100644 --- a/server/php/java/script/servlet/PhpHttpScriptContext.java +++ b/src/main/java/io/soluble/pjb/script/servlet/PhpHttpScriptContext.java @@ -1,4 +1,4 @@ -package php.java.script.servlet; +package io.soluble.pjb.script.servlet; /*-*- mode: Java; tab-width:8 -*-*/ @@ -16,21 +16,21 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import php.java.bridge.ILogger; -import php.java.bridge.NotImplementedException; -import php.java.bridge.Util; -import php.java.bridge.http.ContextServer; -import php.java.bridge.http.HeaderParser; -import php.java.bridge.http.WriterOutputStream; -import php.java.script.Continuation; -import php.java.script.IPhpScriptContext; -import php.java.script.PhpScriptContextDecorator; -import php.java.script.PhpScriptWriter; -import php.java.script.ResultProxy; -import php.java.script.servlet.HttpFastCGIProxy; -import php.java.script.servlet.PhpScriptLogWriter; -import php.java.servlet.ContextLoaderListener; -import php.java.servlet.ServletUtil; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.NotImplementedException; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.ContextServer; +import io.soluble.pjb.bridge.http.HeaderParser; +import io.soluble.pjb.bridge.http.WriterOutputStream; +import io.soluble.pjb.script.Continuation; +import io.soluble.pjb.script.IPhpScriptContext; +import io.soluble.pjb.script.PhpScriptContextDecorator; +import io.soluble.pjb.script.PhpScriptWriter; +import io.soluble.pjb.script.ResultProxy; +import io.soluble.pjb.script.servlet.HttpFastCGIProxy; +import io.soluble.pjb.script.servlet.PhpScriptLogWriter; +import io.soluble.pjb.servlet.ContextLoaderListener; +import io.soluble.pjb.servlet.ServletUtil; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -237,7 +237,7 @@ public void setWriter(Writer writer) { */ public Writer getErrorWriter() { if (errorWriter == null) { - setErrorWriter(PhpScriptLogWriter.getWriter(new php.java.servlet.Logger())); + setErrorWriter(PhpScriptLogWriter.getWriter(new io.soluble.pjb.servlet.Logger())); } return errorWriter; } @@ -276,14 +276,14 @@ public void setReader(Reader reader) { * {@inheritDoc} */ public Object init(Object callable) throws Exception { - return php.java.bridge.http.Context.getManageable(callable); + return io.soluble.pjb.bridge.http.Context.getManageable(callable); } /** * {@inheritDoc} */ public void onShutdown(Object closeable) { - php.java.servlet.HttpContext.handleManaged(closeable, context); + io.soluble.pjb.servlet.HttpContext.handleManaged(closeable, context); } /** diff --git a/server/php/java/script/servlet/PhpScriptLogWriter.java b/src/main/java/io/soluble/pjb/script/servlet/PhpScriptLogWriter.java similarity index 92% rename from server/php/java/script/servlet/PhpScriptLogWriter.java rename to src/main/java/io/soluble/pjb/script/servlet/PhpScriptLogWriter.java index d159299..5127304 100644 --- a/server/php/java/script/servlet/PhpScriptLogWriter.java +++ b/src/main/java/io/soluble/pjb/script/servlet/PhpScriptLogWriter.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.script.servlet; +package io.soluble.pjb.script.servlet; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -27,9 +27,9 @@ import java.io.IOException; import java.io.OutputStream; -import php.java.bridge.ILogger; -import php.java.bridge.NotImplementedException; -import php.java.script.PhpScriptWriter; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.NotImplementedException; +import io.soluble.pjb.script.PhpScriptWriter; /** * A PrintWriter which uses the JavaBridge logger. diff --git a/server/php/java/script/servlet/package.html b/src/main/java/io/soluble/pjb/script/servlet/package.html similarity index 100% rename from server/php/java/script/servlet/package.html rename to src/main/java/io/soluble/pjb/script/servlet/package.html diff --git a/server/php/java/servlet/BufferedResponse.java b/src/main/java/io/soluble/pjb/servlet/BufferedResponse.java similarity index 97% rename from server/php/java/servlet/BufferedResponse.java rename to src/main/java/io/soluble/pjb/servlet/BufferedResponse.java index edcc34a..ab5e320 100644 --- a/server/php/java/servlet/BufferedResponse.java +++ b/src/main/java/io/soluble/pjb/servlet/BufferedResponse.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; import java.io.IOException; diff --git a/server/php/java/servlet/ContextLoaderListener.java b/src/main/java/io/soluble/pjb/servlet/ContextLoaderListener.java similarity index 94% rename from server/php/java/servlet/ContextLoaderListener.java rename to src/main/java/io/soluble/pjb/servlet/ContextLoaderListener.java index 5816637..f72f699 100644 --- a/server/php/java/servlet/ContextLoaderListener.java +++ b/src/main/java/io/soluble/pjb/servlet/ContextLoaderListener.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; import java.io.File; import java.io.FileOutputStream; @@ -18,21 +18,21 @@ import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; -import php.java.bridge.ILogger; -import php.java.bridge.ThreadPool; -import php.java.bridge.Util; -import php.java.bridge.http.ContextServer; -import php.java.bridge.http.FCGIConnectException; -import php.java.bridge.http.FCGIConnection; -import php.java.bridge.http.FCGIConnectionFactory; -import php.java.bridge.http.FCGIConnectionPool; -import php.java.bridge.http.FCGIIOFactory; -import php.java.bridge.http.FCGIInputStream; -import php.java.bridge.http.FCGIOutputStream; -import php.java.bridge.http.FCGIUtil; -import php.java.bridge.http.IFCGIProcess; -import php.java.bridge.http.IFCGIProcessFactory; -import php.java.servlet.fastcgi.FCGIProcess; +import io.soluble.pjb.bridge.ILogger; +import io.soluble.pjb.bridge.ThreadPool; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.ContextServer; +import io.soluble.pjb.bridge.http.FCGIConnectException; +import io.soluble.pjb.bridge.http.FCGIConnection; +import io.soluble.pjb.bridge.http.FCGIConnectionFactory; +import io.soluble.pjb.bridge.http.FCGIConnectionPool; +import io.soluble.pjb.bridge.http.FCGIIOFactory; +import io.soluble.pjb.bridge.http.FCGIInputStream; +import io.soluble.pjb.bridge.http.FCGIOutputStream; +import io.soluble.pjb.bridge.http.FCGIUtil; +import io.soluble.pjb.bridge.http.IFCGIProcess; +import io.soluble.pjb.bridge.http.IFCGIProcessFactory; +import io.soluble.pjb.servlet.fastcgi.FCGIProcess; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -62,7 +62,7 @@ *

* * <listener> - *   <listener-class>php.java.servlet.ContextLoaderListener</listener-class> + *   <listener-class>io.soluble.pjb.servlet.ContextLoaderListener</listener-class> * </listener> * *
@@ -218,9 +218,9 @@ private void init() { try { val = context.getInitParameter("php_fcgi_children"); if (val == null) val = context.getInitParameter("PHP_FCGI_CHILDREN"); - if (val == null) val = System.getProperty("php.java.bridge.php_fcgi_children"); + if (val == null) val = System.getProperty("io.soluble.pjb.bridge.php_fcgi_children"); if (val == null) val = context.getInitParameter("php_fcgi_connection_pool_size"); - if (val == null) val = System.getProperty("php.java.bridge.php_fcgi_connection_pool_size"); + if (val == null) val = System.getProperty("io.soluble.pjb.bridge.php_fcgi_connection_pool_size"); if (val != null) php_fcgi_connection_pool_size_number = Integer.parseInt(val); } catch (Throwable t) {/*ignore*/} if (val != null) php_fcgi_connection_pool_size = val; @@ -228,7 +228,7 @@ private void init() { val = null; try { val = context.getInitParameter("php_fcgi_connection_pool_timeout"); - if (val == null) val = System.getProperty("php.java.bridge.php_fcgi_connection_pool_timeout"); + if (val == null) val = System.getProperty("io.soluble.pjb.bridge.php_fcgi_connection_pool_timeout"); if (val != null) php_fcgi_connection_pool_timeout_number = Integer.parseInt(val); } catch (Throwable t) {/*ignore*/} if (val != null) php_fcgi_connection_pool_timeout = val; @@ -238,7 +238,7 @@ private void init() { try { val = context.getInitParameter("php_include_java"); if (val == null) val = context.getInitParameter("PHP_INCLUDE_JAVA"); - if (val == null) val = System.getProperty("php.java.bridge.php_include_java"); + if (val == null) val = System.getProperty("io.soluble.pjb.bridge.php_include_java"); if (val != null && (val.equalsIgnoreCase("on") || val.equalsIgnoreCase("true"))) php_include_java = true; } catch (Throwable t) {/*ignore*/} @@ -246,7 +246,7 @@ private void init() { val = null; try { val = context.getInitParameter("php_fcgi_max_requests"); - if (val == null) val = System.getProperty("php.java.bridge.php_fcgi_max_requests"); + if (val == null) val = System.getProperty("io.soluble.pjb.bridge.php_fcgi_max_requests"); if (val != null) { php_fcgi_max_requests_number = Integer.parseInt(val); php_fcgi_max_requests = val; @@ -278,7 +278,7 @@ private void checkCgiBinary() { try { value = context.getInitParameter("use_fast_cgi"); if (value == null) try { - value = System.getProperty("php.java.bridge.use_fast_cgi"); + value = System.getProperty("io.soluble.pjb.bridge.use_fast_cgi"); } catch (Exception e) {/*ignore*/} if ("false".equalsIgnoreCase(value) || "off".equalsIgnoreCase(value)) fcgiIsConfigured = false; else { diff --git a/server/php/java/servlet/HttpContext.java b/src/main/java/io/soluble/pjb/servlet/HttpContext.java similarity index 95% rename from server/php/java/servlet/HttpContext.java rename to src/main/java/io/soluble/pjb/servlet/HttpContext.java index 4fb0e89..aba32a7 100644 --- a/server/php/java/servlet/HttpContext.java +++ b/src/main/java/io/soluble/pjb/servlet/HttpContext.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; import java.io.IOException; import java.io.Writer; @@ -10,9 +10,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import php.java.bridge.NotImplementedException; -import php.java.bridge.Util; -import php.java.bridge.http.IContext; +import io.soluble.pjb.bridge.NotImplementedException; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.IContext; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -42,7 +42,7 @@ * * @author jostb */ -public class HttpContext extends php.java.bridge.http.Context { +public class HttpContext extends io.soluble.pjb.bridge.http.Context { protected HttpServletResponse response; protected ServletContext context; protected HttpServletRequest request; @@ -155,7 +155,7 @@ public static void handleManaged(Object closeable, ServletContext ctx) { */ public Object init(Object callable) throws Exception { if (Util.logLevel > 3) Util.logDebug("calling servlet context init"); - return php.java.bridge.http.Context.getManageable(callable); + return io.soluble.pjb.bridge.http.Context.getManageable(callable); } /** diff --git a/server/php/java/servlet/HttpContextRunner.java b/src/main/java/io/soluble/pjb/servlet/HttpContextRunner.java similarity index 94% rename from server/php/java/servlet/HttpContextRunner.java rename to src/main/java/io/soluble/pjb/servlet/HttpContextRunner.java index 111c3b2..4b4b501 100644 --- a/server/php/java/servlet/HttpContextRunner.java +++ b/src/main/java/io/soluble/pjb/servlet/HttpContextRunner.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -29,11 +29,11 @@ import java.io.OutputStream; import java.io.Serializable; -import php.java.bridge.JavaBridge; -import php.java.bridge.Request; -import php.java.bridge.Util; -import php.java.bridge.http.AbstractChannel; -import php.java.bridge.http.IContextFactory; +import io.soluble.pjb.bridge.JavaBridge; +import io.soluble.pjb.bridge.Request; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.AbstractChannel; +import io.soluble.pjb.bridge.http.IContextFactory; /** * @author jostb diff --git a/server/php/java/servlet/HttpSessionFacade.java b/src/main/java/io/soluble/pjb/servlet/HttpSessionFacade.java similarity index 98% rename from server/php/java/servlet/HttpSessionFacade.java rename to src/main/java/io/soluble/pjb/servlet/HttpSessionFacade.java index 4d8194d..5265451 100644 --- a/server/php/java/servlet/HttpSessionFacade.java +++ b/src/main/java/io/soluble/pjb/servlet/HttpSessionFacade.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -34,8 +34,8 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import php.java.bridge.ISession; -import php.java.bridge.http.IContextFactory; +import io.soluble.pjb.bridge.ISession; +import io.soluble.pjb.bridge.http.IContextFactory; /** * Wraps the J2EE session interface diff --git a/server/php/java/servlet/Logger.java b/src/main/java/io/soluble/pjb/servlet/Logger.java similarity index 95% rename from server/php/java/servlet/Logger.java rename to src/main/java/io/soluble/pjb/servlet/Logger.java index 3929424..df9c2b6 100644 --- a/server/php/java/servlet/Logger.java +++ b/src/main/java/io/soluble/pjb/servlet/Logger.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -24,7 +24,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -import php.java.bridge.ILogger; +import io.soluble.pjb.bridge.ILogger; /** * A logger class, uses log4j if possible diff --git a/server/php/java/servlet/PhpCGIFilter.java b/src/main/java/io/soluble/pjb/servlet/PhpCGIFilter.java similarity index 98% rename from server/php/java/servlet/PhpCGIFilter.java rename to src/main/java/io/soluble/pjb/servlet/PhpCGIFilter.java index 1843f99..e98d8ab 100644 --- a/server/php/java/servlet/PhpCGIFilter.java +++ b/src/main/java/io/soluble/pjb/servlet/PhpCGIFilter.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; /* * Copyright (C) 2003-2010 Jost Boekemeier @@ -37,7 +37,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; -import php.java.bridge.Util; +import io.soluble.pjb.bridge.Util; /** * Handles /foo/bar.php/baz?param=value requests. diff --git a/server/php/java/servlet/PhpJavaServlet.java b/src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java similarity index 97% rename from server/php/java/servlet/PhpJavaServlet.java rename to src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java index ee8b709..32d19cf 100644 --- a/server/php/java/servlet/PhpJavaServlet.java +++ b/src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -36,12 +36,12 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import php.java.bridge.JavaBridge; -import php.java.bridge.Request; -import php.java.bridge.Util; -import php.java.bridge.http.AbstractChannelName; -import php.java.bridge.http.ContextFactory; -import php.java.bridge.http.ContextServer; +import io.soluble.pjb.bridge.JavaBridge; +import io.soluble.pjb.bridge.Request; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.AbstractChannelName; +import io.soluble.pjb.bridge.http.ContextFactory; +import io.soluble.pjb.bridge.http.ContextServer; /** * Handles requests from PHP clients.

When Apache, IIS or php diff --git a/server/php/java/servlet/RemoteContext.java b/src/main/java/io/soluble/pjb/servlet/RemoteContext.java similarity index 97% rename from server/php/java/servlet/RemoteContext.java rename to src/main/java/io/soluble/pjb/servlet/RemoteContext.java index d89120c..28a7244 100644 --- a/server/php/java/servlet/RemoteContext.java +++ b/src/main/java/io/soluble/pjb/servlet/RemoteContext.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -28,7 +28,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import php.java.bridge.http.IContext; +import io.soluble.pjb.bridge.http.IContext; /** diff --git a/server/php/java/servlet/RemoteHttpServletContextFactory.java b/src/main/java/io/soluble/pjb/servlet/RemoteHttpServletContextFactory.java similarity index 95% rename from server/php/java/servlet/RemoteHttpServletContextFactory.java rename to src/main/java/io/soluble/pjb/servlet/RemoteHttpServletContextFactory.java index 9679350..ddb1494 100644 --- a/server/php/java/servlet/RemoteHttpServletContextFactory.java +++ b/src/main/java/io/soluble/pjb/servlet/RemoteHttpServletContextFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -37,21 +37,21 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import php.java.bridge.ISession; -import php.java.bridge.JavaBridgeFactory; -import php.java.bridge.Request; -import php.java.bridge.http.ContextFactory; -import php.java.bridge.http.IContext; -import php.java.bridge.http.IContextFactory; -import php.java.bridge.http.IContextFactoryVisitor; +import io.soluble.pjb.bridge.ISession; +import io.soluble.pjb.bridge.JavaBridgeFactory; +import io.soluble.pjb.bridge.Request; +import io.soluble.pjb.bridge.http.ContextFactory; +import io.soluble.pjb.bridge.http.IContext; +import io.soluble.pjb.bridge.http.IContextFactory; +import io.soluble.pjb.bridge.http.IContextFactoryVisitor; /** * Create session contexts for servlets.

* This ContextFactory can be used in environments where no custom class loaders and no threads are allowed. * * @author jostb - * @see php.java.bridge.http.ContextFactory - * @see php.java.bridge.http.ContextServer + * @see io.soluble.pjb.bridge.http.ContextFactory + * @see io.soluble.pjb.bridge.http.ContextServer */ public class RemoteHttpServletContextFactory extends JavaBridgeFactory implements IContextFactory, Serializable { @@ -238,7 +238,7 @@ public void destroy() { * Return an emulated JSR223 context. * * @return The context. - * @see php.java.servlet.HttpContext + * @see io.soluble.pjb.servlet.HttpContext */ private IContext createContext() { diff --git a/server/php/java/servlet/RemoteHttpServletRequest.java b/src/main/java/io/soluble/pjb/servlet/RemoteHttpServletRequest.java similarity index 96% rename from server/php/java/servlet/RemoteHttpServletRequest.java rename to src/main/java/io/soluble/pjb/servlet/RemoteHttpServletRequest.java index ffee8a4..c23437d 100644 --- a/server/php/java/servlet/RemoteHttpServletRequest.java +++ b/src/main/java/io/soluble/pjb/servlet/RemoteHttpServletRequest.java @@ -1,7 +1,7 @@ /** * */ -package php.java.servlet; +package io.soluble.pjb.servlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; diff --git a/server/php/java/servlet/RemoteHttpServletResponse.java b/src/main/java/io/soluble/pjb/servlet/RemoteHttpServletResponse.java similarity index 99% rename from server/php/java/servlet/RemoteHttpServletResponse.java rename to src/main/java/io/soluble/pjb/servlet/RemoteHttpServletResponse.java index a981660..74a838b 100644 --- a/server/php/java/servlet/RemoteHttpServletResponse.java +++ b/src/main/java/io/soluble/pjb/servlet/RemoteHttpServletResponse.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/servlet/RemoteServletContextFactory.java b/src/main/java/io/soluble/pjb/servlet/RemoteServletContextFactory.java similarity index 92% rename from server/php/java/servlet/RemoteServletContextFactory.java rename to src/main/java/io/soluble/pjb/servlet/RemoteServletContextFactory.java index 454f3e6..a1afa95 100644 --- a/server/php/java/servlet/RemoteServletContextFactory.java +++ b/src/main/java/io/soluble/pjb/servlet/RemoteServletContextFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -30,17 +30,17 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import php.java.bridge.ISession; -import php.java.bridge.http.IContext; -import php.java.bridge.http.IContextFactory; +import io.soluble.pjb.bridge.ISession; +import io.soluble.pjb.bridge.http.IContext; +import io.soluble.pjb.bridge.http.IContextFactory; /** * Create session contexts for servlets.

In addition to the * standard ContextFactory this factory keeps a reference to the * HttpServletRequest. * - * @see php.java.bridge.http.ContextFactory - * @see php.java.bridge.http.ContextServer + * @see io.soluble.pjb.bridge.http.ContextFactory + * @see io.soluble.pjb.bridge.http.ContextServer */ public class RemoteServletContextFactory extends SimpleServletContextFactory { protected RemoteServletContextFactory(Servlet servlet, ServletContext ctx, HttpServletRequest proxy, HttpServletRequest req, HttpServletResponse res) { @@ -88,7 +88,7 @@ public static IContextFactory addNew(Servlet servlet, ServletContext kontext, Ht * Return an emulated JSR223 context. * * @return The context. - * @see php.java.servlet.HttpContext + * @see io.soluble.pjb.servlet.HttpContext */ public IContext createContext() { IContext ctx = new HttpContext(kontext, req, res); diff --git a/server/php/java/servlet/ServletContextFactory.java b/src/main/java/io/soluble/pjb/servlet/ServletContextFactory.java similarity index 92% rename from server/php/java/servlet/ServletContextFactory.java rename to src/main/java/io/soluble/pjb/servlet/ServletContextFactory.java index 3e2fd01..92ab925 100644 --- a/server/php/java/servlet/ServletContextFactory.java +++ b/src/main/java/io/soluble/pjb/servlet/ServletContextFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -29,16 +29,16 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import php.java.bridge.http.ContextServer; -import php.java.bridge.http.IContextFactory; +import io.soluble.pjb.bridge.http.ContextServer; +import io.soluble.pjb.bridge.http.IContextFactory; /** * Create session contexts for servlets.

In addition to the * standard ContextFactory this factory keeps a reference to the * HttpServletRequest. * - * @see php.java.bridge.http.ContextFactory - * @see php.java.bridge.http.ContextServer + * @see io.soluble.pjb.bridge.http.ContextFactory + * @see io.soluble.pjb.bridge.http.ContextServer */ public class ServletContextFactory extends SimpleServletContextFactory { protected ServletContextFactory(Servlet servlet, ServletContext ctx, diff --git a/server/php/java/servlet/ServletUtil.java b/src/main/java/io/soluble/pjb/servlet/ServletUtil.java similarity index 98% rename from server/php/java/servlet/ServletUtil.java rename to src/main/java/io/soluble/pjb/servlet/ServletUtil.java index 71d9ef0..ecd2c8f 100644 --- a/server/php/java/servlet/ServletUtil.java +++ b/src/main/java/io/soluble/pjb/servlet/ServletUtil.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; import java.io.File; import java.io.IOException; @@ -18,8 +18,8 @@ import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletResponse; -import php.java.bridge.Util; -import php.java.bridge.http.WriterOutputStream; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.WriterOutputStream; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/servlet/SimpleHttpServletResponse.java b/src/main/java/io/soluble/pjb/servlet/SimpleHttpServletResponse.java similarity index 98% rename from server/php/java/servlet/SimpleHttpServletResponse.java rename to src/main/java/io/soluble/pjb/servlet/SimpleHttpServletResponse.java index 95279d1..f0b3f4e 100644 --- a/server/php/java/servlet/SimpleHttpServletResponse.java +++ b/src/main/java/io/soluble/pjb/servlet/SimpleHttpServletResponse.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; /* * Copyright (C) 2003-2007 Jost Boekemeier diff --git a/server/php/java/servlet/SimpleServletContextFactory.java b/src/main/java/io/soluble/pjb/servlet/SimpleServletContextFactory.java similarity index 93% rename from server/php/java/servlet/SimpleServletContextFactory.java rename to src/main/java/io/soluble/pjb/servlet/SimpleServletContextFactory.java index 2dd999b..7ee0ea9 100644 --- a/server/php/java/servlet/SimpleServletContextFactory.java +++ b/src/main/java/io/soluble/pjb/servlet/SimpleServletContextFactory.java @@ -1,6 +1,6 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet; +package io.soluble.pjb.servlet; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -30,18 +30,18 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import php.java.bridge.ISession; -import php.java.bridge.http.IContext; +import io.soluble.pjb.bridge.ISession; +import io.soluble.pjb.bridge.http.IContext; /** * Create session contexts for servlets.

In addition to the * standard ContextFactory this factory keeps a reference to the * HttpServletRequest. * - * @see php.java.bridge.http.ContextFactory - * @see php.java.bridge.http.ContextServer + * @see io.soluble.pjb.bridge.http.ContextFactory + * @see io.soluble.pjb.bridge.http.ContextServer */ -public class SimpleServletContextFactory extends php.java.bridge.http.SimpleContextFactory { +public class SimpleServletContextFactory extends io.soluble.pjb.bridge.http.SimpleContextFactory { protected HttpServletRequest proxy, req; protected HttpServletResponse res; protected ServletContext kontext; @@ -98,7 +98,7 @@ public synchronized void destroy() { * Return an emulated JSR223 context. * * @return The context. - * @see php.java.servlet.HttpContext + * @see io.soluble.pjb.servlet.HttpContext */ public IContext createContext() { IContext ctx = new HttpContext(kontext, req, res); diff --git a/server/php/java/servlet/VoidInputHttpServletRequest.java b/src/main/java/io/soluble/pjb/servlet/VoidInputHttpServletRequest.java similarity index 96% rename from server/php/java/servlet/VoidInputHttpServletRequest.java rename to src/main/java/io/soluble/pjb/servlet/VoidInputHttpServletRequest.java index 8d6081c..2411519 100644 --- a/server/php/java/servlet/VoidInputHttpServletRequest.java +++ b/src/main/java/io/soluble/pjb/servlet/VoidInputHttpServletRequest.java @@ -1,7 +1,7 @@ /** * */ -package php.java.servlet; +package io.soluble.pjb.servlet; import java.io.BufferedReader; import java.io.IOException; diff --git a/server/php/java/servlet/fastcgi/FCGIProcess.java b/src/main/java/io/soluble/pjb/servlet/fastcgi/FCGIProcess.java similarity index 95% rename from server/php/java/servlet/fastcgi/FCGIProcess.java rename to src/main/java/io/soluble/pjb/servlet/fastcgi/FCGIProcess.java index 93dc8c6..2c4b96d 100644 --- a/server/php/java/servlet/fastcgi/FCGIProcess.java +++ b/src/main/java/io/soluble/pjb/servlet/fastcgi/FCGIProcess.java @@ -1,5 +1,5 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet.fastcgi; +package io.soluble.pjb.servlet.fastcgi; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -28,8 +28,8 @@ import java.util.LinkedList; import java.util.Map; -import php.java.bridge.Util; -import php.java.bridge.http.IFCGIProcess; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.IFCGIProcess; /** * Represents the FastCGI process. diff --git a/server/php/java/servlet/fastcgi/FastCGIServlet.java b/src/main/java/io/soluble/pjb/servlet/fastcgi/FastCGIServlet.java similarity index 96% rename from server/php/java/servlet/fastcgi/FastCGIServlet.java rename to src/main/java/io/soluble/pjb/servlet/fastcgi/FastCGIServlet.java index 841392e..f9362f4 100644 --- a/server/php/java/servlet/fastcgi/FastCGIServlet.java +++ b/src/main/java/io/soluble/pjb/servlet/fastcgi/FastCGIServlet.java @@ -1,5 +1,5 @@ /*-*- mode: Java; tab-width:8 -*-*/ -package php.java.servlet.fastcgi; +package io.soluble.pjb.servlet.fastcgi; /* * Copyright (C) 2003-2007 Jost Boekemeier @@ -37,19 +37,19 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import php.java.bridge.Util; -import php.java.bridge.http.AbstractChannelName; -import php.java.bridge.http.FCGIConnectException; -import php.java.bridge.http.FCGIConnectionException; -import php.java.bridge.http.FCGIConnectionPool; -import php.java.bridge.http.FCGIInputStream; -import php.java.bridge.http.FCGIOutputStream; -import php.java.bridge.http.FCGIUtil; -import php.java.bridge.http.IContextFactory; -import php.java.servlet.ContextLoaderListener; -import php.java.servlet.PhpJavaServlet; -import php.java.servlet.ServletContextFactory; -import php.java.servlet.ServletUtil; +import io.soluble.pjb.bridge.Util; +import io.soluble.pjb.bridge.http.AbstractChannelName; +import io.soluble.pjb.bridge.http.FCGIConnectException; +import io.soluble.pjb.bridge.http.FCGIConnectionException; +import io.soluble.pjb.bridge.http.FCGIConnectionPool; +import io.soluble.pjb.bridge.http.FCGIInputStream; +import io.soluble.pjb.bridge.http.FCGIOutputStream; +import io.soluble.pjb.bridge.http.FCGIUtil; +import io.soluble.pjb.bridge.http.IContextFactory; +import io.soluble.pjb.servlet.ContextLoaderListener; +import io.soluble.pjb.servlet.PhpJavaServlet; +import io.soluble.pjb.servlet.ServletContextFactory; +import io.soluble.pjb.servlet.ServletUtil; /** * A CGI Servlet which connects to a FastCGI server. If allowed by the @@ -111,7 +111,7 @@ protected static class Environment { * * @param config The servlet config * @throws ServletException - * @see php.java.bridge.http.FCGIConnectionPool + * @see io.soluble.pjb.bridge.http.FCGIConnectionPool * @see #destroy() */ public void init(ServletConfig config) throws ServletException { diff --git a/server/php/java/servlet/fastcgi/package.html b/src/main/java/io/soluble/pjb/servlet/fastcgi/package.html similarity index 100% rename from server/php/java/servlet/fastcgi/package.html rename to src/main/java/io/soluble/pjb/servlet/fastcgi/package.html diff --git a/server/php/java/servlet/package.html b/src/main/java/io/soluble/pjb/servlet/package.html similarity index 100% rename from server/php/java/servlet/package.html rename to src/main/java/io/soluble/pjb/servlet/package.html From ae760d2412b5d55dc764504dd4a560c03df3339f Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Mon, 23 Jan 2017 09:55:37 +0100 Subject: [PATCH 17/75] cleanup --- server/php/java/bridge/global.properties.in | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 server/php/java/bridge/global.properties.in diff --git a/server/php/java/bridge/global.properties.in b/server/php/java/bridge/global.properties.in deleted file mode 100644 index f61c969..0000000 --- a/server/php/java/bridge/global.properties.in +++ /dev/null @@ -1,20 +0,0 @@ -## auto-generated variables -## do not edit -BACKEND_VERSION = @BACKEND_VERSION@ - -## You can adjust and enable the following properties: -## - -# The name of the library, usually JavaBridge or MonoBridge -EXTENSION_DISPLAY_NAME = JavaBridge - -# A white space delimited list of environment entries; NOT to be passed to PHP -PHP_ENV_BLACKLIST = PHPRC - -# BASE = -# THREADS = 20 -# DEFAULT_LOG_LEVEL = 3 -# DEFAULT_LOG_FILE = -# PHP_EXEC = /usr/bin/php-cgi -# PHP_EXEC_ARGS = -d allow_url_include=On -d display_errors=Off -d log_errors=On -d java.persistent_servlet_connections=On -# MAX_WAIT = 15000 From 0a7fa0624ce56ece50fa0312953109a08ec23aea Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Mon, 23 Jan 2017 09:56:02 +0100 Subject: [PATCH 18/75] another one... --- .gitignore | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index bada022..ac5042e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,19 +7,21 @@ bin/ lib/ nbproject/ doc/API/ -META-INF/java/JavaProxy.php -META-INF/java/Java.inc -bridge/JavaProxy.java -bridge/LauncherWindows.java -bridge/LauncherWindows2.java -bridge/LauncherWindows3.java -bridge/LauncherUnix.java -bridge/JavaInc.java -bridge/LauncherWindows4.java -bridge/PhpDebuggerPHP.java .classpath nbbuild.xml manifest.mf *.iml *.lock *.log +devNull +server/META-INF/java/Java.inc +server/META-INF/java/JavaProxy.php +src/main/java/io/soluble/pjb/bridge/JavaInc.java +src/main/java/io/soluble/pjb/bridge/JavaProxy.java +src/main/java/io/soluble/pjb/bridge/LauncherUnix.java +src/main/java/io/soluble/pjb/bridge/LauncherWindows.java +src/main/java/io/soluble/pjb/bridge/LauncherWindows2.java +src/main/java/io/soluble/pjb/bridge/LauncherWindows3.java +src/main/java/io/soluble/pjb/bridge/LauncherWindows4.java +src/main/resources/META-INF/java/Java.inc +src/main/resources/META-INF/java/JavaProxy.php From a87bbd240b07fa91c0bfe9dda612b30ab9642c9b Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Mon, 23 Jan 2017 09:57:17 +0100 Subject: [PATCH 19/75] adjust php source generators to new package name --- server/buildClassFromTextFile.php | 2 +- server/buildLauncherWindows.php | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/server/buildClassFromTextFile.php b/server/buildClassFromTextFile.php index e2380a6..7405c55 100644 --- a/server/buildClassFromTextFile.php +++ b/server/buildClassFromTextFile.php @@ -6,7 +6,7 @@ $s.='""'; $str=<< Date: Mon, 23 Jan 2017 09:59:13 +0100 Subject: [PATCH 20/75] unit test for script package moved from server/php/java/test to test sources --- server/php/java/test/TestBindings.java | 118 ------------- server/php/java/test/TestCli.java | 71 -------- server/php/java/test/TestDiscovery.java | 43 ----- server/php/java/test/TestException.java | 43 ----- .../php/java/test/TestExceptionInvocable.java | 51 ------ .../java/test/TestExceptionInvocable2.java | 68 -------- server/php/java/test/TestGetInterface.java | 67 -------- server/php/java/test/TestGetResult.java | 49 ------ .../test/TestInteractiveRequestAbort.java | 46 ----- server/php/java/test/TestInvocable.java | 39 ----- .../test/TestInvocablePhpScriptEngine.java | 162 ------------------ server/php/java/test/TestPhpScriptEngine.java | 104 ----------- server/php/java/test/TestScript.java | 42 ----- server/php/java/test/TestSetWriter.java | 66 ------- .../php/java/test/TestSimpleInvocation.java | 42 ----- server/php/java/test/TestURLReader.java | 46 ----- .../java/io/soluble/pjb/script/AllTests.java | 2 +- ...leable.java => TestSimpleCompileable.java} | 4 +- 18 files changed, 3 insertions(+), 1060 deletions(-) delete mode 100644 server/php/java/test/TestBindings.java delete mode 100644 server/php/java/test/TestCli.java delete mode 100644 server/php/java/test/TestDiscovery.java delete mode 100644 server/php/java/test/TestException.java delete mode 100644 server/php/java/test/TestExceptionInvocable.java delete mode 100644 server/php/java/test/TestExceptionInvocable2.java delete mode 100644 server/php/java/test/TestGetInterface.java delete mode 100644 server/php/java/test/TestGetResult.java delete mode 100644 server/php/java/test/TestInteractiveRequestAbort.java delete mode 100644 server/php/java/test/TestInvocable.java delete mode 100644 server/php/java/test/TestInvocablePhpScriptEngine.java delete mode 100644 server/php/java/test/TestPhpScriptEngine.java delete mode 100644 server/php/java/test/TestScript.java delete mode 100644 server/php/java/test/TestSetWriter.java delete mode 100644 server/php/java/test/TestSimpleInvocation.java delete mode 100644 server/php/java/test/TestURLReader.java rename src/test/java/io/soluble/pjb/script/{SimpleCompileable.java => TestSimpleCompileable.java} (88%) diff --git a/server/php/java/test/TestBindings.java b/server/php/java/test/TestBindings.java deleted file mode 100644 index 6497034..0000000 --- a/server/php/java/test/TestBindings.java +++ /dev/null @@ -1,118 +0,0 @@ -package php.java.test; - -import java.io.ByteArrayOutputStream; -import java.io.Closeable; -import java.io.File; -import java.io.OutputStreamWriter; -import java.io.Reader; -import java.io.StringReader; - -import javax.script.Bindings; -import javax.script.Compilable; -import javax.script.CompiledScript; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; -import javax.script.SimpleBindings; - -import junit.framework.TestCase; - -public class TestBindings extends TestCase { - - private ScriptEngine e; - private ScriptEngine e2; - private Bindings b; - private String script; - private ScriptEngineManager m; - - public TestBindings(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - m = new ScriptEngineManager(); - e = m.getEngineByName("php"); - e2 = m.getEngineByName("php"); - e.put("javax.script.argv", new String[]{"1", "2", "3"}); - - b = new SimpleBindings(); - b.put("javax.script.argv", new String[]{"1", "2", "3"}); - - script = "get('javax.script.argv');" + - "$result = (string)$argv[0]+ (string)$argv[1]+ (string)$argv[2];" + - "exit($result);" + - "?>"; - } - - protected void tearDown() throws Exception { - super.tearDown(); - ((Closeable) e).close(); - } - - public void testEvalReader() { - try { - Reader r = new StringReader(script); - assertTrue("6".equals(String.valueOf(e.eval(r)))); - r.close(); - } catch (Exception e) { - fail(String.valueOf(e)); - } - } - - public void testEvalReaderBindings() { - try { - Reader r = new StringReader(script); - assertTrue("6".equals(String.valueOf(e2.eval(r, b)))); - r.close(); - } catch (Exception e) { - fail(String.valueOf(e)); - } - } - - public void testEvalString() { - try { - assertTrue("6".equals(String.valueOf(e.eval(script)))); - } catch (ScriptException e) { - fail(String.valueOf(e)); - } - } - - public void testEvalStringBindings() { - try { - assertTrue("6".equals(String.valueOf(e2.eval(script, b)))); - } catch (ScriptException e) { - fail(String.valueOf(e)); - } - } - - public void testEvalCompilableString() { - try { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - OutputStreamWriter writer = new OutputStreamWriter(out); - ScriptEngine e = m.getEngineByName("php"); - - e.put("javax.script.argv", new String[]{"1", "2", "3"}); - e.getContext().setWriter(writer); - ((java.io.FileFilter) e).accept(new File(System.getProperty("java.io.tmpdir", "/tmp") + File.separator + "test.php")); - CompiledScript s = ((Compilable) e).compile("get('javax.script.argv');" + - "$result = (string)$argv[0]+ (string)$argv[1]+ (string)$argv[2];" + - "echo($result);" + - "?>"); - - long t1 = System.currentTimeMillis(); - for (int i = 0; i < 100; i++) { - s.eval(); - assertTrue("6".equals(out.toString())); - out.reset(); - } - long t2 = System.currentTimeMillis(); - System.out.println("testEvalCompilableString time:" + (t2 - t1)); - - } catch (Exception e) { - fail(String.valueOf(e)); - } - } -} diff --git a/server/php/java/test/TestCli.java b/server/php/java/test/TestCli.java deleted file mode 100644 index a06f68b..0000000 --- a/server/php/java/test/TestCli.java +++ /dev/null @@ -1,71 +0,0 @@ -package php.java.test; - -import java.io.ByteArrayOutputStream; -import java.io.Closeable; -import java.io.OutputStreamWriter; -import java.io.Writer; - -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; - -import junit.framework.TestCase; - -public class TestCli extends TestCase { - - public TestCli(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testSimple() { - try { - ByteArrayOutputStream errOut = new ByteArrayOutputStream(); - Writer err = new OutputStreamWriter(errOut); - ScriptEngine eng = (new ScriptEngineManager()).getEngineByName("php-interactive"); - eng.getContext().setErrorWriter(err); - eng.eval("$a=new java('java.util.Vector');"); - eng.eval("$a->add(1);"); - eng.eval("$a->add(2);"); - eng.eval("$a->add(3);"); - eng.eval("class C{function toString() {return 'foo';}}"); - eng.eval("$a->add(java_closure(new C()));"); - eng.eval("$b=new java('java.util.Vector');"); - eng.eval("$b->add(1);"); - eng.eval("$b->add(2);"); - eng.eval("$b->add(3);"); - assertTrue("[1, 2, 3]".equals(eng.eval("echo $b"))); - assertTrue("[1, 2, 3, foo]".equals(eng.eval("echo $a"))); - ((Closeable) eng).close(); - } catch (Exception e) { - fail(String.valueOf(e)); - } - } - - public void testClosure() { - try { - ByteArrayOutputStream errOut = new ByteArrayOutputStream(); - Writer err = new OutputStreamWriter(errOut); - ScriptEngine eng = (new ScriptEngineManager()).getEngineByName("php-interactive"); - eng.getContext().setErrorWriter(err); - eng.eval("$a=new java('java.util.Vector');"); - eng.eval("$a->add(1);"); - eng.eval("$a->add(2);"); - try { - eng.eval("die();"); - } catch (Exception e) { - assertTrue(e.getMessage().equals("php.java.bridge.Request$AbortException")); - } - assertTrue(eng.eval("echo $a").equals("[1, 2]")); - ((Closeable) eng).close(); - } catch (Exception e) { - fail(String.valueOf(e)); - } - } -} diff --git a/server/php/java/test/TestDiscovery.java b/server/php/java/test/TestDiscovery.java deleted file mode 100644 index bd6a61a..0000000 --- a/server/php/java/test/TestDiscovery.java +++ /dev/null @@ -1,43 +0,0 @@ -package php.java.test; - -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; - -import junit.framework.TestCase; - -public class TestDiscovery extends TestCase { - - public TestDiscovery(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testDiscovery() { - try { - StringBuffer s = new StringBuffer(); - ScriptEngineManager manager = new ScriptEngineManager(); - ScriptEngine e = manager.getEngineByName("php"); - e.put("hello", new StringBuffer("hello world")); - e.put("s", s); - e.eval("getAttribute('s');" + - "$s->append(java_values(java_context()->getAttribute('hello')));" + - "/*echo java_values($s);*/" + - "java_context()->setAttribute('hello', '!', 100);" + - "?>"); - s.append(e.get("hello")); - if (!(s.toString().equals("hello world!"))) { - fail("ERROR"); - } - } catch (Exception e) { - fail(String.valueOf(e)); - } - } -} diff --git a/server/php/java/test/TestException.java b/server/php/java/test/TestException.java deleted file mode 100644 index be277ae..0000000 --- a/server/php/java/test/TestException.java +++ /dev/null @@ -1,43 +0,0 @@ -package php.java.test; - -import java.io.ByteArrayOutputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; - -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; - -import junit.framework.TestCase; - -public class TestException extends TestCase { - - public TestException(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void test() throws Exception { - ScriptEngineManager manager = new ScriptEngineManager(); - ScriptEngine e = manager.getEngineByName("php"); - OutputStream out = new ByteArrayOutputStream(); - Writer w = new OutputStreamWriter(out); - e.getContext().setWriter(w); - e.getContext().setErrorWriter(w); - try { - e.eval(""); - } catch (ScriptException ex) { - if (out.toString().length() == 0) throw new Exception("test failed"); - return; - } - fail("test failed"); - } -} diff --git a/server/php/java/test/TestExceptionInvocable.java b/server/php/java/test/TestExceptionInvocable.java deleted file mode 100644 index b0e990f..0000000 --- a/server/php/java/test/TestExceptionInvocable.java +++ /dev/null @@ -1,51 +0,0 @@ -package php.java.test; - -import java.io.ByteArrayOutputStream; -import java.io.Closeable; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; - -import javax.script.Invocable; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; - -import junit.framework.TestCase; - -public class TestExceptionInvocable extends TestCase { - - public TestExceptionInvocable(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void test() throws Exception { - ScriptEngineManager manager = new ScriptEngineManager(); - ScriptEngine e = manager.getEngineByName("php-invocable"); - OutputStream out = new ByteArrayOutputStream(); - Writer w = new OutputStreamWriter(out); - e.getContext().setWriter(w); - e.getContext().setErrorWriter(w); - e.eval(""); - - Invocable i = (Invocable) e; - try { - i.invokeFunction("f", new Object[]{}); - } catch (ScriptException ex) { - ((Closeable) e).close(); - if (out.toString().length() != 0) throw new Exception("test failed"); - return; - } - ((Closeable) e).close(); - fail("test failed"); - } - -} diff --git a/server/php/java/test/TestExceptionInvocable2.java b/server/php/java/test/TestExceptionInvocable2.java deleted file mode 100644 index eb1b5f6..0000000 --- a/server/php/java/test/TestExceptionInvocable2.java +++ /dev/null @@ -1,68 +0,0 @@ -package php.java.test; - -import java.io.ByteArrayOutputStream; -import java.io.Closeable; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; - -import javax.script.Invocable; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; - -import junit.framework.TestCase; - -public class TestExceptionInvocable2 extends TestCase { - - public TestExceptionInvocable2(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void test() throws Exception { - ScriptEngineManager manager = new ScriptEngineManager(); - ScriptEngine e = manager.getEngineByName("php-invocable"); - OutputStream out = new ByteArrayOutputStream(); - Writer w = new OutputStreamWriter(out); - e.getContext().setWriter(w); - e.getContext().setErrorWriter(w); - e.eval("setAttribute('c', java_closure(new c()), 100); " + - "?>"); - - Invocable i = (Invocable) e; - try { - assertTrue("f ok".equals(i.invokeFunction("f", new Object[]{}))); - } catch (Throwable ex) { - fail("2"); - } - try { - i.invokeFunction("g", new Object[]{}); - System.err.println("test failed"); - fail("3"); - } catch (NoSuchMethodException ex) { -// ex.printStackTrace(System.out); - } - try { - assertTrue("c::p ok".equals(i.invokeMethod(e.get("c"), "p", new Object[]{}))); - } catch (NoSuchMethodException ex) { - fail("4"); - } - try { - i.invokeMethod(e.get("c"), "g", new Object[]{}); - fail("5"); - } catch (NoSuchMethodException ex) { - //ex.printStackTrace(System.out); - } - ((Closeable) e).close(); - if (out.toString().length() != 0) throw new Exception("test failed"); - } -} diff --git a/server/php/java/test/TestGetInterface.java b/server/php/java/test/TestGetInterface.java deleted file mode 100644 index 2f608ea..0000000 --- a/server/php/java/test/TestGetInterface.java +++ /dev/null @@ -1,67 +0,0 @@ -package php.java.test; - -import java.io.ByteArrayOutputStream; -import java.io.Closeable; -import java.io.OutputStreamWriter; - -import javax.script.Invocable; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; - -import junit.framework.TestCase; - -public class TestGetInterface extends TestCase { - - public TestGetInterface(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - private ScriptEngine scriptEngine; - - String classA = "class A{function toString(){return '::A';} function invokeA($b){$b->invokeB();}}\n"; - String classB = "class B{function toString(){return '::B';} function invokeB(){echo '::B';}}\n"; - String test = "getAttribute('thiz');\n$thiz->call(java_closure(new A()), java_closure(new B())); ?>"; - - public void test() throws Exception { - scriptEngine = new ScriptEngineManager().getEngineByName("php-invocable"); - scriptEngine.put("thiz", this); - ByteArrayOutputStream out; - OutputStreamWriter writer; - scriptEngine.getContext().setWriter(writer = new OutputStreamWriter(out = new ByteArrayOutputStream())); - scriptEngine.eval(test); - ((Closeable) scriptEngine).close(); - - writer.close(); - if (!"::B".equals(out.toString())) { - fail("test failed"); - } - return; - } - - interface IA { - public void invokeA(IB ccb); - } - - ; - - interface IB { - public void invokeB(); - } - - ; - - public void call(Object $cca, Object $ccb) { - IA cca = (IA) ((Invocable) scriptEngine).getInterface($cca, IA.class); - IB ccb = (IB) ((Invocable) scriptEngine).getInterface($ccb, IB.class); - cca.invokeA(ccb); - } - -} diff --git a/server/php/java/test/TestGetResult.java b/server/php/java/test/TestGetResult.java deleted file mode 100644 index ad0c966..0000000 --- a/server/php/java/test/TestGetResult.java +++ /dev/null @@ -1,49 +0,0 @@ -package php.java.test; - -import java.io.ByteArrayOutputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; - -import javax.script.Invocable; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; - -import junit.framework.TestCase; - -public class TestGetResult extends TestCase { - - public TestGetResult(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testDiscovery() { - try { - ScriptEngine e = new ScriptEngineManager().getEngineByName("php"); - String result = String.valueOf(e.eval(""); - result = String.valueOf(o); // note that this releases the engine, the next invoke will implicitly call eval() with an empty script - ((Invocable) e).invokeFunction("phpinfo", new Object[]{}); - if (!result.equals("16")) throw new ScriptException("test failed"); - if (out.toString().length() == 0) throw new ScriptException("test failed"); - } catch (Exception e1) { - fail(String.valueOf(e1)); - } - } -} diff --git a/server/php/java/test/TestInteractiveRequestAbort.java b/server/php/java/test/TestInteractiveRequestAbort.java deleted file mode 100644 index d6bb444..0000000 --- a/server/php/java/test/TestInteractiveRequestAbort.java +++ /dev/null @@ -1,46 +0,0 @@ -package php.java.test; - -import java.io.File; -import java.io.FileWriter; - -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; - -import junit.framework.TestCase; -import php.java.bridge.Request.AbortException; - -public class TestInteractiveRequestAbort extends TestCase { - - public TestInteractiveRequestAbort(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void test() throws Exception { - String devNull = new File("/dev/null").exists() ? "/dev/null" : "devNull"; - ScriptEngineManager m = new ScriptEngineManager(); - ScriptEngine e = m.getEngineByName("php-interactive"); - e.getContext().setErrorWriter(new FileWriter(new File(devNull))); - e.getContext().setWriter(new FileWriter(new File(devNull))); - - try { - e.eval("function toString() {return 'hello'; }; echo java_closure(); echo new JavaException('java.lang.Exception', 'hello'); echo JavaException('foo')"); - } catch (ScriptException ex) { - Throwable orig = ex.getCause(); - if (orig instanceof AbortException) { - return; - } - } - - fail("test failed"); - } - -} diff --git a/server/php/java/test/TestInvocable.java b/server/php/java/test/TestInvocable.java deleted file mode 100644 index 34fb3de..0000000 --- a/server/php/java/test/TestInvocable.java +++ /dev/null @@ -1,39 +0,0 @@ -package php.java.test; - -import java.io.Reader; - -import javax.script.Invocable; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; - -import junit.framework.TestCase; - -public class TestInvocable extends TestCase { - - public TestInvocable(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void test() throws Exception { - - ScriptEngineManager manager = new ScriptEngineManager(); - ScriptEngine e = manager.getEngineByName("php-invocable"); - - e.eval("setAttribute('f', java_closure(new f()), 100); ?>"); - - Invocable i = (Invocable) e; - Object f = e.getContext().getAttribute("f", 100); - assertTrue(2 == (Integer) i.invokeMethod(f, "a", new Object[]{new Integer(1)})); - - e.eval((Reader) null); - } -} diff --git a/server/php/java/test/TestInvocablePhpScriptEngine.java b/server/php/java/test/TestInvocablePhpScriptEngine.java deleted file mode 100644 index e0bf64a..0000000 --- a/server/php/java/test/TestInvocablePhpScriptEngine.java +++ /dev/null @@ -1,162 +0,0 @@ -package php.java.test; - -import java.io.ByteArrayOutputStream; -import java.io.Closeable; -import java.io.File; -import java.io.OutputStreamWriter; -import java.io.Reader; -import java.io.StringReader; - -import javax.script.Bindings; -import javax.script.Compilable; -import javax.script.CompiledScript; -import javax.script.Invocable; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; -import javax.script.SimpleBindings; - -import junit.framework.TestCase; - -public class TestInvocablePhpScriptEngine extends TestCase { - - private ScriptEngine e; - private Bindings b; - private String script; - private ScriptEngineManager m; - private String invocableScript; - - public TestInvocablePhpScriptEngine(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - - m = new ScriptEngineManager(); - e = m.getEngineByName("php-invocable"); - b = new SimpleBindings(); - script = ""; - invocableScript = ""; // no exit() - - } - - protected void tearDown() throws Exception { - super.tearDown(); - ((Closeable) e).close(); - } - - public void testEvalReader() { - try { - Reader r = new StringReader(script); - assertTrue("3".equals(String.valueOf(e.eval(r)))); - r.close(); - } catch (Exception e) { - fail(String.valueOf(e)); - } - } - - public void testEvalReaderBindings() { - try { - Reader r = new StringReader(script); - assertTrue("3".equals(String.valueOf(e.eval(r, b)))); - r.close(); - } catch (Exception e) { - fail(String.valueOf(e)); - } - } - - public void testEvalString() { - try { - assertTrue("3".equals(String.valueOf(e.eval(script)))); - } catch (ScriptException e) { - fail(String.valueOf(e)); - } - } - - public void testEvalStringBindings() { - try { - assertTrue("3".equals(String.valueOf(e.eval(script, b)))); - } catch (ScriptException e) { - fail(String.valueOf(e)); - } - } - - public void testEvalCompilableString() { - try { - ScriptEngine e = m.getEngineByName("php-invocable"); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - OutputStreamWriter writer = new OutputStreamWriter(out); - e.getContext().setWriter(writer); - e.getContext().getWriter(); - ((java.io.FileFilter) e).accept(new File(System.getProperty("java.io.tmpdir", "/tmp") + File.separator + "test.php")); - CompiledScript s = ((Compilable) e).compile(""); - - long t1 = System.currentTimeMillis(); - for (int i = 0; i < 100; i++) { - s.eval(); - ((Closeable) e).close(); - assertTrue("3".equals(out.toString())); - out.reset(); - } - long t2 = System.currentTimeMillis(); - System.out.println("testEvalInvocableCompilableString time:" + (t2 - t1)); - - } catch (Exception e) { - fail(String.valueOf(e)); - } - } - - public void testInvokeFunction() { - try { - ScriptEngine e = m.getEngineByName("php-invocable"); - e.eval(invocableScript); - assertTrue(6 == (Integer) ((Invocable) e).invokeFunction("f", new Object[]{"5"})); - ((Closeable) e).close(); - } catch (Exception e) { - fail(String.valueOf(e)); - } - } - - public void testInvokeFunctionCompiled() { - try { - ScriptEngine e = m.getEngineByName("php-invocable"); - ((java.io.FileFilter) e).accept(new File(System.getProperty("java.io.tmpdir", "/tmp") + File.separator + "test.php")); - CompiledScript c = ((Compilable) e).compile(invocableScript); - c.eval(); - assertTrue(6 == (Integer) ((Invocable) e).invokeFunction("f", new Object[]{"5"})); - c.eval(); - assertTrue(6 == (Integer) ((Invocable) e).invokeFunction("f", new Object[]{"5"})); - ((Closeable) e).close(); - } catch (Exception e) { - fail(String.valueOf(e)); - } - } - -// public void testInvokeMethod() { -// fail("Not yet implemented"); -// } -// -// public void testGetInterfaceClass() { -// fail("Not yet implemented"); -// } -// -// public void testGetInterfaceObjectClass() { -// fail("Not yet implemented"); -// } -// public void testInvokeFunctionCompiled() { -// fail("Not yet implemented"); -// } -// -// public void testInvokeMethodCompiled() { -// fail("Not yet implemented"); -// } -// -// public void testGetInterfaceClassCompiled() { -// fail("Not yet implemented"); -// } -// -// public void testGetInterfaceObjectClassCompiled() { -// fail("Not yet implemented"); -// } -} diff --git a/server/php/java/test/TestPhpScriptEngine.java b/server/php/java/test/TestPhpScriptEngine.java deleted file mode 100644 index a245ba7..0000000 --- a/server/php/java/test/TestPhpScriptEngine.java +++ /dev/null @@ -1,104 +0,0 @@ -package php.java.test; - -import java.io.ByteArrayOutputStream; -import java.io.Closeable; -import java.io.File; -import java.io.OutputStreamWriter; -import java.io.Reader; -import java.io.StringReader; - -import javax.script.Bindings; -import javax.script.Compilable; -import javax.script.CompiledScript; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; -import javax.script.SimpleBindings; - -import junit.framework.TestCase; - -public class TestPhpScriptEngine extends TestCase { - - private ScriptEngine e; - private Bindings b; - private String script; - private ScriptEngineManager m; - - public TestPhpScriptEngine(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - m = new ScriptEngineManager(); - e = m.getEngineByName("php"); - b = new SimpleBindings(); - script = ""; - } - - protected void tearDown() throws Exception { - super.tearDown(); - ((Closeable) e).close(); - } - - public void testEvalReader() { - try { - Reader r = new StringReader(script); - assertTrue("3".equals(String.valueOf(e.eval(r)))); - r.close(); - } catch (Exception e) { - fail(String.valueOf(e)); - } - } - - public void testEvalReaderBindings() { - try { - Reader r = new StringReader(script); - assertTrue("3".equals(String.valueOf(e.eval(r, b)))); - r.close(); - } catch (Exception e) { - fail(String.valueOf(e)); - } - } - - public void testEvalString() { - try { - assertTrue("3".equals(String.valueOf(e.eval(script)))); - } catch (ScriptException e) { - fail(String.valueOf(e)); - } - } - - public void testEvalStringBindings() { - try { - assertTrue("3".equals(String.valueOf(e.eval(script, b)))); - } catch (ScriptException e) { - fail(String.valueOf(e)); - } - } - - public void testEvalCompilableString() { - try { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - OutputStreamWriter writer = new OutputStreamWriter(out); - ScriptEngine e = m.getEngineByName("php"); - - e.getContext().setWriter(writer); - ((java.io.FileFilter) e).accept(new File(System.getProperty("java.io.tmpdir", "/tmp") + File.separator + "test.php")); - CompiledScript s = ((Compilable) e).compile(""); - - long t1 = System.currentTimeMillis(); - for (int i = 0; i < 100; i++) { - s.eval(); - assertTrue("3".equals(out.toString())); - out.reset(); - } - long t2 = System.currentTimeMillis(); - System.out.println("testEvalCompilableString time:" + (t2 - t1)); - - } catch (Exception e) { - fail(String.valueOf(e)); - } - } - -} diff --git a/server/php/java/test/TestScript.java b/server/php/java/test/TestScript.java deleted file mode 100644 index 0c9cb91..0000000 --- a/server/php/java/test/TestScript.java +++ /dev/null @@ -1,42 +0,0 @@ -package php.java.test; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; - -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; - -import junit.framework.TestCase; - -public class TestScript extends TestCase { - - public TestScript(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void test() throws IOException, ScriptException { - ScriptEngine eng = (new ScriptEngineManager()).getEngineByName("php"); - OutputStream out = new ByteArrayOutputStream(); - Writer w = new OutputStreamWriter(out); - eng.getContext().setWriter(w); - eng.getContext().setErrorWriter(w); - - eng.eval("call(java_closure()))) print('test okay'); ?>"); - eng.eval((String) null); - - assertTrue("test okay".equals(String.valueOf(out))); - } - -} diff --git a/server/php/java/test/TestSetWriter.java b/server/php/java/test/TestSetWriter.java deleted file mode 100644 index 53788fb..0000000 --- a/server/php/java/test/TestSetWriter.java +++ /dev/null @@ -1,66 +0,0 @@ -package php.java.test; - -import java.io.IOException; -import java.io.Reader; -import java.io.Writer; - -import javax.script.ScriptContext; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; - -import junit.framework.TestCase; - -public class TestSetWriter extends TestCase { - - public TestSetWriter(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public static class TestWriter extends Writer { - - public void close() throws IOException { - throw new RuntimeException("failed"); - } - - public void flush() throws IOException { - - } - - public void write(char[] cbuf, int off, int len) throws IOException { - assertTrue("3".equals(new String(cbuf, off, len))); - } - - } - - public static class TestReader extends Reader { - - public void close() throws IOException { - throw new RuntimeException("failed"); - } - - public int read(char[] cbuf, int off, int len) throws IOException { - return 0; - } - - } - - public void test() throws Exception { - ScriptEngineManager m = new ScriptEngineManager(); - ScriptEngine e = m.getEngineByName("php"); - ScriptContext c = e.getContext(); - c.setWriter(new TestWriter()); - c.setErrorWriter(new TestWriter()); - c.setReader(new TestReader()); - e.eval(""); - - } - -} diff --git a/server/php/java/test/TestSimpleInvocation.java b/server/php/java/test/TestSimpleInvocation.java deleted file mode 100644 index 395e567..0000000 --- a/server/php/java/test/TestSimpleInvocation.java +++ /dev/null @@ -1,42 +0,0 @@ -package php.java.test; - -import java.io.ByteArrayOutputStream; -import java.io.Closeable; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; - -import javax.script.Invocable; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; - -import junit.framework.TestCase; - -public class TestSimpleInvocation extends TestCase { - - public TestSimpleInvocation(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void test() throws Exception { - ScriptEngineManager m = new ScriptEngineManager(); - ScriptEngine e = m.getEngineByName("php-invocable"); - OutputStream out = new ByteArrayOutputStream(); - Writer w = new OutputStreamWriter(out); - e.getContext().setWriter(w); - e.getContext().setErrorWriter(w); - Invocable i = (Invocable) e; - i.invokeFunction("phpinfo", new Object[0]); - if (out.toString().length() == 0) throw new ScriptException("test failed"); - ((Closeable) e).close(); - } -} diff --git a/server/php/java/test/TestURLReader.java b/server/php/java/test/TestURLReader.java deleted file mode 100644 index dcdade3..0000000 --- a/server/php/java/test/TestURLReader.java +++ /dev/null @@ -1,46 +0,0 @@ -package php.java.test; - -import java.io.ByteArrayOutputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; -import java.net.URL; - -import javax.script.Invocable; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; - -import junit.framework.TestCase; -import php.java.script.IPhpScriptContext; -import php.java.script.URLReader; - -public class TestURLReader extends TestCase { - - public TestURLReader(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void test() throws Exception { - ScriptEngine e = new ScriptEngineManager().getEngineByName("php-invocable"); - - // Note: don't use the following line in your own code - // URLReader should be used to connect to a real HTTP server, usually running on port 80 - e.eval(new URLReader(new URL("http://localhost:" + ((IPhpScriptContext) e.getContext()).getSocketName() + "/JavaBridge/java/JavaProxy.php"))); - - OutputStream out = new ByteArrayOutputStream(); - Writer w = new OutputStreamWriter(out); - e.getContext().setWriter(w); - e.getContext().setErrorWriter(w); - String result = String.valueOf(((Invocable) e).invokeFunction("addslashes", new Object[]{"Is your name O'reilly?"})); - assertTrue(out.toString().length() == 0); - assertTrue("Is your name O\\'reilly?".equals(result)); - } -} diff --git a/src/test/java/io/soluble/pjb/script/AllTests.java b/src/test/java/io/soluble/pjb/script/AllTests.java index 3669dc1..94c64eb 100644 --- a/src/test/java/io/soluble/pjb/script/AllTests.java +++ b/src/test/java/io/soluble/pjb/script/AllTests.java @@ -10,7 +10,7 @@ public static Test suite() { //$JUnit-BEGIN$ suite.addTestSuite(TestException.class); suite.addTestSuite(TestGetResult.class); - suite.addTestSuite(SimpleCompileable.class); + suite.addTestSuite(TestSimpleCompileable.class); suite.addTestSuite(TestGetInterface.class); suite.addTestSuite(TestScript.class); suite.addTestSuite(TestInvocablePhpScriptEngine.class); diff --git a/src/test/java/io/soluble/pjb/script/SimpleCompileable.java b/src/test/java/io/soluble/pjb/script/TestSimpleCompileable.java similarity index 88% rename from src/test/java/io/soluble/pjb/script/SimpleCompileable.java rename to src/test/java/io/soluble/pjb/script/TestSimpleCompileable.java index 46c8222..186664a 100644 --- a/src/test/java/io/soluble/pjb/script/SimpleCompileable.java +++ b/src/test/java/io/soluble/pjb/script/TestSimpleCompileable.java @@ -6,11 +6,11 @@ import junit.framework.TestCase; -public class SimpleCompileable extends TestCase { +public class TestSimpleCompileable extends TestCase { private CompiledScript script; - public SimpleCompileable(String name) { + public TestSimpleCompileable(String name) { super(name); } From 892f47bd4a4b2efa66116c8935c24548046f9c30 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Tue, 24 Jan 2017 09:33:16 +0100 Subject: [PATCH 21/75] WEB-INF moved to source tree --- src/main/webapp/WEB-INF/cgi/README | 48 +++++ .../php-cgi.exe.MISSING.README.txt | 1 + src/main/webapp/WEB-INF/cgi/launcher.c | 192 ++++++++++++++++++ src/main/webapp/WEB-INF/cgi/launcher.sh | 8 + src/main/webapp/WEB-INF/web.xml | 65 ++++++ src/main/webapp/index.jsp | 13 ++ 6 files changed, 327 insertions(+) create mode 100644 src/main/webapp/WEB-INF/cgi/README create mode 100644 src/main/webapp/WEB-INF/cgi/amd64-windows/php-cgi.exe.MISSING.README.txt create mode 100644 src/main/webapp/WEB-INF/cgi/launcher.c create mode 100644 src/main/webapp/WEB-INF/cgi/launcher.sh create mode 100644 src/main/webapp/WEB-INF/web.xml create mode 100644 src/main/webapp/index.jsp diff --git a/src/main/webapp/WEB-INF/cgi/README b/src/main/webapp/WEB-INF/cgi/README new file mode 100644 index 0000000..117f099 --- /dev/null +++ b/src/main/webapp/WEB-INF/cgi/README @@ -0,0 +1,48 @@ +If this directory contains a PHP FastCGI executable called +-/php-cgi.sh] or -/php-cgi.exe, +the PHP/Java Bridge library tries to call it via a /bin/sh wrapper +(see launcher.sh) or via a "launcher.exe" when the server +or the web context starts: + + + internet + clients + \ + \ jsp/servlet/php req. . + \ . + ---- :8080 -- J2EE AS . + / | . + | | . + | ---- servlet /------ :9667 + | ---- FastCGIServlet / . PHP FastCGI Server + | ---- jsp . | + | ->-- PhpJavaServlet . \--- php + | ---- ... \ ------->--\--- php -->| + | . P-J-B ... | + | . PROTOCOL | + ------------------------------<--------------------------------| + P-J-B PROTOCOL . + + + + +UNIX: If /bin/sh is available and the php-cgi supports the -b flag, +the library executes the following command during startup: + +REDIRECT_STATUS="200" \ +X_JAVABRIDGE_OVERRIDE_HOSTS="/" \ +PHP_FCGI_CHILDREN="5" \ +PHP_FCGI_MAX_REQUESTS="5000" \ +arch-os/launcher.sh arch-os/php-cgi -c php-cgi.ini -b 127.0.0.1:9667 + + +WINDOWS: If /bin/sh is not available or if the php-cgi.exe does not +support the -b flag, the library executes the following command during +startup: + +set REDIRECT_STATUS "200" +set X_JAVABRIDGE_OVERRIDE_HOSTS "/" +set PHP_FCGI_CHILDREN "5" +set PHP_FCGI_MAX_REQUESTS "5000" +launcher.exe PHP-CGI NAMED-PIPE PHP-OPTIONS + diff --git a/src/main/webapp/WEB-INF/cgi/amd64-windows/php-cgi.exe.MISSING.README.txt b/src/main/webapp/WEB-INF/cgi/amd64-windows/php-cgi.exe.MISSING.README.txt new file mode 100644 index 0000000..4f90721 --- /dev/null +++ b/src/main/webapp/WEB-INF/cgi/amd64-windows/php-cgi.exe.MISSING.README.txt @@ -0,0 +1 @@ +You can add "php-cgi.exe" to this directory and re-deploy your web application. diff --git a/src/main/webapp/WEB-INF/cgi/launcher.c b/src/main/webapp/WEB-INF/cgi/launcher.c new file mode 100644 index 0000000..7fcc80a --- /dev/null +++ b/src/main/webapp/WEB-INF/cgi/launcher.c @@ -0,0 +1,192 @@ +/*-*- mode: C; tab-width:4 -*-*/ + +/** The launcher.exe starts a PHP FastCGI server on Windows. + + Copyright (C) 2003-2007 Jost Boekemeier + + This file is part of the PHP/Java Bridge. + + The PHP/Java Bridge ("the library") is free software; you can + redistribute it and/or modify it under the terms of the GNU General + Public License as published by the Free Software Foundation; either + version 2, or (at your option) any later version. + + The library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the PHP/Java Bridge; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this file statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + +/* + * Compile this program with: i386-pc-mingw32-gcc launcher.c -o + * launcher.exe -lws2_32 + */ + +#include +#include +#include +#include +#include + +void die(int line) { + fprintf(stderr, "launcher.exe terminated with error code %d in line %d.\n", GetLastError(), line); + exit(2); +} +void usage() { + puts("This file is part of the PHP/Java Bridge."); + puts("Copyright (C) 2003, 2006 Jost Boekemeier and others."); + puts("This is free software; see the source for copying conditions. There is NO"); + puts("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."); + puts("Usage: launcher.exe php-cgi.exe channelName php-options"); + puts("Influential environment variables: PHP_FCGI_MAX_REQUESTS, PHP_FCGI_CHILDREN"); + puts("Example: launcher.exe php-cgi \\\\.\\pipe\\JavaBridge@9667 -d allow_url_include=On"); + exit(1); +} + +HANDLE *processes; +SECURITY_ATTRIBUTES sa = { 0 }; +STARTUPINFO su_info; +char cmd[8192], *pEnv; + +HANDLE start_proc(char*name) { + HANDLE listen_handle; + PROCESS_INFORMATION p; + + listen_handle = CreateNamedPipe(name, + PIPE_ACCESS_DUPLEX, + PIPE_TYPE_BYTE|PIPE_READMODE_BYTE|PIPE_WAIT, + PIPE_UNLIMITED_INSTANCES, + 8192, 8192, NMPWAIT_WAIT_FOREVER, NULL); + + if (listen_handle == INVALID_HANDLE_VALUE) die(__LINE__); + su_info.hStdInput = listen_handle; + SetHandleInformation(su_info.hStdInput, HANDLE_FLAG_INHERIT, TRUE); + + if(!(CreateProcess(NULL, cmd, NULL, NULL, TRUE, 0, pEnv, NULL, &su_info, &p))) die(__LINE__); + CloseHandle(p.hThread); + CloseHandle(listen_handle); + return p.hProcess; +} + +int wait_stdin(void*dummy) { + char buf[256]; + fgets(buf, sizeof buf, stdin); + SetEvent(processes[0]); + return 0; +} + +int main(int argc, char **argv) { + extern char **environ; + HANDLE sem; + int children, i, pterm; + size_t len, envlen; + char *tmp, *php_fcgi_children, **envp, *s, *t, ts[256]; + + if(argc == 2) usage(); + else if(argc<=1) { + static char *std_argv[] = {NULL, "php-cgi", "\\\\.\\pipe\\JavaBridge@9667"}; + argc = 3; + argv = std_argv; + } + /* teminate all children when launcher + gets killed */ + if(!(sem = CreateSemaphore(&sa, 1, 1, NULL))) die(__LINE__); + SetHandleInformation(sem, HANDLE_FLAG_INHERIT, TRUE); + snprintf(ts, sizeof(ts), "_FCGI_SHUTDOWN_EVENT_=%ld", sem); + + /* windows requires a null terminated + block of null terminated env + strings */ + for(envp=environ,envlen=0; *envp; envp++) envlen+=1+strlen(*envp); + envlen++; + + pEnv = malloc(envlen+strlen(ts)+1); + for(t=pEnv,envp=environ; *envp; envp++) + for(s=*envp; *t++=*s++; ) + ; + for(s=ts; *t++=*s++; ) + ; + *t=0; + + /* how many processes? */ + for(php_fcgi_children=0,envp=environ; *envp; envp++) + if(!strncmp("PHP_FCGI_CHILDREN", *envp, 17)) { + php_fcgi_children = strchr(*envp, '=')+1; + break; + } + if(!php_fcgi_children) php_fcgi_children="5"; + children = atoi(php_fcgi_children); + processes = malloc(1+(children*sizeof*processes)); + if(!processes) abort(); + + + /* set up process info */ + sa.bInheritHandle = TRUE; + sa.nLength = sizeof(sa); + + su_info.cb = sizeof(STARTUPINFO); + su_info.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; + su_info.wShowWindow = SW_HIDE; + su_info.hStdError = INVALID_HANDLE_VALUE; + su_info.hStdOutput = INVALID_HANDLE_VALUE; + + /* change to: launcher.exe + '\\\\.\\pipe\\pjb9667' php-cgi -d + allow_url_include=On" */ + tmp = argv[1]; + argv[1] = argv[2]; + argv[2] = tmp; + + /* the command line */ + for(*cmd=len=0, i=2, argc-=2; argc--; i++) { + len += 3+strlen(argv[i]); + if(len>=sizeof(cmd)) abort(); + strcat(cmd, "\""); + strcat(cmd, argv[i]); + strcat(cmd, "\""); + if(argc) strcat(cmd, " "); + } + + //fputs(cmd, stderr); + + /* start the children */ + if(!(processes[0] = CreateEvent(NULL, TRUE, FALSE, NULL))) die(__LINE__); + if(argv[0]) CreateThread(NULL, 0, wait_stdin, NULL, 0, NULL); + for(i=1; i<=children; i++) + processes[i]=start_proc(argv[1]); + + /* until stdin is not available anymore */ + while(1) { + if((pterm=WaitForMultipleObjects(children+1,processes,FALSE,INFINITE))==WAIT_FAILED) + die(__LINE__); + pterm-=WAIT_OBJECT_0; + if(pterm) + processes[pterm]=start_proc(argv[1]); + else { + for(i=1; i<=children; i++) TerminateProcess(processes[i], -1); + return 0; + } + } + return 3; +} diff --git a/src/main/webapp/WEB-INF/cgi/launcher.sh b/src/main/webapp/WEB-INF/cgi/launcher.sh new file mode 100644 index 0000000..1377c97 --- /dev/null +++ b/src/main/webapp/WEB-INF/cgi/launcher.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# php fcgi launcher +#set -x + +"$@" 1>&2 & +trap "kill $! && exit 0;" 1 2 15 +read result 1>&2 +kill $! diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..cf06817 --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,65 @@ + + + + + + + + + + prefer_system_php_exec + On + + + + php_exec + php-cgi.exe + + + + + PhpCGIFilter + io.soluble.pjb.servlet.PhpCGIFilter + + + PhpCGIFilter + /* + + + + + io.soluble.pjb.servlet.ContextLoaderListener + + + + + PhpJavaServlet + io.soluble.pjb.servlet.PhpJavaServlet + + + + + PhpCGIServlet + io.soluble.pjb.servlet.fastcgi.FastCGIServlet + + + + + PhpJavaServlet + *.phpjavabridge + + + + + PhpCGIServlet + *.php + + + + + index.php + + + diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp new file mode 100644 index 0000000..1c4a4d9 --- /dev/null +++ b/src/main/webapp/index.jsp @@ -0,0 +1,13 @@ +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + PhpJavaBridge Home Page + + +

PhpJavaBridge Home Page

+ + From 34f8d7ad21bde0c20d7890af01f68eca0f01dc08 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Tue, 24 Jan 2017 09:34:38 +0100 Subject: [PATCH 22/75] add war build --- build.gradle | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 83968ff..2bb113d 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,8 @@ ant.importBuild 'build.xml' apply plugin: 'java' apply plugin: 'jacoco' +apply plugin: 'war' +apply plugin: 'com.bmuschko.tomcat' // provides embedded tomcat 7 compileJava.options.encoding = 'UTF-8' compileTestJava.options.encoding = 'UTF-8' @@ -13,15 +15,24 @@ sourceCompatibility = 1.7 targetCompatibility = 1.7 repositories { + mavenLocal() mavenCentral() } dependencies { - compileOnly('javax.servlet:servlet-api:2.5') + providedCompile('javax.servlet:servlet-api:2.5') testCompile('junit:junit:3.8.2') // the project still uses this junit API + + def tomcatVersion = '7.0.59' + tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}", + "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}" + tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") { + exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj' + } } jar { + baseName "JavaBridge" manifest { attributes("Main-Class": "io.soluble.pjb.Standalone", "Implementation-Title": "php-java-bridge.jar", @@ -29,6 +40,11 @@ jar { } } +war { + baseName "JavaBridge" + //from 'src/rootContent' // adds a file-set to the root of the archive +} + clean { dependsOn genClean } @@ -44,4 +60,18 @@ jacocoTestReport { csv.enabled false html.destination "${buildDir}/reports/coverage" } -} \ No newline at end of file +} + +buildscript { + repositories { + jcenter() + } + + dependencies { + classpath 'com.bmuschko:gradle-tomcat-plugin:2.0' + } +} + +[tomcatRun, tomcatRunWar]*.contextPath = '/JavaBridge' +[tomcatRun, tomcatRunWar]*.daemon = true + From c5bf4874bceb28d93a07e53685cabf82dbeb1803 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Tue, 24 Jan 2017 09:35:09 +0100 Subject: [PATCH 23/75] and again... --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index ac5042e..baa48bb 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ src/main/java/io/soluble/pjb/bridge/LauncherWindows3.java src/main/java/io/soluble/pjb/bridge/LauncherWindows4.java src/main/resources/META-INF/java/Java.inc src/main/resources/META-INF/java/JavaProxy.php +/.nb-gradle/ +.nb-gradle-properties From 6c0f23cf3326485f7e19764ca94bb3f7f37b7df8 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Tue, 24 Jan 2017 09:35:56 +0100 Subject: [PATCH 24/75] code cleanup & moderizations --- src/main/java/io/soluble/pjb/bridge/Util.java | 43 ++++++++++--------- .../soluble/pjb/servlet/PhpJavaServlet.java | 20 ++++----- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/src/main/java/io/soluble/pjb/bridge/Util.java b/src/main/java/io/soluble/pjb/bridge/Util.java index 22e979c..187ee7f 100644 --- a/src/main/java/io/soluble/pjb/bridge/Util.java +++ b/src/main/java/io/soluble/pjb/bridge/Util.java @@ -1,7 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -24,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; @@ -67,7 +65,9 @@ public final class Util { * Script engines are started from this pool. * Use pool.destroy() to destroy the thread pool upon JVM or servlet shutdown */ - public static final ThreadPool PHP_SCRIPT_ENGINE_THREAD_POOL = new ThreadPool("JavaBridgeStandaloneScriptEngineProxy", Integer.parseInt(Util.THREAD_POOL_MAX_SIZE)) { + public static final ThreadPool PHP_SCRIPT_ENGINE_THREAD_POOL = + new ThreadPool("JavaBridgeStandaloneScriptEngineProxy", Integer.parseInt(Util.THREAD_POOL_MAX_SIZE)) { + @Override protected Delegate createDelegate(String name) { Delegate d = super.createDelegate(name); d.setDaemon(true); @@ -172,8 +172,8 @@ public Logger(boolean useChainsaw, ILogger logger) { if (useChainsaw) try { this.clogger = ChainsawLogger.createChainsawLogger(); - } catch (Throwable t) { - if (Util.logLevel > 5) t.printStackTrace(); + } catch (Exception e) { + if (Util.logLevel > 5) e.printStackTrace(); this.logger = logger; } else { @@ -189,6 +189,7 @@ private ILogger getLogger() { /** * {@inheritDoc} */ + @Override public void printStackTrace(Throwable t) { if (clogger == null) logger.printStackTrace(t); else @@ -203,6 +204,7 @@ public void printStackTrace(Throwable t) { /** * {@inheritDoc} */ + @Override public void log(int level, String msg) { if (clogger == null) logger.log(level, msg); else @@ -393,33 +395,33 @@ private static void initGlobals() { try { JAVA_INC = Class.forName("io.soluble.pjb.bridge.JavaInc"); - } catch (Exception e) {/*ignore*/} + } catch (ClassNotFoundException e) {/*ignore*/} try { PHPDEBUGGER_PHP = Class.forName("io.soluble.pjb.bridge.PhpDebuggerPHP"); - } catch (Exception e) {/*ignore*/} + } catch (ClassNotFoundException e) {/*ignore*/} try { JAVA_PROXY = Class.forName("io.soluble.pjb.bridge.JavaProxy"); - } catch (Exception e) {/*ignore*/} + } catch (ClassNotFoundException e) {/*ignore*/} try { LAUNCHER_UNIX = Class.forName("io.soluble.pjb.bridge.LauncherUnix"); - } catch (Exception e) {/*ignore*/} + } catch (ClassNotFoundException e) {/*ignore*/} try { LAUNCHER_WINDOWS = Class.forName("io.soluble.pjb.bridge.LauncherWindows"); LAUNCHER_WINDOWS2 = Class.forName("io.soluble.pjb.bridge.LauncherWindows2"); LAUNCHER_WINDOWS3 = Class.forName("io.soluble.pjb.bridge.LauncherWindows3"); LAUNCHER_WINDOWS4 = Class.forName("io.soluble.pjb.bridge.LauncherWindows4"); - } catch (Exception e) {/*ignore*/} + } catch (ClassNotFoundException e) {/*ignore*/} Properties p = new Properties(); try { InputStream in = Util.class.getResourceAsStream("global.properties"); p.load(in); VERSION = p.getProperty("BACKEND_VERSION"); - } catch (Throwable t) { + } catch (IOException t) { VERSION = "unknown"; //t.printStackTrace(); } - ; + ENVIRONMENT_BLACKLIST = getEnvironmentBlacklist(p); COMMON_ENVIRONMENT = getCommonEnvironment(ENVIRONMENT_BLACKLIST); DEFAULT_CGI_LOCATIONS = new String[]{"/usr/bin/php-cgi", "c:/Program Files/PHP/php-cgi.exe"}; @@ -454,7 +456,7 @@ private static void initGlobals() { } catch (Throwable xe) {/*ignore*/} try { MAX_WAIT = Integer.parseInt(getProperty(p, "io.soluble.pjb.bridge.max_wait", "15000")); - } catch (Exception e) { + } catch (NumberFormatException e) { MAX_WAIT = 15000; } try { @@ -482,7 +484,6 @@ private static void initGlobals() { } catch (Throwable t) { //t.printStackTrace(); } - ; // resolve java.io.tmpdir for windows; PHP doesn't like dos short file names like foo~1\bar~2\... TMPDIR = new File(System.getProperty("java.io.tmpdir", "/tmp")); @@ -511,14 +512,14 @@ private static void initGlobals() { } catch (Throwable t) { //t.printStackTrace(); } - ; + try { EXTENSION_NAME = "JavaBridge"; EXTENSION_NAME = getProperty(p, "EXTENSION_DISPLAY_NAME", "JavaBridge"); } catch (Throwable t) { //t.printStackTrace(); } - ; + try { PHP_EXEC = getProperty(p, "PHP_EXEC", null); } catch (Throwable t) { @@ -528,7 +529,7 @@ private static void initGlobals() { String s = getProperty(p, "DEFAULT_LOG_LEVEL", "3"); DEFAULT_LOG_LEVEL = Integer.parseInt(s); Util.logLevel = Util.DEFAULT_LOG_LEVEL; /* java.log_level in php.ini overrides */ - } catch (Throwable t) {/*ignore*/} + } catch (NumberFormatException t) {/*ignore*/} try { DEFAULT_LOG_FILE_SET = false; DEFAULT_LOG_FILE = getProperty(p, "DEFAULT_LOG_FILE", Util.EXTENSION_NAME + ".log"); @@ -908,7 +909,7 @@ public static String[] checkCgiBinary(String php) { String path = phpFile.getParent(); String file = phpFile.getName(); - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); if (path != null) { buf.append(path); buf.append(File.separatorChar); @@ -944,7 +945,7 @@ public static String[] checkCgiBinary(String php) { */ public static String checkError(String s) { // Is there a better way to check for a fatal error? - return (s.startsWith("PHP") && (s.indexOf("error:") > -1)) ? s : null; + return (s.startsWith("PHP") && (s.contains("error:"))) ? s : null; } /** diff --git a/src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java b/src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java index 32d19cf..ae45325 100644 --- a/src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java +++ b/src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java @@ -1,7 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.servlet; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -24,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.servlet; + import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -77,6 +75,7 @@ /** * @inheritDoc */ + @Override public void init(ServletConfig config) throws ServletException { maxKeepAliveRequests = ServletUtil.getMBeanProperty("*:type=Connector,port=8080", "maxKeepAliveRequests"); keepAliveTimeout = ServletUtil.getMBeanProperty("*:type=Connector,port=8080", "keepAliveTimeout"); @@ -119,6 +118,7 @@ public void init(ServletConfig config) throws ServletException { /** * {@inheritDoc} */ + @Override public void destroy() { super.destroy(); } @@ -131,7 +131,6 @@ public void destroy() { * * @param req The HttpServletRequest * @param res The HttpServletResponse - * @param credentials The provided credentials. * @return The (new) ServletContextFactory. */ protected SimpleServletContextFactory getContextFactory(HttpServletRequest req, HttpServletResponse res) { @@ -220,12 +219,12 @@ protected void handleLocalConnection(HttpServletRequest req, HttpServletResponse sin.close(); try { res.flushBuffer(); - } catch (Throwable t) { + } catch (IOException t) { Util.printStackTrace(t); } // resin ignores resOut.close() try { resOut.close(); - } catch (Throwable t) { + } catch (IOException t) { Util.printStackTrace(t); } // Sun Java System AS 9 ignores flushBuffer() this.waitForContext(ctx); @@ -278,6 +277,7 @@ protected void handlePut(HttpServletRequest req, HttpServletResponse res) /** * Dispatcher for the "http tunnel", "local channel" or "override redirect". */ + @Override protected void doPut(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { try { @@ -285,10 +285,7 @@ protected void doPut(HttpServletRequest req, HttpServletResponse res) } catch (RuntimeException e) { Util.printStackTrace(e); throw new ServletException(e); - } catch (IOException e) { - Util.printStackTrace(e); - throw e; - } catch (ServletException e) { + } catch (IOException | ServletException e) { Util.printStackTrace(e); throw e; } @@ -297,6 +294,7 @@ protected void doPut(HttpServletRequest req, HttpServletResponse res) /** * For backward compatibility */ + @Override protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String uri = req.getRequestURI(); From 26d6b8fe2007c511548b374f6a62da6ff57f1784 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Tue, 24 Jan 2017 09:42:46 +0100 Subject: [PATCH 25/75] copy generated sources to new webapp dir in source tree --- .gitignore | 2 ++ build.xml | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index baa48bb..71cb839 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,5 @@ src/main/resources/META-INF/java/Java.inc src/main/resources/META-INF/java/JavaProxy.php /.nb-gradle/ .nb-gradle-properties +src/main/webapp/java/Java.inc +src/main/webapp/java/JavaProxy.php diff --git a/build.xml b/build.xml index 3fe8006..198312d 100644 --- a/build.xml +++ b/build.xml @@ -8,6 +8,7 @@ + @@ -37,7 +38,7 @@ - + @@ -47,6 +48,7 @@ + From c65b0756c3b49d6af4a1344b50893636d1689c17 Mon Sep 17 00:00:00 2001 From: sebastien Date: Tue, 24 Jan 2017 13:10:33 +0100 Subject: [PATCH 26/75] Changlog updated --- CHANGELOG.md | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1caee94..355a973 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,29 +1,38 @@ -# CHANGELOG +# Change Log +All notable changes to this project will be documented in this file. -## 6.2.xx (2017-xx-xx) - +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +## [Unreleased] ### Added -- Preliminary support for gradle [see #5](https://github.com/belgattitude/php-java-bridge/issues/5) +- Build: Preliminary support for Gradle (still relying on ant build.xml), see [#5](https://github.com/belgattitude/php-java-bridge/issues/5) and [#9](https://github.com/belgattitude/php-java-bridge/pull/9) +- Build: New tasks added in gradle 'jacocoTestReport', see P/R [#9](https://github.com/belgattitude/php-java-bridge/pull/9) +- Test: test and coverage using Jacoco added, see P/R [#9](https://github.com/belgattitude/php-java-bridge/pull/9) +- Doc: trick to build when default interpreter is php 7+, see [#4](https://github.com/belgattitude/php-java-bridge/issues/4) +- -### Improvements +### Changed -- Some more doc updates +- Moved namespace `php.java` into `io.soluble.pjb`, see P/R [#9](https://github.com/belgattitude/php-java-bridge/pull/9) +- Project directory structure _mavenized_, sources moved from './server' to './src/main/java', see P/R [#9](https://github.com/belgattitude/php-java-bridge/pull/9) +- + +### Fixed -### Fixes - -- Ant build: solution for building when php7+ [see #4](https://github.com/belgattitude/php-java-bridge/issues/4) +- ## 6.2.10 (2017-01-15) -### Changes +### Changed - Removal embedded php-cgi binaries [see #3](https://github.com/belgattitude/php-java-bridge/issues/3) - Source code indentation - README.md: added Recipe for building and deploying on tomcat -### Fixes +### Fixed - Added a `build-php5.6.xml` ant config From 2b03a398c6a17ef33663f48c0338902d66d0c43e Mon Sep 17 00:00:00 2001 From: sebastien Date: Tue, 24 Jan 2017 13:11:46 +0100 Subject: [PATCH 27/75] Changlog updated --- CHANGELOG.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 355a973..7706438 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,17 +11,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Build: New tasks added in gradle 'jacocoTestReport', see P/R [#9](https://github.com/belgattitude/php-java-bridge/pull/9) - Test: test and coverage using Jacoco added, see P/R [#9](https://github.com/belgattitude/php-java-bridge/pull/9) - Doc: trick to build when default interpreter is php 7+, see [#4](https://github.com/belgattitude/php-java-bridge/issues/4) -- + ### Changed - Moved namespace `php.java` into `io.soluble.pjb`, see P/R [#9](https://github.com/belgattitude/php-java-bridge/pull/9) - Project directory structure _mavenized_, sources moved from './server' to './src/main/java', see P/R [#9](https://github.com/belgattitude/php-java-bridge/pull/9) -- ### Fixed -- + ## 6.2.10 (2017-01-15) From 8e2dd84986233d45f9cddf39eb5e2e077c3939c2 Mon Sep 17 00:00:00 2001 From: sebastien Date: Tue, 24 Jan 2017 14:52:53 +0100 Subject: [PATCH 28/75] Added credits and contributors --- CREDITS | 8 -------- CREDITS.md | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) delete mode 100644 CREDITS create mode 100644 CREDITS.md diff --git a/CREDITS b/CREDITS deleted file mode 100644 index 08fe16c..0000000 --- a/CREDITS +++ /dev/null @@ -1,8 +0,0 @@ -VM BRIDGE - -Andre Felipe Machado, -Sam Ruby, -Kai Londenberg, -Nandika Jayawardana, -Sanka Samaranayake, -Jost Boekemeier diff --git a/CREDITS.md b/CREDITS.md new file mode 100644 index 0000000..63c4373 --- /dev/null +++ b/CREDITS.md @@ -0,0 +1,20 @@ +# Credits + +## Authors + +All credits for the original implementation: + +- Jost Boekemeier +- Andre Felipe Machado +- Sam Ruby +- Kai Londenberg +- Nandika Jayawardana +- Sanka Samaranayake + +## Contributors + +Contributors and/or maintainers for the [unofficial fork](https://github.com/belgattitude/php-java-bridge) and post 6.2.1 versions + +- Christian P. Lerch +- Sébastien Vanvelthem + \ No newline at end of file From 3e3c606b0da608f19094271c3eb9902ad00093e6 Mon Sep 17 00:00:00 2001 From: sebastien Date: Tue, 24 Jan 2017 14:58:17 +0100 Subject: [PATCH 29/75] Cleanup removal of obsolete files, working #11 --- CVS_RELEASE.sh | 61 ----------------------------------------- RPM-GPG-KEY | 16 ----------- nbbuild.xml | 73 -------------------------------------------------- 3 files changed, 150 deletions(-) delete mode 100644 CVS_RELEASE.sh delete mode 100755 RPM-GPG-KEY delete mode 100644 nbbuild.xml diff --git a/CVS_RELEASE.sh b/CVS_RELEASE.sh deleted file mode 100644 index 36d161f..0000000 --- a/CVS_RELEASE.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh -set -x -LANG=C - -rm -rf [^C][^V][^S]* .??* *~ -cvs -Q update -APd -find . -print0 | xargs -0 touch -dirs=`ls -l | grep '^d' | fgrep -v CVS | awk '{print $9}'` -find $dirs -name "CVS" -print | xargs rm -rf - -version=`cat VERSION` -ln -s `pwd` php-java-bridge-${version} - -# create archive -tar czhf php-java-bridge_${version}.tar.gz --exclude "php-java-bridge-${version}/php-java-bridge[_-]*" --exclude CVS --exclude ".??*" php-java-bridge-${version} - -rpmbuild -tb php-java-bridge_${version}.tar.gz -mv ~/rpmbuild/RPMS/i386/php-java-bridge-${version}-1.i386.rpm "./php-java-bridge-${version}-1.fc`cat /etc/issue | sed 1q | awk '{print $3}'`.i386.rpm" -mv ~/rpmbuild/RPMS/i386/php-java-bridge-devel-${version}-1.i386.rpm "./php-java-bridge-devel-${version}-1.fc`cat /etc/issue | sed 1q | awk '{print $3}'`.i386.rpm" - -ant clean && -ant PhpDoc 2>/dev/null >/dev/null && -ant JavaDoc && -ant && -ant SrcZip - -cp dist/*.war dist/src.zip . -cp -r php_java_lib tests.php5 tests.jsr223 server - -cp JavaBridge.war JavaBridgeTemplate.war -for i in 'META-INF/*' 'WEB-INF/lib/[^pJ]*.jar' 'WEB-INF/lib/poi.jar' 'WEB-INF/cgi/*' 'WEB-INF/web.xml' 'WEB-INF/platform/*' 'locale/*' '*.class' '*.jsp' '*.rpt*' '*.php'; do - zip -d JavaBridgeTemplate.war "$i"; -done -cat examples/php+jsp/settings.php >./index.php -echo '' >test.php -rm -rf WEB-INF; mkdir WEB-INF -cp server/example-web.xml WEB-INF/web.xml -zip JavaBridgeTemplate.war index.php test.php -zip JavaBridgeTemplate.war WEB-INF/web.xml -zip -d JavaBridgeTemplate.war birtreportlib/ -rm -f test.php - -cp src.zip README FAQ.html PROTOCOL.TXT INSTALL.STANDALONE INSTALL.J2EE INSTALL.J2SE NEWS documentation -mv examples documentation -mv server documentation -list="documentation/API documentation/examples documentation/README documentation/FAQ.html documentation/PROTOCOL.TXT documentation/INSTALL.J2EE documentation/INSTALL.J2SE documentation/INSTALL.STANDALONE documentation/src.zip documentation/NEWS JavaBridge.war documentation/server/documentation documentation/server/php_java_lib documentation/server/tests.jsr223 documentation/server/tests.php5" -find $list -type d -name "CVS" -print | xargs rm -rf - - -chmod +x JavaBridge.war - -# create j2ee download -zip -q -r php-java-bridge_${version}_documentation.zip $list -mv JavaBridgeTemplate.war "JavaBridgeTemplate`echo ${version}|sed 's/\.//g'`.war" -rm -rf $dirs -cvs -Q update -APd - -scp "php-java-bridge_`cat VERSION`_documentation.zip" "JavaBridgeTemplate`echo ${version}|sed 's/\.//g'`.war" jost_boekemeier,php-java-bridge@web.sf.net:"/home/pfs/project/p/ph/php-java-bridge/Binary\ package/php-java-bridge_`cat VERSION`/" -scp dist/Java.inc dist/php-script.jar dist/JavaBridge.jar dist/php-servlet.jar dist/script-api.jar jost_boekemeier,php-java-bridge@web.sf.net:"/home/pfs/project/p/ph/php-java-bridge/Binary\ package/php-java-bridge_`cat VERSION`/exploded/" - -scp "php-java-bridge_`cat VERSION`.tar.gz" jost_boekemeier,php-java-bridge@web.sf.net:"/home/pfs/project/p/ph/php-java-bridge/RHEL_FC\ SecurityEnhancedLinux/php-java-bridge_`cat VERSION`/" diff --git a/RPM-GPG-KEY b/RPM-GPG-KEY deleted file mode 100755 index 1027b3f..0000000 --- a/RPM-GPG-KEY +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: rpm-4.4.2.2 (beecrypt-4.1.2) - -mQGiBEd3RyARBADja6IVksaKCJRq+T59pFvCod+uJOmLezoZRS52kgHCM6Iw0HHIYvMcgrOO -LsRAAtP8K7GjeWuoK1VN5n5VWlfmHn9j6SB/Ny0AmBm8beUtDiirssVUP0gp+7ojRgTyPpX1 -jcoAbaBvIvKGhtu3n1oc5vIN2lOx7Rc4N4JyqrvV5wCgjTJq/1t4gtuOIiIHxcGOhxUhoUcE -AKn9jxE9k3nVqssJzu8cz0W0LNY7cdZbTJApFjWQMY3bnxwY8WhT9AfCJmR5zjnUlvFJbpD6 -88t3vZgwtTDnkgr+Gx45dEck2M4tnAdrhhuhQu4kVa7ifF5c+It6SJlnzTelR0AYdr9Lw61E -HzuYGzkUtvN0nSyz8RGo6QokiKeZA/0XDzL1Casp6MAga2pzm0D14ecKb15jWzK7AO/0YjpH -UJLa8iTg2ldG1sLAX4RX2suTbV1inLzUR0Ga3P2Vz3llUVeZ4dtTUu0ebd8rWpp58M0onMM+ -pXLfkduDSXA3NavZsMlEArjGdO4czlPxJPCxWyDgmrV3efuXqqDrOeC10bQqSm9zdCBCb2Vr -ZW1laWVyIDxqb3N0X2JvZWtlbWVpZXJAeWFob28uZGU+iGAEExECACAFAkd3RyACGwMGCwkI -BwMCBBUCCAMEFgIDAQIeAQIXgAAKCRDwfdQH84kQcV9hAJ4xvMWBT+7nLgJBTKm9wH0nEaOP -bACeOsuaiW/jrEcYdDjOgpv9EkrRUHQ= -=+Qgh ------END PGP PUBLIC KEY BLOCK----- diff --git a/nbbuild.xml b/nbbuild.xml deleted file mode 100644 index da99c7c..0000000 --- a/nbbuild.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - Builds, tests, and runs the project php-java-bridge. - - - From 293c755054c8635800180ce2fc789950e9dd7bf9 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Tue, 24 Jan 2017 16:05:13 +0100 Subject: [PATCH 30/75] cleanup unnecessary files --- CVS_RELEASE.sh | 61 ---- RPM-GPG-KEY | 16 - debian/Makefile.frag | 36 --- debian/README.Debian | 152 --------- debian/changelog | 294 ------------------ debian/compat | 1 - debian/control | 84 ----- debian/copyright | 167 ---------- debian/dirs | 4 - debian/docs | 7 - debian/install | 2 - debian/patches/00list | 5 - .../20_SELinuxMakefileDebian_patch.dpatch | 21 -- .../30_SELinuxTeTomcatDebian_patch.dpatch | 22 -- .../50_SELinuxReadmeDebian_patch.dpatch | 19 -- debian/php-java-bridge-devel.docs | 8 - debian/php-java-bridge-devel.examples | 9 - debian/php-java-bridge-docs.docs | 7 - debian/php-java-bridge-j2ee-docs.docs | 1 - debian/php-java-bridge-j2ee-selinux.dirs | 2 - debian/php-java-bridge-j2ee-selinux.docs | 7 - debian/php-java-bridge-j2ee-selinux.install | 2 - debian/php-java-bridge-j2ee-selinux.postinst | 52 ---- debian/php-java-bridge-j2ee-selinux.postrm | 56 ---- debian/php-java-bridge-j2ee-selinux.preinst | 42 --- debian/php-java-bridge-j2ee.dirs | 2 - debian/php-java-bridge-j2ee.docs | 7 - debian/php-java-bridge-j2ee.install | 3 - debian/php-java-bridge-j2ee.postinst | 48 --- debian/php-java-bridge-j2ee.postrm | 57 ---- debian/php-java-bridge-j2ee.preinst | 42 --- debian/php-java-bridge-selinux.dirs | 2 - debian/php-java-bridge-selinux.docs | 7 - debian/php-java-bridge-selinux.install | 2 - debian/php-java-bridge-selinux.postinst | 52 ---- debian/php-java-bridge-selinux.postrm | 55 ---- debian/php-java-bridge.dirs | 4 - debian/php-java-bridge.examples | 13 - debian/php-java-bridge.install | 3 - debian/postinst | 43 --- debian/postrm | 52 ---- debian/rules | 283 ----------------- security/README | 3 - security/module/Makefile | 8 - security/module/README | 4 - security/module/php-java-bridge-tomcat.fc.in | 1 - security/module/php-java-bridge-tomcat.if | 0 security/module/php-java-bridge-tomcat.te | 17 - security/module/php-java-bridge.fc.in | 8 - security/module/php-java-bridge.if | 24 -- security/module/php-java-bridge.te | 134 -------- security/php-java-bridge-tomcat.te | 7 - security/php-java-bridge.fc.in | 6 - security/php-java-bridge.te | 83 ----- security/update_policy.sh.in | 37 --- server/META-INF/java/.cvsignore | 2 - test.php | 42 --- 57 files changed, 2128 deletions(-) delete mode 100644 CVS_RELEASE.sh delete mode 100755 RPM-GPG-KEY delete mode 100644 debian/Makefile.frag delete mode 100644 debian/README.Debian delete mode 100644 debian/changelog delete mode 100644 debian/compat delete mode 100644 debian/control delete mode 100644 debian/copyright delete mode 100644 debian/dirs delete mode 100644 debian/docs delete mode 100644 debian/install delete mode 100644 debian/patches/00list delete mode 100755 debian/patches/20_SELinuxMakefileDebian_patch.dpatch delete mode 100755 debian/patches/30_SELinuxTeTomcatDebian_patch.dpatch delete mode 100755 debian/patches/50_SELinuxReadmeDebian_patch.dpatch delete mode 100644 debian/php-java-bridge-devel.docs delete mode 100644 debian/php-java-bridge-devel.examples delete mode 100644 debian/php-java-bridge-docs.docs delete mode 100644 debian/php-java-bridge-j2ee-docs.docs delete mode 100644 debian/php-java-bridge-j2ee-selinux.dirs delete mode 100644 debian/php-java-bridge-j2ee-selinux.docs delete mode 100644 debian/php-java-bridge-j2ee-selinux.install delete mode 100644 debian/php-java-bridge-j2ee-selinux.postinst delete mode 100644 debian/php-java-bridge-j2ee-selinux.postrm delete mode 100644 debian/php-java-bridge-j2ee-selinux.preinst delete mode 100644 debian/php-java-bridge-j2ee.dirs delete mode 100644 debian/php-java-bridge-j2ee.docs delete mode 100644 debian/php-java-bridge-j2ee.install delete mode 100644 debian/php-java-bridge-j2ee.postinst delete mode 100644 debian/php-java-bridge-j2ee.postrm delete mode 100644 debian/php-java-bridge-j2ee.preinst delete mode 100644 debian/php-java-bridge-selinux.dirs delete mode 100644 debian/php-java-bridge-selinux.docs delete mode 100644 debian/php-java-bridge-selinux.install delete mode 100644 debian/php-java-bridge-selinux.postinst delete mode 100644 debian/php-java-bridge-selinux.postrm delete mode 100644 debian/php-java-bridge.dirs delete mode 100644 debian/php-java-bridge.examples delete mode 100644 debian/php-java-bridge.install delete mode 100644 debian/postinst delete mode 100644 debian/postrm delete mode 100755 debian/rules delete mode 100644 security/README delete mode 100644 security/module/Makefile delete mode 100644 security/module/README delete mode 100644 security/module/php-java-bridge-tomcat.fc.in delete mode 100644 security/module/php-java-bridge-tomcat.if delete mode 100644 security/module/php-java-bridge-tomcat.te delete mode 100644 security/module/php-java-bridge.fc.in delete mode 100644 security/module/php-java-bridge.if delete mode 100644 security/module/php-java-bridge.te delete mode 100644 security/php-java-bridge-tomcat.te delete mode 100644 security/php-java-bridge.fc.in delete mode 100644 security/php-java-bridge.te delete mode 100644 security/update_policy.sh.in delete mode 100644 server/META-INF/java/.cvsignore delete mode 100755 test.php diff --git a/CVS_RELEASE.sh b/CVS_RELEASE.sh deleted file mode 100644 index 36d161f..0000000 --- a/CVS_RELEASE.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh -set -x -LANG=C - -rm -rf [^C][^V][^S]* .??* *~ -cvs -Q update -APd -find . -print0 | xargs -0 touch -dirs=`ls -l | grep '^d' | fgrep -v CVS | awk '{print $9}'` -find $dirs -name "CVS" -print | xargs rm -rf - -version=`cat VERSION` -ln -s `pwd` php-java-bridge-${version} - -# create archive -tar czhf php-java-bridge_${version}.tar.gz --exclude "php-java-bridge-${version}/php-java-bridge[_-]*" --exclude CVS --exclude ".??*" php-java-bridge-${version} - -rpmbuild -tb php-java-bridge_${version}.tar.gz -mv ~/rpmbuild/RPMS/i386/php-java-bridge-${version}-1.i386.rpm "./php-java-bridge-${version}-1.fc`cat /etc/issue | sed 1q | awk '{print $3}'`.i386.rpm" -mv ~/rpmbuild/RPMS/i386/php-java-bridge-devel-${version}-1.i386.rpm "./php-java-bridge-devel-${version}-1.fc`cat /etc/issue | sed 1q | awk '{print $3}'`.i386.rpm" - -ant clean && -ant PhpDoc 2>/dev/null >/dev/null && -ant JavaDoc && -ant && -ant SrcZip - -cp dist/*.war dist/src.zip . -cp -r php_java_lib tests.php5 tests.jsr223 server - -cp JavaBridge.war JavaBridgeTemplate.war -for i in 'META-INF/*' 'WEB-INF/lib/[^pJ]*.jar' 'WEB-INF/lib/poi.jar' 'WEB-INF/cgi/*' 'WEB-INF/web.xml' 'WEB-INF/platform/*' 'locale/*' '*.class' '*.jsp' '*.rpt*' '*.php'; do - zip -d JavaBridgeTemplate.war "$i"; -done -cat examples/php+jsp/settings.php >./index.php -echo '' >test.php -rm -rf WEB-INF; mkdir WEB-INF -cp server/example-web.xml WEB-INF/web.xml -zip JavaBridgeTemplate.war index.php test.php -zip JavaBridgeTemplate.war WEB-INF/web.xml -zip -d JavaBridgeTemplate.war birtreportlib/ -rm -f test.php - -cp src.zip README FAQ.html PROTOCOL.TXT INSTALL.STANDALONE INSTALL.J2EE INSTALL.J2SE NEWS documentation -mv examples documentation -mv server documentation -list="documentation/API documentation/examples documentation/README documentation/FAQ.html documentation/PROTOCOL.TXT documentation/INSTALL.J2EE documentation/INSTALL.J2SE documentation/INSTALL.STANDALONE documentation/src.zip documentation/NEWS JavaBridge.war documentation/server/documentation documentation/server/php_java_lib documentation/server/tests.jsr223 documentation/server/tests.php5" -find $list -type d -name "CVS" -print | xargs rm -rf - - -chmod +x JavaBridge.war - -# create j2ee download -zip -q -r php-java-bridge_${version}_documentation.zip $list -mv JavaBridgeTemplate.war "JavaBridgeTemplate`echo ${version}|sed 's/\.//g'`.war" -rm -rf $dirs -cvs -Q update -APd - -scp "php-java-bridge_`cat VERSION`_documentation.zip" "JavaBridgeTemplate`echo ${version}|sed 's/\.//g'`.war" jost_boekemeier,php-java-bridge@web.sf.net:"/home/pfs/project/p/ph/php-java-bridge/Binary\ package/php-java-bridge_`cat VERSION`/" -scp dist/Java.inc dist/php-script.jar dist/JavaBridge.jar dist/php-servlet.jar dist/script-api.jar jost_boekemeier,php-java-bridge@web.sf.net:"/home/pfs/project/p/ph/php-java-bridge/Binary\ package/php-java-bridge_`cat VERSION`/exploded/" - -scp "php-java-bridge_`cat VERSION`.tar.gz" jost_boekemeier,php-java-bridge@web.sf.net:"/home/pfs/project/p/ph/php-java-bridge/RHEL_FC\ SecurityEnhancedLinux/php-java-bridge_`cat VERSION`/" diff --git a/RPM-GPG-KEY b/RPM-GPG-KEY deleted file mode 100755 index 1027b3f..0000000 --- a/RPM-GPG-KEY +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: rpm-4.4.2.2 (beecrypt-4.1.2) - -mQGiBEd3RyARBADja6IVksaKCJRq+T59pFvCod+uJOmLezoZRS52kgHCM6Iw0HHIYvMcgrOO -LsRAAtP8K7GjeWuoK1VN5n5VWlfmHn9j6SB/Ny0AmBm8beUtDiirssVUP0gp+7ojRgTyPpX1 -jcoAbaBvIvKGhtu3n1oc5vIN2lOx7Rc4N4JyqrvV5wCgjTJq/1t4gtuOIiIHxcGOhxUhoUcE -AKn9jxE9k3nVqssJzu8cz0W0LNY7cdZbTJApFjWQMY3bnxwY8WhT9AfCJmR5zjnUlvFJbpD6 -88t3vZgwtTDnkgr+Gx45dEck2M4tnAdrhhuhQu4kVa7ifF5c+It6SJlnzTelR0AYdr9Lw61E -HzuYGzkUtvN0nSyz8RGo6QokiKeZA/0XDzL1Casp6MAga2pzm0D14ecKb15jWzK7AO/0YjpH -UJLa8iTg2ldG1sLAX4RX2suTbV1inLzUR0Ga3P2Vz3llUVeZ4dtTUu0ebd8rWpp58M0onMM+ -pXLfkduDSXA3NavZsMlEArjGdO4czlPxJPCxWyDgmrV3efuXqqDrOeC10bQqSm9zdCBCb2Vr -ZW1laWVyIDxqb3N0X2JvZWtlbWVpZXJAeWFob28uZGU+iGAEExECACAFAkd3RyACGwMGCwkI -BwMCBBUCCAMEFgIDAQIeAQIXgAAKCRDwfdQH84kQcV9hAJ4xvMWBT+7nLgJBTKm9wH0nEaOP -bACeOsuaiW/jrEcYdDjOgpv9EkrRUHQ= -=+Qgh ------END PGP PUBLIC KEY BLOCK----- diff --git a/debian/Makefile.frag b/debian/Makefile.frag deleted file mode 100644 index 831d0f1..0000000 --- a/debian/Makefile.frag +++ /dev/null @@ -1,36 +0,0 @@ -# -*- mode: Makefile; -*- -tmp_prefix:=$(prefix) -prefix = ${DESTDIR}$(tmp_prefix) -TMP_EXTENSION_DIR:=$(EXTENSION_DIR) -EXTENSION_DIR=${DESTDIR}$(TMP_EXTENSION_DIR) - - - -$(srcdir)/java_inc.c: $(srcdir)/Java.inc - echo -n 'char java_inc[]="' >$(srcdir)/java_inc.c - cat $(srcdir)/Java.inc | sed 's/\\/\\\\/g;s/"/\\"/g;s/.*/&\\n\\/' >>$(srcdir)/java_inc.c - echo '";' >>$(srcdir)/java_inc.c - echo '#include ' >>$(srcdir)/java_inc.c - echo 'size_t java_inc_length() {return sizeof(java_inc);}' >>$(srcdir)/java_inc.c - - -$(srcdir)/JavaRaw.inc: - cat $(srcdir)/server/META-INF/java/JavaBridge.inc $(srcdir)/server/META-INF/java/Options.inc $(srcdir)/server/META-INF/java/Client.inc $(srcdir)/server/META-INF/java/GlobalRef.inc $(srcdir)/server/META-INF/java/NativeParser.inc $(srcdir)/server/META-INF/java/Parser.inc $(srcdir)/server/META-INF/java/Protocol.inc $(srcdir)/server/META-INF/java/SimpleParser.inc $(srcdir)/server/META-INF/java/JavaProxy.inc | sed -f $(srcdir)/server/extract.sed | sed '/^\/\*/,/\*\/$$/d' >$(srcdir)/JavaRaw.inc - -$(srcdir)/Java.inc: $(srcdir)/JavaRaw.inc - cat $(srcdir)/JavaRaw.inc | sed '/do not delete this line/d' >$(srcdir)/Java.inc - -$(srcdir)/mono_inc.c: $(srcdir)/Mono.inc - echo -n 'char mono_inc[]="' >$(srcdir)/mono_inc.c - cat $(srcdir)/Mono.inc | sed 's/\\/\\\\/g;s/"/\\"/g;s/.*/&\\n\\/' >>$(srcdir)/mono_inc.c - echo '";' >>$(srcdir)/mono_inc.c - echo '#include ' >>$(srcdir)/mono_inc.c - echo 'size_t mono_inc_length() {return sizeof(mono_inc);}' >>$(srcdir)/mono_inc.c - - -$(srcdir)/Mono.inc: $(srcdir)/JavaRaw.inc - cat $(srcdir)/JavaRaw.inc | sed -f $(srcdir)/server/append.sed | sed 's/JAVA/MONO/g;s/java/mono/g;s/Java/Mono/g;s/updateJarLibraryPath/updateLibraryPath/;s/^.*do not delete this line.*$$/$$name="cli.".$$name;/;' >$(srcdir)/Mono.inc - - -$(phplibdir)/stamp: - cd $(srcdir)/server; $(MAKE) CFLAGS="$(CFLAGS_CLEAN)" GCJFLAGS="$(GCJFLAGS) `echo $(CFLAGS_CLEAN)|sed 's/-D[^ ]*//g'`" install diff --git a/debian/README.Debian b/debian/README.Debian deleted file mode 100644 index dcc0263..0000000 --- a/debian/README.Debian +++ /dev/null @@ -1,152 +0,0 @@ -php-java-bridge for Debian --------------------------- - -This Debian package was compiled for installing php5 C modules, j2ee server, -docs and development files using separated packages. -Also, it must use Sun Java 6 and Tomcat 5.5, as of today. -You must use the J2EE version, because C implementation was removed from -distribution and source tree. -This file release do not include C implementation binary. -This version is not compatible with php 4.x. -Compilation against GCJ is possible, but some tweaks must be done. Read the -other document files. -This version needs debhelper >= 7.4.11~bpo50+1 for build. -This version uses ant build environment, and only SELinux still use make. -This package uses an EXPERIMENTAL and TOO permissive Tomcat 5.5 security policy. -Only suitable for security benign development environments. -Java security is not actually enough for blocking malicious code from php. -The production quality solution should be using Security Enhanced Linux -policies. -Read more at the "devel" package, -"/usr/share/doc/php-java-bridge-devel/examples/security" directory. -This version includes minimal SE Linux rules for starting Tomcat 5.5 and -php-java-bridge. -Please, contribute improved rules to the project. -This version needs PhpDocumentor in order to build. It is not packaged for -Debian yet. You must install php-pear, dh-make, dh-make-pear packages and then -execute, logged as root and if your Apache document root is at /var/www: - -# pear channel-update "pear.php.net" -# pear config-set data_dir /var/www/pear - -Then OR you could install PhpDocumentor using pear: - -# pear install --alldeps PhpDocumentor - -OR you could create debian packages for it and its dependencies (XML_Beautifier, - XML_Parser, XML_Util) logged as regular user (you may cd to individual -directories for each): - -$ dh-make-pear --depends php-xml-beautifier, php5-cli PhpDocumentor -$ dh-make-pear --depends php-xml-util, php-xml-parser XML_Beautifier -$ dh-make-pear XML_Util -$ dh-make-pear XML_Parser - -Then enter at each respective pear module source directory as regular user: - -$ debuild -uc -us - -These commands will build rough debian packages for the pear modules. -You may need to adjust dependency field at each debian/control files, and -maintainer field, at least. -Install these pear module debian packages in order to compile php-java-bridge -debian packages. - -After having all these pear dependencies satisfied, use the command as regular -user: - -$ debuild -rfakeroot -uc -us - -at a directory you downloaded the .dsc, .changes, .diff.gz, orig.tar.gz files -and given you already have all devscripts tool chain Debian packages installed. - - -1. Creating and Building Debian package directly from CVS -Most steps are only needed if you will commit a new version to the repository. -If you want only to build an already commited version, you will need only create - a local working area (checkout module) as anonymous cvs user and then jump to -the step "building the package". - -1.1 Creating package - -1.1.1 Create your local project area (checkout module to your local CVS area). -See http://sourceforge.net/cvs/?group_id=117793 -The commands below are suitable for cvs commiters. Use your sourceforge cvs -username. -If you are only building the package, use anonymous cvs checkout as instructed -in the URL. - -$ mkdir ~/projects -$ cd ~/projects -$ export CVS_RSH=ssh -$ cvs -d:ext:your_sourcefoge_cvs_username@php-java-bridge.cvs.sourceforge.net:/cvsroot/php-java-bridge checkout php-java-bridge - -Now you should have your own local area (checked out module) in -~/projects/php-java-bridge -If you are only building the package, jump to the step 2. - -1.1.1.1 If you are trying to merge a downloaded and then expanded src.tgz into -the cvs tree, use the command below, adapting it to the suitable version. - -$ cp --recursive --update --verbose --archive \ ---preserve php-java-bridge-5.2.2/* --target-directory=php-java-bridge - -1.1.2 Commit the (eventual) changes to the repository. Ideally, you will not to -do this, if step 1.1.1.1 is not needed. - -1.1.3 Create an upstream tag. The formating is VERY strict. Adapt to the -suitable version. - -$ cd ~/projects/php-java-bridge -$ cvs -f tag 'upstream_version_6_1_2_1' '.' - -1.1.4 Create or edit the Debian php-java-bridge specific patches. - -$ cd ~/projects/php-java-bridge -$ dpatch-edit-patch patch 10_MakefileFrag_patch - -Copy around from a personal template or edit the Makefile.frag into the -./debian directory. -Exit dpatch shell. -All your modifications were being recorded and will result in the defined patch -file name into the ./debian/patches directory. - -1.1.5 Modify the Debian changelog in the correct way. It is very important to -follow the strict formating, as the Debian changelog is actualy used as one of -the package control files. - -$ debchange -v 6.1.2.1-1 - -1.1.6 Modify some other */debian files, if needed. - -1.1.7 Commit all changes. - -1.1.8 Create the Debian version tag. The formating is very strict. Adapt to the -suitable version. - -$ cd ~/projects/php-java-bridge -$ cvs -f tag 'debian_version_6_1_2_1-1' '.' - - -2. Building the package from cvs tree. -If you are only building the package, you could use the anonymous cvs pserver -login and checkout as explained in previous item. - -$ mkdir ~/compilation_tmp -$ cd ~/projects/php-java-bridge - -Hint: You need to specify the absolute path to the temporary scratchpad working -area instead of ~/. - -$ cvs-buildpackage -rfakeroot -uc -us -R. -W/home/andremachado/compilation_tmp - -The generated files will result at the specified temporary scratchpad working -area. - -3. Different port on Debian systems -The Tomcat php-java-bridge deployment could be tested at -http://localhost:8180/JavaBridge -with or without SE Linux packaged rules installed. -The port is configured 8180 in order to avoid conflict with Apache. - - -- Andre Felipe Machado Tue, 04 May 2010 16:55:22 -0300 diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 38dd5cc..0000000 --- a/debian/changelog +++ /dev/null @@ -1,294 +0,0 @@ -php-java-bridge (6.1.2.1-1) unstable; urgency=low - - * New upstream version. - * Correction of SE Linux Tomcat Debian patch. - - -- Andre Felipe Machado Mon, 04 May 2010 16:15:04 -0300 - - -php-java-bridge (6.1.2-1) unstable; urgency=low - - * New upstream version. - * Rules file cleanup, removing deprecated packages. - - -- Andre Felipe Machado Mon, 22 Apr 2010 10:12:21 -0300 - - - -php-java-bridge (6.1.1-2) unstable; urgency=low - - * Corrections at control file, removing deprecated packages. - * Files clean up. - - -- Andre Felipe Machado Mon, 06 Apr 2010 14:34:35 -0300 - - - -php-java-bridge (6.1.1-1) unstable; urgency=low - - * New upstream version. - * Removed C binary package and its SE Linux companion package. - * Dependency on debhelper from backports.org - - -- Andre Felipe Machado Mon, 06 Apr 2010 13:57:23 -0300 - - - -php-java-bridge (5.5.5-1) unstable; urgency=low - - * New upstream version. - * Improved README.Debian. - - -- Andre Felipe Machado Fri, 26 Jan 2009 10:40:12 -0200 - - -php-java-bridge (5.5.4.1-1) unstable; urgency=low - - * New upstream version. - - -- Andre Felipe Machado Fri, 09 Dec 2009 14:15:41 -0300 - -php-java-bridge (5.5.1-1) unstable; urgency=low - - * New upstream version. - * SE Linux Debian patch is not needed anymore. - - -- Andre Felipe Machado Fri, 31 Aug 2009 12:05:43 -0300 - -php-java-bridge (5.5-2) unstable; urgency=low - - * Correction of SE Linux Debian patch for right bridge version. - - -- Andre Felipe Machado Fri, 31 Aug 2009 11:32:15 -0300 - - -php-java-bridge (5.5-1) unstable; urgency=low - - * New upstream version. - * build dependency on php-pear. - * improved dependency control (rules and control files). - * build dependency on PhpDocumentor (manually installed by php-pear) - - -- Andre Felipe Machado Fri, 07 Aug 2009 15:20:18 -0300 - - -php-java-bridge (5.4.4.2-3) unstable; urgency=low - - * SELinux EXPERIMENTAL packaging. - * Corrections at directories packaging. - * Corrections at JavaBridge TomCat security policy file for default Lenny. - * Improved dependency configuration. - * Corrections at installation scripts sequence. - - -- Andre Felipe Machado Tue, 16 Jul 2009 17:44:32 -0300 - - -php-java-bridge (5.4.4.2-2) unstable; urgency=low - - * Corrections at Tomcat 5.5 security policy. EXPERIMENTAL and TOO permissive. - Only suitable for security benign development environments. - Java security is not actually enough for blocking malicious code from php. - The production quality solution should be using Security Enhanced Linux - policies. Read more at the "devel" package, - "/usr/share/doc/php-java-bridge-devel/examples/security" directory. - As of today, you have to edit and compile SE Linux rules yourself. - Please, contribute improved rules. - * Compiled in Debian GNU/Linux 5.0 Lenny with Sun Java 6. - - -- Andre Felipe Machado Mon, 29 Jun 2009 14:28:05 -0300 - - -php-java-bridge (5.4.4.2-1) unstable; urgency=low - - * New upstream release. - * Corrections at the rules for installing at the Tomcat 5.5 auto deploy - directory. - * Compiled in Debian GNU/Linux 5.0 Lenny with Sun Java 6. - - -- Andre Felipe Machado Thu, 30 Apr 2009 10:03:31 -0300 - - -php-java-bridge (5.4.4.1-1) unstable; urgency=low - - * New upstream release. - * Dependencies corrections for Tomcat 5.5 in Lenny. - * Correction at postrm and postinst scripts for Tomcat 5.5. - * Compiled in Debian GNU/Linux 5.0 Lenny with Sun Java 6. - - -- Andre Felipe Machado Thu, 30 Mar 2009 11:15:23 -0300 - - -php-java-bridge (5.4.4-1) unstable; urgency=low - - * New upstream release. - * Compiled in Debian GNU/Linux 5.0 Lenny with Sun Java 6. - - -- Andre Felipe Machado Thu, 12 Mar 2009 14:05:04 -0300 - -php-java-bridge (5.4.3.2-1) unstable; urgency=low - - * New upstream release. - - -- Andre Felipe Machado Thu, 19 Feb 2009 16:55:08 -0300 - -php-java-bridge (5.4.3.1-1) unstable; urgency=low - - * New upstream release. - * README.GNU_JAVA renamed to README.GCJ. - * java-servlet.ini not installed anymore. - - -- Andre Felipe Machado Mon, 26 Jan 2009 10:26:15 -0300 - - -php-java-bridge (5.3.4-1) unstable; urgency=low - - * New upstream release. - * Missing some tests: jsr223. - * java.ini: Switch off java.security_policy per default as some VM - implementations don't understand the policy==... syntax. - Thanks to Jan Wagner to pointing this. - * New build location for Java.inc and included for j2ee package. - * Removed server/test directory from examples. - - -- Andre Felipe Machado Fri, 03 Dec 2008 11:06:18 -0300 - -php-java-bridge (5.3.3-1) unstable; urgency=low - - * New upstream release. - * Missing Java.inc and Mono.inc from native code package. But at this package, - the mono version is not built. - Thanks to Jan Wagner to pointing this. - - -- Andre Felipe Machado Fri, 26 Nov 2008 10:25:18 -0300 - -php-java-bridge (5.3.2.1.2-1) unstable; urgency=low - - * New upstream release. - - -- Andre Felipe Machado Fri, 13 Oct 2008 10:25:18 -0300 - -php-java-bridge (5.3.2.1.1-1) unstable; urgency=low - - * New upstream release. - * Detailed control of build and install process using implicit and explicit - rules. - * Correct interpretation of -a, -i, -p rules options, clearing all errors. - * Correct use of intermediate targets. - * Correct use of .PHONY, binary-indep, binary-arch targets. - * Intermediate targets does not understand -p@ option. Instead, use complete - target copy. - * Intermediate target installbasic does not include dh_install rule anymore. - * Improved comments at debian/rules file. - - -- Andre Felipe Machado Fri, 10 Oct 2008 11:04:08 -0300 - - -php-java-bridge (5.2.2-1) unstable; urgency=low - - * New upstream release. - * Packaging improvements and corrections. - Adjustments of package sizes and contents. - - -- Andre Felipe Machado Tue, 06 May 2008 12:02:33 -0300 - -php-java-bridge (5.1.0-1) unstable; urgency=low - - * New upstream release. - * Droped support for php4. - * Deprecated C implementation. - * Droped initscript. - * Packaging improvements and corrections. - Adjustments of package sizes and contents. - - -- Andre Felipe Machado Tue, 29 Jan 2008 12:02:33 -0200 - -php-java-bridge (4.3.2-1) unstable; urgency=low - - * New upstream development version - * Included LSB compatible (needs status command) initscripts for Debian systems - * Corrected some miscreated top-level directories bugs - - -- Andre Felipe Machado Thu, 20 Dec 2007 13:14:22 -0200 - -php-java-bridge (4.3.0-1) unstable; urgency=low - - * New upstream development version - * New high-level API: When the PHP standard library is - available (PHP version >= 5.2), java_autoload("libs...") - can be used. - * It is now possible to access PHP (HTTP- or FastCGI) pool - instances from servlets or frameworks such as Spring or - JSF using the JSR 223 API. See script/EngineFactory.java - and servlet/ContextLoaderListener.java. - - -- Andre Felipe Machado Wed, 17 Oct 2007 17:14:22 -0200 - -php-java-bridge (4.2.2-1) unstable; urgency=low - - * New upstream development version. - * Deprecated C extension implementation since 4.1.7. - * Remotion of java extension documentation. - * Dependency on jdk 1.6. - * Correction for JavaBridge.war inclusion at j2ee package instead of docs package. - - -- Andre Felipe Machado Mon, 7 Aug 2007 11:27:07 -0300 - -php-java-bridge (4.0.8a-1) unstable; urgency=low - - * new upstream version - * installini target substituted by install file - * no more mono.ini installation - * postrm and postinst scripts corrected. - * some rules formatting cleanup - - -- Andre Felipe Machado Fri, 20 Apr 2007 14:38:06 -0300 - -php-java-bridge (4.0.8-2) unstable; urgency=low - - * Improvements on packaging. The php-java-bridge-j2ee now stop and - restart tomcat5. - - -- Andre Felipe Machado Tue, 10 Apr 2007 14:34:33 -0300 - -php-java-bridge (4.0.8-1) unstable; urgency=low - - * New upstream version. - * C implementation now in sync with php J2EE implementation. - - -- Andre Felipe Machado Mon, 9 Apr 2007 09:38:09 -0300 - -php-java-bridge (4.0.7-1) unstable; urgency=low - - * New upstream version - * Splitted in multiple packages - * C implementation is still the same as 4.0.1 - - -- Andre Felipe Machado Mon, 2 Apr 2007 16:34:41 -0300 - -php-java-bridge (4.0.6-1) unstable; urgency=low - - * New upstream version - * C implementation is still the same as 4.0.1 - - -- Andre Felipe Machado Mon, 26 Mar 2007 13:18:49 -0300 - -php-java-bridge (4.0.2-1) unstable; urgency=low - - * New upstream version. - * C implementation is still the same as 4.0.1 - - -- Andre Felipe Machado Tue, 20 Mar 2007 08:25:26 -0300 - -php-java-bridge (4.0.1-2) unstable; urgency=low - - * Corrected the /debian subdir for new release and rebuild from cvs - tree on a real Debian Etch machine. - - -- Andre Felipe Machado Mon, 12 Mar 2007 15:52:15 -0300 - -php-java-bridge (3.2.1-1) unstable; urgency=low - - * Initial release - - -- Andre Felipe Machado Tue, 28 Nov 2006 12:10:27 -0200 - diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 7ed6ff8..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/debian/control b/debian/control deleted file mode 100644 index 1aed870..0000000 --- a/debian/control +++ /dev/null @@ -1,84 +0,0 @@ -Source: php-java-bridge -Section: web -Priority: optional -Maintainer: Andre Felipe Machado -Build-Depends: debhelper (>= 7.4.11~bpo50+1), libncurses5-dev (>= 5.5-2 ), libselinux1-dev (>= 1.30 ), libsepol1-dev (>= 1.12.24 ), php5-dev (>= 5.1.0 ) , automake (>= 1.6.3 ) | automake1.7 | automake1.8 | automake1.9, sun-java6-jdk (>= 1 ), locales (>= 2.3.6.ds1-4 ), gcc (>= 3.2 ), make (>= 1 ), liblucene-java, libitext-java, dpatch, libtomcat5.5-java, libaprutil1-dev, libapr1-dev, libtcnative-1, php-pear, libsemanage1, checkpolicy, libapache2-mod-jk, selinux-policy-dev, apache2-prefork-dev, libxalan110, dh-make, dh-make-php, php5-cli -Standards-Version: 3.8.0 -XBS-Homepage: http://php-java-bridge.sourceforge.net - - - -Package: php-java-bridge-j2ee -Architecture: all -Depends: sun-java6-jre, tomcat5.5, liblucene-java, libitext-java, libapache2-mod-jk, php5-cli, php5-cgi, libaprutil1, libapr1, libtcnative-1, libxalan110 -Conflicts: php-java-bridge -Description: XML-based net connection protocol between PHP-Java / ECMA 335 vm - The PHP/Java Bridge is an optimized, XML-based network - protocol which can be used to connect a native script - engine with a Java or ECMA 335 virtual machine. - It is more than 50 times faster than local RPC via SOAP, - uses less resources on the web-server side and it is faster - and more reliable than a communication via the Java Native - Interface. - This Debian package installs the bridge J2EE server - implementation. - -Package: php-java-bridge-docs -Architecture: all -Depends: -Description: XML-based net connection protocol between PHP-Java / ECMA 335 vm - The PHP/Java Bridge is an optimized, XML-based network - protocol which can be used to connect a native script - engine with a Java or ECMA 335 virtual machine. - It is more than 50 times faster than local RPC via SOAP, - uses less resources on the web-server side and it is faster - and more reliable than a communication via the Java Native - Interface. - This Debian package installs user documentation. - -Package: php-java-bridge-j2ee-docs -Architecture: all -Depends: -Description: XML-based net connection protocol between PHP-Java / ECMA 335 vm - The PHP/Java Bridge is an optimized, XML-based network - protocol which can be used to connect a native script - engine with a Java or ECMA 335 virtual machine. - It is more than 50 times faster than local RPC via SOAP, - uses less resources on the web-server side and it is faster - and more reliable than a communication via the Java Native - Interface. - This Debian package installs J2EE server user documentation. - -Package: php-java-bridge-devel -Architecture: all -Depends: sun-java6-jdk, liblucene-java, libitext-java, php-java-bridge | php-java-bridge-j2ee -Description: XML-based net connection protocol between PHP-Java / ECMA 335 vm - The PHP/Java Bridge is an optimized, XML-based network - protocol which can be used to connect a native script - engine with a Java or ECMA 335 virtual machine. - It is more than 50 times faster than local RPC via SOAP, - uses less resources on the web-server side and it is faster - and more reliable than a communication via the Java Native - Interface. - This Debian package Contains the development documentation. - Also the development files needed to create java applications - with embedded PHP scripts. - -Package: php-java-bridge-j2ee-selinux -Architecture: all -Depends: sun-java6-jre, tomcat5.5, liblucene-java, libitext-java, php-java-bridge-j2ee -Description: XML-based net connection protocol between PHP-Java / ECMA 335 vm security - The PHP/Java Bridge is an optimized, XML-based network - protocol which can be used to connect a native script - engine with a Java or ECMA 335 virtual machine. - It is more than 50 times faster than local RPC via SOAP, - uses less resources on the web-server side and it is faster - and more reliable than a communication via the Java Native - Interface. - This Debian package installs the bridge J2EE server - SE Linux rules contained in the package devel, - examples/security/module directory. - This package works only for tomcat5.5 and SELinux default policy. - Other J2EE server or policy should compile and install from your - modified source. - diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index fb576c7..0000000 --- a/debian/copyright +++ /dev/null @@ -1,167 +0,0 @@ -This package was debianized by Andre Felipe Machado - on Thu, 23 Nov 2006 13:32:33 -0200. - -It was downloaded from http://php-java-bridge.sourceforge.net - -Upstream Author: http://php-java-bridge.sourceforge.net - -Copyright: 2006 http://php-java-bridge.sourceforge.net - -License: - - This package is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this package; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -On Debian systems, the complete text of the GNU Lesser General -Public License can be found in `/usr/share/common-licenses/LGPL'. - - -The Debian packaging is (C) 2006, Andre Felipe Machado - and is licensed under the GPL, -see `/usr/share/common-licenses/GPL'. - -Portions of the code are licensed under terms and conditions of -GNU Lesser General Public License (LGPL) 2.0. -A copy of the license is available at -http://www.gnu.org/copyleft/lesser.html - -Portions of code at unsupported/platforms/plugins are licensed under -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 -A copy of the license is available at -http://www.sun.com/cddl/cddl.html . - -Portions of code at unsupported/platforms/plugins are licensed under -Eclipse Public License Version 1.0 ("EPL"). -A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. - -Portions of Rhino code at unsupported/platforms/plugins are licensed under -Mozilla Public License Version 1.1 ("MPL"). -A copy of the license is available at -http://www.mozilla.org/MPL/MPL-1.1.html - -Portions of Rhino code at unsupported/platforms/plugins are licensed under -Netscape Public License Version 1.1 ("MPL"). -A copy of the license is available at -http://www.mozilla.org/MPL/NPL-1.1.html - -Portions of code at unsupported/platforms/plugins are licensed under -the terms and conditions of the Apache License, Version 2.0 ("Apache License"). -A copy of the license can be found at http://www.apache.org/licenses/LICENSE-2.0.txt. - -Portions of code at unsupported/platforms/plugins are licensed under -the terms and conditions of the W3C software license, dated December 31 2002 ("W3C License"). -A copy of the W3C License is vailable at http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231. - -Portions of code at unsupported/platforms/plugins are licensed under -the terms and conditions of the -UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE -A copy of the terms is available at http://www.unicode.org/copyright.html. - -Portions of code at unsupported/platforms/plugins are licensed under -the terms and conditions of the following text: - - Copyright (c) 2001 Sun Microsystems, Inc. All Rights Reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - -Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - -Redistribution in binary form must reproduct the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - Neither the name of Sun Microsystems, Inc. or the names of contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - - This software is provided "AS IS," without a warranty of any kind. ALL - EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY - IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR - NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE - LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING - OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS - LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, - INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER - CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF - OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE - POSSIBILITY OF SUCH DAMAGES. - - You acknowledge that Software is not designed or intended for use in - the design, construction, operation or maintenance of any nuclear facility. - - -Portions of code at unsupported/platforms/plugins are licensed under -the terms and conditions of the following text: - -The package com.lowagie.bc.asn1 was integrated into iText by Paulo Soares in November 2004. -This package is an adaptation of package org.bouncycastle.asn1 by The Legion of the Bouncy Castle. -This is the license of the org.bouncycastle.asn1 package: - -License -Copyright (c) 2000 - 2006 The Legion Of The Bouncy Castle (http://www.bouncycastle.org) -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE -AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -Portions of code at unsupported/platforms/plugins and of the Servlet code are licensed under -the terms and conditions of the Apache Software License, Version 1.1 -http://www.apache.org/licenses/LICENSE-1.1 - - -Portions of code of the servlet are licensed under -the terms and conditions of the following text: - -/* - * Copyright (C) 2003-2007 Jost Boekemeier - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - - - -Portions of code and or documentation are licensed under the terms and -conditions of the PHP License. -A copy of the license is available at -http://www.php.net/license/ - diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index 7f0465f..0000000 --- a/debian/dirs +++ /dev/null @@ -1,4 +0,0 @@ -etc/php5/conf.d -var/lib/tomcat5/webapps -usr/include/php5/java - diff --git a/debian/docs b/debian/docs deleted file mode 100644 index 410993a..0000000 --- a/debian/docs +++ /dev/null @@ -1,7 +0,0 @@ -ChangeLog -CREDITS -FAQ.html -NEWS -PROTOCOL.TXT -README -VERSION diff --git a/debian/install b/debian/install deleted file mode 100644 index 139597f..0000000 --- a/debian/install +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/debian/patches/00list b/debian/patches/00list deleted file mode 100644 index 1bb90a2..0000000 --- a/debian/patches/00list +++ /dev/null @@ -1,5 +0,0 @@ -20_SELinuxMakefileDebian_patch.dpatch -30_SELinuxTeTomcatDebian_patch.dpatch -50_SELinuxReadmeDebian_patch.dpatch - - diff --git a/debian/patches/20_SELinuxMakefileDebian_patch.dpatch b/debian/patches/20_SELinuxMakefileDebian_patch.dpatch deleted file mode 100755 index 7bbaf95..0000000 --- a/debian/patches/20_SELinuxMakefileDebian_patch.dpatch +++ /dev/null @@ -1,21 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 20_SELinuxMakefileDebian_patch.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: No description. - -@DPATCH@ -diff -urNad php-java-bridge~/security/module/Makefile php-java-bridge/security/module/Makefile ---- php-java-bridge~/security/module/Makefile 2009-07-01 17:34:05.000000000 -0300 -+++ php-java-bridge/security/module/Makefile 2009-07-01 17:35:03.000000000 -0300 -@@ -1,8 +1,9 @@ -+#!/usr/bin/make -f - - AWK ?= gawk - - NAME ?= $(shell $(AWK) -F= '/^SELINUXTYPE/{ print $$2 }' /etc/selinux/config) - SHAREDIR ?= /usr/share/selinux --HEADERDIR := $(SHAREDIR)/devel/include -+HEADERDIR := $(SHAREDIR)/$(NAME)/include - - include $(HEADERDIR)/Makefile diff --git a/debian/patches/30_SELinuxTeTomcatDebian_patch.dpatch b/debian/patches/30_SELinuxTeTomcatDebian_patch.dpatch deleted file mode 100755 index 037cf5f..0000000 --- a/debian/patches/30_SELinuxTeTomcatDebian_patch.dpatch +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 30_SELinuxTeTomcatDebian_patch.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: No description. - -@DPATCH@ -diff -urNad php-java-bridge~/security/module/php-java-bridge-tomcat.te.rej php-java-bridge/security/module/php-java-bridge-tomcat.te.rej ---- php-java-bridge~/security/module/php-java-bridge-tomcat.te.rej 1969-12-31 21:00:00.000000000 -0300 -+++ php-java-bridge/security/module/php-java-bridge-tomcat.te.rej 2010-05-04 16:48:22.000000000 -0300 -@@ -0,0 +1,11 @@ -+*************** -+*** 1,4 **** -+- policy_module(javabridge_tomcat,3.1.7) -+ -+ ######################################## -+ # -+--- 1,4 ---- -++ policy_module(javabridge_tomcat,6.1.2.1) -+ -+ ######################################## -+ # diff --git a/debian/patches/50_SELinuxReadmeDebian_patch.dpatch b/debian/patches/50_SELinuxReadmeDebian_patch.dpatch deleted file mode 100755 index 0f7a4c5..0000000 --- a/debian/patches/50_SELinuxReadmeDebian_patch.dpatch +++ /dev/null @@ -1,19 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 50_SELinuxReadmeDebian_patch.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: No description. - -@DPATCH@ -diff -urNad php-java-bridge~/security/module/README php-java-bridge/security/module/README ---- php-java-bridge~/security/module/README 2009-07-01 17:27:18.000000000 -0300 -+++ php-java-bridge/security/module/README 2009-07-01 17:39:24.000000000 -0300 -@@ -1,4 +1,6 @@ --Security Enhanced Linux rules for FC5, RHEL 5 and above. -+Security Enhanced Linux rules for FC5, RHEL 5, Debian 5.0 and above. - --Type make to build and semodule -i php-java-bridge.pp to install. -+Type make to build and semodule -i php-java-bridge.pp and -+semodule -i php-java-bridge-tomcat.pp to install. - -+Please, contribute better rules to the project. diff --git a/debian/php-java-bridge-devel.docs b/debian/php-java-bridge-devel.docs deleted file mode 100644 index 7bbae82..0000000 --- a/debian/php-java-bridge-devel.docs +++ /dev/null @@ -1,8 +0,0 @@ -ChangeLog -CREDITS -CVS_RELEASE.sh -FAQ.html -NEWS -PROTOCOL.TXT -README -VERSION diff --git a/debian/php-java-bridge-devel.examples b/debian/php-java-bridge-devel.examples deleted file mode 100644 index 010bfd1..0000000 --- a/debian/php-java-bridge-devel.examples +++ /dev/null @@ -1,9 +0,0 @@ -examples/* -php-java-bridge.spec -test.php -security -tests.jsr223 -tests.php5 -unsupported -server/php/ -php_java_lib diff --git a/debian/php-java-bridge-docs.docs b/debian/php-java-bridge-docs.docs deleted file mode 100644 index 410993a..0000000 --- a/debian/php-java-bridge-docs.docs +++ /dev/null @@ -1,7 +0,0 @@ -ChangeLog -CREDITS -FAQ.html -NEWS -PROTOCOL.TXT -README -VERSION diff --git a/debian/php-java-bridge-j2ee-docs.docs b/debian/php-java-bridge-j2ee-docs.docs deleted file mode 100644 index 8b13789..0000000 --- a/debian/php-java-bridge-j2ee-docs.docs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/debian/php-java-bridge-j2ee-selinux.dirs b/debian/php-java-bridge-j2ee-selinux.dirs deleted file mode 100644 index c177baf..0000000 --- a/debian/php-java-bridge-j2ee-selinux.dirs +++ /dev/null @@ -1,2 +0,0 @@ -usr/share/selinux/default - diff --git a/debian/php-java-bridge-j2ee-selinux.docs b/debian/php-java-bridge-j2ee-selinux.docs deleted file mode 100644 index 410993a..0000000 --- a/debian/php-java-bridge-j2ee-selinux.docs +++ /dev/null @@ -1,7 +0,0 @@ -ChangeLog -CREDITS -FAQ.html -NEWS -PROTOCOL.TXT -README -VERSION diff --git a/debian/php-java-bridge-j2ee-selinux.install b/debian/php-java-bridge-j2ee-selinux.install deleted file mode 100644 index ac960f9..0000000 --- a/debian/php-java-bridge-j2ee-selinux.install +++ /dev/null @@ -1,2 +0,0 @@ -security/module/php-java-bridge-tomcat.pp usr/share/selinux/default - diff --git a/debian/php-java-bridge-j2ee-selinux.postinst b/debian/php-java-bridge-j2ee-selinux.postinst deleted file mode 100644 index 4957f1b..0000000 --- a/debian/php-java-bridge-j2ee-selinux.postinst +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# postinst script for php-java-bridge -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-remove' -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - -javabridgetomcatselinuxpolicy=/usr/share/selinux/default/php-java-bridge-tomcat.pp -javabridgej2eepackage=php-java-bridge-j2ee-selinux -policystore=default - -case "$1" in - configure|install) - semodule --verbose --store $policystore --install=$javabridgetomcatselinuxpolicy; - ucfr $javabridgej2eepackage $javabridgetomcatselinuxpolicy; - invoke-rc.d tomcat5.5 restart; - ;; - upgrade) - semodule --verbose --store $policystore --upgrade=$javabridgetomcatselinuxpolicy; - ucfr $javabridgej2eepackage $javabridgetomcatselinuxpolicy; - invoke-rc.d tomcat5.5 restart; - ;; - abort-upgrade|abort-remove|abort-deconfigure) - invoke-rc.d tomcat5.5 restart; - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - diff --git a/debian/php-java-bridge-j2ee-selinux.postrm b/debian/php-java-bridge-j2ee-selinux.postrm deleted file mode 100644 index dc9de81..0000000 --- a/debian/php-java-bridge-j2ee-selinux.postrm +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -# postrm script for php-java-bridge -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `remove' -# * `purge' -# * `upgrade' -# * `failed-upgrade' -# * `abort-install' -# * `abort-install' -# * `abort-upgrade' -# * `disappear' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -javabridgetomcatselinuxpolicy=/usr/share/selinux/default/php-java-bridge-tomcat.pp -policystore=default -policymodulename=javabridge_tomcat -# semodule --remove operates on module NAME as defined at its source code. -# semodule --install operates on module FILE NAME. - - -case "$1" in - remove|upgrade) - invoke-rc.d tomcat5.5 restart; - ;; - - purge|failed-upgrade|abort-install|abort-upgrade|disappear) - if which ucf >/dev/null 2>&1; then - ucf --purge $javabridgetomcatselinuxpolicy; - fi - rm -f $javabridgetomcatselinuxpolicy; - semodule --verbose --store $policystore --remove=$policymodulename; - invoke-rc.d tomcat5.5 restart; - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - diff --git a/debian/php-java-bridge-j2ee-selinux.preinst b/debian/php-java-bridge-j2ee-selinux.preinst deleted file mode 100644 index 262be17..0000000 --- a/debian/php-java-bridge-j2ee-selinux.preinst +++ /dev/null @@ -1,42 +0,0 @@ -#! /bin/sh -# preinst script for %PACKAGE% -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `install' -# * `install' -# * `upgrade' -# * `abort-upgrade' -# -# For details see /usr/share/doc/packaging-manual/ - -case "$1" in - install|upgrade|configure) -# if [ "$1" = "upgrade" ] -# then -# start-stop-daemon --stop --quiet --oknodo \ -# --pidfile /var/run/%PACKAGE%.pid \ -# --exec /usr/sbin/%PACKAGE% 2>/dev/null || true -# fi - invoke-rc.d tomcat5.5 stop - ;; - - abort-upgrade) - ;; - - *) - echo "preinst called with unknown argument \`$1'" >&2 - exit 0 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - diff --git a/debian/php-java-bridge-j2ee.dirs b/debian/php-java-bridge-j2ee.dirs deleted file mode 100644 index 9e80a7c..0000000 --- a/debian/php-java-bridge-j2ee.dirs +++ /dev/null @@ -1,2 +0,0 @@ -etc/php5/conf.d -var/lib/tomcat5.5/webapps diff --git a/debian/php-java-bridge-j2ee.docs b/debian/php-java-bridge-j2ee.docs deleted file mode 100644 index 410993a..0000000 --- a/debian/php-java-bridge-j2ee.docs +++ /dev/null @@ -1,7 +0,0 @@ -ChangeLog -CREDITS -FAQ.html -NEWS -PROTOCOL.TXT -README -VERSION diff --git a/debian/php-java-bridge-j2ee.install b/debian/php-java-bridge-j2ee.install deleted file mode 100644 index deed2af..0000000 --- a/debian/php-java-bridge-j2ee.install +++ /dev/null @@ -1,3 +0,0 @@ -server/META-INF/java/Java.inc usr/include/php5/java -server/60JavaBridge.policy etc/tomcat5.5/policy.d - diff --git a/debian/php-java-bridge-j2ee.postinst b/debian/php-java-bridge-j2ee.postinst deleted file mode 100644 index ae347a8..0000000 --- a/debian/php-java-bridge-j2ee.postinst +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# postinst script for php-java-bridge -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-remove' -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - -TomCatUser=tomcat55 -TomCatGroup=adm -TomCatJavaBridgeSecurityPolicy=/etc/tomcat5.5/policy.d/60JavaBridge.policy - -case "$1" in - configure) - chown $TomCatUser:$TomCatGroup $TomCatJavaBridgeSecurityPolicy; - chmod 640 $TomCatJavaBridgeSecurityPolicy; - invoke-rc.d tomcat5.5 restart; - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - invoke-rc.d tomcat5.5 restart; - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - diff --git a/debian/php-java-bridge-j2ee.postrm b/debian/php-java-bridge-j2ee.postrm deleted file mode 100644 index 2053f13..0000000 --- a/debian/php-java-bridge-j2ee.postrm +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# postrm script for php-java-bridge -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `remove' -# * `purge' -# * `upgrade' -# * `failed-upgrade' -# * `abort-install' -# * `abort-install' -# * `abort-upgrade' -# * `disappear' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -javaini=/etc/php5/conf.d/java.ini -javaservletini=/etc/php5/conf.d/java-servlet.ini -javabridgetomcatpolicy=/etc/tomcat5.5/policy.d/60JavaBridge.policy - - -case "$1" in - remove|upgrade) - invoke-rc.d tomcat5.5 restart; - ;; - - purge|failed-upgrade|abort-install|abort-upgrade|disappear) - if which ucf >/dev/null 2>&1; then - ucf --purge $javaini; - ucf --purge $javaservletini; - ucf --purge $javabridgetomcatpolicy; - fi - rm -f $javaini; - rm -f $javaservletini; - rm -f $javabridgetomcatpolicy; - invoke-rc.d tomcat5.5 restart; - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - diff --git a/debian/php-java-bridge-j2ee.preinst b/debian/php-java-bridge-j2ee.preinst deleted file mode 100644 index 262be17..0000000 --- a/debian/php-java-bridge-j2ee.preinst +++ /dev/null @@ -1,42 +0,0 @@ -#! /bin/sh -# preinst script for %PACKAGE% -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `install' -# * `install' -# * `upgrade' -# * `abort-upgrade' -# -# For details see /usr/share/doc/packaging-manual/ - -case "$1" in - install|upgrade|configure) -# if [ "$1" = "upgrade" ] -# then -# start-stop-daemon --stop --quiet --oknodo \ -# --pidfile /var/run/%PACKAGE%.pid \ -# --exec /usr/sbin/%PACKAGE% 2>/dev/null || true -# fi - invoke-rc.d tomcat5.5 stop - ;; - - abort-upgrade) - ;; - - *) - echo "preinst called with unknown argument \`$1'" >&2 - exit 0 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - diff --git a/debian/php-java-bridge-selinux.dirs b/debian/php-java-bridge-selinux.dirs deleted file mode 100644 index c177baf..0000000 --- a/debian/php-java-bridge-selinux.dirs +++ /dev/null @@ -1,2 +0,0 @@ -usr/share/selinux/default - diff --git a/debian/php-java-bridge-selinux.docs b/debian/php-java-bridge-selinux.docs deleted file mode 100644 index 410993a..0000000 --- a/debian/php-java-bridge-selinux.docs +++ /dev/null @@ -1,7 +0,0 @@ -ChangeLog -CREDITS -FAQ.html -NEWS -PROTOCOL.TXT -README -VERSION diff --git a/debian/php-java-bridge-selinux.install b/debian/php-java-bridge-selinux.install deleted file mode 100644 index be81cc6..0000000 --- a/debian/php-java-bridge-selinux.install +++ /dev/null @@ -1,2 +0,0 @@ -security/module/php-java-bridge.pp usr/share/selinux/default - diff --git a/debian/php-java-bridge-selinux.postinst b/debian/php-java-bridge-selinux.postinst deleted file mode 100644 index 80322ed..0000000 --- a/debian/php-java-bridge-selinux.postinst +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# postinst script for php-java-bridge -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-remove' -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - -javabridgeselinuxpolicy=/usr/share/selinux/default/php-java-bridge.pp -javabridgepackage=php-java-bridge-selinux -policystore=default - -case "$1" in - configure|install) - semodule --verbose --store $policystore --install=$javabridgeselinuxpolicy; - ucfr $javabridgepackage $javabridgeselinuxpolicy; - invoke-rc.d apache2 restart; - ;; - upgrade) - semodule --verbose --store $policystore --upgrade=$javabridgeselinuxpolicy; - ucfr $javabridgepackage $javabridgeselinuxpolicy; - invoke-rc.d apache2 restart; - ;; - abort-upgrade|abort-remove|abort-deconfigure) - invoke-rc.d apache2 restart; - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - diff --git a/debian/php-java-bridge-selinux.postrm b/debian/php-java-bridge-selinux.postrm deleted file mode 100644 index e32c1dc..0000000 --- a/debian/php-java-bridge-selinux.postrm +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# postrm script for php-java-bridge -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `remove' -# * `purge' -# * `upgrade' -# * `failed-upgrade' -# * `abort-install' -# * `abort-install' -# * `abort-upgrade' -# * `disappear' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -javabridgeselinuxpolicy=/usr/share/selinux/default/php-java-bridge.pp -policystore=default -policymodulename=javabridge -# semodule --remove operates on module NAME as defined at its source code. -# semodule --install operates on module FILE NAME. - -case "$1" in - remove|upgrade) - invoke-rc.d apache2 restart; - ;; - - purge|failed-upgrade|abort-install|abort-upgrade|disappear) - if which ucf >/dev/null 2>&1; then - ucf --purge $javabridgeselinuxpolicy; - fi - rm -f $javabridgeselinuxpolicy; - semodule --verbose --store $policystore --remove=$policymodulename; - invoke-rc.d apache2 restart; - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - diff --git a/debian/php-java-bridge.dirs b/debian/php-java-bridge.dirs deleted file mode 100644 index 5a3b5ed..0000000 --- a/debian/php-java-bridge.dirs +++ /dev/null @@ -1,4 +0,0 @@ -etc/php5/conf.d -var/lib/tomcat5/webapps -usr/include/php5/java -usr/include/php5/mono diff --git a/debian/php-java-bridge.examples b/debian/php-java-bridge.examples deleted file mode 100644 index 0622089..0000000 --- a/debian/php-java-bridge.examples +++ /dev/null @@ -1,13 +0,0 @@ -examples/ -test.php -test.bat -test.sh -run-tests.php -security -tests.jsr223 -tests.mono+net -tests.php5 -tests.quercus -unsupported -server/php/ -php_java_lib diff --git a/debian/php-java-bridge.install b/debian/php-java-bridge.install deleted file mode 100644 index f1ca1d5..0000000 --- a/debian/php-java-bridge.install +++ /dev/null @@ -1,3 +0,0 @@ -java.ini etc/php5/conf.d -server/META-INF/java/Java.inc usr/include/php5/java - diff --git a/debian/postinst b/debian/postinst deleted file mode 100644 index 6aad486..0000000 --- a/debian/postinst +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# postinst script for php-java-bridge -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-remove' -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - configure) - invoke-rc.d apache2 restart; - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - invoke-rc.d apache2 restart; - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - diff --git a/debian/postrm b/debian/postrm deleted file mode 100644 index e3e1ccc..0000000 --- a/debian/postrm +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# postrm script for php-java-bridge -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `remove' -# * `purge' -# * `upgrade' -# * `failed-upgrade' -# * `abort-install' -# * `abort-install' -# * `abort-upgrade' -# * `disappear' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -javaini=/etc/php5/conf.d/java.ini - - - -case "$1" in - remove|upgrade) - invoke-rc.d apache2 restart; - ;; - - purge|failed-upgrade|abort-install|abort-upgrade|disappear) - if which ucf >/dev/null 2>&1; then - ucf --purge $javaini; - fi - rm -f $javaini; - invoke-rc.d apache2 restart; - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 809dca2..0000000 --- a/debian/rules +++ /dev/null @@ -1,283 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -export DH_VERBOSE=1 - -# Read http://wiki.debian.org/PkgSplit "How to split a package into several -# smaller packages" for details of this file. -# variables MUST be set outside target rules -# target rules MUST start at column 1, then followed by ":" -# actions MUST start after a TAB, not blank spaces -# builddir for using dh_install for .war files. - -# Copyright (C) 2009 Andre Felipe Machado -# et al from Debian Project http://www.debian.org , Joey Hess, Craig Small. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - BUILDDIR := debian/build - DESTDIR := ${CURDIR}/${BUILDDIR} - PHP_EXT_DIR := $(shell /usr/bin/php-config --extension-dir) - PHP_INCLUDE_DIR := $(shell /usr/bin/php-config --include-dir) - -CFLAGS = -Wall -g - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif - -# using dpatch for flexibility -configure: patchsource configure-stamp - -configure-stamp: - dh_testdir - # Add here commands to configure the package. - - touch configure-stamp - -build: build-stamp - -# using dpatch for flexibility, no mv anymore -build-stamp: configure - dh_testdir - # Add here commands to compile the package. - dh_auto_build --buildsystem=ant - #docbook-to-man debian/php-java-bridge.sgml > php-java-bridge.1 - #into makefiles, each line spawns own shell, so you need to write single line batches. - cd security/module; $(MAKE) -f Makefile; cd ../.. - touch $@ - -# using dpatch for flexibility -clean-patched: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - # Add here commands to clean up after the build process. - dh_auto_clean --buildsystem=ant - cd security/module; dh_auto_clean; cd ../.. - dh_clean -# rm -rf ${BUILDDIR} - -install: installbasic - - # Add here commands to install the package into debian/php-java-bridge. - -# specifiy destdir debian way - dh_auto_install --buildsystem=ant DESTDIR=${DESTDIR} - -# avoid multiple binary packages conflicts with --keep -installbasic: - dh_testdir - dh_testroot -# dh_clean --keep #deprecated form - dh_prep - cd security/module; dh_prep; cd ../.. - -# Build architecture-independent files here. -# creating also docs package without examples files. See /debian/*.docs file -binary-indep: php-java-bridge-devel php-java-bridge-j2ee php-java-bridge-j2ee-selinux binarydocs - -# creating j2ee package . See /debian/*j2ee.* files -# note the -p$@ to use target name package files in /debian as parameters -# this option defines that a given rule will act only at the specified package -# Caution: the -i option is for rule acting on ALL architecture INdependent -# packages at this WHOLE file, not only at where it is written. - -php-java-bridge-j2ee: - dh_testdir - dh_testroot - dh_installdirs -p$@ - dh_installchangelogs -p$@ ChangeLog - dh_installdocs -p$@ -# dh_installexamples -p$@ -# using dh_installdirs and dh_install for this task -# note the absence of leading "/" - dh_install --fail-missing --package=$@ dist/JavaBridge.war var/lib/tomcat5.5/webapps -# dh_install -i -p$@ -# dh_installmenu -i -# dh_installdebconf -i -# dh_installlogrotate -i -# dh_installemacsen -i -# dh_installpam -i -# dh_installmime -i -# dh_python -i -# dh_installinit -i -# dh_installcron -i -# dh_installinfo -i - dh_installman -p$@ - dh_link -p$@ - dh_strip -p$@ - dh_compress -p$@ - dh_fixperms -p$@ -# dh_perl -i - dh_makeshlibs -p$@ - dh_installdeb -p$@ - dh_shlibdeps -p$@ - dh_gencontrol -p$@ - dh_md5sums -p$@ - dh_builddeb -p$@ - - - -php-java-bridge-j2ee-selinux: - dh_testdir - dh_testroot - dh_installdirs -p$@ - dh_installchangelogs -p$@ ChangeLog - dh_installdocs -p$@ -# dh_installexamples -p$@ - dh_installdirs -p$@ - dh_install --fail-missing -p$@ -# dh_installmenu -i -# dh_installdebconf -i -# dh_installlogrotate -i -# dh_installemacsen -i -# dh_installpam -i -# dh_installmime -i -# dh_python -i -# dh_installinit -i -# dh_installcron -i -# dh_installinfo -i - dh_installman -p$@ - dh_link -p$@ - dh_strip -p$@ - dh_compress -p$@ - dh_fixperms -p$@ -# dh_perl -i - dh_makeshlibs -p$@ - dh_installdeb -p$@ - dh_shlibdeps -p$@ - dh_gencontrol -p$@ - dh_md5sums -p$@ - dh_builddeb -p$@ - - - -# creating devel package . See /debian/*devel.* files -# note the -p$@ to use target name package files in /debian as parameters -php-java-bridge-devel: - dh_testdir - dh_testroot - dh_installdirs -p$@ - dh_installchangelogs ChangeLog - dh_installdocs -p$@ - dh_installexamples -p$@ - dh_install --fail-missing -p$@ dist/*.jar $(PHP_INCLUDE_DIR)/ext/php-java-bridge -# dh_install -i -p$@ -# dh_installmenu -i -# dh_installdebconf -i -# dh_installlogrotate -i -# dh_installemacsen -i -# dh_installpam -i -# dh_installmime -i -# dh_python -i -# dh_installinit -i -# dh_installcron -i -# dh_installinfo -i - dh_installman -p$@ - dh_link -p$@ - dh_strip -p$@ - dh_compress -p$@ - dh_fixperms -p$@ -# dh_perl -i - dh_makeshlibs -p$@ - dh_installdeb -p$@ - dh_shlibdeps -p$@ - dh_gencontrol -p$@ - dh_md5sums -p$@ - dh_builddeb -p$@ - -# creating docs package without examples files. See /debian/*.docs file -# pitfall: packages have "-" in their name. -# Do not create intermediate rules with this character -binarydocs: php-java-bridge-docs php-java-bridge-j2ee-docs - -php-java-bridge-docs: - dh_testdir - dh_testroot - dh_installdirs -p$@ - dh_installchangelogs -p$@ ChangeLog - dh_installdocs -p$@ - dh_installman -p$@ - dh_link -p$@ - dh_strip -p$@ - dh_compress -p$@ - dh_fixperms -p$@ - dh_makeshlibs -p$@ - dh_installdeb -p$@ - dh_shlibdeps -p$@ - dh_gencontrol -p$@ - dh_md5sums -p$@ - dh_builddeb -p$@ - -php-java-bridge-j2ee-docs: - dh_testdir - dh_testroot - dh_installdirs -p$@ - dh_installchangelogs -p$@ ChangeLog - dh_installdocs -p$@ -# dh_installexamples -i -# dh_install -i -# dh_installmenu -i -# dh_installdebconf -i -# dh_installlogrotate -i -# dh_installemacsen -i -# dh_installpam -i -# dh_installmime -i -# dh_python -i -# dh_installinit -i -# dh_installcron -i -# dh_installinfo -i - dh_installman -p$@ - dh_link -p$@ - dh_strip -p$@ - dh_compress -p$@ - dh_fixperms -p$@ -# dh_perl -i - dh_makeshlibs -p$@ - dh_installdeb -p$@ - dh_shlibdeps -p$@ - dh_gencontrol -p$@ - dh_md5sums -p$@ - dh_builddeb -p$@ - -# Build architecture-dependent files here. -# Caution: the -a option is for rule acting on ALL architecture DEPENDENT -# packages at this WHOLE file, not only at where it is written. - -# build and install are implicit, but THIS package source needs 2 cycles. -# so the first cycle is implicity and this entry is for the second cycle. -binary: build install binary-indep -.PHONY: build build-stamp clean clean-patched binary-indep binarydocs binary install configure configure-stamp installdocs installbasic unpatch patchsource patch-stamp php-java-bridge-j2ee php-java-bridge-devel php-java-bridge-docs php-java-bridge-j2ee-docs php-java-bridge-j2ee-selinux - -# using dpatch for flexibility -unpatch: - dpatch deapply-all - rm -rf patch-stamp debian/patched - -patchsource: patch-stamp - -patch-stamp: - dpatch apply-all - dpatch cat-all >patch-stamp - -clean: clean-patched unpatch diff --git a/security/README b/security/README deleted file mode 100644 index 49157ba..0000000 --- a/security/README +++ /dev/null @@ -1,3 +0,0 @@ -Security Enhanced Linux rules for FC4 and below. - -Type sh ./update_policy.sh to install. diff --git a/security/module/Makefile b/security/module/Makefile deleted file mode 100644 index 3862c9c..0000000 --- a/security/module/Makefile +++ /dev/null @@ -1,8 +0,0 @@ - -AWK ?= gawk - -NAME ?= $(shell $(AWK) -F= '/^SELINUXTYPE/{ print $$2 }' /etc/selinux/config) -SHAREDIR ?= /usr/share/selinux -HEADERDIR := $(SHAREDIR)/devel/include - -include $(HEADERDIR)/Makefile diff --git a/security/module/README b/security/module/README deleted file mode 100644 index 6a68b9d..0000000 --- a/security/module/README +++ /dev/null @@ -1,4 +0,0 @@ -Security Enhanced Linux rules for FC5, RHEL 5 and above. - -Type make to build and semodule -i php-java-bridge.pp to install. - diff --git a/security/module/php-java-bridge-tomcat.fc.in b/security/module/php-java-bridge-tomcat.fc.in deleted file mode 100644 index 8b13789..0000000 --- a/security/module/php-java-bridge-tomcat.fc.in +++ /dev/null @@ -1 +0,0 @@ - diff --git a/security/module/php-java-bridge-tomcat.if b/security/module/php-java-bridge-tomcat.if deleted file mode 100644 index e69de29..0000000 diff --git a/security/module/php-java-bridge-tomcat.te b/security/module/php-java-bridge-tomcat.te deleted file mode 100644 index e0486bd..0000000 --- a/security/module/php-java-bridge-tomcat.te +++ /dev/null @@ -1,17 +0,0 @@ -policy_module(javabridge_tomcat,3.1.7) - -######################################## -# -# Declarations -# - -######################################## -# -# javabridge local policy -# -gen_require(` - type httpd_t, http_cache_port_t; -') - -allow httpd_t http_cache_port_t:tcp_socket name_connect; - diff --git a/security/module/php-java-bridge.fc.in b/security/module/php-java-bridge.fc.in deleted file mode 100644 index fa471c1..0000000 --- a/security/module/php-java-bridge.fc.in +++ /dev/null @@ -1,8 +0,0 @@ -# javabridge executable will have: -# label: system_u:object_r:javabridge_exec_t -# MLS sensitivity: s0 -# MCS categories: - -@EXTENSION_DIR@/RunJavaBridge -- gen_context(system_u:object_r:javabridge_exec_t,s0) -@EXTENSION_DIR@/java -- gen_context(system_u:object_r:bin_t,s0) - diff --git a/security/module/php-java-bridge.if b/security/module/php-java-bridge.if deleted file mode 100644 index bfb48f7..0000000 --- a/security/module/php-java-bridge.if +++ /dev/null @@ -1,24 +0,0 @@ -## javabridge example policy -# - -######################################## -## -## Execute a domain transition to run javabridge. -## -## -## Domain allowed to transition. -## -# -interface(`javabridge_domtrans',` - gen_require(` - type javabridge_t, javabridge_exec_t; - ') - - domain_auto_trans($1,javabridge_exec_t,javabridge_t) - - allow $1 javabridge_t:fd use; - allow javabridge_t $1:fd use; - allow javabridge_t $1:fifo_file rw_file_perms; - allow javabridge_t $1:process sigchld; - allow javabridge_t $1:process sighup; -') diff --git a/security/module/php-java-bridge.te b/security/module/php-java-bridge.te deleted file mode 100644 index 52a9f0d..0000000 --- a/security/module/php-java-bridge.te +++ /dev/null @@ -1,134 +0,0 @@ -policy_module(javabridge,5.5.1) - -######################################## -# -# Declarations -# - -type javabridge_t; -type javabridge_exec_t; -init_daemon_domain(javabridge_t,javabridge_exec_t) - -domain_type(javabridge_t) -domain_entry_file(javabridge_t, javabridge_exec_t) - -type javabridge_tmp_t; -files_tmp_file(javabridge_tmp_t) - -type javabridge_var_run_t; -files_pid_file(javabridge_var_run_t) - -######################################## -# -# javabridge local policy -# -gen_require(` - type httpd_log_t,sbin_t,inaddr_any_node_t,netif_t,lo_node_t,httpd_sys_content_t,port_t,var_log_t,devpts_t,httpd_t,java_exec_t,user_tmp_t; -') - -#################### -# Domain transitions -domain_auto_trans(httpd_t, javabridge_exec_t, javabridge_t) - - -##################### -# tmp -allow javabridge_t javabridge_tmp_t:dir create_dir_perms; -allow javabridge_t javabridge_tmp_t:dir { write search rmdir read remove_name add_name }; -allow javabridge_t javabridge_tmp_t:file { read write unlink }; -allow javabridge_t javabridge_tmp_t:file create_file_perms; -allow javabridge_t javabridge_tmp_t:file rename; -allow javabridge_t tmpfs_t:dir search; -files_tmp_filetrans(javabridge_t,javabridge_tmp_t,{ file dir }) - - -########### -allow javabridge_t devpts_t:chr_file { read write }; -allow javabridge_t javabridge_exec_t:file execute_no_trans; -allow javabridge_t self:process { execmem signal }; -allow javabridge_t self:unix_stream_socket { accept listen }; - -######### -# Connect from httpd. -allow httpd_t javabridge_exec_t:file getattr; -allow httpd_t javabridge_t:unix_stream_socket connectto; - -# Connect from httpd using tcp sockets -allow javabridge_t self:tcp_socket { accept bind connect create getattr listen read setopt write shutdown }; -allow javabridge_t port_t:tcp_socket { name_bind name_connect recv_msg send_msg }; - -corenet_tcp_sendrecv_generic_if(javabridge_t) -#corenet_non_ipsec_sendrecv(javabridge_t) -corenet_all_recvfrom_unlabeled(javabridge_t) -allow javabridge_t lo_node_t:node { tcp_recv tcp_send }; -allow javabridge_t lo_node_t:tcp_socket node_bind; - -dontaudit javabridge_t inaddr_any_node_t:tcp_socket node_bind; -dontaudit javabridge_t sbin_t:dir search; -######### - -################################## -# /usr/bin/java -corecmd_exec_bin(javabridge_t); -# /usr/bin/gij -allow javabridge_t java_exec_t:file { execute execute_no_trans read }; - -kernel_read_network_state(javabridge_t) -kernel_read_system_state(javabridge_t) -kernel_read_all_sysctls(javabridge_t) -kernel_search_vm_sysctl(javabridge_t) - -# compatibility with fedora 10, fedora 11 -#userdom_write_user_tmp_sockets(javabridge_t) -files_search_tmp(javabridge_t) -write_sock_files_pattern(javabridge_t, user_tmp_t, user_tmp_t) - - -dev_read_sound(javabridge_t) -dev_write_sound(javabridge_t) -dev_read_urand(javabridge_t) -dev_read_rand(javabridge_t) - -files_read_etc_files(javabridge_t) -files_read_usr_files(javabridge_t) -files_search_var_lib(javabridge_t) -files_read_etc_runtime_files(javabridge_t) -# Read global fonts and font config -files_read_etc_files(javabridge_t) - -fs_getattr_xattr_fs(javabridge_t) -fs_dontaudit_rw_tmpfs_files(javabridge_t) - -libs_use_ld_so(javabridge_t) -libs_use_shared_libs(javabridge_t) - -miscfiles_read_localization(javabridge_t) -# Read global fonts and font config -miscfiles_read_fonts(javabridge_t) - -################################################### -# Read /var/www -allow javabridge_t httpd_sys_content_t:dir list_dir_perms; -allow javabridge_t httpd_sys_content_t:file read_file_perms; -allow javabridge_t httpd_sys_content_t:lnk_file {getattr read}; - -sysnet_read_config(javabridge_t) - -################################################### -# Running the back-end as a sub-component of apache -apache_use_fds(javabridge_t) -apache_sigchld(javabridge_t) -allow javabridge_t httpd_t:fifo_file rw_file_perms; -allow httpd_t javabridge_t:process { sigkill signal }; -# append to apache log -allow javabridge_t httpd_log_t:file append; -allow javabridge_t self:fifo_file { getattr read write }; -allow javabridge_t self:process { getsched sigkill }; - -#################################################### -# Insane settings needed for sun java 1.5. Comment this out, if you -# can. -allow javabridge_t javabridge_tmp_t:file { execute }; -allow javabridge_t usr_t:file { execute }; -allow javabridge_t locale_t:file { execute }; -allow javabridge_t random_device_t:chr_file { append }; diff --git a/security/php-java-bridge-tomcat.te b/security/php-java-bridge-tomcat.te deleted file mode 100644 index 86dc1b0..0000000 --- a/security/php-java-bridge-tomcat.te +++ /dev/null @@ -1,7 +0,0 @@ -################################# -# php-java-bridge-tomcat.te -# additional tomcat SELinux rules for the javabridge_t domain -# -# @see php-java-bridge.te - -allow httpd_t http_cache_port_t:tcp_socket name_connect; diff --git a/security/php-java-bridge.fc.in b/security/php-java-bridge.fc.in deleted file mode 100644 index 78c5eb5..0000000 --- a/security/php-java-bridge.fc.in +++ /dev/null @@ -1,6 +0,0 @@ -################################# -# php-java-bridge.fc -# SELinux file contexts for the bridge -# -@EXTENSION_DIR@/RunJavaBridge -- system_u:object_r:javabridge_exec_t -@EXTENSION_DIR@/java -- system_u:object_r:bin_t diff --git a/security/php-java-bridge.te b/security/php-java-bridge.te deleted file mode 100644 index ca3817f..0000000 --- a/security/php-java-bridge.te +++ /dev/null @@ -1,83 +0,0 @@ -################################# -# php-java-bridge.te -# SELinux rules for the javabridge_t domain -# -# javabridge_exec_t is the type of the javabridge -# executable "RunJavaBridge", see php-java-bridge.fc - -daemon_domain(javabridge, `, nscd_client_domain'); -# log_domain(javabridge); -tmp_domain(javabridge); - -# Domain transitions -#################### -domain_auto_trans(httpd_t, javabridge_exec_t, javabridge_t) - -# -- base file read access --------- -# We can't use the base_file_read_access macro on FC3. -# The following is a copy of the FC4 macro: - -# Read /. -allow javabridge_t root_t:dir r_dir_perms; -allow javabridge_t root_t:notdevfile_class_set r_file_perms; - -# Read /usr. -allow javabridge_t usr_t:dir r_dir_perms; -allow javabridge_t usr_t:notdevfile_class_set r_file_perms; - -# Read bin and sbin directories. -allow javabridge_t bin_t:dir r_dir_perms; -allow javabridge_t bin_t:notdevfile_class_set r_file_perms; -allow javabridge_t sbin_t:dir r_dir_perms; -allow javabridge_t sbin_t:notdevfile_class_set r_file_perms; -read_sysctl(javabridge_t) -# --- end base file read access --- - -can_exec_any(javabridge_t) - -general_domain_access(javabridge_t) -general_proc_read_access(javabridge_t) - -# we currently have no log directory -allow javabridge_t var_log_t:dir { add_name write search }; -allow javabridge_t var_log_t:file { create append write }; - -################################ -# Connect from httpd. -can_unix_connect(httpd_t, javabridge_t) - -# Connect from httpd using tcp sockets -allow javabridge_t self:tcp_socket { accept bind connect create getattr listen read setopt write shutdown }; -allow javabridge_t port_t:tcp_socket { name_bind name_connect recv_msg send_msg }; -allow javabridge_t netif_lo_t:netif { tcp_recv tcp_send }; -allow javabridge_t node_lo_t:node { tcp_recv tcp_send }; -allow javabridge_t node_lo_t:tcp_socket node_bind; - -dontaudit javabridge_t node_inaddr_any_t:tcp_socket node_bind; -dontaudit javabridge_t sbin_t:dir search; -################################ - -# Read locale data -read_locale(javabridge_t) - -# Access random device -allow javabridge_t { urandom_device_t random_device_t }:chr_file r_file_perms; - -# Read /etc -allow javabridge_t etc_runtime_t:{ file lnk_file } r_file_perms; - -# Read /var/www -r_dir_file(javabridge_t, httpd_sys_content_t) - -################################################### -# Running the back-end as a sub-component of apache -allow javabridge_t httpd_log_t:file append; -allow httpd_t javabridge_t:process { sigkill signal }; - - -# Insane settings needed for sun java 1.5. Comment this out, if you -# can. -allow javabridge_t javabridge_tmp_t:file { execute }; -allow javabridge_t usr_t:file { execute }; -allow javabridge_t locale_t:file { execute }; -allow javabridge_t random_device_t:chr_file { append }; diff --git a/security/update_policy.sh.in b/security/update_policy.sh.in deleted file mode 100644 index 8c12fd9..0000000 --- a/security/update_policy.sh.in +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -if test $# != 1; then - echo "Usage: $0 " - echo "Example: $0 /etc/selinux/targeted/src/policy" - exit 1; -fi - -if ! test -f ${1}/Makefile; then - echo "ERROR: SEL policy sources not installed. Please install them." - exit 2; -fi - -PATH=/usr/sbin:/sbin:$PATH - -enforce=`getenforce` -setenforce 0 -domains=${1}/domains -contexts=${1}/file_contexts -cat `dirname $0`/php-java-bridge*.te >$domains/program/php-java-bridge.te && -cat `dirname $0`/php-java-bridge*.fc >$contexts/program/php-java-bridge.fc && -make -C $1 install && -make -C $1 reload && -EXT=@EXTENSION_DIR@ -mkdir ${EXT}/lib 2>/dev/null -for i in ${EXT}/RunJavaBridge ${EXT}/java.so ${EXT}/libnatcJavaBridge.so ${EXT}/lib; do -if test -f $i; then setfiles -d ${1}/file_contexts/file_contexts $i; fi -done -err=$? -setenforce $enforce -if test $err != 0; then - echo "ERROR: $err." - exit 1 -else - echo "SELinux policy files for php-java-bridge installed." - exit 0 -fi diff --git a/server/META-INF/java/.cvsignore b/server/META-INF/java/.cvsignore deleted file mode 100644 index 1e7b082..0000000 --- a/server/META-INF/java/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -JavaProxy.php -Java.inc diff --git a/test.php b/test.php deleted file mode 100755 index d642dfb..0000000 --- a/test.php +++ /dev/null @@ -1,42 +0,0 @@ -getProperties(); - - /* convert the result object into a PHP array */ - $array = java_values($props); - foreach($array as $k=>$v) { - echo "$k=>$v"; echo "
\n"; - } - echo "
\n"; - - /* create a PHP class which implements the Java toString() method */ - class MyClass { - function toString() { return "hello PHP from Java!"; } - } - - /* create a Java object from the PHP object */ - $javaObject = java_closure(new MyClass()); - echo "PHP says that Java says: "; echo $javaObject; echo "
\n"; - echo "
\n"; - - - echo java("php.java.bridge.Util")->VERSION; echo "
\n"; - -} catch (JavaException $ex) { - echo "An exception occured: "; echo $ex; echo "
\n"; -} - -?> From 573ff07591ab7c58b12a7fd3f5ddc96edf73537e Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Tue, 24 Jan 2017 16:05:58 +0100 Subject: [PATCH 31/75] getting better all the time... --- .gitignore | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 71cb839..abf1cd1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,17 +5,17 @@ build/ dist/ bin/ lib/ -nbproject/ doc/API/ .classpath +nbproject/ nbbuild.xml +.nb-gradle/ +.nb-gradle-properties manifest.mf *.iml *.lock *.log devNull -server/META-INF/java/Java.inc -server/META-INF/java/JavaProxy.php src/main/java/io/soluble/pjb/bridge/JavaInc.java src/main/java/io/soluble/pjb/bridge/JavaProxy.java src/main/java/io/soluble/pjb/bridge/LauncherUnix.java @@ -25,7 +25,5 @@ src/main/java/io/soluble/pjb/bridge/LauncherWindows3.java src/main/java/io/soluble/pjb/bridge/LauncherWindows4.java src/main/resources/META-INF/java/Java.inc src/main/resources/META-INF/java/JavaProxy.php -/.nb-gradle/ -.nb-gradle-properties src/main/webapp/java/Java.inc src/main/webapp/java/JavaProxy.php From 720ce5d5716a8d323063d5fd28071203cbac9821 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Tue, 24 Jan 2017 16:07:09 +0100 Subject: [PATCH 32/75] fixing code gen targets genJavaInc, genJavaProxyPhP --- build.xml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/build.xml b/build.xml index 198312d..b09a7a4 100644 --- a/build.xml +++ b/build.xml @@ -14,6 +14,10 @@ + + + + @@ -25,30 +29,30 @@ - - - - - - - - - + + + + + + + + + - + - + - + From ee4af2ccf7ad663ddda9c60cf14c844d676c430d Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Tue, 24 Jan 2017 17:45:44 +0100 Subject: [PATCH 33/75] comment hardcoded php command --- build.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.xml b/build.xml index b09a7a4..4dc32f5 100644 --- a/build.xml +++ b/build.xml @@ -9,7 +9,7 @@ - + From 0f4f40ede860004dd6c82da11688d9b1d5a42f89 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Tue, 24 Jan 2017 18:56:07 +0100 Subject: [PATCH 34/75] fix ant targets bug: keep java directory --- src/main/resources/META-INF/java/.gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/main/resources/META-INF/java/.gitkeep diff --git a/src/main/resources/META-INF/java/.gitkeep b/src/main/resources/META-INF/java/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/main/resources/META-INF/java/.gitkeep @@ -0,0 +1 @@ + From c4651918ad26c5a6282741db218e1f25341b7487 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Tue, 24 Jan 2017 19:12:57 +0100 Subject: [PATCH 35/75] cleanup temp file --- manifest.mf | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 manifest.mf diff --git a/manifest.mf b/manifest.mf deleted file mode 100644 index 328e8e5..0000000 --- a/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - From 3f9fc4ca13e5c47f9e7f658d19a17534f6ae8f8f Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Tue, 24 Jan 2017 19:13:16 +0100 Subject: [PATCH 36/75] fix version number --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 024b066..1a400c8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.2.1 +6.2.11 From 57f979c29ec0c2a0a1326c166d615bce34e89beb Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Tue, 24 Jan 2017 19:15:12 +0100 Subject: [PATCH 37/75] fix ant targets bug: keep java directory --- src/main/webapp/java/.gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/main/webapp/java/.gitkeep diff --git a/src/main/webapp/java/.gitkeep b/src/main/webapp/java/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/main/webapp/java/.gitkeep @@ -0,0 +1 @@ + From 7a2ec3996c53c7fdd91adaca759378415b8faac9 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" <> Date: Wed, 25 Jan 2017 12:03:44 +0100 Subject: [PATCH 38/75] Pass -Dphp_exec= to Ant targets Make genrating Java.inc, JavaProxy.php conditional --- build.xml | 54 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/build.xml b/build.xml index 4dc32f5..84ac896 100644 --- a/build.xml +++ b/build.xml @@ -1,6 +1,6 @@ - - + + @@ -9,7 +9,7 @@ - + @@ -26,8 +26,15 @@ - - + + + + + + + + + @@ -44,8 +51,15 @@ - - + + + + + + + + + @@ -55,7 +69,7 @@ - + @@ -65,7 +79,7 @@ - + @@ -75,7 +89,7 @@ - + @@ -85,7 +99,7 @@ - + @@ -106,7 +120,7 @@ - + @@ -201,7 +215,7 @@ - + @@ -219,7 +233,7 @@ - + @@ -229,7 +243,7 @@ - + @@ -238,7 +252,7 @@ - + @@ -248,7 +262,7 @@ - + @@ -258,7 +272,7 @@ - + @@ -268,7 +282,7 @@ - + @@ -276,7 +290,7 @@ - + From 52cbdcaac09a36167c95c64f4442e4e393f15697 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Wed, 25 Jan 2017 12:12:49 +0100 Subject: [PATCH 39/75] Revert "Pass -Dphp_exec= to Ant targets" This reverts commit 7a2ec3996c53c7fdd91adaca759378415b8faac9. --- build.xml | 54 ++++++++++++++++++++---------------------------------- 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/build.xml b/build.xml index 84ac896..4dc32f5 100644 --- a/build.xml +++ b/build.xml @@ -1,6 +1,6 @@ - - + + @@ -9,7 +9,7 @@ - + @@ -26,15 +26,8 @@ - - - - - - - - - + + @@ -51,15 +44,8 @@ - - - - - - - - - + + @@ -69,7 +55,7 @@ - + @@ -79,7 +65,7 @@ - + @@ -89,7 +75,7 @@ - + @@ -99,7 +85,7 @@ - + @@ -120,7 +106,7 @@ - + @@ -215,7 +201,7 @@ - + @@ -233,7 +219,7 @@ - + @@ -243,7 +229,7 @@ - + @@ -252,7 +238,7 @@ - + @@ -262,7 +248,7 @@ - + @@ -272,7 +258,7 @@ - + @@ -282,7 +268,7 @@ - + @@ -290,7 +276,7 @@ - + From 2c2aca11e1b6ef9a0ee36dfc8718a98ce9664960 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Wed, 25 Jan 2017 12:19:12 +0100 Subject: [PATCH 40/75] Pass -Dphp_exec to Ant targets; Make genrating Java.inc, JavaProxy.php conditional --- build.gradle | 14 +++++++++----- build.xml | 36 +++++++++++++++++++++++++----------- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index 2bb113d..0b2cbf8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,10 @@ group 'io.soluble.pjb' version '6.2.11' -ant.importBuild 'build.xml' - apply plugin: 'java' apply plugin: 'jacoco' apply plugin: 'war' -apply plugin: 'com.bmuschko.tomcat' // provides embedded tomcat 7 +apply plugin: 'com.bmuschko.tomcat' // provides embedded tomcat 7 for testing purposes compileJava.options.encoding = 'UTF-8' compileTestJava.options.encoding = 'UTF-8' @@ -21,7 +19,7 @@ repositories { dependencies { providedCompile('javax.servlet:servlet-api:2.5') - testCompile('junit:junit:3.8.2') // the project still uses this junit API + testCompile('junit:junit:3.8.2') // the test code still uses this junit API def tomcatVersion = '7.0.59' tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}", @@ -31,6 +29,12 @@ dependencies { } } +if (System.getProperty('php_exec') == null) { + ant.properties['php_exec'] = 'php' +} + +ant.importBuild 'build.xml' + jar { baseName "JavaBridge" manifest { @@ -41,6 +45,7 @@ jar { } war { + dependsOn jar baseName "JavaBridge" //from 'src/rootContent' // adds a file-set to the root of the archive } @@ -74,4 +79,3 @@ buildscript { [tomcatRun, tomcatRunWar]*.contextPath = '/JavaBridge' [tomcatRun, tomcatRunWar]*.daemon = true - diff --git a/build.xml b/build.xml index 4dc32f5..246ad82 100644 --- a/build.xml +++ b/build.xml @@ -1,6 +1,6 @@ - - + + @@ -9,7 +9,7 @@ - + @@ -26,8 +26,15 @@ - - + + + + + + + + + @@ -44,8 +51,15 @@ - - + + + + + + + + + @@ -55,7 +69,7 @@ - + @@ -65,7 +79,7 @@ - + @@ -75,7 +89,7 @@ - + @@ -85,7 +99,7 @@ - + From 36543112c4bb3418975a605900422f6b04059e1f Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Wed, 25 Jan 2017 17:07:19 +0100 Subject: [PATCH 41/75] task tomcatRunWar should not be used --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 0b2cbf8..e275eab 100644 --- a/build.gradle +++ b/build.gradle @@ -77,5 +77,5 @@ buildscript { } } -[tomcatRun, tomcatRunWar]*.contextPath = '/JavaBridge' -[tomcatRun, tomcatRunWar]*.daemon = true +tomcatRun.contextPath = '/JavaBridge' +tomcatRun.daemon = true From e2d2f453e9085e1c5dfd3ae858aa23672bd93243 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Wed, 25 Jan 2017 17:08:01 +0100 Subject: [PATCH 42/75] minor changes --- src/main/webapp/index.jsp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index 1c4a4d9..e4f3d3b 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -1,13 +1,11 @@ <%@page contentType="text/html" pageEncoding="UTF-8"%> - - + - PhpJavaBridge Home Page + PhpJavaBridge Home -

PhpJavaBridge Home Page

+

PhpJavaBridge Home

From 3c363e9f3b274c4703349caa37291e85c24fe632 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Thu, 26 Jan 2017 07:09:28 +0100 Subject: [PATCH 43/75] code quality enhancements --- .../java/io/soluble/pjb/bridge/ILogger.java | 14 +- .../java/io/soluble/pjb/bridge/Invocable.java | 2 - .../io/soluble/pjb/bridge/JavaBridge.java | 970 +++++++++++------- .../java/io/soluble/pjb/bridge/PhpMap.java | 3 +- .../java/io/soluble/pjb/bridge/Session.java | 18 +- .../io/soluble/pjb/bridge/SessionFactory.java | 10 +- 6 files changed, 603 insertions(+), 414 deletions(-) diff --git a/src/main/java/io/soluble/pjb/bridge/ILogger.java b/src/main/java/io/soluble/pjb/bridge/ILogger.java index d200f38..0fd8647 100644 --- a/src/main/java/io/soluble/pjb/bridge/ILogger.java +++ b/src/main/java/io/soluble/pjb/bridge/ILogger.java @@ -35,26 +35,26 @@ public interface ILogger { /** * fatal log level */ - public static final int FATAL = 1; + static final int FATAL = 1; /** * error log level */ - public static final int ERROR = 2; + static final int ERROR = 2; /** * info log level */ - public static final int INFO = 3; + static final int INFO = 3; /** * debug log level */ - public static final int DEBUG = 4; + static final int DEBUG = 4; /** * Log a stack trace * * @param t The Throwable */ - public void printStackTrace(Throwable t); + void printStackTrace(Throwable t); /** * Log a message. @@ -62,12 +62,12 @@ public interface ILogger { * @param level The log level 0: FATAL, 1:ERROR, 2: INFO, 3: DEBUG * @param msg The message */ - public void log(int level, String msg); + void log(int level, String msg); /** * Display a warning if logLevel >= 1 * * @param msg The warn message */ - public void warn(String msg); + void warn(String msg); } diff --git a/src/main/java/io/soluble/pjb/bridge/Invocable.java b/src/main/java/io/soluble/pjb/bridge/Invocable.java index 60fbf6a..8c28131 100644 --- a/src/main/java/io/soluble/pjb/bridge/Invocable.java +++ b/src/main/java/io/soluble/pjb/bridge/Invocable.java @@ -2,8 +2,6 @@ package io.soluble.pjb.bridge; -import io.soluble.pjb.bridge.*; - /* * Copyright (C) 2003-2007 Jost Boekemeier * diff --git a/src/main/java/io/soluble/pjb/bridge/JavaBridge.java b/src/main/java/io/soluble/pjb/bridge/JavaBridge.java index 8f6ba42..934c71e 100644 --- a/src/main/java/io/soluble/pjb/bridge/JavaBridge.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaBridge.java @@ -1,7 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - /* * Copyright (C) 2003-2007 Jost Boekemeier and others. * @@ -23,6 +19,7 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; import java.beans.BeanInfo; import java.beans.Introspector; @@ -50,8 +47,7 @@ import java.util.Map.Entry; /** - * This is the main interface of the PHP/Java Bridge. It - * contains utility methods which can be used by clients. + * This is the main interface of the PHP/Java Bridge. It contains utility methods which can be used by clients. * * @author Sam Ruby (methods coerce and select) * @author Kai Londenberg @@ -59,19 +55,30 @@ * @see io.soluble.pjb.bridge.Standalone * @see io.soluble.pjb.servlet.PhpJavaServlet */ -public class JavaBridge implements Runnable { +public final class JavaBridge implements Runnable { + static final int DISPLAY_MAX_ELEMENTS = 10; + static final int DISPLAY_MAX_CHARS = 80; + static final String PHPSESSION = "PHPSESSION"; + static final String INTERNAL_PHPSESSION = "INTERNAL_PHPSESSION"; + static final HashMap SESSION_HASH = new HashMap(); + + private final MethodCache methodCache = new MethodCache(); + private final ConstructorCache constructorCache = new ConstructorCache(); + + boolean canModifySecurityPermission = true; // false if we detect that setAccessible is not possible + StringCache stringCache = new StringCache(this); + Options options; + /** * For PHP4's last_exception_get. */ - public Throwable lastException = null; - protected Throwable lastAsyncException; // reported by end_document() + Throwable lastException = null; + Throwable lastAsyncException; // reported by end_document() // array of objects in use in the current script GlobalRef globalRef = new GlobalRef(); - static HashMap sessionHash = new HashMap(); - /** * For internal use only. The input stream for the current channel. */ @@ -86,6 +93,19 @@ public class JavaBridge implements Runnable { */ public int logLevel = Util.logLevel; + /** + * For internal use only. The current request (if any) + */ + public Request request; + + + /** + * For internal use only. + */ + private IJavaBridgeFactory sessionFactory; + private Object o[] = new Object[1]; + private Class c[] = new Class[1]; + /** * Return the log level: *
@@ -105,19 +125,23 @@ public int getLogLevel() { /** * Handle requests from the InputStream, write the responses to OutputStream * - * @param in the InputStream - * @param out the OutputStream - * @param logger the default logger can be obtained via getServletContext().getAttribute(ContextLoaderListener.LOGGER) + * @param in the InputStream + * @param out the OutputStream + * @param logger the default logger can be obtained via + * getServletContext().getAttribute(ContextLoaderListener.LOGGER) * @throws IOException * @deprecated Example: *
* - * protected void doPut (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
- *   IContextFactory ctx = new RemoteHttpServletContextFactory(this, getServletContext(), req, req, resr);
+ * protected void doPut (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { + *
+ *   IContextFactory ctx = new RemoteHttpServletContextFactory(this, getServletContext(), req, req, + * resr);
*   res.setHeader("X_JAVABRIDGE_CONTEXT", ctx.getId());
*   res.setHeader("Pragma", "no-cache");
*   res.setHeader("Cache-Control", "no-cache");
- *   try { ctx.getBridge().handleRequests(req.getInputStream(), res.getOutputStream(), myLogge); } finally { ctx.destroy(); }
+ *   try { ctx.getBridge().handleRequests(req.getInputStream(), res.getOutputStream(), myLogge); } finally + * { ctx.destroy(); }
* } *
*
@@ -129,20 +153,23 @@ public void handleRequests(InputStream in, OutputStream out, ILogger logger) thr /** * Handle requests from the InputStream, write the responses to OutputStream * - * @param in the InputStream + * @param in the InputStream * @param out the OutputStream * @throws IOException Example: - *
- * - * protected void doPut (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
- *   IContextFactory ctx = new RemoteHttpServletContextFactory(this, getServletContext(), req, req, resr);
- *   res.setHeader("X_JAVABRIDGE_CONTEXT", ctx.getId());
- *   res.setHeader("Pragma", "no-cache");
- *   res.setHeader("Cache-Control", "no-cache");
- *   try { ctx.getBridge().handleRequests(req.getInputStream(), res.getOutputStream(), myLogge); } finally { ctx.destroy(); }
- * } - *
- *
+ *
+ * + * protected void doPut (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { + *
+ *   IContextFactory ctx = new RemoteHttpServletContextFactory(this, getServletContext(), req, req, + * resr);
+ *   res.setHeader("X_JAVABRIDGE_CONTEXT", ctx.getId());
+ *   res.setHeader("Pragma", "no-cache");
+ *   res.setHeader("Cache-Control", "no-cache");
+ *   try { ctx.getBridge().handleRequests(req.getInputStream(), res.getOutputStream(), myLogge); } finally + * { ctx.destroy(); }
+ * } + *
+ *
*/ public void handleRequests(InputStream in, OutputStream out) throws IOException { this.request = new Request(this); @@ -157,34 +184,18 @@ public void handleRequests(InputStream in, OutputStream out) throws IOException } - /** - * For internal use only. The current request (if any) - */ - public Request request; - - // false if we detect that setAccessible is not possible - boolean canModifySecurityPermission = true; - private MethodCache methodCache = new MethodCache(); - private ConstructorCache constructorCache = new ConstructorCache(); - StringCache stringCache = new StringCache(this); - - /** - * For internal use only. - */ - private IJavaBridgeFactory sessionFactory; - /** * Return the session/jsr223 factory associated with this bridge * * @return The session/jsr223 factory */ public IJavaBridgeFactory getFactory() { - if (sessionFactory == null) throw new NullPointerException("session factory"); + if (sessionFactory == null) { + throw new NullPointerException("session factory"); + } return sessionFactory; } - Options options; - /** * Returns the connection options * @@ -194,7 +205,6 @@ public Options getOptions() { return options; } - /** * Communication with client in a new thread */ @@ -204,7 +214,9 @@ public void run() { request = new Request(this); try { - if (!request.init(in, out)) return; + if (!request.init(in, out)) { + return; + } } catch (Throwable e) { printStackTrace(e); return; @@ -221,15 +233,19 @@ public void run() { } catch (Exception t) { printStackTrace(t); } finally { - if (in != null) try { - in.close(); - } catch (IOException e1) { - printStackTrace(e1); + if (in != null) { + try { + in.close(); + } catch (IOException e1) { + printStackTrace(e1); + } } - if (out != null) try { - out.close(); - } catch (IOException e2) { - printStackTrace(e2); + if (out != null) { + try { + out.close(); + } catch (IOException e2) { + printStackTrace(e2); + } } sessionFactory.destroy(); } @@ -247,11 +263,9 @@ public static ISocketFactory bind(String sockname) throws IOException { } /** - * Global init. Redirects System.out and System.err to the server - * log file(s) or to System.err and creates and opens the - * communcation channel. Note: Do not write anything to - * System.out, this stream is connected with a pipe which waits - * for the channel name. + * Global init. Redirects System.out and System.err to the server log file(s) or to System.err and creates and opens + * the communcation channel. Note: Do not write anything to System.out, this stream is connected with a pipe which + * waits for the channel name. * * @param s an array of [socketname, level, logFile] */ @@ -263,7 +277,9 @@ public static void init(String s[]) { static void initLog(String socket, int logLevel, String s[]) { String logFile = null, rawLogFile = null; - if (logLevel == -1) logLevel = Util.DEFAULT_LOG_LEVEL; + if (logLevel == -1) { + logLevel = Util.DEFAULT_LOG_LEVEL; + } Util.logLevel = logLevel; try { @@ -271,11 +287,14 @@ static void initLog(String socket, int logLevel, String s[]) { rawLogFile = logFile = s.length > 0 ? "" : Util.DEFAULT_LOG_FILE; if (s.length > 2) { rawLogFile = logFile = s[2]; - if (Util.setConfiguredLogger(logFile)) + if (Util.setConfiguredLogger(logFile)) { logFile = null; // when log4j is used, System.out and System.err are not redirected - else + } else { Util.setDefaultLogger(new FileLogger()); // use specified log file - if (Util.logLevel > 3) System.err.println(Util.EXTENSION_NAME + " log: " + rawLogFile); + } + if (Util.logLevel > 3) { + System.err.println(Util.EXTENSION_NAME + " log: " + rawLogFile); + } } } catch (Throwable t) { t.printStackTrace(); @@ -283,8 +302,9 @@ static void initLog(String socket, int logLevel, String s[]) { Util.redirectOutput(logFile); Util.logMessage("VM : " + Util.VM_NAME); - if (Util.VERSION != null) + if (Util.VERSION != null) { Util.logMessage(Util.EXTENSION_NAME + " version : " + Util.VERSION); + } Util.logMessage("logFile : " + rawLogFile); Util.logMessage("default logLevel : " + Util.logLevel); Util.logMessage("socket : " + socket); @@ -333,7 +353,7 @@ static void init(ISocketFactory socket, int logLevel, String s[]) { } } - } catch (Throwable t) { + } catch (IOException t) { throw new RuntimeException(t); } } @@ -342,28 +362,24 @@ static void init(ISocketFactory socket, int logLevel, String s[]) { * Start the PHP/Java Bridge.
* Example:
* java -Djava.awt.headless=true -jar JavaBridge.jar INET:9656 5 /var/log/php-java-bridge.log
- * Note: Do not write anything to System.out, this - * stream is connected with a pipe which waits for the channel name. + * Note: Do not write anything to System.out, this stream is connected with a pipe which waits for the channel name. * - * @param s an array of [socketname, level, logFile] - * Use Standalone.main() + * @param s an array of [socketname, level, logFile] Use Standalone.main() * @see io.soluble.pjb.bridge.Standalone#main(String[]) */ public static void main(String s[]) { Standalone.main(s); } - /** * Print a stack trace to the log file. * * @param t the throwable */ public void printStackTrace(Throwable t) { - if (logLevel > 0) - if ((t instanceof Error) || logLevel > 1) { - Util.getLogger().printStackTrace(t); - } + if (logLevel > 0 && ((t instanceof Error) || logLevel > 1)) { + Util.getLogger().printStackTrace(t); + } } private String getId() { @@ -376,7 +392,9 @@ private String getId() { * @param msg The message */ public void logDebug(String msg) { - if (logLevel > 3) Util.println(4, getId() + " " + msg); + if (logLevel > 3) { + Util.println(4, getId() + " " + msg); + } } /** @@ -385,7 +403,9 @@ public void logDebug(String msg) { * @param msg The message */ public void logFatal(String msg) { - if (logLevel > 0) Util.println(1, getId() + " " + msg); + if (logLevel > 0) { + Util.println(1, getId() + " " + msg); + } } /** @@ -394,7 +414,9 @@ public void logFatal(String msg) { * @param msg The message */ public void logError(String msg) { - if (logLevel > 1) Util.println(2, getId() + " " + msg); + if (logLevel > 1) { + Util.println(2, getId() + " " + msg); + } } /** @@ -403,7 +425,9 @@ public void logError(String msg) { * @param msg The message */ public void logMessage(String msg) { - if (logLevel > 2) Util.println(3, getId() + " " + msg); + if (logLevel > 2) { + Util.println(3, getId() + " " + msg); + } } /** @@ -412,14 +436,20 @@ public void logMessage(String msg) { * @param msg The warning. */ public void warn(String msg) { - if (logLevel > 0) Util.warn(getId() + " " + msg); + if (logLevel > 0) { + Util.warn(getId() + " " + msg); + } } void setException(Response response, Throwable e, String method, Object obj, String name, Object args[], Class params[], boolean hasDeclaredExceptions) { if (e instanceof InvocationTargetException) { Throwable t = ((InvocationTargetException) e).getTargetException(); - if (t != null) e = t; - if (logLevel > 3 || (!options.preferValues() && !hasDeclaredExceptions)) printStackTrace(e); + if (t != null) { + e = t; + } + if (logLevel > 3 || (!options.preferValues() && !hasDeclaredExceptions)) { + printStackTrace(e); + } } else { printStackTrace(e); } @@ -448,26 +478,28 @@ void setException(Response response, Throwable e, String method, Object obj, Str lastException = new Exception(buf.toString(), e); StackTraceElement[] trace = e.getStackTrace(); - if (trace != null) lastException.setStackTrace(trace); + if (trace != null) { + lastException.setStackTrace(trace); + } response.setResultException(lastException, hasDeclaredExceptions); } private Exception getUnresolvedExternalReferenceException(Throwable e, String what) { - return new ClassNotFoundException("Unresolved external reference: " + e + ". -- " + - "Unable to " + what + ", see the README section \"Java platform issues\" " + - "for details and DO NOT REPORT THIS PROBLEM TO THE PHP/Java Bridge MAILING LIST!", e); + return new ClassNotFoundException("Unresolved external reference: " + e + ". -- " + + "Unable to " + what + ", see the README section \"Java platform issues\" " + + "for details and DO NOT REPORT THIS PROBLEM TO THE PHP/Java Bridge MAILING LIST!", e); } /** * Create an new instance of a given class, to be called by clients. * - * @param name The class name + * @param name The class name * @param createInstance true if we should create an instance, false otherwise - * @param args The argument array - * @param response The response writer + * @param args The argument array + * @param response The response writer */ public void CreateObject(String name, boolean createInstance, - Object args[], Response response) { + Object args[], Response response) { Class params[] = null; LinkedList candidates = new LinkedList(); LinkedList matches = new LinkedList(); @@ -483,23 +515,25 @@ public void CreateObject(String name, boolean createInstance, selected = constructorCache.get(entry); if (selected == null) { Constructor cons[] = clazz.getConstructors(); - for (int i = 0; i < cons.length; i++) { - candidates.add(cons[i]); - if (cons[i].getParameterTypes().length == args.length) { - matches.add(cons[i]); + for (Constructor con : cons) { + candidates.add(con); + if (con.getParameterTypes().length == args.length) { + matches.add(con); } } selected = (Constructor) select(matches, args); - if (selected != null) constructorCache.put(entry, selected); + if (selected != null) { + constructorCache.put(entry, selected); + } } } if (selected == null) { if (args.length > 0) { - throw createInstance ? - (Exception) new InstantiationException("No matching constructor found. " + "Candidates: " + String.valueOf(candidates)) : - (Exception) new JavaBridgeIllegalArgumentException("ReferenceClass must be called w/o arguments; either write new JavaClass(\"" + name + "\") or new Java(\"" + name + "\", args...)."); + throw createInstance + ? (Exception) new InstantiationException("No matching constructor found. " + "Candidates: " + String.valueOf(candidates)) + : (Exception) new JavaBridgeIllegalArgumentException("ReferenceClass must be called w/o arguments; either write new JavaClass(\"" + name + "\") or new Java(\"" + name + "\", args...)."); } else { // for classes which have no visible constructor, return the class // useful for classes like java.lang.System and java.util.Calendar. @@ -511,7 +545,7 @@ public void CreateObject(String name, boolean createInstance, } } - Object coercedArgs[] = coerce(params = entry.getParameterTypes(selected), args, response); + Object coercedArgs[] = coerce(params = entry.getParameterTypes(selected), args, response); //TODO possible null pointer // If we have a logLevel of 5 or above, do very detailed invocation logging hasDeclaredExceptions = selected.getExceptionTypes().length != 0; if (this.logLevel > 4) { @@ -523,7 +557,9 @@ public void CreateObject(String name, boolean createInstance, } } catch (Throwable e) { Throwable e1 = e; - if (e1 instanceof InvocationTargetException) e1 = ((InvocationTargetException) e1).getTargetException(); + if (e1 instanceof InvocationTargetException) { + e1 = ((InvocationTargetException) e1).getTargetException(); + } if (e1 instanceof Request.AbortException) { throw (Request.AbortException) e1; } @@ -546,8 +582,8 @@ public void CreateObject(String name, boolean createInstance, private int weight(Class param, Class arg, Object phpArrayValue) { int w = 0; if (param.isAssignableFrom(arg)) { - for (Class c = arg; (c = c.getSuperclass()) != null; ) { - if (!param.isAssignableFrom(c)) { + for (Class clazz = arg; (clazz = clazz.getSuperclass()) != null;) { + if (!param.isAssignableFrom(clazz)) { break; } w += 16; // prefer more specific arg, for @@ -555,18 +591,21 @@ private int weight(Class param, Class arg, Object phpArrayValue) { // over Object hashMap. } } else if (param == java.lang.String.class) { - if (!(String.class.isAssignableFrom(arg)) && !(PhpString.class.isAssignableFrom(arg))) - if (byte[].class.isAssignableFrom(arg)) + if (!(String.class.isAssignableFrom(arg)) && !(PhpString.class.isAssignableFrom(arg))) { + if (byte[].class.isAssignableFrom(arg)) { w += 32; - else + } else { w += 8000; // conversion to string is always possible + } + } } else if (param.isArray()) { if (PhpString.class.isAssignableFrom(arg)) { - Class c = param.getComponentType(); - if (c == byte.class) + Class clazz = param.getComponentType(); + if (clazz == byte.class) { w += 32; - else + } else { w += 9999; + } } else if (arg == PhpArray.class) { Iterator iterator = phpArrayValue == null ? EMPTY_ITERATOR : ((Map) phpArrayValue).values().iterator(); if (iterator.hasNext()) { @@ -581,30 +620,51 @@ private int weight(Class param, Class arg, Object phpArrayValue) { if (ptype != atype) { w += (ptype == Object.class ? 10 : 8200) + weight(ptype, atype, null); } - } else w += 9999; + } else { + w += 9999; + } } else if ((java.util.Collection.class).isAssignableFrom(param)) { - if (java.util.Map.class.isAssignableFrom(arg)) w += 8100; // conversion to Collection is always possible - else if (!(PhpArray.class.isAssignableFrom(arg))) w += 9999; + if (java.util.Map.class.isAssignableFrom(arg)) { + w += 8100; // conversion to Collection is always possible + } else if (!(PhpArray.class.isAssignableFrom(arg))) { + w += 9999; + } } else if (param.isPrimitive()) { - Class c = param; + Class clazz = param; if (Number.class.isAssignableFrom(arg)) { if (Double.class.isAssignableFrom(arg)) { - if (c == Float.TYPE) w += 1; - else if (c == Double.TYPE) w += 0; - else w += 256; + if (clazz == Float.TYPE) { + w += 1; + } else if (clazz == Double.TYPE) { + w += 0; + } else { + w += 256; + } } else { - if (c == Boolean.TYPE) w += 5; - else if (c == Character.TYPE) w += 4; - else if (c == Byte.TYPE) w += 3; - else if (c == Short.TYPE) w += 2; - else if (c == Integer.TYPE) w += 1; - else if (c == Long.TYPE) w += 0; - else w += 256; + if (clazz == Boolean.TYPE) { + w += 5; + } else if (clazz == Character.TYPE) { + w += 4; + } else if (clazz == Byte.TYPE) { + w += 3; + } else if (clazz == Short.TYPE) { + w += 2; + } else if (clazz == Integer.TYPE) { + w += 1; + } else if (clazz == Long.TYPE) { + w += 0; + } else { + w += 256; + } } } else if (Boolean.class.isAssignableFrom(arg)) { - if (c != Boolean.TYPE) w += 9999; + if (clazz != Boolean.TYPE) { + w += 9999; + } } else if (Character.class.isAssignableFrom(arg)) { - if (c != Character.TYPE) w += 9999; + if (clazz != Character.TYPE) { + w += 9999; + } } else if ((String.class.isAssignableFrom(arg)) || (PhpString.class.isAssignableFrom(arg))) { w += 64; } else { @@ -612,66 +672,80 @@ private int weight(Class param, Class arg, Object phpArrayValue) { } } else if (Number.class.isAssignableFrom(param)) { if (param == Float.class || param == Double.class) { - if (!(Double.class.isAssignableFrom(arg))) w += 9999; - } else if (!(PhpExactNumber.class.isAssignableFrom(arg))) w += 9999; + if (!(Double.class.isAssignableFrom(arg))) { + w += 9999; + } + } else if (!(PhpExactNumber.class.isAssignableFrom(arg))) { + w += 9999; + } } else { w += 9999; } - if (logLevel > 4) logDebug("weight " + param + " " + arg + ": " + w); + if (logLevel > 4) { + logDebug("weight " + param + " " + arg + ": " + w); + } return w; } private Object select(LinkedList methods, Object args[]) { - if (methods.size() == 1) return methods.getFirst(); + if (methods.size() == 1) { + return methods.getFirst(); + } Object similar = null, selected = null; int best = Integer.MAX_VALUE; - int n = 0; - - for (Iterator e = methods.iterator(); e.hasNext(); n++) { + for (Iterator e = methods.iterator(); e.hasNext();) { Object element = e.next(); int w = 0; - Class parms[] = (element instanceof Method) ? - ((Method) element).getParameterTypes() : - ((Constructor) element).getParameterTypes(); + Class parms[] = (element instanceof Method) + ? ((Method) element).getParameterTypes() + : ((Constructor) element).getParameterTypes(); for (int i = 0; i < parms.length; i++) { Object arg = args[i]; - if (arg != null) + if (arg != null) { w += weight(parms[i], arg.getClass(), arg); + } } if (w < best) { if (w == 0) { - if (logLevel > 4) logDebug("Selected: " + element + " " + w); + if (logLevel > 4) { + logDebug("Selected: " + element + " " + w); + } return element; } best = w; selected = element; if (logLevel > 2) { similar = null; - if (logLevel > 4) logDebug("best: " + selected + " " + w); + if (logLevel > 4) { + logDebug("best: " + selected + " " + w); + } } } else { if (logLevel > 2) { - if (w == best) similar = element; - if (logLevel > 4) logDebug("skip: " + element + " " + w); + if (w == best) { + similar = element; + } + if (logLevel > 4) { + logDebug("skip: " + element + " " + w); + } } } } if (logLevel > 2 && similar != null) { StringBuffer buf = new StringBuffer(); - for (int i = 0; i < args.length; i++) { - Util.appendParam(args[i], buf); + for (Object arg : args) { + Util.appendParam(arg, buf); } logMessage("Portability warning: " + selected + " and " + similar + " both match " + buf.toString()); } - if (logLevel > 4) logDebug("Selected: " + selected + " " + best); + if (logLevel > 4) { + logDebug("Selected: " + selected + " " + best); + } return selected; } - private Object o[] = new Object[1]; - private Class c[] = new Class[1]; - Object coerce(Class param, Object arg, Response response) { o[0] = arg; c[0] = param; @@ -690,28 +764,39 @@ Object[] coerce(Class parms[], Object args[], Response response) { int size = 0; for (int i = 0; i < args.length; i++) { - if ((arg = args[i]) == null) continue; + if ((arg = args[i]) == null) { + continue; + } if (parms[i] == String.class) { - if (arg instanceof PhpString) + if (arg instanceof PhpString) { result[i] = ((PhpString) arg).getString(); - else + } else { result[i] = arg.toString(); + } } else if (arg instanceof PhpString || arg instanceof String) { if (!parms[i].isArray()) { - Class c = parms[i]; + Class clazz = parms[i]; String s = (arg instanceof String) ? (String) arg : ((PhpString) arg).getString(); result[i] = s; try { - if (c == Boolean.TYPE) result[i] = new Boolean(s); - else if (c == Byte.TYPE) result[i] = new Byte(s); - else if (c == Short.TYPE) result[i] = new Short(s); - else if (c == Integer.TYPE) result[i] = new Integer(s); - else if (c == Float.TYPE) result[i] = new Float(s); - else if (c == Double.TYPE) result[i] = new Double(s); - else if (c == Long.TYPE) result[i] = new Long(s); - else if (c == Character.TYPE && s.length() > 0) - result[i] = new Character(s.charAt(0)); + if (clazz == Boolean.TYPE) { + result[i] = Boolean.valueOf(s); + } else if (clazz == Byte.TYPE) { + result[i] = new Byte(s); + } else if (clazz == Short.TYPE) { + result[i] = new Short(s); + } else if (clazz == Integer.TYPE) { + result[i] = new Integer(s); + } else if (clazz == Float.TYPE) { + result[i] = new Float(s); + } else if (clazz == Double.TYPE) { + result[i] = new Double(s); + } else if (clazz == Long.TYPE) { + result[i] = new Long(s); + } else if (clazz == Character.TYPE && s.length() > 0) { + result[i] = s.charAt(0); + } } catch (NumberFormatException n) { printStackTrace(n); // oh well, we tried! @@ -721,24 +806,31 @@ else if (c == Character.TYPE && s.length() > 0) } } else if (arg instanceof Number) { if (parms[i].isPrimitive()) { - Class c = parms[i]; + Class clazz = parms[i]; Number n = (Number) arg; - if (c == Boolean.TYPE) result[i] = new Boolean(0.0 != n.floatValue()); - else if (c == Byte.TYPE) result[i] = new Byte(n.byteValue()); - else if (c == Short.TYPE) result[i] = new Short(n.shortValue()); - else if (c == Integer.TYPE) result[i] = new Integer(n.intValue()); - else if (c == Float.TYPE) result[i] = new Float(n.floatValue()); - else if (c == Double.TYPE) result[i] = new Double(n.doubleValue()); - else if (c == Long.TYPE && !(n instanceof Long)) - result[i] = new Long(n.longValue()); + if (clazz == Boolean.TYPE) { + result[i] = 0.0 != n.floatValue(); + } else if (clazz == Byte.TYPE) { + result[i] = n.byteValue(); + } else if (clazz == Short.TYPE) { + result[i] = n.shortValue(); + } else if (clazz == Integer.TYPE) { + result[i] = n.intValue(); + } else if (clazz == Float.TYPE) { + result[i] = n.floatValue(); + } else if (clazz == Double.TYPE) { + result[i] = n.doubleValue(); + } else if (clazz == Long.TYPE && !(n instanceof Long)) { + result[i] = n.longValue(); + } } else { if (arg.getClass() == PhpExactNumber.class) { { - Class c = parms[i]; - if (c.isAssignableFrom(Integer.class)) { - result[i] = new Integer(((Number) arg).intValue()); + Class clazz = parms[i]; + if (clazz.isAssignableFrom(Integer.class)) { + result[i] = ((Number) arg).intValue(); } else { - result[i] = new Long(((Number) arg).longValue()); + result[i] = ((Number) arg).longValue(); } } } @@ -761,7 +853,7 @@ else if (c == Long.TYPE && !(n instanceof Long)) throw new JavaBridgeIllegalArgumentException("Could not create array from Map: " + firstChars(arg), ex); } try { - for (Iterator ii = ht.entrySet().iterator(); ii.hasNext(); ) { + for (Iterator ii = ht.entrySet().iterator(); ii.hasNext();) { e = (Entry) ii.next(); Array.set(tempArray, ((Number) (e.getKey())).intValue(), coerce(targetType, e.getValue(), response)); } @@ -773,18 +865,20 @@ else if (c == Long.TYPE && !(n instanceof Long)) } else if ((java.util.Collection.class).isAssignableFrom(parms[i])) { try { Map m = (Map) arg; - Collection c = m.values(); - if (!parms[i].isInstance(c)) + Collection coll = m.values(); + if (!parms[i].isInstance(coll)) { try { // could be a concrete class, for example LinkedList. Collection collection = (Collection) parms[i].newInstance(); - collection.addAll(c); - c = collection; + collection.addAll(coll); + coll = collection; } catch (Exception e) { // it was an interface, try some concrete class try { - c = new ArrayList(c); - } catch (Exception ex) {/*we've tried*/} + coll = new ArrayList(coll); + } catch (Exception ex) {/*we've tried*/ + } } - result[i] = c; + } + result[i] = coll; } catch (Exception ex) { //logError("Could not create Collection from Map: " +objectDebugDescription(arg) + ". Cause: " + ex); throw new JavaBridgeIllegalArgumentException("Could not create Collection from Map: " + firstChars(arg), ex); @@ -812,6 +906,7 @@ else if (c == Long.TYPE && !(n instanceof Long)) } static abstract class FindMatchingInterface { + JavaBridge bridge; String name; Object args[]; @@ -831,19 +926,21 @@ public boolean checkAccessible(AccessibleObject o) { } } - static final FindMatchingInterfaceVoid MATCH_VOID_ICASE = new FindMatchingInterfaceVoid(true); static final FindMatchingInterfaceVoid MATCH_VOID_CASE = new FindMatchingInterfaceVoid(false); static class FindMatchingInterfaceVoid extends FindMatchingInterface { + public FindMatchingInterfaceVoid(boolean b) { super(null, null, null, b); } + @Override Class findMatchingInterface(Class jclass) { return jclass; } + @Override public boolean checkAccessible(AccessibleObject o) { if (!o.isAccessible()) { try { @@ -857,20 +954,27 @@ public boolean checkAccessible(AccessibleObject o) { } static class FindMatchingInterfaceForInvoke extends FindMatchingInterface { + protected FindMatchingInterfaceForInvoke(JavaBridge bridge, String name, Object args[], boolean ignoreCase) { super(bridge, name, args, ignoreCase); } public static FindMatchingInterface getInstance(JavaBridge bridge, String name, Object args[], boolean ignoreCase, boolean canModifySecurityPermission) { - if (canModifySecurityPermission) return ignoreCase ? MATCH_VOID_ICASE : MATCH_VOID_CASE; - else return new FindMatchingInterfaceForInvoke(bridge, name, args, ignoreCase); + if (canModifySecurityPermission) { + return ignoreCase ? MATCH_VOID_ICASE : MATCH_VOID_CASE; + } else { + return new FindMatchingInterfaceForInvoke(bridge, name, args, ignoreCase); + } } + @Override Class findMatchingInterface(Class jclass) { - if (jclass == null) return jclass; - if (bridge.logLevel > 3) - if (bridge.logLevel > 3) - bridge.logDebug("searching for matching interface for Invoke for class " + jclass); + if (jclass == null) { + return jclass; + } + if (bridge.logLevel > 3) { + bridge.logDebug("searching for matching interface for Invoke for class " + jclass); + } while (!Modifier.isPublic(jclass.getModifiers())) { // OK, some joker gave us an instance of a non-public class // This often occurs in the case of enumerators @@ -878,15 +982,17 @@ Class findMatchingInterface(Class jclass) { // and barring that, try the superclass Class interfaces[] = jclass.getInterfaces(); Class superclass = jclass.getSuperclass(); - for (int i = interfaces.length; i-- > 0; ) { + for (int i = interfaces.length; i-- > 0;) { if (Modifier.isPublic(interfaces[i].getModifiers())) { jclass = interfaces[i]; Method methods[] = jclass.getMethods(); - for (int j = 0; j < methods.length; j++) { - String nm = methods[j].getName(); + for (Method method : methods) { + String nm = method.getName(); boolean eq = ignoreCase ? nm.equalsIgnoreCase(name) : nm.equals(name); - if (eq && (methods[j].getParameterTypes().length == args.length)) { - if (bridge.logLevel > 3) bridge.logDebug("matching interface for Invoke: " + jclass); + if (eq && (method.getParameterTypes().length == args.length)) { + if (bridge.logLevel > 3) { + bridge.logDebug("matching interface for Invoke: " + jclass); + } return jclass; } } @@ -894,26 +1000,35 @@ Class findMatchingInterface(Class jclass) { } jclass = superclass; } - if (bridge.logLevel > 3) bridge.logDebug("interface for Invoke: " + jclass); + if (bridge.logLevel > 3) { + bridge.logDebug("interface for Invoke: " + jclass); + } return jclass; } } static class FindMatchingInterfaceForGetSetProp extends FindMatchingInterface { + protected FindMatchingInterfaceForGetSetProp(JavaBridge bridge, String name, Object args[], boolean ignoreCase) { super(bridge, name, args, ignoreCase); } public static FindMatchingInterface getInstance(JavaBridge bridge, String name, Object args[], boolean ignoreCase, boolean canModifySecurityPermission) { - if (canModifySecurityPermission) return ignoreCase ? MATCH_VOID_ICASE : MATCH_VOID_CASE; - else return new FindMatchingInterfaceForGetSetProp(bridge, name, args, ignoreCase); + if (canModifySecurityPermission) { + return ignoreCase ? MATCH_VOID_ICASE : MATCH_VOID_CASE; + } else { + return new FindMatchingInterfaceForGetSetProp(bridge, name, args, ignoreCase); + } } + @Override Class findMatchingInterface(Class jclass) { - if (jclass == null) return jclass; - if (bridge.logLevel > 3) - if (bridge.logLevel > 3) - bridge.logDebug("searching for matching interface for GetSetProp for class " + jclass); + if (jclass == null) { + return jclass; + } + if (bridge.logLevel > 3) { + bridge.logDebug("searching for matching interface for GetSetProp for class " + jclass); + } while (!Modifier.isPublic(jclass.getModifiers())) { // OK, some joker gave us an instance of a non-public class // This often occurs in the case of enumerators @@ -921,16 +1036,17 @@ Class findMatchingInterface(Class jclass) { // and barring that, try the superclass Class interfaces[] = jclass.getInterfaces(); Class superclass = jclass.getSuperclass(); - for (int i = interfaces.length; i-- > 0; ) { + for (int i = interfaces.length; i-- > 0;) { if (Modifier.isPublic(interfaces[i].getModifiers())) { jclass = interfaces[i]; Field jfields[] = jclass.getFields(); - for (int j = 0; j < jfields.length; j++) { - String nm = jfields[j].getName(); + for (Field jfield : jfields) { + String nm = jfield.getName(); boolean eq = ignoreCase ? nm.equalsIgnoreCase(name) : nm.equals(name); if (eq) { - if (bridge.logLevel > 3) + if (bridge.logLevel > 3) { bridge.logDebug("matching interface for GetSetProp: " + jclass); + } return jclass; } } @@ -938,27 +1054,33 @@ Class findMatchingInterface(Class jclass) { } jclass = superclass; } - if (bridge.logLevel > 3) bridge.logDebug("interface for GetSetProp: " + jclass); + if (bridge.logLevel > 3) { + bridge.logDebug("interface for GetSetProp: " + jclass); + } return jclass; } } private static ClassIterator getClassClassIterator(Class clazz) { - if (clazz == Class.class) return new MetaClassIterator(); + if (clazz == Class.class) { + return new MetaClassIterator(); + } return new ClassClassIterator(); } private static abstract class ClassIterator { + Object object; Class current; FindMatchingInterface match; public static ClassIterator getInstance(Object object, FindMatchingInterface match) { ClassIterator c; - if (object instanceof Class) + if (object instanceof Class) { c = getClassClassIterator((Class) object); - else + } else { c = new ObjectClassIterator(); + } c.match = match; c.object = object; @@ -974,25 +1096,32 @@ public static ClassIterator getInstance(Object object, FindMatchingInterface mat } static class ObjectClassIterator extends ClassIterator { + private Class next() { - if (current == null) return current = object.getClass(); + if (current == null) { + return current = object.getClass(); + } return null; } + @Override public Class getNext() { return match.findMatchingInterface(next()); } + @Override public boolean checkAccessible(AccessibleObject o) { return match.checkAccessible(o); } + @Override public boolean isVisible(int modifier) { return true; } } static class ClassClassIterator extends ClassIterator { + boolean hasNext = false; private Class next() { @@ -1008,14 +1137,17 @@ private Class next() { return null; } + @Override public Class getNext() { return next(); } + @Override public boolean checkAccessible(AccessibleObject o) { return true; } + @Override public boolean isVisible(int modifier) { // all members of the class class or only static members of the class return !hasNext || ((modifier & Modifier.STATIC) != 0); @@ -1023,6 +1155,7 @@ public boolean isVisible(int modifier) { } static class MetaClassIterator extends ClassIterator { + private Class next() { // The ClassClass has the ClassClass as its class if (current == null) { @@ -1031,14 +1164,17 @@ private Class next() { return null; } + @Override public Class getNext() { return next(); } + @Override public boolean checkAccessible(AccessibleObject o) { return true; } + @Override public boolean isVisible(int modifier) { return true; } @@ -1047,7 +1183,9 @@ public boolean isVisible(int modifier) { private static void logInvoke(Object obj, String method, Object args[]) { String dmsg = "\nInvoking " + objectDebugDescription(obj) + "." + method + "("; for (int t = 0; t < args.length; t++) { - if (t > 0) dmsg += ","; + if (t > 0) { + dmsg += ","; + } dmsg += objectDebugDescription(args[t]); } @@ -1063,14 +1201,13 @@ private static void logResult(Object obj) { /** * Invoke a method on a given object, to be called by clients. * - * @param object The object - * @param method The method of the object - * @param args The argument array + * @param object The object + * @param method The method of the object + * @param args The argument array * @param response The response writer * @throws NullPointerException If the object was null */ - public void Invoke - (Object object, String method, Object args[], Response response) { + public void Invoke(Object object, String method, Object args[], Response response) { Class jclass; boolean again; Object coercedArgs[] = null; @@ -1085,7 +1222,7 @@ private static void logResult(Object obj) { object = Request.PHPNULL; throw new NullPointerException("cannot call \"" + method + "()\" on a Java null object. A previous Java call has returned a null value, use java_is_null($jvalue) to check."); } - /* PR1616498: Do not use Util.getClass(): if object is a class, we must pass the class class. + /* PR1616498: Do not use Util.getClass(): if object is a class, we must pass the class class. * All VM, including gcc >= 3.3.3, return the class class for class.getClass(), not null. This is okay for the cache implementation. */ MethodCache.Entry entry = methodCache.getEntry(method, object, args); selected = (Method) methodCache.get(entry); @@ -1095,10 +1232,9 @@ private static void logResult(Object obj) { again = false; ClassIterator iter; if (selected == null) { - for (iter = ClassIterator.getInstance(object, FindMatchingInterfaceForInvoke.getInstance(this, method, args, true, canModifySecurityPermission)); (jclass = iter.getNext()) != null; ) { + for (iter = ClassIterator.getInstance(object, FindMatchingInterfaceForInvoke.getInstance(this, method, args, true, canModifySecurityPermission)); (jclass = iter.getNext()) != null;) { Method methods[] = jclass.getMethods(); - for (int i = 0; i < methods.length; i++) { - Method meth = methods[i]; + for (Method meth : methods) { if (meth.getName().equalsIgnoreCase(method) && iter.isVisible(meth.getModifiers())) { candidates.add(meth); if (meth.getParameterTypes().length == args.length) { @@ -1108,8 +1244,9 @@ private static void logResult(Object obj) { } } selected = (Method) select(matches, args); - if (selected == null) + if (selected == null) { checkM(object, String.valueOf(method) + "(" + Util.argsToString(args, params) + "). " + "Candidates: " + String.valueOf(candidates)); + } methodCache.put(entry, selected); if (!iter.checkAccessible(selected)) { logDebug("Security restriction: Cannot use setAccessible(), reverting to interface searching."); @@ -1122,7 +1259,7 @@ private static void logResult(Object obj) { coercedArgs = coerce(params = entry.getParameterTypes(selected), args, response); } while (again); - hasDeclaredExceptions = selected.getExceptionTypes().length != 0; + hasDeclaredExceptions = selected.getExceptionTypes().length != 0; //TODO possible null pointer // If we have a logLevel of 5 or above, do very detailed invocation logging if (this.logLevel > 4) { logInvoke(object, method, coercedArgs); @@ -1134,7 +1271,9 @@ private static void logResult(Object obj) { } } catch (Throwable e) { Throwable e1 = e; - if (e1 instanceof InvocationTargetException) e1 = ((InvocationTargetException) e1).getTargetException(); + if (e1 instanceof InvocationTargetException) { + e1 = ((InvocationTargetException) e1).getTargetException(); + } if (e1 instanceof Request.AbortException) { throw (Request.AbortException) e1; } @@ -1146,39 +1285,37 @@ private static void logResult(Object obj) { e = getUnresolvedExternalReferenceException(e1, "call the method"); } - if (selected != null && e1 instanceof IllegalArgumentException) { - if (this.logLevel > 3) { - String errMsg = "\nInvoked " + method + " on " + objectDebugDescription(object) + "\n"; - errMsg += " Expected Arguments for this Method:\n"; - Class paramTypes[] = selected.getParameterTypes(); - for (int k = 0; k < paramTypes.length; k++) { - errMsg += " (" + k + ") " + classDebugDescription(paramTypes[k]) + "\n"; - } - errMsg += " Plain Arguments for this Method:\n"; - for (int k = 0; k < args.length; k++) { - errMsg += " (" + k + ") " + objectDebugDescription(args[k]) + "\n"; - } - if (coercedArgs != null) { - errMsg += " Coerced Arguments for this Method:\n"; - for (int k = 0; k < coercedArgs.length; k++) { - errMsg += " (" + k + ") " + objectDebugDescription(coercedArgs[k]) + "\n"; - } + if (selected != null && e1 instanceof IllegalArgumentException && this.logLevel > 3) { + String errMsg = "\nInvoked " + method + " on " + objectDebugDescription(object) + "\n"; + errMsg += " Expected Arguments for this Method:\n"; + Class paramTypes[] = selected.getParameterTypes(); + for (int k = 0; k < paramTypes.length; k++) { + errMsg += " (" + k + ") " + classDebugDescription(paramTypes[k]) + "\n"; + } + errMsg += " Plain Arguments for this Method:\n"; + for (int k = 0; k < args.length; k++) { + errMsg += " (" + k + ") " + objectDebugDescription(args[k]) + "\n"; + } + if (coercedArgs != null) { + errMsg += " Coerced Arguments for this Method:\n"; + for (int k = 0; k < coercedArgs.length; k++) { + errMsg += " (" + k + ") " + objectDebugDescription(coercedArgs[k]) + "\n"; } - this.logDebug(errMsg); } + this.logDebug(errMsg); } setException(response, e, "Invoke", object, method, args, params, hasDeclaredExceptions); } } private void checkM(Object object, String string) throws NoSuchMethodException { - if (object instanceof Class) throw new NoSuchProcedureException(string); - else throw new NoSuchMethodException(string); + if (object instanceof Class) { + throw new NoSuchProcedureException(string); + } else { + throw new NoSuchMethodException(string); + } } - static private final int DISPLAY_MAX_ELEMENTS = 10; - static private final int DISPLAY_MAX_CHARS = 80; - private static String firstChars(Object o) { String append = ""; String s = o instanceof java.lang.reflect.Proxy ? o.getClass().getName() : String.valueOf(o); @@ -1208,13 +1345,21 @@ public static String objectDebugDescription(Object ob) { * @return A debug description. */ private static String objectDebugDescription(Object ob, int level) { - if (ob == null) return "[Object null]"; + if (ob == null) { + return "[Object null]"; + } Object obj = ob; - if (obj instanceof Collection) obj = ((Collection) obj).toArray(); - else if (obj instanceof List) obj = ((List) obj).toArray(); - else if (obj instanceof Map) obj = ((Map) obj).values().toArray(); + if (obj instanceof Collection) { + obj = ((Collection) obj).toArray(); + } else if (obj instanceof List) { + obj = ((List) obj).toArray(); + } else if (obj instanceof Map) { + obj = ((Map) obj).values().toArray(); + } if (level < DISPLAY_MAX_ELEMENTS && obj.getClass().isArray()) { - StringBuffer buf = new StringBuffer("[Object " + System.identityHashCode(ob) + " - Class: " + classDebugDescription(ob.getClass()) + "]: "); + StringBuilder buf + = new StringBuilder("[Object " + System.identityHashCode(ob) + + " - Class: " + classDebugDescription(ob.getClass()) + "]: "); buf.append("{\n"); int length = Array.getLength(obj); for (int i = 0; i < length; i++) { @@ -1245,14 +1390,13 @@ public static String classDebugDescription(Class cls) { /** * Get or Set a property, to be called by clients. * - * @param object The object - * @param prop The object property - * @param args The argument array + * @param object The object + * @param prop The object property + * @param args The argument array * @param response The response writer * @throws NullPointerException If the object is null */ - public void GetSetProp - (Object object, String prop, Object args[], Response response) throws NullPointerException { + public void GetSetProp(Object object, String prop, Object args[], Response response) throws NullPointerException { LinkedList matches = new LinkedList(); boolean set = (args != null && args.length > 0); Class params[] = null; @@ -1268,11 +1412,10 @@ public static String classDebugDescription(Class cls) { // first search for the field *exactly* again2: // because of security exception - for (ClassIterator iter = ClassIterator.getInstance(object, FindMatchingInterfaceForGetSetProp.getInstance(this, prop, args, false, canModifySecurityPermission)); (jclass = iter.getNext()) != null; ) { + for (ClassIterator iter = ClassIterator.getInstance(object, FindMatchingInterfaceForGetSetProp.getInstance(this, prop, args, false, canModifySecurityPermission)); (jclass = iter.getNext()) != null;) { try { Field jfields[] = jclass.getFields(); - for (int i = 0; i < jfields.length; i++) { - Field fld = jfields[i]; + for (Field fld : jfields) { if (fld.getName().equals(prop) && iter.isVisible(fld.getModifiers())) { matches.add(fld.getName()); Object res = null; @@ -1293,25 +1436,26 @@ public static String classDebugDescription(Class cls) { return; } } - } catch (Exception ee) {/* may happen when field is not static */} + } catch (Exception ee) {/* may happen when field is not static */ + } } matches.clear(); // search for a getter/setter, ignore case again1: // because of security exception - for (ClassIterator iter = ClassIterator.getInstance(object, FindMatchingInterfaceForInvoke.getInstance(this, prop, args, true, canModifySecurityPermission)); (jclass = iter.getNext()) != null; ) { + for (ClassIterator iter = ClassIterator.getInstance(object, FindMatchingInterfaceForInvoke.getInstance(this, prop, args, true, canModifySecurityPermission)); (jclass = iter.getNext()) != null;) { try { BeanInfo beanInfo = Introspector.getBeanInfo(jclass); - PropertyDescriptor props[] = beanInfo.getPropertyDescriptors(); - for (int i = 0; i < props.length; i++) { - if (props[i].getName().equalsIgnoreCase(prop)) { + PropertyDescriptor propDesc[] = beanInfo.getPropertyDescriptors(); + for (PropertyDescriptor pd : propDesc) { + if (pd.getName().equalsIgnoreCase(prop)) { Method method; if (set) { - method = props[i].getWriteMethod(); + method = pd.getWriteMethod(); args = coerce(params = method.getParameterTypes(), args, response); } else { - method = props[i].getReadMethod(); + method = pd.getReadMethod(); } matches.add(method); if (!iter.checkAccessible(method)) { @@ -1325,18 +1469,18 @@ public static String classDebugDescription(Class cls) { return; } } - } catch (Exception ee) {/* may happen when method is not static */} + } catch (Exception ee) {/* may happen when method is not static */ + } } matches.clear(); // search for the field, ignore case again0: // because of security exception - for (ClassIterator iter = ClassIterator.getInstance(object, FindMatchingInterfaceForGetSetProp.getInstance(this, prop, args, true, canModifySecurityPermission)); (jclass = iter.getNext()) != null; ) { + for (ClassIterator iter = ClassIterator.getInstance(object, FindMatchingInterfaceForGetSetProp.getInstance(this, prop, args, true, canModifySecurityPermission)); (jclass = iter.getNext()) != null;) { try { Field jfields[] = jclass.getFields(); - for (int i = 0; i < jfields.length; i++) { - Field fld = jfields[i]; + for (Field fld : jfields) { if (fld.getName().equalsIgnoreCase(prop) && iter.isVisible(fld.getModifiers())) { matches.add(prop); Object res = null; @@ -1357,13 +1501,16 @@ public static String classDebugDescription(Class cls) { return; } } - } catch (Exception ee) {/* may happen when field is not static */} + } catch (Exception ee) {/* may happen when field is not static */ + } } checkF(object, String.valueOf(prop) + " (with args:" + Util.argsToString(args, params) + "). " + "Candidates: " + String.valueOf(matches)); } catch (Throwable e) { Throwable e1 = e; - if (e1 instanceof InvocationTargetException) e1 = ((InvocationTargetException) e1).getTargetException(); + if (e1 instanceof InvocationTargetException) { + e1 = ((InvocationTargetException) e1).getTargetException(); + } if (e1 instanceof Request.AbortException) { throw (Request.AbortException) e1; } @@ -1378,17 +1525,17 @@ public static String classDebugDescription(Class cls) { } } - private void checkF(Object object, String string) throws NoSuchFieldException { - if (object instanceof Class) throw new NoSuchConstantException(string); - else throw new NoSuchFieldException(string); + if (object instanceof Class) { + throw new NoSuchConstantException(string); + } else { + throw new NoSuchFieldException(string); + } } /** - * Convert Map or Collection into a PHP array, - * sends the entire array, Map or Collection to the client. This - * is much more efficient than generating round-trips while - * iterating over the values of an array, Map or Collection. + * Convert Map or Collection into a PHP array, sends the entire array, Map or Collection to the client. This is much + * more efficient than generating round-trips while iterating over the values of an array, Map or Collection. * * @param ob - The object to expand * @return The passed ob, will be expanded by the appropriate writer. @@ -1413,7 +1560,7 @@ public long unwrapClosure(Object closure) throws IllegalArgumentException { /** * Cast a object to a type * - * @param ob - The object to cast + * @param ob - The object to cast * @param type - The target type * @return The passed ob, will be coerced by the appropriate writer. */ @@ -1437,7 +1584,7 @@ public Object castToString(Object ob) { * Cast a throwable to a string * * @param throwable The throwable to cast - * @param trace The PHP stack trace + * @param trace The PHP stack trace * @return The result String object, will be coerced by the appropriate writer. */ public Object castToString(Exception throwable, String trace) { @@ -1518,37 +1665,37 @@ public PhpMap getPhpMap(Object value) { public String inspect(Object object) { Class jclass; ClassIterator iter; - StringBuffer buf = new StringBuffer("["); + StringBuilder buf = new StringBuilder("["); buf.append(String.valueOf(Util.getClass(object))); buf.append(":\nConstructors:\n"); - for (iter = ClassIterator.getInstance(object, MATCH_VOID_CASE); (jclass = iter.getNext()) != null; ) { + for (iter = ClassIterator.getInstance(object, MATCH_VOID_CASE); (jclass = iter.getNext()) != null;) { Constructor[] constructors = jclass.getConstructors(); - for (int i = 0; i < constructors.length; i++) { - buf.append(String.valueOf(constructors[i])); + for (Constructor constructor : constructors) { + buf.append(String.valueOf(constructor)); buf.append("\n"); } } buf.append("\nFields:\n"); - for (iter = ClassIterator.getInstance(object, MATCH_VOID_CASE); (jclass = iter.getNext()) != null; ) { + for (iter = ClassIterator.getInstance(object, MATCH_VOID_CASE); (jclass = iter.getNext()) != null;) { Field jfields[] = jclass.getFields(); - for (int i = 0; i < jfields.length; i++) { - buf.append(String.valueOf(jfields[i])); + for (Field jfield : jfields) { + buf.append(String.valueOf(jfield)); buf.append("\n"); } } buf.append("\nMethods:\n"); - for (iter = ClassIterator.getInstance(object, MATCH_VOID_CASE); (jclass = iter.getNext()) != null; ) { + for (iter = ClassIterator.getInstance(object, MATCH_VOID_CASE); (jclass = iter.getNext()) != null;) { Method jmethods[] = jclass.getMethods(); - for (int i = 0; i < jmethods.length; i++) { - buf.append(String.valueOf(jmethods[i])); + for (Method jmethod : jmethods) { + buf.append(String.valueOf(jmethod)); buf.append("\n"); } } buf.append("\nClasses:\n"); - for (iter = ClassIterator.getInstance(object, MATCH_VOID_CASE); (jclass = iter.getNext()) != null; ) { + for (iter = ClassIterator.getInstance(object, MATCH_VOID_CASE); (jclass = iter.getNext()) != null;) { Class jclasses[] = jclass.getClasses(); - for (int i = 0; i < jclasses.length; i++) { - buf.append(String.valueOf(jclasses[i].getName())); + for (Class jclasse : jclasses) { + buf.append(String.valueOf(jclasse.getName())); buf.append("\n"); } } @@ -1557,8 +1704,7 @@ public String inspect(Object object) { } /** - * Set a new file encoding, used to code and decode strings. - * Example: setFileEncoding("UTF-8") + * Set a new file encoding, used to code and decode strings. Example: setFileEncoding("UTF-8") * * @param fileEncoding The file encoding. */ @@ -1569,7 +1715,7 @@ public void setFileEncoding(String fileEncoding) { /** * Check if object is an instance of class. * - * @param ob The object + * @param ob The object * @param claz The class or an instance of a class * @return true if ob is an instance of class, false otherwise. */ @@ -1585,7 +1731,9 @@ public boolean InstanceOf(Object ob, Object claz) { * @return A string representation. */ public Object ObjectToString(Object ob) { - if (ob == null && !options.preferValues()) ob = Request.PHPNULL; + if (ob == null && !options.preferValues()) { + ob = Request.PHPNULL; + } return castToString(Util.stringValueOf(ob)); } @@ -1596,8 +1744,10 @@ public Object ObjectToString(Object ob) { * @return A string representation. */ public Object ObjectToString(Boolean ob) { - if (ob == null) return ObjectToString((Object) null); - return castToString(ob.booleanValue() ? "1" : ""); + if (ob == null) { + return ObjectToString((Object) null); + } + return castToString(ob ? "1" : ""); } /** @@ -1607,7 +1757,9 @@ public Object ObjectToString(Boolean ob) { * @return A string representation. */ public Object ObjectToString(String ob) { - if (ob == null) return ObjectToString((Object) null); + if (ob == null) { + return ObjectToString((Object) null); + } return castToString(ob); } @@ -1618,14 +1770,16 @@ public Object ObjectToString(String ob) { * @return A string representation. */ public Object ObjectToString(byte[] ob) { - if (ob == null) return ObjectToString((Object) null); + if (ob == null) { + return ObjectToString((Object) null); + } return castToString(ob); } /** * Returns a string representation of the object * - * @param ob The Throwable + * @param ob The Throwable * @param trace The stack trace * @return A string representation. */ @@ -1658,24 +1812,28 @@ public Object ObjectToString(Throwable ob, String trace) { * @return The JSR223 context. */ public Object getContext() { - if (contextCache != null) return contextCache; + if (contextCache != null) { + return contextCache; + } return contextCache = sessionFactory.getContext(); } /** - * Return a session handle shared among all JavaBridge - * instances. If it is a HTTP session, the session is shared with - * the servlet or jsp. + * Return a session handle shared among all JavaBridge instances. If it is a HTTP session, the session is shared + * with the servlet or jsp. * - * @param name The session name, if any + * @param name The session name, if any * @param clientIsNew true, if the client wants a new session - * @param timeout session timeout in seconds. If timeout is <= 0, the session will never expire - * @return The session context. + * @param timeout session timeout in seconds. If timeout is <= 0, the session will never expire @return The session context + * . + * @return * @throws Exception * @see io.soluble.pjb.bridge.ISession */ public ISession getSession(String name, short clientIsNew, int timeout) throws Exception { - if (timeout == 0) timeout = -1; + if (timeout == 0) { + timeout = -1; + } try { return sessionFactory.getSession(name, clientIsNew, timeout); } catch (Exception t) { @@ -1690,11 +1848,13 @@ public ISession getSession(String name, short clientIsNew, int timeout) throws E * java_closure($this, $map);
* * @param object the PHP environment (the php instance) - * @param names maps java to php names + * @param names maps java to php names * @return the proxy */ public Object makeClosure(long object, Map names) { - if (names == null) return makeClosure(object); + if (names == null) { + return makeClosure(object); + } return PhpProcedure.createProxy(getFactory(), null, names, Util.ZERO_PARAM, object); } @@ -1703,13 +1863,15 @@ public Object makeClosure(long object, Map names) { * Example:
* java_closure($this, $map, $interfaces);
* - * @param object the PHP environment (the php instance) - * @param names maps java to php names + * @param object the PHP environment (the php instance) + * @param names maps java to php names * @param interfaces list of interfaces which the PHP environment must implement * @return the proxy */ public Object makeClosure(long object, Map names, Class interfaces[]) { - if (names == null) names = emptyMap; + if (names == null) { + names = EMPTY_MAP; + } return PhpProcedure.createProxy(getFactory(), null, names, interfaces, object); } @@ -1719,8 +1881,8 @@ public Object makeClosure(long object, Map names, Class interfaces[]) { * java_closure($this, $map, $interfaces);
* * @param object the PHP environment (the php instance) - * @param name maps all java names to this php name - * @param iface interface which the PHP environment must implement + * @param name maps all java names to this php name + * @param iface interface which the PHP environment must implement * @return the proxy */ public Object makeClosure(long object, String name, Class iface) { @@ -1734,8 +1896,8 @@ public Object makeClosure(long object, String name, Class iface) { * java_closure($this, $map, $interfaces);
* * @param object the PHP environment (the php instance) - * @param names maps java to php names - * @param iface interface which the PHP environment must implement + * @param names maps java to php names + * @param iface interface which the PHP environment must implement * @return the proxy */ public Object makeClosure(long object, Map names, Class iface) { @@ -1749,11 +1911,13 @@ public Object makeClosure(long object, Map names, Class iface) { * java_closure($this, "clickMe");
* * @param object the PHP environment (the php instance) - * @param name maps all java names to this php name + * @param name maps all java names to this php name * @return the proxy */ public Object makeClosure(long object, String name) { - if (name == null) return makeClosure(object); + if (name == null) { + return makeClosure(object); + } return PhpProcedure.createProxy(getFactory(), name, null, Util.ZERO_PARAM, object); } @@ -1762,17 +1926,19 @@ public Object makeClosure(long object, String name) { * Example:
* java_closure($this, "clickMe", $interfaces);
* - * @param object the PHP environment (the php instance) - * @param name maps all java names to this php name + * @param object the PHP environment (the php instance) + * @param name maps all java names to this php name * @param interfaces list of interfaces which the PHP environment must implement * @return the proxy */ public Object makeClosure(long object, String name, Class interfaces[]) { - if (name == null) return makeClosure(object, emptyMap, interfaces); + if (name == null) { + return makeClosure(object, EMPTY_MAP, interfaces); + } return PhpProcedure.createProxy(getFactory(), name, null, interfaces, object); } - private static final HashMap emptyMap = new HashMap(); + private static final HashMap EMPTY_MAP = new HashMap(); /** * Create a dynamic proxy proxy for calling PHP code.
@@ -1784,12 +1950,11 @@ public Object makeClosure(long object, String name, Class interfaces[]) { * @return the proxy */ public Object makeClosure(long object) { - return PhpProcedure.createProxy(getFactory(), null, emptyMap, Util.ZERO_PARAM, object); + return PhpProcedure.createProxy(getFactory(), null, EMPTY_MAP, Util.ZERO_PARAM, object); } /** - * This method sets a new session factory. Used by the servlet to - * implement session sharing. + * This method sets a new session factory. Used by the servlet to implement session sharing. * * @param sessionFactory The sessionFactory to set. */ @@ -1797,23 +1962,22 @@ void setFactory(IJavaBridgeFactory sessionFactory) { this.sessionFactory = sessionFactory; } - protected static final String PHPSESSION = "PHPSESSION"; - protected static final String INTERNAL_PHPSESSION = "INTERNAL_PHPSESSION"; - /** - * Load the object from the session store. - * The C code requires that this method is called "deserialize" even though it doesn't deserialize anything. - * See the JSessionAdapter in the php_java_lib folder. For real serialization/deserialization see the JPersistenceAdapter in the php_java_lib folder. + * Load the object from the session store. The C code requires that this method is called "deserialize" even though + * it doesn't deserialize anything. See the JSessionAdapter in the php_java_lib folder. For real + * serialization/deserialization see the JPersistenceAdapter in the php_java_lib folder. * * @param serialID The key - * @param timeout The timeout, usually 1400 seconds. + * @param timeout The timeout, usually 1400 seconds. * @return the new object identity. * @throws IllegalArgumentException if serialID does not exist anymore. */ public int deserialize(String serialID, int timeout) throws IllegalArgumentException { ISession session = sessionFactory.getSession(JavaBridge.INTERNAL_PHPSESSION, ISession.SESSION_GET_OR_CREATE, timeout); Object obj = session.get(serialID); - if (obj == null) throw new IllegalArgumentException("Session serialID " + serialID + " expired."); + if (obj == null) { + throw new IllegalArgumentException("Session serialID " + serialID + " expired."); + } return globalRef.append(castToExact(obj)); } @@ -1824,16 +1988,18 @@ private static synchronized int getSerialID() { } /** - * Store the object in the session store and return the serial id. - * The C code requires that this method is called "serialize" even though it doesn't serialize anything. - * See the JSessionAdapter in the php_java_lib folder. For real serialization/deserialization see the JPersistenceAdapter in the php_java_lib folder. + * Store the object in the session store and return the serial id. The C code requires that this method is called + * "serialize" even though it doesn't serialize anything. See the JSessionAdapter in the php_java_lib folder. For + * real serialization/deserialization see the JPersistenceAdapter in the php_java_lib folder. * - * @param obj The object + * @param obj The object * @param timeout The timeout, usually 1400 seconds * @return the serialID */ public String serialize(Object obj, int timeout) throws IllegalArgumentException { - if (obj == null) obj = Request.PHPNULL; + if (obj == null) { + obj = Request.PHPNULL; + } ISession session = sessionFactory.getSession(JavaBridge.INTERNAL_PHPSESSION, ISession.SESSION_GET_OR_CREATE, timeout); String id = Integer.toHexString(getSerialID()); session.put(id, obj); @@ -1844,7 +2010,7 @@ public String serialize(Object obj, int timeout) throws IllegalArgumentException * Checks if a given position exists. * * @param value The map. - * @param pos The position + * @param pos The position * @return true if an element exists at this position, false otherwise. */ private boolean offsetExists(Map value, Object pos) { @@ -1856,7 +2022,7 @@ private boolean offsetExists(Map value, Object pos) { * Returns the object at the posisition. * * @param value The map. - * @param pos The position. + * @param pos The position. * @return The object at the given position. */ private Object offsetGet(Map value, Object pos) { @@ -1867,14 +2033,16 @@ private Object offsetGet(Map value, Object pos) { * Set an object at position. * * @param value The map. - * @param pos The position. - * @param val The object. + * @param pos The position. + * @param val The object. */ private void offsetSet(Map value, Object pos, Object val) { Class type = value.getClass().getComponentType(); - if (type != null) val = coerce(type, val, request.response); + if (type != null) { + val = coerce(type, val, request.response); + } if (pos == null) { - pos = new Integer(value.size()); + pos = value.size(); } value.put(pos, val); } @@ -1883,7 +2051,7 @@ private void offsetSet(Map value, Object pos, Object val) { * Remove an object from the position. * * @param value The map. - * @param pos The position. + * @param pos The position. */ private void offsetUnset(Map value, Object pos) { value.remove(pos); @@ -1893,7 +2061,7 @@ private void offsetUnset(Map value, Object pos) { * Checks if a given position exists. * * @param value The list. - * @param pos The position + * @param pos The position * @return true if an element exists at this position, false otherwise. */ private boolean offsetExists(List value, int pos) { @@ -1910,7 +2078,7 @@ private boolean offsetExists(List value, int pos) { * Returns the object at the posisition. * * @param value The list. - * @param pos The position. + * @param pos The position. * @return The object at the given position. */ private Object offsetGet(List value, int pos) { @@ -1921,12 +2089,13 @@ private Object offsetGet(List value, int pos) { * Set an object at position. * * @param value The list. - * @param pos The position. - * @param val The object. + * @param pos The position. + * @param val The object. */ private void offsetSet(List value, Number off, Object val) { - if (off == null) value.add(val); - else { + if (off == null) { + value.add(val); + } else { int pos = off.intValue(); value.set(pos, val); } @@ -1936,7 +2105,7 @@ private void offsetSet(List value, Number off, Object val) { * Remove an object from the position. * * @param value The list. - * @param pos The position. + * @param pos The position. */ private void offsetUnset(List value, int pos) { value.remove(pos); @@ -1952,7 +2121,7 @@ boolean offsetExists(int length, int pos) { * Checks if a given position exists. * * @param value The array. - * @param pos The position + * @param pos The position * @return true if an element exists at this position, false otherwise. */ private boolean offsetExists(Object value, int pos) { @@ -1963,12 +2132,16 @@ private boolean offsetExists(Object value, int pos) { * Checks if a given position exists. * * @param table The table. - * @param off The offset + * @param off The offset * @return true if an element exists at this position, false otherwise. */ public boolean offsetExists(Object table, Object off) { - if (table.getClass().isArray()) return offsetExists(table, ((Number) off).intValue()); - if (table instanceof List) return offsetExists((List) table, ((Number) off).intValue()); + if (table.getClass().isArray()) { + return offsetExists(table, ((Number) off).intValue()); + } + if (table instanceof List) { + return offsetExists((List) table, ((Number) off).intValue()); + } return offsetExists((Map) table, off); } @@ -1976,25 +2149,29 @@ public boolean offsetExists(Object table, Object off) { * Returns the object at the posisition. * * @param value The array. - * @param pos The position. + * @param pos The position. * @return The object at the given position. */ private Object offsetGet(Object value, int pos) { int i = pos; - Object o = Array.get(value, i); - return o == this ? null : o; + Object obj = Array.get(value, i); + return obj == this ? null : obj; } /** * Returns the object at the posisition. * * @param table The table. - * @param off The offset. + * @param off The offset. * @return The object at the given position. */ public Object offsetGet(Object table, Object off) { - if (table.getClass().isArray()) return offsetGet(table, ((Number) off).intValue()); - if (table instanceof List) return offsetGet((List) table, ((Number) off).intValue()); + if (table.getClass().isArray()) { + return offsetGet(table, ((Number) off).intValue()); + } + if (table instanceof List) { + return offsetGet((List) table, ((Number) off).intValue()); + } return offsetGet((Map) table, off); } @@ -2015,15 +2192,17 @@ public void beginDocument() { public void endDocument() throws Throwable { Response res = request.response; res.setDefaultWriter(); - if (lastAsyncException != null) throw lastAsyncException; + if (lastAsyncException != null) { + throw lastAsyncException; + } } /** * Set an object at position. * * @param value The array. - * @param pos The position. - * @param val The object. + * @param pos The position. + * @param val The object. */ private void offsetSet(Object value, int pos, Object val) { Array.set(value, pos, coerce(value.getClass().getComponentType(), val, request.response)); @@ -2033,20 +2212,24 @@ private void offsetSet(Object value, int pos, Object val) { * Set an object at position. * * @param table The table - * @param off The offset. - * @param val The value + * @param off The offset. + * @param val The value */ public void offsetSet(Object table, Object off, Object val) { - if (table.getClass().isArray()) offsetSet(table, ((Number) off).intValue(), val); - else if (table instanceof List) offsetSet((List) table, ((Number) off), val); - else offsetSet((Map) table, off, val); + if (table.getClass().isArray()) { + offsetSet(table, ((Number) off).intValue(), val); + } else if (table instanceof List) { + offsetSet((List) table, ((Number) off), val); + } else { + offsetSet((Map) table, off, val); + } } /** * Remove an object from the position. * * @param value The array. - * @param pos The position. + * @param pos The position. */ private void offsetUnset(Object value, int pos) { int i = pos; @@ -2057,24 +2240,27 @@ private void offsetUnset(Object value, int pos) { * Remove an object from the position. * * @param table The table. - * @param off The offset. + * @param off The offset. */ public void offsetUnset(Object table, Object off) { - if (table.getClass().isArray()) offsetUnset(table, ((Number) off).intValue()); - else if (table instanceof List) offsetUnset((List) table, ((Number) off).intValue()); - else offsetUnset((Map) table, off); + if (table.getClass().isArray()) { + offsetUnset(table, ((Number) off).intValue()); + } else if (table instanceof List) { + offsetUnset((List) table, ((Number) off).intValue()); + } else { + offsetUnset((Map) table, off); + } } /** - * Re-initialize the current bridge for keep-alive - * See php.ini option java.persistent_connections + * Re-initialize the current bridge for keep-alive See php.ini option java.persistent_connections */ public void recycle() { this.contextCache = null; globalRef = new GlobalRef(); options.recycle(); - + /* resets the bridge: make sure to set the original bridge before calling sessionFactory.recycle() */ request.recycle(); /* resets the currentThreadContextClassLoader from the bridge's loader */ @@ -2090,8 +2276,8 @@ public void recycle() { /** * Return a new string using the current file encoding (see java_set_file_encoding()). * - * @param b The byte array - * @param start The start index + * @param b The byte array + * @param start The start index * @param length The number of bytes to encode. * @return The encoded string. */ @@ -2108,8 +2294,8 @@ public String getString(byte[] b, int start, int length) { /** * Return a cached string using the current file encoding (see java_set_file_encoding()). * - * @param b The byte array - * @param start The start index + * @param b The byte array + * @param start The start index * @param length The number of bytes to encode. * @return The encoded string. */ @@ -2137,7 +2323,8 @@ public boolean typeExists(String name) { Util.classForName(name); castToBoolean(null); return true; - } catch (ClassNotFoundException ex) {/*ignore*/} + } catch (ClassNotFoundException ex) {/*ignore*/ + } castToBoolean(null); return false; } @@ -2149,12 +2336,16 @@ public boolean typeExists(String name) { */ public Throwable getLastException() { request.response.setCoerceWriter().setType(Object.class); - if (lastAsyncException != null) return lastAsyncException; + if (lastAsyncException != null) { + return lastAsyncException; + } return lastException; } protected Throwable setLastAsyncException(Throwable t) { - if (lastAsyncException == null) lastException = lastAsyncException = t; + if (lastAsyncException == null) { + lastException = lastAsyncException = t; + } return t; } @@ -2164,4 +2355,5 @@ protected Throwable setLastAsyncException(Throwable t) { public void clearLastException() { lastException = lastAsyncException = null; } + } diff --git a/src/main/java/io/soluble/pjb/bridge/PhpMap.java b/src/main/java/io/soluble/pjb/bridge/PhpMap.java index 2168746..f6ed2e1 100644 --- a/src/main/java/io/soluble/pjb/bridge/PhpMap.java +++ b/src/main/java/io/soluble/pjb/bridge/PhpMap.java @@ -24,7 +24,6 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -import io.soluble.pjb.bridge.*; import java.lang.reflect.Array; import java.util.Collection; import java.util.Iterator; @@ -35,7 +34,7 @@ * * @author jostb */ -abstract class PhpMap { +public abstract class PhpMap { JavaBridge _bridge; Object value; Class componentType; diff --git a/src/main/java/io/soluble/pjb/bridge/Session.java b/src/main/java/io/soluble/pjb/bridge/Session.java index 6e8a08f..7f7bbb2 100644 --- a/src/main/java/io/soluble/pjb/bridge/Session.java +++ b/src/main/java/io/soluble/pjb/bridge/Session.java @@ -79,9 +79,9 @@ public boolean isNew() { public void destroy() { sessionCount--; - synchronized (JavaBridge.sessionHash) { - if (JavaBridge.sessionHash != null) - JavaBridge.sessionHash.remove(name); + synchronized (JavaBridge.SESSION_HASH) { + if (JavaBridge.SESSION_HASH != null) + JavaBridge.SESSION_HASH.remove(name); } } @@ -107,9 +107,9 @@ public Map getAll() { * see #CHECK_SESSION_TIMEOUT */ static synchronized void expire() { - if (JavaBridge.sessionHash == null) return; - synchronized (JavaBridge.sessionHash) { - for (Iterator e = JavaBridge.sessionHash.values().iterator(); e.hasNext(); ) { + if (JavaBridge.SESSION_HASH == null) return; + synchronized (JavaBridge.SESSION_HASH) { + for (Iterator e = JavaBridge.SESSION_HASH.values().iterator(); e.hasNext(); ) { Session ref = (Session) e.next(); if ((ref.timeout > 0) && (ref.lastAccessedTime + ref.timeout <= System.currentTimeMillis())) { sessionCount--; @@ -124,9 +124,9 @@ static synchronized void expire() { * Expires all sessions immediately. */ public static void reset() { - if (JavaBridge.sessionHash == null) return; - synchronized (JavaBridge.sessionHash) { - for (Iterator e = JavaBridge.sessionHash.values().iterator(); e.hasNext(); ) { + if (JavaBridge.SESSION_HASH == null) return; + synchronized (JavaBridge.SESSION_HASH) { + for (Iterator e = JavaBridge.SESSION_HASH.values().iterator(); e.hasNext(); ) { Session ref = (Session) e.next(); sessionCount--; e.remove(); diff --git a/src/main/java/io/soluble/pjb/bridge/SessionFactory.java b/src/main/java/io/soluble/pjb/bridge/SessionFactory.java index 10b2651..f2914ac 100644 --- a/src/main/java/io/soluble/pjb/bridge/SessionFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/SessionFactory.java @@ -62,17 +62,17 @@ private static SessionTimer getSessionTimer() { } private ISession session(String name, short clientIsNew, int timeout) { - synchronized (JavaBridge.sessionHash) { + synchronized (JavaBridge.SESSION_HASH) { Session ref = null; - if (!JavaBridge.sessionHash.containsKey(name)) { + if (!JavaBridge.SESSION_HASH.containsKey(name)) { ref = new Session(name); - JavaBridge.sessionHash.put(name, ref); + JavaBridge.SESSION_HASH.put(name, ref); } else { - ref = (Session) JavaBridge.sessionHash.get(name); + ref = (Session) JavaBridge.SESSION_HASH.get(name); if (clientIsNew == ISession.SESSION_CREATE_NEW) { // client side gc'ed, destroy server ref now! ref.destroy(); ref = new Session(name); - JavaBridge.sessionHash.put(name, ref); + JavaBridge.SESSION_HASH.put(name, ref); } else { ref.isNew = false; } From af13746aaaaa7f61246421142fa5885036d10454 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Thu, 26 Jan 2017 07:28:48 +0100 Subject: [PATCH 44/75] code quality enhancements --- src/main/java/io/soluble/pjb/bridge/IManaged.java | 9 ++------- src/main/java/io/soluble/pjb/bridge/ISession.java | 7 ++----- .../io/soluble/pjb/bridge/ISocketFactory.java | 7 ++----- .../io/soluble/pjb/bridge/IntegerComparator.java | 12 +++++------- .../JavaBridgeIllegalArgumentException.java | 8 ++------ .../bridge/JavaBridgeIllegalStateException.java | 8 ++------ .../java/io/soluble/pjb/bridge/MethodCache.java | 14 +++++++------- .../pjb/bridge/NoSuchConstantException.java | 8 ++------ .../pjb/bridge/NoSuchProcedureException.java | 8 ++------ .../pjb/bridge/NotImplementedException.java | 7 ++----- .../java/io/soluble/pjb/bridge/ParserTag.java | 8 ++------ .../io/soluble/pjb/bridge/PhpExactNumber.java | 15 ++++++++------- .../soluble/pjb/bridge/SSLServerSocketHelper.java | 11 ++++++----- .../io/soluble/pjb/bridge/SimplePhpString.java | 10 ++++------ .../io/soluble/pjb/bridge/TCPServerSocket.java | 12 ++++++------ 15 files changed, 54 insertions(+), 90 deletions(-) diff --git a/src/main/java/io/soluble/pjb/bridge/IManaged.java b/src/main/java/io/soluble/pjb/bridge/IManaged.java index ebc7dd4..86d4424 100644 --- a/src/main/java/io/soluble/pjb/bridge/IManaged.java +++ b/src/main/java/io/soluble/pjb/bridge/IManaged.java @@ -1,10 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - -import io.soluble.pjb.bridge.*; - - /* * Copyright (C) 2003-2009 Jost Boekemeier * @@ -27,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + /** * Classes which implement this interface receive a notification before their container terminates. * This usually happens when the ContextLoaderListener.contextDestroyed(javax.servlet.ServletContextEvent) diff --git a/src/main/java/io/soluble/pjb/bridge/ISession.java b/src/main/java/io/soluble/pjb/bridge/ISession.java index 8b114a8..f96b758 100644 --- a/src/main/java/io/soluble/pjb/bridge/ISession.java +++ b/src/main/java/io/soluble/pjb/bridge/ISession.java @@ -1,7 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -24,7 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -import io.soluble.pjb.bridge.*; +package io.soluble.pjb.bridge; + import java.util.Map; /** diff --git a/src/main/java/io/soluble/pjb/bridge/ISocketFactory.java b/src/main/java/io/soluble/pjb/bridge/ISocketFactory.java index cb12a3a..e11d42c 100644 --- a/src/main/java/io/soluble/pjb/bridge/ISocketFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/ISocketFactory.java @@ -1,7 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -24,7 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -import io.soluble.pjb.bridge.*; +package io.soluble.pjb.bridge; + import java.io.IOException; import java.net.Socket; diff --git a/src/main/java/io/soluble/pjb/bridge/IntegerComparator.java b/src/main/java/io/soluble/pjb/bridge/IntegerComparator.java index e8a2445..ba688e2 100644 --- a/src/main/java/io/soluble/pjb/bridge/IntegerComparator.java +++ b/src/main/java/io/soluble/pjb/bridge/IntegerComparator.java @@ -1,7 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -24,13 +20,15 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -import io.soluble.pjb.bridge.*; +package io.soluble.pjb.bridge; + import java.util.Comparator; final class IntegerComparator implements Comparator { + @Override public int compare(Object arg0, Object arg1) { - int k0 = ((Integer) arg0).intValue(); - int k1 = ((Integer) arg1).intValue(); + int k0 = ((Integer) arg0); + int k1 = ((Integer) arg1); if (k0 < k1) return -1; else if (k0 > k1) return 1; return 0; diff --git a/src/main/java/io/soluble/pjb/bridge/JavaBridgeIllegalArgumentException.java b/src/main/java/io/soluble/pjb/bridge/JavaBridgeIllegalArgumentException.java index 3fd8a05..53df3c9 100644 --- a/src/main/java/io/soluble/pjb/bridge/JavaBridgeIllegalArgumentException.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaBridgeIllegalArgumentException.java @@ -1,9 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - -import io.soluble.pjb.bridge.*; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -26,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + /** * This class is needed for backward compatibility with JDK 1.4 */ diff --git a/src/main/java/io/soluble/pjb/bridge/JavaBridgeIllegalStateException.java b/src/main/java/io/soluble/pjb/bridge/JavaBridgeIllegalStateException.java index 7407c1a..b71ed25 100644 --- a/src/main/java/io/soluble/pjb/bridge/JavaBridgeIllegalStateException.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaBridgeIllegalStateException.java @@ -1,9 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - -import io.soluble.pjb.bridge.*; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -26,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + /** * This class is needed for backward compatibility with JDK 1.4 */ diff --git a/src/main/java/io/soluble/pjb/bridge/MethodCache.java b/src/main/java/io/soluble/pjb/bridge/MethodCache.java index f664594..0c481b9 100644 --- a/src/main/java/io/soluble/pjb/bridge/MethodCache.java +++ b/src/main/java/io/soluble/pjb/bridge/MethodCache.java @@ -1,7 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -24,7 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -import io.soluble.pjb.bridge.*; +package io.soluble.pjb.bridge; + import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; @@ -90,10 +87,11 @@ protected Entry(String name, Object obj, Class params[]) { private boolean hasResult = false; private int result = 1; + @Override public int hashCode() { if (hasResult) return result; - for (int i = 0; i < params.length; i++) { - result = result * 31 + (params[i] == null ? 0 : params[i].hashCode()); + for (Class param : params) { + result = result * 31 + (param == null ? 0 : param.hashCode()); } result = result * 31 + clazz.hashCode(); result = result * 31 + name.hashCode(); @@ -102,6 +100,7 @@ public int hashCode() { return result; } + @Override public boolean equals(Object o) { Entry that = (Entry) o; if (clazz != that.clazz) return false; @@ -126,6 +125,7 @@ public Class[] getParameterTypes(Method method) { } private static final class NoCache extends Entry { + @Override public Class[] getParameterTypes(Method method) { return method.getParameterTypes(); } diff --git a/src/main/java/io/soluble/pjb/bridge/NoSuchConstantException.java b/src/main/java/io/soluble/pjb/bridge/NoSuchConstantException.java index 08670e9..65c7c59 100644 --- a/src/main/java/io/soluble/pjb/bridge/NoSuchConstantException.java +++ b/src/main/java/io/soluble/pjb/bridge/NoSuchConstantException.java @@ -1,9 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - -import io.soluble.pjb.bridge.*; - /* * Copyright (C) 2003-2007 Jost Boekemeier and others. * @@ -26,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + /** * Thrown when a class does not contain a constant. */ diff --git a/src/main/java/io/soluble/pjb/bridge/NoSuchProcedureException.java b/src/main/java/io/soluble/pjb/bridge/NoSuchProcedureException.java index c72ac40..82c905d 100644 --- a/src/main/java/io/soluble/pjb/bridge/NoSuchProcedureException.java +++ b/src/main/java/io/soluble/pjb/bridge/NoSuchProcedureException.java @@ -1,9 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - -import io.soluble.pjb.bridge.*; - /* * Copyright (C) 2003-2007 Jost Boekemeier and others. * @@ -26,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + /** * Thrown when a class does not contain a procedure. */ diff --git a/src/main/java/io/soluble/pjb/bridge/NotImplementedException.java b/src/main/java/io/soluble/pjb/bridge/NotImplementedException.java index faced7a..15d420a 100644 --- a/src/main/java/io/soluble/pjb/bridge/NotImplementedException.java +++ b/src/main/java/io/soluble/pjb/bridge/NotImplementedException.java @@ -1,8 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ -package io.soluble.pjb.bridge; - -import io.soluble.pjb.bridge.*; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -25,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + /** * Thrown when a feature is not and will not be implemented */ diff --git a/src/main/java/io/soluble/pjb/bridge/ParserTag.java b/src/main/java/io/soluble/pjb/bridge/ParserTag.java index f2f06ea..8d7d623 100644 --- a/src/main/java/io/soluble/pjb/bridge/ParserTag.java +++ b/src/main/java/io/soluble/pjb/bridge/ParserTag.java @@ -1,9 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - -import io.soluble.pjb.bridge.*; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -26,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + /** * This structure carries the parsed tag and the arguments. * diff --git a/src/main/java/io/soluble/pjb/bridge/PhpExactNumber.java b/src/main/java/io/soluble/pjb/bridge/PhpExactNumber.java index e43bf7b..b19a98c 100644 --- a/src/main/java/io/soluble/pjb/bridge/PhpExactNumber.java +++ b/src/main/java/io/soluble/pjb/bridge/PhpExactNumber.java @@ -1,9 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - -import io.soluble.pjb.bridge.*; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -26,13 +20,15 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + final class PhpExactNumber extends Number { /** * */ private static final long serialVersionUID = 3257566187666749240L; - private long l; + private final long l; /** * @param l @@ -44,6 +40,7 @@ public PhpExactNumber(long l) { /* (non-Javadoc) * @see java.lang.Number#intValue() */ + @Override public int intValue() { return (int) l; @@ -52,6 +49,7 @@ public int intValue() { /* (non-Javadoc) * @see java.lang.Number#longValue() */ + @Override public long longValue() { return l; } @@ -59,6 +57,7 @@ public long longValue() { /* (non-Javadoc) * @see java.lang.Number#floatValue() */ + @Override public float floatValue() { return l; } @@ -66,10 +65,12 @@ public float floatValue() { /* (non-Javadoc) * @see java.lang.Number#doubleValue() */ + @Override public double doubleValue() { return l; } + @Override public String toString() { return String.valueOf(l); } diff --git a/src/main/java/io/soluble/pjb/bridge/SSLServerSocketHelper.java b/src/main/java/io/soluble/pjb/bridge/SSLServerSocketHelper.java index b6b06c9..5cfedee 100644 --- a/src/main/java/io/soluble/pjb/bridge/SSLServerSocketHelper.java +++ b/src/main/java/io/soluble/pjb/bridge/SSLServerSocketHelper.java @@ -1,7 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -24,7 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -import io.soluble.pjb.bridge.*; +package io.soluble.pjb.bridge; + import java.io.IOException; import java.io.InputStream; import java.net.InetAddress; @@ -68,21 +65,25 @@ public static final ISocketFactory bind(final int port, final int backlog, final return new ISocketFactory() { /**{@inheritDoc}*/ + @Override public String getSocketName() { return String.valueOf(port); } /**{@inheritDoc}*/ + @Override public void close() throws IOException { ssocket.close(); } /**{@inheritDoc}*/ + @Override public Socket accept() throws IOException { return ssocket.accept(); } /**{@inheritDoc}*/ + @Override public String toString() { return (isLocal ? "HTTP_LOCAL:" : "HTTPS:") + getSocketName(); } diff --git a/src/main/java/io/soluble/pjb/bridge/SimplePhpString.java b/src/main/java/io/soluble/pjb/bridge/SimplePhpString.java index 7677234..4479bcf 100644 --- a/src/main/java/io/soluble/pjb/bridge/SimplePhpString.java +++ b/src/main/java/io/soluble/pjb/bridge/SimplePhpString.java @@ -1,9 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - -import io.soluble.pjb.bridge.*; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -26,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + final class SimplePhpString extends PhpString { String s; JavaBridge bridge; @@ -35,10 +31,12 @@ final class SimplePhpString extends PhpString { this.s = s; } + @Override public String getString() { return s; } + @Override public byte[] getBytes() { return bridge.options.getBytes(s); } diff --git a/src/main/java/io/soluble/pjb/bridge/TCPServerSocket.java b/src/main/java/io/soluble/pjb/bridge/TCPServerSocket.java index be2a9b5..de7f986 100644 --- a/src/main/java/io/soluble/pjb/bridge/TCPServerSocket.java +++ b/src/main/java/io/soluble/pjb/bridge/TCPServerSocket.java @@ -1,7 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ - -package io.soluble.pjb.bridge; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -24,7 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -import io.soluble.pjb.bridge.*; +package io.soluble.pjb.bridge; + import java.io.IOException; import java.net.InetAddress; import java.net.ServerSocket; @@ -70,7 +67,6 @@ private void findFreePort(int start, int backlog) { this.port = port; return; } catch (IOException e) { - continue; } } @@ -86,20 +82,24 @@ private TCPServerSocket(int port, int backlog, boolean local) throws IOException } } + @Override public void close() throws IOException { sock.close(); } + @Override public Socket accept() throws IOException { Socket s = sock.accept(); s.setTcpNoDelay(true); return s; } + @Override public String getSocketName() { return String.valueOf(port); } + @Override public String toString() { return (local ? "INET_LOCAL:" : "INET:") + getSocketName(); } From 7d3eb2c5dbd0c64d7646004ece5b6335b2e7f88d Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Thu, 26 Jan 2017 09:09:45 +0100 Subject: [PATCH 45/75] add runtime logger implementation --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index e275eab..7d55bb0 100644 --- a/build.gradle +++ b/build.gradle @@ -19,6 +19,7 @@ repositories { dependencies { providedCompile('javax.servlet:servlet-api:2.5') + runtime('log4j:log4j:1:2:17') testCompile('junit:junit:3.8.2') // the test code still uses this junit API def tomcatVersion = '7.0.59' From 9f2270f7e9f312381ae2a99f59908d9d79ed95c9 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Thu, 26 Jan 2017 09:12:24 +0100 Subject: [PATCH 46/75] code quality enhancements --- src/main/java/io/soluble/pjb/bridge/Util.java | 1201 +++++++++-------- 1 file changed, 607 insertions(+), 594 deletions(-) diff --git a/src/main/java/io/soluble/pjb/bridge/Util.java b/src/main/java/io/soluble/pjb/bridge/Util.java index 187ee7f..915fe7a 100644 --- a/src/main/java/io/soluble/pjb/bridge/Util.java +++ b/src/main/java/io/soluble/pjb/bridge/Util.java @@ -44,10 +44,10 @@ import java.util.Properties; import java.util.StringTokenizer; import java.util.TimeZone; -import java.util.Vector; import java.util.Map.Entry; import io.soluble.pjb.bridge.http.FCGIConnectionPool; +import java.util.ArrayList; /** @@ -61,19 +61,7 @@ public final class Util { initGlobals(); } - /** - * Script engines are started from this pool. - * Use pool.destroy() to destroy the thread pool upon JVM or servlet shutdown - */ - public static final ThreadPool PHP_SCRIPT_ENGINE_THREAD_POOL = - new ThreadPool("JavaBridgeStandaloneScriptEngineProxy", Integer.parseInt(Util.THREAD_POOL_MAX_SIZE)) { - @Override - protected Delegate createDelegate(String name) { - Delegate d = super.createDelegate(name); - d.setDaemon(true); - return d; - } - }; + private Util() {} /** * Only for internal use. The library standalone ScriptEngine FastCGI connection pool, if any @@ -140,97 +128,6 @@ protected Delegate createDelegate(String name) { public static final String X_JAVABRIDGE_INCLUDE_ONLY = "X_JAVABRIDGE_INCLUDE_ONLY"; - private Util() { - } - - /** - * Only for internal use. Use Util.getLogger() instread. - *

- * A bridge which uses log4j or the default logger. - */ - public static class Logger implements ILogger { - protected ChainsawLogger clogger = null; - protected ILogger logger; - - /** - * Use chainsaw, if available or a default logger. - */ - public Logger() { - logger = new FileLogger(); // log to logStream - } - - /** - * Use chainsaw, if available. - * - * @param logger The specified logger. - */ - public Logger(ILogger logger) { - this(!DEFAULT_LOG_FILE_SET, logger); - } - - public Logger(boolean useChainsaw, ILogger logger) { - if (useChainsaw) - try { - this.clogger = ChainsawLogger.createChainsawLogger(); - } catch (Exception e) { - if (Util.logLevel > 5) e.printStackTrace(); - this.logger = logger; - } - else { - this.logger = logger; - } - } - - private ILogger getLogger() { - if (logger == null) return logger = new FileLogger(); - return logger; - } - - /** - * {@inheritDoc} - */ - @Override - public void printStackTrace(Throwable t) { - if (clogger == null) logger.printStackTrace(t); - else - try { - clogger.printStackTrace(t); - } catch (Exception e) { - clogger = null; - getLogger().printStackTrace(t); - } - } - - /** - * {@inheritDoc} - */ - @Override - public void log(int level, String msg) { - if (clogger == null) logger.log(level, msg); - else - try { - clogger.log(level, msg); - } catch (Exception e) { - clogger = null; - getLogger().log(level, msg); - } - } - - /** - * {@inheritDoc} - */ - public void warn(String msg) { - if (clogger == null) logger.warn(msg); - else - try { - clogger.warn(msg); - } catch (Exception e) { - clogger = null; - getLogger().warn(msg); - } - } - } - /** * The default PHP arguments. Can be passed via -Dio.soluble.pjb.bridge.php_exec_args=list of urlencoded strings separated by space * Default: "-d display_errors=Off -d log_errors=On -d java.persistent_servlet_connections=On" @@ -285,12 +182,13 @@ public void warn(String msg) { * libraries). */ public static final String DEFAULT_EXT_DIRS[] = {"/usr/share/java/ext", "/usr/java/packages/lib/ext"}; - + //TODO: platform neutrality /** * Set to true if the VM is gcj, false otherwise */ public static final boolean IS_GNU_JAVA = checkVM(); + //TODO: drop GNU Java support /** * The name of the extension, usually "JavaBridge" or "MonoBridge" @@ -360,14 +258,6 @@ public void warn(String msg) { */ public static String JAVABRIDGE_BASE; - private static String getProperty(Properties p, String key, String defaultValue) { - String s = null; - if (p != null) s = p.getProperty(key); - if (s == null) s = System.getProperty("io.soluble.pjb.bridge." + String.valueOf(key).toLowerCase()); - if (s == null) s = defaultValue; - return s; - } - /** * Only for internal use */ @@ -391,6 +281,28 @@ private static String getProperty(Properties p, String key, String defaultValue) private static String sessionSavePath; + /** + * Script engines are started from this pool. + * Use pool.destroy() to destroy the thread pool upon JVM or servlet shutdown + */ + public static final ThreadPool PHP_SCRIPT_ENGINE_THREAD_POOL = + new ThreadPool("JavaBridgeStandaloneScriptEngineProxy", Integer.parseInt(Util.THREAD_POOL_MAX_SIZE)) { + @Override + protected ThreadPool.Delegate createDelegate(String name) { + ThreadPool.Delegate d = super.createDelegate(name); + d.setDaemon(true); + return d; + } + }; + + private static String getProperty(Properties p, String key, String defaultValue) { + String s = null; + if (p != null) s = p.getProperty(key); + if (s == null) s = System.getProperty("io.soluble.pjb.bridge." + String.valueOf(key).toLowerCase()); + if (s == null) s = defaultValue; + return s; + } + private static void initGlobals() { try { @@ -848,20 +760,16 @@ public static byte[] toBytes(String s) { /** * Create a string array from a hashtable. * - * @param h The hashtable + * @param map The hashtable * @return The String * @throws NullPointerException */ - public static String[] hashToStringArray(Map h) { - Vector v = new Vector(); - Iterator e = h.keySet().iterator(); - while (e.hasNext()) { - String k = e.next().toString(); - v.add(k + "=" + h.get(k)); + public static String[] hashToStringArray(Map map) { + ArrayList list = new ArrayList<>(map.size()); + for (String key : map.keySet()) { + list.add(key + "=" + map.get(key)); } - String[] strArr = new String[v.size()]; - v.copyInto(strArr); - return strArr; + return list.toArray(new String[list.size()]); } /** @@ -897,7 +805,8 @@ public static String getHostAddress(boolean promiscuous) { } /** - * Checks if the cgi binary buf-<os.arch>-<os.name>.sh or buf-<os.arch>-<os.name>.exe or buf-<os.arch>-<os.name> exists. + * Checks if the cgi binary buf-<os.arch>-<os.name>.sh or buf-<os.arch>-<os.name>.exe + * or buf-<os.arch>-<os.name> exists. * * @param php the php binary or null * @return The full name or null. @@ -949,97 +858,452 @@ public static String checkError(String s) { } /** - * Convenience daemon thread class + * Redirect System.out and System.err to the configured logFile or System.err. + * System.out is always redirected, either to the logFile or to System.err. + * This is because System.out is reserved to report the status back to the + * container (IIS, Apache, ...) running the JavaBridge back-end. + * + * @param redirectOutput this flag is set, if natcJavaBridge has already redirected stdin, stdout, stderr + * @param logFile the log file */ - public static class Thread extends java.lang.Thread { - /** - * Create a new thread - */ - public Thread() { - super(); - initThread(); - } - - /** - * Create a new thread - * - * @param name - */ - public Thread(String name) { - super(name); - initThread(); - } + static void redirectOutput(String logFile) { + redirectJavaOutput(logFile); + } - /** - * Create a new thread - * - * @param target - */ - public Thread(Runnable target) { - super(target); - initThread(); + static void redirectJavaOutput(String logFile) { + Util.logStream = System.err; + if (logFile != null && logFile.length() > 0) + try { + Util.logStream = new java.io.PrintStream(new java.io.FileOutputStream(logFile)); + } catch (Exception e) { + e.printStackTrace(); + } + try { + System.setErr(logStream); + } catch (Exception e) { + e.printStackTrace(); } - - /** - * Create a new thread - * - * @param group - * @param target - */ - public Thread(ThreadGroup group, Runnable target) { - super(group, target); - initThread(); + try { + System.setOut(logStream); + } catch (Exception e) { + e.printStackTrace(); + System.exit(9); } + } - /** - * Create a new thread - * - * @param group - * @param name - */ - public Thread(ThreadGroup group, String name) { - super(group, name); - initThread(); + private static List getEnvironmentBlacklist(Properties p) { + List l = new LinkedList(); + try { + String s = getProperty(p, "PHP_ENV_BLACKLIST", "PHPRC"); + StringTokenizer t = new StringTokenizer(s, " "); + while (t.hasMoreTokens()) l.add(t.nextToken()); + } catch (Exception e) { + e.printStackTrace(); + l = new LinkedList(); + l.add("PHPRC"); } + return l; + } - /** - * Create a new thread - * - * @param target - * @param name - */ - public Thread(Runnable target, String name) { - super(target, name); - initThread(); + private static HashMap getCommonEnvironment(List blacklist) { + String entries[] = { + "PATH", "PATH", "LD_LIBRARY_PATH", "LD_ASSUME_KERNEL", "USER", "TMP", "TEMP", "HOME", "HOMEPATH", "LANG", "TZ", "OS" + }; + HashMap defaultEnv = new HashMap(); + String key, val; + Method m = null; + try { + m = System.class.getMethod("getenv", new Class[]{String.class}); + } catch (Exception e) {/*ignore*/} + for (String entrie : entries) { + val = null; + if (m != null) { + try { + val = (String) m.invoke(System.class, (Object[]) new String[]{entrie}); + } catch (Exception e) { + m = null; + } + } + if (val == null) { + try { + val = System.getProperty(entrie); + } catch (Exception e) {/*ignore*/} + } + if ((val != null) && (!blacklist.contains(entrie))) { + defaultEnv.put(entrie, val); + } } - /** - * Create a new thread - * - * @param group - * @param target - * @param name - */ - public Thread(ThreadGroup group, Runnable target, String name) { - super(group, target, name); + // check for windows SystemRoot, needed for socket operations + key = val = null; + if ((new File("c:/winnt")).isDirectory()) val = "c:\\winnt"; + else if ((new File("c:/windows")).isDirectory()) val = "c:\\windows"; + try { + String s = System.getenv(key = "SystemRoot"); + if (s != null) val = s; + } catch (Throwable t) {/*ignore*/} + try { + String s = System.getProperty(key = "Windows.SystemRoot"); + if (s != null) val = s; + } catch (Throwable t) {/*ignore*/} + if (val != null && (!blacklist.contains(key))) defaultEnv.put("SystemRoot", val); + + // add all non-blacklisted environment entries + try { + m = System.class.getMethod("getenv", ZERO_PARAM); + Map map = (Map) m.invoke(System.class, ZERO_ARG); + for (Iterator ii = map.entrySet().iterator(); ii.hasNext(); ) { + Entry entry = (Entry) ii.next(); + key = (String) entry.getKey(); + val = (String) entry.getValue(); + + if (!blacklist.contains(key)) + defaultEnv.put(key, val); + } + } catch (Exception e) { + e.printStackTrace(); + } + + return defaultEnv; + } + + /** + * This procedure should be used whenever object may be a dynamic proxy: + * String.valueOf(object) returns null, if object is a proxy and returns null. + * + * @param object The object or dynamic proxy + * @return The string representation of object + */ + public static String stringValueOf(Object object) { + String s = String.valueOf(object); + if (s == null) s = String.valueOf(s); + return s; + } + + /** + * Create a new AppThreadPool. + * + * @param name The pool name + * @return A new AppThreadPool for up to {@link #THREAD_POOL_MAX_SIZE} runnables + */ + public static AppThreadPool createThreadPool(String name) { + AppThreadPool pool = null; + int maxSize = 20; + try { + maxSize = Integer.parseInt(Util.THREAD_POOL_MAX_SIZE); + } catch (Throwable t) { + Util.printStackTrace(t); + } + if (maxSize > 0) { + pool = new AppThreadPool(name, maxSize); + } + return pool; + } + + + /** + * parse java.log_file=@HOST:PORT + * + * @param logFile The log file from the PHP .ini file + * @return true, if we can use the log4j logger, false otherwise. + */ + static boolean setConfiguredLogger(String logFile) { + try { + return tryConfiguredChainsawLogger(logFile); + } catch (Exception e) { + printStackTrace(e); + Util.setDefaultLogger(new FileLogger()); + } + return true; + } + + /** + * parse java.log_file=@HOST:PORT + * + * @param logFile The log file from the PHP .ini file + * @return true, if we can use the log4j logger, false otherwise. + * @throws Exception + */ + private static boolean tryConfiguredChainsawLogger(String logFile) throws Exception { + if (logFile != null && logFile.length() > 0 && logFile.charAt(0) == '@') { + logFile = logFile.substring(1, logFile.length()); + int idx = logFile.indexOf(':'); + int port = -1; + String host = null; + if (idx != -1) { + String p = logFile.substring(idx + 1, logFile.length()); + if (p.length() > 0) port = Integer.parseInt(p); + host = logFile.substring(0, idx); + } else { + if (logFile.length() > 0) host = logFile; + } + ILogger logger = ConfiguredChainsawLogger.createLogger(host, port); + Util.setDefaultLogger(logger); + return true; + } + return false; + } + + /** + * Return the time in GMT + * + * @param ms the time in milliseconds + * @return The formatted date string + */ + public static String formatDateTime(long ms) { + java.sql.Timestamp t = new java.sql.Timestamp(ms); + DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.LONG, Locale.ENGLISH); + formatter.setTimeZone(TimeZone.getTimeZone("GMT")); + String str = formatter.format(t); + return str; + } + + static final boolean checkVM() { + try { + return "libgcj".equals(System.getProperty("gnu.classpath.vm.shortname")); + } catch (Throwable t) { + return false; + } + } + + /** + * Return the thread context class loader + * + * @return The context class loader + */ + public static ClassLoader getContextClassLoader() { + ClassLoader loader = null; + try { + loader = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) {/*ignore*/} + if (loader == null) loader = JavaBridge.class.getClassLoader(); + return loader; + } + + public static Class classForName(String name) throws ClassNotFoundException { + return Class.forName(name, true, getContextClassLoader()); + } + + public static String getSimpleRedirectString(String webPath, String socketName, boolean isSecure) { + try { + StringBuilder buf = new StringBuilder(); + buf.append(socketName); + buf.append("/"); + buf.append(webPath); + URI uri = new URI(isSecure ? "s:127.0.0.1" : "h:127.0.0.1", buf.toString(), null); + return (uri.toASCIIString() + ".phpjavabridge"); + } catch (URISyntaxException e) { + Util.printStackTrace(e); + } + StringBuilder buf = new StringBuilder(isSecure ? "s:127.0.0.1" : "h:127.0.0.1:"); + buf.append(socketName); + buf.append('/'); + buf.append(webPath); + buf.append(".phpjavabridge"); + return buf.toString(); + } + + /** + * Destroy the thread associated with util. + */ + public static void destroy() { + try { + PHP_SCRIPT_ENGINE_THREAD_POOL.destroy(); + } catch (Exception e) { + Util.printStackTrace(e); + } + try { + if (fcgiConnectionPool != null) fcgiConnectionPool.destroy(); + } catch (Exception e) { + Util.printStackTrace(e); + } + try { + JavaBridgeRunner.destroyRunner(); + } catch (Exception e) { + Util.printStackTrace(e); + } + } + + /** + * Convenience daemon thread class + */ + public static class Thread extends java.lang.Thread { + /** + * Create a new thread + */ + public Thread() { + super(); + initThread(); + } + + /** + * Create a new thread + * + * @param name + */ + public Thread(String name) { + super(name); + initThread(); + } + + /** + * Create a new thread + * + * @param target + */ + public Thread(Runnable target) { + super(target); + initThread(); + } + + /** + * Create a new thread + * + * @param group + * @param target + */ + public Thread(ThreadGroup group, Runnable target) { + super(group, target); + initThread(); + } + + /** + * Create a new thread + * + * @param group + * @param name + */ + public Thread(ThreadGroup group, String name) { + super(group, name); + initThread(); + } + + /** + * Create a new thread + * + * @param target + * @param name + */ + public Thread(Runnable target, String name) { + super(target, name); + initThread(); + } + + /** + * Create a new thread + * + * @param group + * @param target + * @param name + */ + public Thread(ThreadGroup group, Runnable target, String name) { + super(group, target, name); initThread(); } /** - * Create a new thread - * - * @param group - * @param target - * @param name - * @param stackSize + * Create a new thread + * + * @param group + * @param target + * @param name + * @param stackSize + */ + public Thread(ThreadGroup group, Runnable target, String name, long stackSize) { + super(group, target, name, stackSize); + initThread(); + } + + private void initThread() { + setDaemon(true); + } + } + + /** + * Only for internal use. Use Util.getLogger() instread. + *

+ * A bridge which uses log4j or the default logger. + */ + public static class Logger implements ILogger { + protected ChainsawLogger clogger = null; + protected ILogger logger; + + /** + * Use chainsaw, if available or a default logger. + */ + public Logger() { + logger = new FileLogger(); // log to logStream + } + + /** + * Use chainsaw, if available. + * + * @param logger The specified logger. + */ + public Logger(ILogger logger) { + this(!DEFAULT_LOG_FILE_SET, logger); + } + + public Logger(boolean useChainsaw, ILogger logger) { + if (useChainsaw) + try { + this.clogger = ChainsawLogger.createChainsawLogger(); + } catch (Exception e) { + if (Util.logLevel > 5) e.printStackTrace(); + this.logger = logger; + } + else { + this.logger = logger; + } + } + + private ILogger getLogger() { + if (logger == null) return logger = new FileLogger(); + return logger; + } + + /** + * {@inheritDoc} + */ + @Override + public void printStackTrace(Throwable t) { + if (clogger == null) logger.printStackTrace(t); + else + try { + clogger.printStackTrace(t); + } catch (Exception e) { + clogger = null; + getLogger().printStackTrace(t); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void log(int level, String msg) { + if (clogger == null) logger.log(level, msg); + else + try { + clogger.log(level, msg); + } catch (Exception e) { + clogger = null; + getLogger().log(level, msg); + } + } + + /** + * {@inheritDoc} */ - public Thread(ThreadGroup group, Runnable target, String name, long stackSize) { - super(group, target, name, stackSize); - initThread(); - } - - private void initThread() { - setDaemon(true); + public void warn(String msg) { + if (clogger == null) logger.warn(msg); + else + try { + clogger.warn(msg); + } catch (Exception e) { + clogger = null; + getLogger().warn(msg); + } } } @@ -1051,22 +1315,25 @@ public static class Process extends java.lang.Process { protected java.lang.Process proc; private String[] args; private File homeDir; - private Map env; - private boolean tryOtherLocations; - private boolean preferSystemPhp; private boolean isOldPhpVersion = false; // php < 5.3 - private boolean includeJava; - private String cgiDir; - private String pearDir; - private String webInfDir; + private final Map env; + private final boolean tryOtherLocations; + private final boolean preferSystemPhp; + private final boolean includeJava; + private final String cgiDir; + private final String pearDir; + private final String webInfDir; - private String getQuoted(String key, String val) { - if (isOldPhpVersion) return key + val; - StringBuffer buf = new StringBuffer(key); - buf.append("'"); - buf.append(val); - buf.append("'"); - return buf.toString(); + protected Process(String[] args, boolean includeJava, String cgiDir, String pearDir, String webInfDir, File homeDir, Map env, boolean tryOtherLocations, boolean preferSystemPhp) { + this.args = args; + this.homeDir = homeDir; + this.env = env; + this.tryOtherLocations = tryOtherLocations; + this.preferSystemPhp = preferSystemPhp; + this.includeJava = includeJava; + this.cgiDir = cgiDir; + this.pearDir = pearDir; + this.webInfDir = webInfDir; } /** @@ -1080,7 +1347,12 @@ private String getQuoted(String key, String val) { * @return args with PHP_ARGS appended */ private String[] getPhpArgs(String[] args, boolean includeJava, String cgiDir, String pearDir, String webInfDir) { - String[] allArgs = new String[args.length + PHP_ARGS.length + ((sessionSavePath != null) ? 2 : 0) + (includeJava ? 1 : 0) + (cgiDir != null ? 2 : 0) + (pearDir != null ? 2 : 0) + (webInfDir != null ? 2 : 0)]; + String[] allArgs = new String[args.length + PHP_ARGS.length + + ((sessionSavePath != null) ? 2 : 0) + + (includeJava ? 1 : 0) + + (cgiDir != null ? 2 : 0) + + (pearDir != null ? 2 : 0) + + (webInfDir != null ? 2 : 0)]; int i = 0; for (i = 0; i < args.length; i++) { allArgs[i] = args[i]; @@ -1109,13 +1381,22 @@ private String[] getPhpArgs(String[] args, boolean includeJava, String cgiDir, S allArgs[i++] = getQuoted("java.web_inf_dir=", webInfDir); } if (includeJava) allArgs[i++] = "-C"; // don't chdir, we'll do it - for (int j = 0; j < PHP_ARGS.length; j++) { - allArgs[i++] = PHP_ARGS[j]; + for (String PHP_ARGS1 : PHP_ARGS) { + allArgs[i++] = PHP_ARGS1; } return allArgs; } + private String getQuoted(String key, String val) { + if (isOldPhpVersion) return key + val; + StringBuilder buf = new StringBuilder(key); + buf.append("'"); + buf.append(val); + buf.append("'"); + return buf.toString(); + } + protected String[] quoteArgs(String[] s) { // quote all args for windows if (!USE_SH_WRAPPER) @@ -1305,18 +1586,6 @@ protected void start() throws NullPointerException, IOException { throw new IOException("PHP not found. Please install php-cgi. PHP test command was: " + java.util.Arrays.asList(getTestArgumentArray(php, args)) + " "); } - protected Process(String[] args, boolean includeJava, String cgiDir, String pearDir, String webInfDir, File homeDir, Map env, boolean tryOtherLocations, boolean preferSystemPhp) { - this.args = args; - this.homeDir = homeDir; - this.env = env; - this.tryOtherLocations = tryOtherLocations; - this.preferSystemPhp = preferSystemPhp; - this.includeJava = includeJava; - this.cgiDir = cgiDir; - this.pearDir = pearDir; - this.webInfDir = webInfDir; - } - /** * Starts a CGI process and returns the process handle. * @@ -1390,280 +1659,129 @@ public InputStream getInputStream() { } /** - * {@inheritDoc} - */ - public InputStream getErrorStream() { - return proc.getErrorStream(); - } - - /** - * {@inheritDoc} - */ - public int waitFor() throws InterruptedException { - return proc.waitFor(); - } - - /** - * {@inheritDoc} - */ - public int exitValue() { - return proc.exitValue(); - } - - /** - * {@inheritDoc} - */ - public void destroy() { - proc.destroy(); - } - - } - - /** - * Starts a CGI process with an error handler attached and returns the process handle. - */ - public static class ProcessWithErrorHandler extends Process { - StringBuffer error = null; - InputStream in = null; - OutputStream err = null; - - protected ProcessWithErrorHandler(String[] args, boolean includeJava, String cgiDir, String pearDir, String webInfDir, File homeDir, Map env, boolean tryOtherLocations, boolean preferSystemPhp, OutputStream err) throws IOException { - super(args, includeJava, cgiDir, pearDir, webInfDir, homeDir, env, tryOtherLocations, preferSystemPhp); - this.err = err; - } - - protected void start() throws IOException { - super.start(); - (new Util.Thread("CGIErrorReader") { - public void run() { - readErrorStream(); - } - }).start(); - } - - /** - * {@inheritDoc} - */ - public void checkError() throws PhpException { - String errorString = error == null ? null : Util.checkError(error.toString()); - if (errorString != null) throw new PhpException(errorString); - } - - private synchronized void readErrorStream() { - byte[] buf = new byte[BUF_SIZE]; - int c; - try { - in = proc.getErrorStream(); - while ((c = in.read(buf)) != -1) { - err.write(buf, 0, c); - String s = new String(buf, 0, c, ASCII); - if (Util.logLevel > 4) Util.logError(s); - if (error == null) error = new StringBuffer(s); - else error.append(s); - } - } catch (IOException e) { - e.printStackTrace(); - } finally { - if (in != null) - try { - in.close(); - } catch (IOException e1) { - e1.printStackTrace(); - } - notify(); - } - } - - /** - * {@inheritDoc} - */ - public synchronized int waitFor() throws InterruptedException { - if (in == null) wait(); - return super.waitFor(); - } - - /** - * Starts a CGI process and returns the process handle. - * - * @param args The args array, e.g.: new String[]{null, "-b", ...};. If args is null or if args[0] is null, the function looks for the system property "io.soluble.pjb.bridge.php_exec". - * @param homeDir The home directory. If null, the current working directory is used. - * @param env The CGI environment. If null, Util.DEFAULT_CGI_ENVIRONMENT is used. - * @param tryOtherLocations true if the should check DEFAULT_CGI_LOCATIONS - * @param preferSystemPhp true if the should check DEFAULT_CGI_LOCATIONS first - * @param err The error stream - * @return The process handle. - * @throws IOException - * @see Util#checkCgiBinary(String) - */ - public static Process start(String[] args, boolean includeJava, String cgiDir, String pearDir, String webInfDir, File homeDir, Map env, boolean tryOtherLocations, boolean preferSystemPhp, OutputStream err) throws IOException { - Process proc = new ProcessWithErrorHandler(args, includeJava, cgiDir, pearDir, webInfDir, homeDir, env, tryOtherLocations, preferSystemPhp, err); - proc.start(); - return proc; - } - } - - /** - * Redirect System.out and System.err to the configured logFile or System.err. - * System.out is always redirected, either to the logFile or to System.err. - * This is because System.out is reserved to report the status back to the - * container (IIS, Apache, ...) running the JavaBridge back-end. - * - * @param redirectOutput this flag is set, if natcJavaBridge has already redirected stdin, stdout, stderr - * @param logFile the log file - */ - static void redirectOutput(String logFile) { - redirectJavaOutput(logFile); - } - - static void redirectJavaOutput(String logFile) { - Util.logStream = System.err; - if (logFile != null && logFile.length() > 0) - try { - Util.logStream = new java.io.PrintStream(new java.io.FileOutputStream(logFile)); - } catch (Exception e) { - e.printStackTrace(); - } - try { - System.setErr(logStream); - } catch (Exception e) { - e.printStackTrace(); - } - try { - System.setOut(logStream); - } catch (Exception e) { - e.printStackTrace(); - System.exit(9); - } - } - - private static List getEnvironmentBlacklist(Properties p) { - List l = new LinkedList(); - try { - String s = getProperty(p, "PHP_ENV_BLACKLIST", "PHPRC"); - StringTokenizer t = new StringTokenizer(s, " "); - while (t.hasMoreTokens()) l.add(t.nextToken()); - } catch (Exception e) { - e.printStackTrace(); - l = new LinkedList(); - l.add("PHPRC"); - } - return l; - } - - private static HashMap getCommonEnvironment(List blacklist) { - String entries[] = { - "PATH", "PATH", "LD_LIBRARY_PATH", "LD_ASSUME_KERNEL", "USER", "TMP", "TEMP", "HOME", "HOMEPATH", "LANG", "TZ", "OS" - }; - HashMap defaultEnv = new HashMap(); - String key, val; - Method m = null; - try { - m = System.class.getMethod("getenv", new Class[]{String.class}); - } catch (Exception e) {/*ignore*/} - for (int i = 0; i < entries.length; i++) { - val = null; - if (m != null) { - try { - val = (String) m.invoke(System.class, (Object[]) new String[]{entries[i]}); - } catch (Exception e) { - m = null; - } - } - if (val == null) { - try { - val = System.getProperty(entries[i]); - } catch (Exception e) {/*ignore*/} - } - if ((val != null) && (!blacklist.contains(entries[i]))) - defaultEnv.put(entries[i], val); - } - - // check for windows SystemRoot, needed for socket operations - key = val = null; - if ((new File("c:/winnt")).isDirectory()) val = "c:\\winnt"; - else if ((new File("c:/windows")).isDirectory()) val = "c:\\windows"; - try { - String s = System.getenv(key = "SystemRoot"); - if (s != null) val = s; - } catch (Throwable t) {/*ignore*/} - try { - String s = System.getProperty(key = "Windows.SystemRoot"); - if (s != null) val = s; - } catch (Throwable t) {/*ignore*/} - if (val != null && (!blacklist.contains(key))) defaultEnv.put("SystemRoot", val); + * {@inheritDoc} + */ + public InputStream getErrorStream() { + return proc.getErrorStream(); + } - // add all non-blacklisted environment entries - try { - m = System.class.getMethod("getenv", ZERO_PARAM); - Map map = (Map) m.invoke(System.class, ZERO_ARG); - for (Iterator ii = map.entrySet().iterator(); ii.hasNext(); ) { - Entry entry = (Entry) ii.next(); - key = (String) entry.getKey(); - val = (String) entry.getValue(); + /** + * {@inheritDoc} + */ + public int waitFor() throws InterruptedException { + return proc.waitFor(); + } - if (!blacklist.contains(key)) - defaultEnv.put(key, val); - } - } catch (Exception e) { - e.printStackTrace(); + /** + * {@inheritDoc} + */ + public int exitValue() { + return proc.exitValue(); } - return defaultEnv; - } + /** + * {@inheritDoc} + */ + public void destroy() { + proc.destroy(); + } - /** - * This procedure should be used whenever object may be a dynamic proxy: - * String.valueOf(object) returns null, if object is a proxy and returns null. - * - * @param object The object or dynamic proxy - * @return The string representation of object - */ - public static String stringValueOf(Object object) { - String s = String.valueOf(object); - if (s == null) s = String.valueOf(s); - return s; } /** - * Create a new AppThreadPool. - * - * @param name The pool name - * @return A new AppThreadPool for up to {@link #THREAD_POOL_MAX_SIZE} runnables + * Starts a CGI process with an error handler attached and returns the process handle. */ - public static AppThreadPool createThreadPool(String name) { - AppThreadPool pool = null; - int maxSize = 20; - try { - maxSize = Integer.parseInt(Util.THREAD_POOL_MAX_SIZE); - } catch (Throwable t) { - Util.printStackTrace(t); + public static class ProcessWithErrorHandler extends Process { + StringBuffer error = null; + InputStream in = null; + OutputStream err = null; + + protected ProcessWithErrorHandler(String[] args, boolean includeJava, String cgiDir, String pearDir, String webInfDir, File homeDir, Map env, boolean tryOtherLocations, boolean preferSystemPhp, OutputStream err) throws IOException { + super(args, includeJava, cgiDir, pearDir, webInfDir, homeDir, env, tryOtherLocations, preferSystemPhp); + this.err = err; } - if (maxSize > 0) { - pool = new AppThreadPool(name, maxSize); + + @Override + protected void start() throws IOException { + super.start(); + (new Util.Thread("CGIErrorReader") { + @Override + public void run() { + readErrorStream(); + } + }).start(); } - return pool; - } + /** + * {@inheritDoc} + */ + @Override + public void checkError() throws PhpException { + String errorString = error == null ? null : Util.checkError(error.toString()); + if (errorString != null) throw new PhpException(errorString); + } - /** - * parse java.log_file=@HOST:PORT - * - * @param logFile The log file from the PHP .ini file - * @return true, if we can use the log4j logger, false otherwise. - */ - static boolean setConfiguredLogger(String logFile) { - try { - return tryConfiguredChainsawLogger(logFile); - } catch (Exception e) { - printStackTrace(e); - Util.setDefaultLogger(new FileLogger()); + private synchronized void readErrorStream() { + byte[] buf = new byte[BUF_SIZE]; + int c; + try { + in = proc.getErrorStream(); + while ((c = in.read(buf)) != -1) { + err.write(buf, 0, c); + String s = new String(buf, 0, c, ASCII); + if (Util.logLevel > 4) Util.logError(s); + if (error == null) error = new StringBuffer(s); + else error.append(s); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (in != null) + try { + in.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + notify(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public synchronized int waitFor() throws InterruptedException { + if (in == null) wait(); + return super.waitFor(); + } + + /** + * Starts a CGI process and returns the process handle. + * + * @param args The args array, e.g.: new String[]{null, "-b", ...};. If args is null or if args[0] is null, the function looks for the system property "io.soluble.pjb.bridge.php_exec". + * @param includeJava + * @param cgiDir + * @param pearDir + * @param webInfDir + * @param homeDir The home directory. If null, the current working directory is used. + * @param env The CGI environment. If null, Util.DEFAULT_CGI_ENVIRONMENT is used. + * @param tryOtherLocations true if the should check DEFAULT_CGI_LOCATIONS + * @param preferSystemPhp true if the should check DEFAULT_CGI_LOCATIONS first + * @param err The error stream + * @return The process handle. + * @throws IOException + * @see Util#checkCgiBinary(String) + */ + public static Process start(String[] args, boolean includeJava, String cgiDir, String pearDir, String webInfDir, File homeDir, Map env, boolean tryOtherLocations, boolean preferSystemPhp, OutputStream err) throws IOException { + Process proc = new ProcessWithErrorHandler(args, includeJava, cgiDir, pearDir, webInfDir, homeDir, env, tryOtherLocations, preferSystemPhp, err); + proc.start(); + return proc; } - return true; } private static final class ConfiguredChainsawLogger extends ChainsawLogger { - private String host; - private int port; + private final String host; + private final int port; private ConfiguredChainsawLogger(String host, int port) { super(); @@ -1677,6 +1795,7 @@ public static ConfiguredChainsawLogger createLogger(String host, int port) throw return logger; } + @Override public void configure(String host, int port) throws Exception { host = this.host != null ? this.host : host; port = this.port > 0 ? this.port : port; @@ -1684,110 +1803,4 @@ public void configure(String host, int port) throws Exception { } } - /** - * parse java.log_file=@HOST:PORT - * - * @param logFile The log file from the PHP .ini file - * @return true, if we can use the log4j logger, false otherwise. - * @throws Exception - */ - private static boolean tryConfiguredChainsawLogger(String logFile) throws Exception { - if (logFile != null && logFile.length() > 0 && logFile.charAt(0) == '@') { - logFile = logFile.substring(1, logFile.length()); - int idx = logFile.indexOf(':'); - int port = -1; - String host = null; - if (idx != -1) { - String p = logFile.substring(idx + 1, logFile.length()); - if (p.length() > 0) port = Integer.parseInt(p); - host = logFile.substring(0, idx); - } else { - if (logFile.length() > 0) host = logFile; - } - ILogger logger = ConfiguredChainsawLogger.createLogger(host, port); - Util.setDefaultLogger(logger); - return true; - } - return false; - } - - /** - * Return the time in GMT - * - * @param ms the time in milliseconds - * @return The formatted date string - */ - public static String formatDateTime(long ms) { - java.sql.Timestamp t = new java.sql.Timestamp(ms); - DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.LONG, Locale.ENGLISH); - formatter.setTimeZone(TimeZone.getTimeZone("GMT")); - String str = formatter.format(t); - return str; - } - - static final boolean checkVM() { - try { - return "libgcj".equals(System.getProperty("gnu.classpath.vm.shortname")); - } catch (Throwable t) { - return false; - } - } - - /** - * Return the thread context class loader - * - * @return The context class loader - */ - public static final ClassLoader getContextClassLoader() { - ClassLoader loader = null; - try { - loader = Thread.currentThread().getContextClassLoader(); - } catch (SecurityException ex) {/*ignore*/} - if (loader == null) loader = JavaBridge.class.getClassLoader(); - return loader; - } - - public static final Class classForName(String name) throws ClassNotFoundException { - return Class.forName(name, true, getContextClassLoader()); - } - - public static String getSimpleRedirectString(String webPath, String socketName, boolean isSecure) { - try { - StringBuffer buf = new StringBuffer(); - buf.append(socketName); - buf.append("/"); - buf.append(webPath); - URI uri = new URI(isSecure ? "s:127.0.0.1" : "h:127.0.0.1", buf.toString(), null); - return (uri.toASCIIString() + ".phpjavabridge"); - } catch (URISyntaxException e) { - Util.printStackTrace(e); - } - StringBuffer buf = new StringBuffer(isSecure ? "s:127.0.0.1" : "h:127.0.0.1:"); - buf.append(socketName); - buf.append('/'); - buf.append(webPath); - buf.append(".phpjavabridge"); - return buf.toString(); - } - - /** - * Destroy the thread associated with util. - */ - public static void destroy() { - try { - PHP_SCRIPT_ENGINE_THREAD_POOL.destroy(); - } catch (Exception e) { - Util.printStackTrace(e); - } - try { - if (fcgiConnectionPool != null) fcgiConnectionPool.destroy(); - } catch (Exception e) { - Util.printStackTrace(e); - } - try { - JavaBridgeRunner.destroyRunner(); - } catch (Exception e) { - Util.printStackTrace(e); - } - } } From ad442f2bfb1d726f251377799655f0caad0f1c51 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Thu, 26 Jan 2017 15:48:39 +0100 Subject: [PATCH 47/75] code quality enhancements --- src/main/java/io/soluble/pjb/bridge/JavaBridge.java | 4 ++-- src/main/java/io/soluble/pjb/bridge/Request.java | 3 +-- src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/soluble/pjb/bridge/JavaBridge.java b/src/main/java/io/soluble/pjb/bridge/JavaBridge.java index 934c71e..39df18d 100644 --- a/src/main/java/io/soluble/pjb/bridge/JavaBridge.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaBridge.java @@ -883,6 +883,8 @@ Object[] coerce(Class parms[], Object args[], Response response) { //logError("Could not create Collection from Map: " +objectDebugDescription(arg) + ". Cause: " + ex); throw new JavaBridgeIllegalArgumentException("Could not create Collection from Map: " + firstChars(arg), ex); } + } else if ((java.util.Map.class).isAssignableFrom(parms[i])) { + result[i] = arg; } else if ((java.util.Hashtable.class).isAssignableFrom(parms[i])) { try { Map ht = (Map) arg; @@ -895,8 +897,6 @@ Object[] coerce(Class parms[], Object args[], Response response) { logError("Could not create Hashtable from Map: " + objectDebugDescription(arg) + ". Cause: " + ex); throw new JavaBridgeIllegalArgumentException("Could not create Hashtable from Map: " + firstChars(arg), ex); } - } else if ((java.util.Map.class).isAssignableFrom(parms[i])) { - result[i] = arg; } else if (arg instanceof PhpString) { result[i] = ((PhpString) arg).getString(); // always prefer strings over byte[] } diff --git a/src/main/java/io/soluble/pjb/bridge/Request.java b/src/main/java/io/soluble/pjb/bridge/Request.java index f8ac0d9..d9987fa 100644 --- a/src/main/java/io/soluble/pjb/bridge/Request.java +++ b/src/main/java/io/soluble/pjb/bridge/Request.java @@ -567,8 +567,7 @@ private int handleRequest() throws IOException { public void handleRequests() throws IOException { if (response == null) response = bridge.createResponse(); this.arg = new SimpleArg(); - while (Parser.OK == handleRequest()) - ; + while (Parser.OK == handleRequest()) {} } /** diff --git a/src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java b/src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java index ae45325..21988ea 100644 --- a/src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java +++ b/src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java @@ -79,7 +79,7 @@ public void init(ServletConfig config) throws ServletException { maxKeepAliveRequests = ServletUtil.getMBeanProperty("*:type=Connector,port=8080", "maxKeepAliveRequests"); keepAliveTimeout = ServletUtil.getMBeanProperty("*:type=Connector,port=8080", "keepAliveTimeout"); - StringBuffer buf = new StringBuffer("timeout="); + StringBuilder buf = new StringBuilder("timeout="); buf.append(keepAliveTimeout); buf.append(", max="); buf.append(maxKeepAliveRequests); From d78c3e1ea6dde5e06e04b922507c63bc8f035ac8 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Fri, 27 Jan 2017 18:46:33 +0100 Subject: [PATCH 48/75] build enhancments --- build.gradle | 48 +++++++++++++++++++++++------------------------ gradle.properties | 2 ++ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/build.gradle b/build.gradle index 7d55bb0..7f38bcc 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,16 @@ group 'io.soluble.pjb' version '6.2.11' +buildscript { + repositories { + jcenter() + } + + dependencies { + classpath 'com.bmuschko:gradle-tomcat-plugin:2.2.5' + } +} + apply plugin: 'java' apply plugin: 'jacoco' apply plugin: 'war' @@ -19,7 +29,7 @@ repositories { dependencies { providedCompile('javax.servlet:servlet-api:2.5') - runtime('log4j:log4j:1:2:17') + runtime('log4j:log4j:1.2.17') testCompile('junit:junit:3.8.2') // the test code still uses this junit API def tomcatVersion = '7.0.59' @@ -36,27 +46,28 @@ if (System.getProperty('php_exec') == null) { ant.importBuild 'build.xml' +clean { + dependsOn genClean +} + jar { baseName "JavaBridge" manifest { - attributes("Main-Class": "io.soluble.pjb.Standalone", - "Implementation-Title": "php-java-bridge.jar", - "Implementation-Version": version) + attributes("Main-Class": "io.soluble.pjb.Standalone") } } war { - dependsOn jar baseName "JavaBridge" - //from 'src/rootContent' // adds a file-set to the root of the archive + //from 'src/rootContent' // could add a file-set to the root of the archive } -clean { - dependsOn genClean -} - -compileJava { - dependsOn genAll +tomcatRun { + contextPath = '/' + httpPort = 8090 +// httpsPort = 8091 +// enableSSL = true + daemon = true } jacocoTestReport { @@ -67,16 +78,3 @@ jacocoTestReport { html.destination "${buildDir}/reports/coverage" } } - -buildscript { - repositories { - jcenter() - } - - dependencies { - classpath 'com.bmuschko:gradle-tomcat-plugin:2.0' - } -} - -tomcatRun.contextPath = '/JavaBridge' -tomcatRun.daemon = true diff --git a/gradle.properties b/gradle.properties index e110e41..902cf00 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,3 @@ org.gradle.jvmargs='-Dfile.encoding=UTF-8' +# -Xdebug +# -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 \ No newline at end of file From 00391e0dac2613cbbd7122938331066d124de66a Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Fri, 27 Jan 2017 18:48:10 +0100 Subject: [PATCH 49/75] keep generated files (generate only on demand) --- .gitignore | 19 +- .../java/io/soluble/pjb/bridge/JavaInc.java | 2089 +++++++++++++++++ .../java/io/soluble/pjb/bridge/JavaProxy.java | 24 + .../io/soluble/pjb/bridge/LauncherUnix.java | 13 + .../soluble/pjb/bridge/LauncherWindows.java | 517 ++++ .../soluble/pjb/bridge/LauncherWindows2.java | 517 ++++ .../soluble/pjb/bridge/LauncherWindows3.java | 517 ++++ .../soluble/pjb/bridge/LauncherWindows4.java | 293 +++ src/main/resources/META-INF/java/Java.inc | 2084 ++++++++++++++++ .../resources/META-INF/java/JavaProxy.php | 19 + src/main/webapp/java/Java.inc | 2084 ++++++++++++++++ src/main/webapp/java/JavaProxy.php | 19 + 12 files changed, 8180 insertions(+), 15 deletions(-) create mode 100644 src/main/java/io/soluble/pjb/bridge/JavaInc.java create mode 100644 src/main/java/io/soluble/pjb/bridge/JavaProxy.java create mode 100644 src/main/java/io/soluble/pjb/bridge/LauncherUnix.java create mode 100644 src/main/java/io/soluble/pjb/bridge/LauncherWindows.java create mode 100644 src/main/java/io/soluble/pjb/bridge/LauncherWindows2.java create mode 100644 src/main/java/io/soluble/pjb/bridge/LauncherWindows3.java create mode 100644 src/main/java/io/soluble/pjb/bridge/LauncherWindows4.java create mode 100644 src/main/resources/META-INF/java/Java.inc create mode 100644 src/main/resources/META-INF/java/JavaProxy.php create mode 100644 src/main/webapp/java/Java.inc create mode 100644 src/main/webapp/java/JavaProxy.php diff --git a/.gitignore b/.gitignore index abf1cd1..cf971e7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,29 +1,18 @@ .idea/ .gradle/ .projectKnowledge/ +nbproject/ +nbbuild.xml +.nb-gradle/ +.nb-gradle-properties build/ dist/ bin/ lib/ doc/API/ .classpath -nbproject/ -nbbuild.xml -.nb-gradle/ -.nb-gradle-properties manifest.mf *.iml *.lock *.log devNull -src/main/java/io/soluble/pjb/bridge/JavaInc.java -src/main/java/io/soluble/pjb/bridge/JavaProxy.java -src/main/java/io/soluble/pjb/bridge/LauncherUnix.java -src/main/java/io/soluble/pjb/bridge/LauncherWindows.java -src/main/java/io/soluble/pjb/bridge/LauncherWindows2.java -src/main/java/io/soluble/pjb/bridge/LauncherWindows3.java -src/main/java/io/soluble/pjb/bridge/LauncherWindows4.java -src/main/resources/META-INF/java/Java.inc -src/main/resources/META-INF/java/JavaProxy.php -src/main/webapp/java/Java.inc -src/main/webapp/java/JavaProxy.php diff --git a/src/main/java/io/soluble/pjb/bridge/JavaInc.java b/src/main/java/io/soluble/pjb/bridge/JavaInc.java new file mode 100644 index 0000000..8c64985 --- /dev/null +++ b/src/main/java/io/soluble/pjb/bridge/JavaInc.java @@ -0,0 +1,2089 @@ +package io.soluble.pjb.bridge; +public class JavaInc { + private static final String data = "0) {\n"+ +"$thiz=$ar[$arLen-1];\n"+ +"return dirname($thiz);\n"+ +"} else {\n"+ +"return \"java\";\n"+ +"}\n"+ +"}\n"+ +"function java_truncate($str) {\n"+ +"if (strlen($str)>955)\n"+ +"return substr($str,0,475).'[...]'.substr($str,-475);\n"+ +"return $str;\n"+ +"}\n"+ +"class java_JavaException extends Exception {\n"+ +"function __toString() {return $this->getMessage();}\n"+ +"};\n"+ +"class java_RuntimeException extends java_JavaException {};\n"+ +"class java_IOException extends java_JavaException {};\n"+ +"class java_ConnectException extends java_IOException {};\n"+ +"class java_IllegalStateException extends java_RuntimeException {};\n"+ +"class java_IllegalArgumentException extends java_RuntimeException {\n"+ +"function __construct($ob) {\n"+ +"parent::__construct(\"illegal argument: \".gettype($ob));\n"+ +"}\n"+ +"};\n"+ +"function java_autoload_function5($x) {\n"+ +"$s=str_replace(\"_\",\".\",$x);\n"+ +"$c=__javaproxy_Client_getClient();\n"+ +"if(!($c->invokeMethod(0,\"typeExists\",array($s)))) return false;\n"+ +"$i=\"class ${x} extends Java {\".\n"+ +"\"static function type(\\$sub=null){if(\\$sub) \\$sub='\\$'.\\$sub; return java('${s}'.\\\"\\$sub\\\");}\".\n"+ +"'function __construct() {$args=func_get_args();'.\n"+ +"'array_unshift($args,'.\"'$s'\".'); parent::__construct($args);}}';\n"+ +"eval (\"$i\");\n"+ +"return true;\n"+ +"}\n"+ +"function java_autoload_function($x) {\n"+ +"$idx=strrpos($x,\"\\\\\"); if (!$idx) return java_autoload_function5($x);\n"+ +"$str=str_replace(\"\\\\\",\".\",$x);\n"+ +"$client=__javaproxy_Client_getClient();\n"+ +"if(!($client->invokeMethod(0,\"typeExists\",array($str)))) return false;\n"+ +"$package=substr($x,0,$idx);\n"+ +"$name=substr($x,1+$idx);\n"+ +"$instance=\"namespace $package; class ${name} extends \\\\Java {\".\n"+ +"\"static function type(\\$sub=null){if(\\$sub) \\$sub='\\$'.\\$sub;return \\\\java('${str}'.\\\"\\$sub\\\");}\".\n"+ +"\"static function __callStatic(\\$procedure,\\$args) {return \\\\java_invoke(\\\\java('${str}'),\\$procedure,\\$args);}\".\n"+ +"'function __construct() {$args=func_get_args();'.\n"+ +"'array_unshift($args,'.\"'$str'\".'); parent::__construct($args);}}';\n"+ +"eval (\"$instance\");\n"+ +"return true;\n"+ +"}\n"+ +"if(!defined(\"JAVA_DISABLE_AUTOLOAD\") && function_exists(\"spl_autoload_register\")) spl_autoload_register(\"java_autoload_function\");\n"+ +"function java_autoload($libs=null) {\n"+ +"trigger_error('Please use tomcat or jee hot deployment instead',E_USER_WARNING);\n"+ +"}\n"+ +"function java_virtual($path,$return=false) {\n"+ +"$req=java_context()->getHttpServletRequest();\n"+ +"$req=new java(\"php.java.servlet.VoidInputHttpServletRequest\",$req);\n"+ +"$res=java_context()->getHttpServletResponse();\n"+ +"$res=new java(\"php.java.servlet.RemoteHttpServletResponse\",$res);\n"+ +"$req->getRequestDispatcher($path)->include($req,$res);\n"+ +"if ($return) return $res->getBufferContents();\n"+ +"echo $res->getBufferContents();\n"+ +"return true;\n"+ +"}\n"+ +"function Java($name) {\n"+ +"static $classMap=array();\n"+ +"if(array_key_exists($name,$classMap)) return $classMap[$name];\n"+ +"return $classMap[$name]=new JavaClass($name);\n"+ +"}\n"+ +"function java_get_closure() {return java_closure_array(func_get_args());}\n"+ +"function java_wrap() {return java_closure_array(func_get_args());}\n"+ +"function java_get_values($arg) { return java_values($arg); }\n"+ +"function java_get_session() {return java_session_array(func_get_args());}\n"+ +"function java_get_context() {return java_context(); }\n"+ +"function java_get_server_name() { return java_server_name(); }\n"+ +"function java_isnull($value) { return is_null (java_values ($value)); }\n"+ +"function java_is_null($value) { return is_null (java_values ($value)); }\n"+ +"function java_istrue($value) { return (boolean)(java_values ($value)); }\n"+ +"function java_is_true($value) { return (boolean)(java_values ($value)); }\n"+ +"function java_isfalse($value) { return !(java_values ($value)); }\n"+ +"function java_is_false($value) { return !(java_values ($value)); }\n"+ +"function java_set_encoding($enc) { return java_set_file_encoding ($enc); }\n"+ +"function java_call_with_continuation($kontinuation=null) {\n"+ +"if (java_getHeader(\"X_JAVABRIDGE_INCLUDE\",$_SERVER) && !java_getHeader(\"X_JAVABRIDGE_INCLUDE_ONLY\",$_SERVER)) {\n"+ +"if (is_null($kontinuation))\n"+ +"java_context()->call(java_closure());\n"+ +"elseif (is_string($kontinuation))\n"+ +"java_context()->call(call_user_func($kontinuation));\n"+ +"elseif ($kontinuation instanceof java_JavaType)\n"+ +"java_context()->call($kontinuation);\n"+ +"else\n"+ +"java_context()->call(java_closure($kontinuation));\n"+ +"}\n"+ +"}\n"+ +"function java_defineHostFromInitialQuery($java_base) {\n"+ +"if($java_base!=\"java\") {\n"+ +"$url=parse_url($java_base);\n"+ +"if(isset($url[\"scheme\"]) && ($url[\"scheme\"]==\"http\" || $url[\"scheme\"]==\"https\")) {\n"+ +"$scheme=$url[\"scheme\"]==\"https\" ? \"ssl://\" : \"\";\n"+ +"$host=$url[\"host\"];\n"+ +"$port=$url[\"port\"];\n"+ +"$path=$url[\"path\"];\n"+ +"define (\"JAVA_HOSTS\",\"${scheme}${host}:${port}\");\n"+ +"$dir=dirname($path);\n"+ +"define (\"JAVA_SERVLET\",\"$dir/servlet.phpjavabridge\");\n"+ +"return true;\n"+ +"}\n"+ +"}\n"+ +"return false;\n"+ +"}\n"+ +"define(\"JAVA_PEAR_VERSION\",\"6.2.11\");\n"+ +"if(!defined(\"JAVA_SEND_SIZE\"))\n"+ +"define(\"JAVA_SEND_SIZE\",8192);\n"+ +"if(!defined(\"JAVA_RECV_SIZE\"))\n"+ +"define(\"JAVA_RECV_SIZE\",8192);\n"+ +"if(!defined(\"JAVA_HOSTS\")) {\n"+ +"if(!java_defineHostFromInitialQuery(java_get_base())) {\n"+ +"if ($java_ini=get_cfg_var(\"java.hosts\")) define(\"JAVA_HOSTS\",$java_ini);\n"+ +"else define(\"JAVA_HOSTS\",\"127.0.0.1:8080\");\n"+ +"}\n"+ +"}\n"+ +"if(!defined(\"JAVA_SERVLET\")) {\n"+ +"if (!(($java_ini=get_cfg_var(\"java.servlet\"))===false)) define(\"JAVA_SERVLET\",$java_ini);\n"+ +"else define(\"JAVA_SERVLET\",1);\n"+ +"}\n"+ +"if(!defined(\"JAVA_LOG_LEVEL\"))\n"+ +"if (!(($java_ini=get_cfg_var(\"java.log_level\"))===false)) define(\"JAVA_LOG_LEVEL\",(int)$java_ini);\n"+ +"else define(\"JAVA_LOG_LEVEL\",null);\n"+ +"if (!defined(\"JAVA_PREFER_VALUES\"))\n"+ +"if ($java_ini=get_cfg_var(\"java.prefer_values\")) define(\"JAVA_PREFER_VALUES\",$java_ini);\n"+ +"else define(\"JAVA_PREFER_VALUES\",0);\n"+ +"class java_SimpleFactory {\n"+ +"public $client;\n"+ +"function java_SimpleFactory($client) {\n"+ +"$this->client=$client;\n"+ +"}\n"+ +"function getProxy($result,$signature,$exception,$wrap) {\n"+ +"return $result;\n"+ +"}\n"+ +"function checkResult($result) {\n"+ +"}\n"+ +"}\n"+ +"class java_ProxyFactory extends java_SimpleFactory {\n"+ +"function create($result,$signature) {\n"+ +"return new java_JavaProxy($result,$signature);\n"+ +"}\n"+ +"function createInternal($proxy) {\n"+ +"return new java_InternalJava($proxy);\n"+ +"}\n"+ +"function getProxy($result,$signature,$exception,$wrap) {\n"+ +"$proxy=$this->create($result,$signature);\n"+ +"if($wrap) $proxy=$this->createInternal($proxy);\n"+ +"return $proxy;\n"+ +"}\n"+ +"}\n"+ +"class java_ArrayProxyFactory extends java_ProxyFactory {\n"+ +"function create($result,$signature) {\n"+ +"return new java_ArrayProxy($result,$signature);\n"+ +"}\n"+ +"}\n"+ +"class java_IteratorProxyFactory extends java_ProxyFactory {\n"+ +"function create($result,$signature) {\n"+ +"return new java_IteratorProxy($result,$signature);\n"+ +"}\n"+ +"}\n"+ +"class java_ExceptionProxyFactory extends java_SimpleFactory {\n"+ +"function create($result,$signature) {\n"+ +"return new java_ExceptionProxy($result,$signature);\n"+ +"}\n"+ +"function getProxy($result,$signature,$exception,$wrap) {\n"+ +"$proxy=$this->create($result,$signature);\n"+ +"if($wrap) $proxy=new java_InternalException($proxy,$exception);\n"+ +"return $proxy;\n"+ +"}\n"+ +"}\n"+ +"class java_ThrowExceptionProxyFactory extends java_ExceptionProxyFactory {\n"+ +"function getProxy($result,$signature,$exception,$wrap) {\n"+ +"$proxy=$this->create($result,$signature);\n"+ +"$proxy=new java_InternalException($proxy,$exception);\n"+ +"return $proxy;\n"+ +"}\n"+ +"function checkResult($result) {\n"+ +"if (JAVA_PREFER_VALUES || ($result->__hasDeclaredExceptions=='T'))\n"+ +"throw $result;\n"+ +"else {\n"+ +"trigger_error(\"Unchecked exception detected: \".java_truncate($result->__toString()),E_USER_WARNING);\n"+ +"}\n"+ +"}\n"+ +"}\n"+ +"class java_CacheEntry {\n"+ +"public $fmt,$signature,$factory,$java;\n"+ +"public $resultVoid;\n"+ +"function java_CacheEntry($fmt,$signature,$factory,$resultVoid) {\n"+ +"$this->fmt=$fmt;\n"+ +"$this->signature=$signature;\n"+ +"$this->factory=$factory;\n"+ +"$this->resultVoid=$resultVoid;\n"+ +"}\n"+ +"}\n"+ +"class java_Arg {\n"+ +"public $client;\n"+ +"public $exception;\n"+ +"public $factory,$val;\n"+ +"public $signature;\n"+ +"function java_Arg($client) {\n"+ +"$this->client=$client;\n"+ +"$this->factory=$client->simpleFactory;\n"+ +"}\n"+ +"function linkResult(&$val) {\n"+ +"$this->val=&$val;\n"+ +"}\n"+ +"function setResult($val) {\n"+ +"$this->val=&$val;\n"+ +"}\n"+ +"function getResult($wrap) {\n"+ +"$rc=$this->factory->getProxy($this->val,$this->signature,$this->exception,$wrap);\n"+ +"$factory=$this->factory;\n"+ +"$this->factory=$this->client->simpleFactory;\n"+ +"$factory->checkResult($rc);\n"+ +"return $rc;\n"+ +"}\n"+ +"function setFactory($factory) {\n"+ +"$this->factory=$factory;\n"+ +"}\n"+ +"function setException($string) {\n"+ +"$this->exception=$string;\n"+ +"}\n"+ +"function setVoidSignature() {\n"+ +"$this->signature=\"@V\";\n"+ +"$key=$this->client->currentCacheKey;\n"+ +"if($key && $key[0]!='~') {\n"+ +"$this->client->currentArgumentsFormat[6]=\"3\";\n"+ +"$cacheEntry=new java_CacheEntry($this->client->currentArgumentsFormat,$this->signature,$this->factory,true);\n"+ +"$this->client->methodCache[$key]=$cacheEntry;\n"+ +"}\n"+ +"}\n"+ +"function setSignature($signature) {\n"+ +"$this->signature=$signature;\n"+ +"$key=$this->client->currentCacheKey;\n"+ +"if($key && $key[0]!='~') {\n"+ +"$cacheEntry=new java_CacheEntry($this->client->currentArgumentsFormat,$this->signature,$this->factory,false);\n"+ +"$this->client->methodCache[$key]=$cacheEntry;\n"+ +"}\n"+ +"}\n"+ +"}\n"+ +"class java_CompositeArg extends java_Arg {\n"+ +"public $parentArg;\n"+ +"public $idx;\n"+ +"public $type;\n"+ +"public $counter;\n"+ +"function java_CompositeArg($client,$type) {\n"+ +"parent::java_Arg($client);\n"+ +"$this->type=$type;\n"+ +"$this->val=array();\n"+ +"$this->counter=0;\n"+ +"}\n"+ +"function setNextIndex() {\n"+ +"$this->idx=$this->counter++;\n"+ +"}\n"+ +"function setIndex($val) {\n"+ +"$this->idx=$val;\n"+ +"}\n"+ +"function linkResult(&$val) {\n"+ +"$this->val[$this->idx]=&$val;\n"+ +"}\n"+ +"function setResult($val) {\n"+ +"$this->val[$this->idx]=$this->factory->getProxy($val,$this->signature,$this->exception,true);\n"+ +"$this->factory=$this->client->simpleFactory;\n"+ +"}\n"+ +"}\n"+ +"class java_ApplyArg extends java_CompositeArg {\n"+ +"public $m,$p,$v,$n;\n"+ +"function java_ApplyArg($client,$type,$m,$p,$v,$n) {\n"+ +"parent::java_CompositeArg($client,$type);\n"+ +"$this->m=$m;\n"+ +"$this->p=$p;\n"+ +"$this->v=$v;\n"+ +"$this->n=$n;\n"+ +"}\n"+ +"}\n"+ +"class java_Client {\n"+ +"public $RUNTIME;\n"+ +"public $result,$exception;\n"+ +"public $parser;\n"+ +"public $simpleArg,$compositeArg;\n"+ +"public $simpleFactory,\n"+ +"$proxyFactory,$iteratorProxyFacroty,\n"+ +"$arrayProxyFactory,$exceptionProxyFactory,$throwExceptionProxyFactory;\n"+ +"public $arg;\n"+ +"public $asyncCtx,$cancelProxyCreationCounter;\n"+ +"public $globalRef;\n"+ +"public $stack;\n"+ +"public $defaultCache=array(),$asyncCache=array(),$methodCache;\n"+ +"public $isAsync=0;\n"+ +"public $currentCacheKey,$currentArgumentsFormat;\n"+ +"public $cachedJavaPrototype;\n"+ +"public $sendBuffer,$preparedToSendBuffer;\n"+ +"public $inArgs;\n"+ +"function java_Client() {\n"+ +"$this->RUNTIME=array();\n"+ +"$this->RUNTIME[\"NOTICE\"]='***USE echo java_inspect(jVal) OR print_r(java_values(jVal)) TO SEE THE CONTENTS OF THIS JAVA OBJECT!***';\n"+ +"$this->parser=new java_Parser($this);\n"+ +"$this->protocol=new java_Protocol($this);\n"+ +"$this->simpleFactory=new java_SimpleFactory($this);\n"+ +"$this->proxyFactory=new java_ProxyFactory($this);\n"+ +"$this->arrayProxyFactory=new java_ArrayProxyFactory($this);\n"+ +"$this->iteratorProxyFactory=new java_IteratorProxyFactory($this);\n"+ +"$this->exceptionProxyFactory=new java_ExceptionProxyFactory($this);\n"+ +"$this->throwExceptionProxyFactory=new java_ThrowExceptionProxyFactory($this);\n"+ +"$this->cachedJavaPrototype=new java_JavaProxyProxy($this);\n"+ +"$this->simpleArg=new java_Arg($this);\n"+ +"$this->globalRef=new java_GlobalRef();\n"+ +"$this->asyncCtx=$this->cancelProxyCreationCounter=0;\n"+ +"$this->methodCache=$this->defaultCache;\n"+ +"$this->inArgs=false;\n"+ +"}\n"+ +"function read($size) {\n"+ +"return $this->protocol->read($size);\n"+ +"}\n"+ +"function setDefaultHandler() {\n"+ +"$this->methodCache=$this->defaultCache;\n"+ +"}\n"+ +"function setAsyncHandler() {\n"+ +"$this->methodCache=$this->asyncCache;\n"+ +"}\n"+ +"function handleRequests() {\n"+ +"$tail_call=false;\n"+ +"do {\n"+ +"$this->stack=array($this->arg=$this->simpleArg);\n"+ +"$this->idx=0;\n"+ +"$this->parser->parse();\n"+ +"if((count($this->stack)) > 1) {\n"+ +"$arg=array_pop($this->stack);\n"+ +"$this->apply($arg);\n"+ +"$tail_call=true;\n"+ +"} else {\n"+ +"$tail_call=false;\n"+ +"}\n"+ +"$this->stack=null;\n"+ +"} while($tail_call);\n"+ +"return 1;\n"+ +"}\n"+ +"function getWrappedResult($wrap) {\n"+ +"return $this->simpleArg->getResult($wrap);\n"+ +"}\n"+ +"function getInternalResult() {\n"+ +"return $this->getWrappedResult(false);\n"+ +"}\n"+ +"function getResult() {\n"+ +"return $this->getWrappedResult(true);\n"+ +"}\n"+ +"function getProxyFactory($type) {\n"+ +"switch($type[0]) {\n"+ +"case 'E':\n"+ +"$factory=$this->exceptionProxyFactory;\n"+ +"break;\n"+ +"case 'C':\n"+ +"$factory=$this->iteratorProxyFactory;\n"+ +"break;\n"+ +"case 'A':\n"+ +"$factory=$this->arrayProxyFactory;\n"+ +"break;\n"+ +"default:\n"+ +"case 'O':\n"+ +"$factory=$this->proxyFactory;\n"+ +"}\n"+ +"return $factory;\n"+ +"}\n"+ +"function link(&$arg,&$newArg) {\n"+ +"$arg->linkResult($newArg->val);\n"+ +"$newArg->parentArg=$arg;\n"+ +"}\n"+ +"function getExact($str) {\n"+ +"return hexdec($str);\n"+ +"}\n"+ +"function getInexact($str) {\n"+ +"$val=null;\n"+ +"sscanf($str,\"%e\",$val);\n"+ +"return $val;\n"+ +"}\n"+ +"function begin($name,$st) {\n"+ +"$arg=$this->arg;\n"+ +"switch($name[0]) {\n"+ +"case 'A':\n"+ +"$object=$this->globalRef->get($this->getExact($st['v']));\n"+ +"$newArg=new java_ApplyArg($this,'A',\n"+ +"$this->parser->getData($st['m']),\n"+ +"$this->parser->getData($st['p']),\n"+ +"$object,\n"+ +"$this->getExact($st['n']));\n"+ +"$this->link($arg,$newArg);\n"+ +"array_push($this->stack,$this->arg=$newArg);\n"+ +"break;\n"+ +"case 'X':\n"+ +"$newArg=new java_CompositeArg($this,$st['t']);\n"+ +"$this->link($arg,$newArg);\n"+ +"array_push($this->stack,$this->arg=$newArg);\n"+ +"break;\n"+ +"case 'P':\n"+ +"if($arg->type=='H') {\n"+ +"$s=$st['t'];\n"+ +"if($s[0]=='N') {\n"+ +"$arg->setIndex($this->getExact($st['v']));\n"+ +"} else {\n"+ +"$arg->setIndex($this->parser->getData($st['v']));\n"+ +"}\n"+ +"} else {\n"+ +"$arg->setNextIndex();\n"+ +"}\n"+ +"break;\n"+ +"case 'S':\n"+ +"$arg->setResult($this->parser->getData($st['v']));\n"+ +"break;\n"+ +"case 'B':\n"+ +"$s=$st['v'];\n"+ +"$arg->setResult($s[0]=='T');\n"+ +"break;\n"+ +"case 'L':\n"+ +"$sign=$st['p'];\n"+ +"$val=$this->getExact($st['v']);\n"+ +"if($sign[0]=='A') $val*=-1;\n"+ +"$arg->setResult($val);\n"+ +"break;\n"+ +"case 'D':\n"+ +"$arg->setResult($this->getInexact($st['v']));\n"+ +"break;\n"+ +"case 'V':\n"+ +"if ($st['n']!='T') {\n"+ +"$arg->setVoidSignature();\n"+ +"}\n"+ +"case 'N':\n"+ +"$arg->setResult(null);\n"+ +"break;\n"+ +"case 'F':\n"+ +"break;\n"+ +"case 'O':\n"+ +"$arg->setFactory($this->getProxyFactory($st['p']));\n"+ +"$arg->setResult($this->asyncCtx=$this->getExact($st['v']));\n"+ +"if($st['n']!='T') $arg->setSignature($st['m']);\n"+ +"break;\n"+ +"case 'E':\n"+ +"$arg->setFactory($this->throwExceptionProxyFactory);\n"+ +"$arg->setException($st['m']);\n"+ +"$arg->setResult($this->asyncCtx=$this->getExact($st['v']));\n"+ +"break;\n"+ +"default:\n"+ +"$this->parser->parserError();\n"+ +"}\n"+ +"}\n"+ +"function end($name) {\n"+ +"switch($name[0]) {\n"+ +"case 'X':\n"+ +"$frame=array_pop($this->stack);\n"+ +"$this->arg=$frame->parentArg;\n"+ +"break;\n"+ +"}\n"+ +"}\n"+ +"function createParserString() {\n"+ +"return new java_ParserString();\n"+ +"}\n"+ +"function writeArg($arg) {\n"+ +"if(is_string($arg)) {\n"+ +"$this->protocol->writeString($arg);\n"+ +"} else if(is_object($arg)) {\n"+ +"if ((!$arg instanceof java_JavaType)) {\n"+ +"error_log((string)new java_IllegalArgumentException($arg));\n"+ +"trigger_error(\"argument '\".get_class($arg).\"' is not a Java object,using NULL instead\",E_USER_WARNING);\n"+ +"$this->protocol->writeObject(null);\n"+ +"} else {\n"+ +"$this->protocol->writeObject($arg->__java);\n"+ +"}\n"+ +"} else if(is_null($arg)) {\n"+ +"$this->protocol->writeObject(null);\n"+ +"} else if(is_bool($arg)) {\n"+ +"$this->protocol->writeBoolean($arg);\n"+ +"} else if(is_integer($arg)) {\n"+ +"$this->protocol->writeLong($arg);\n"+ +"} else if(is_float($arg)) {\n"+ +"$this->protocol->writeDouble($arg);\n"+ +"} else if(is_array($arg)) {\n"+ +"$wrote_begin=false;\n"+ +"foreach($arg as $key=>$val) {\n"+ +"if(is_string($key)) {\n"+ +"if(!$wrote_begin) {\n"+ +"$wrote_begin=1;\n"+ +"$this->protocol->writeCompositeBegin_h();\n"+ +"}\n"+ +"$this->protocol->writePairBegin_s($key);\n"+ +"$this->writeArg($val);\n"+ +"$this->protocol->writePairEnd();\n"+ +"} else {\n"+ +"if(!$wrote_begin) {\n"+ +"$wrote_begin=1;\n"+ +"$this->protocol->writeCompositeBegin_h();\n"+ +"}\n"+ +"$this->protocol->writePairBegin_n($key);\n"+ +"$this->writeArg($val);\n"+ +"$this->protocol->writePairEnd();\n"+ +"}\n"+ +"}\n"+ +"if(!$wrote_begin) {\n"+ +"$this->protocol->writeCompositeBegin_a();\n"+ +"}\n"+ +"$this->protocol->writeCompositeEnd();\n"+ +"}\n"+ +"}\n"+ +"function writeArgs($args) {\n"+ +"$this->inArgs=true;\n"+ +"$n=count($args);\n"+ +"for($i=0; $i<$n; $i++) {\n"+ +"$this->writeArg($args[$i]);\n"+ +"}\n"+ +"$this->inArgs=false;\n"+ +"}\n"+ +"function createObject($name,$args) {\n"+ +"$this->protocol->createObjectBegin($name);\n"+ +"$this->writeArgs($args);\n"+ +"$this->protocol->createObjectEnd();\n"+ +"$val=$this->getInternalResult();\n"+ +"return $val;\n"+ +"}\n"+ +"function referenceObject($name,$args) {\n"+ +"$this->protocol->referenceBegin($name);\n"+ +"$this->writeArgs($args);\n"+ +"$this->protocol->referenceEnd();\n"+ +"$val=$this->getInternalResult();\n"+ +"return $val;\n"+ +"}\n"+ +"function getProperty($object,$property) {\n"+ +"$this->protocol->propertyAccessBegin($object,$property);\n"+ +"$this->protocol->propertyAccessEnd();\n"+ +"return $this->getResult();\n"+ +"}\n"+ +"function setProperty($object,$property,$arg) {\n"+ +"$this->protocol->propertyAccessBegin($object,$property);\n"+ +"$this->writeArg($arg);\n"+ +"$this->protocol->propertyAccessEnd();\n"+ +"$this->getResult();\n"+ +"}\n"+ +"function invokeMethod($object,$method,$args) {\n"+ +"$this->protocol->invokeBegin($object,$method);\n"+ +"$this->writeArgs($args);\n"+ +"$this->protocol->invokeEnd();\n"+ +"$val=$this->getResult();\n"+ +"return $val;\n"+ +"}\n"+ +"function unref($object) {\n"+ +"if (isset($this->protocol)) $this->protocol->writeUnref($object);\n"+ +"}\n"+ +"function apply($arg) {\n"+ +"$name=$arg->p;\n"+ +"$object=$arg->v;\n"+ +"$ob=($object==null) ? $name : array(&$object,$name);\n"+ +"$isAsync=$this->isAsync;\n"+ +"$methodCache=$this->methodCache;\n"+ +"$currentArgumentsFormat=$this->currentArgumentsFormat;\n"+ +"try {\n"+ +"$res=$arg->getResult(true);\n"+ +"if((($object==null) && !function_exists($name)) || (!($object==null) && !method_exists($object,$name))) throw new JavaException(\"java.lang.NoSuchMethodError\",\"$name\");\n"+ +"$res=call_user_func_array($ob,$res);\n"+ +"if (is_object($res) && (!($res instanceof java_JavaType))) {\n"+ +"trigger_error(\"object returned from $name() is not a Java object\",E_USER_WARNING);\n"+ +"$this->protocol->invokeBegin(0,\"makeClosure\");\n"+ +"$this->protocol->writeULong($this->globalRef->add($res));\n"+ +"$this->protocol->invokeEnd();\n"+ +"$res=$this->getResult();\n"+ +"}\n"+ +"$this->protocol->resultBegin();\n"+ +"$this->writeArg($res);\n"+ +"$this->protocol->resultEnd();\n"+ +"} catch (JavaException $e) {\n"+ +"$trace=$e->getTraceAsString();\n"+ +"$this->protocol->resultBegin();\n"+ +"$this->protocol->writeException($e->__java,$trace);\n"+ +"$this->protocol->resultEnd();\n"+ +"} catch(Exception $ex) {\n"+ +"error_log($ex->__toString());\n"+ +"trigger_error(\"Unchecked exception detected in callback\",E_USER_ERROR);\n"+ +"die (1);\n"+ +"}\n"+ +"$this->isAsync=$isAsync;\n"+ +"$this->methodCache=$methodCache;\n"+ +"$this->currentArgumentsFormat=$currentArgumentsFormat;\n"+ +"}\n"+ +"function cast($object,$type) {\n"+ +"switch($type[0]) {\n"+ +"case 'S': case 's':\n"+ +"return $this->invokeMethod(0,\"castToString\",array($object));\n"+ +"case 'B': case 'b':\n"+ +"return $this->invokeMethod(0,\"castToBoolean\",array($object));\n"+ +"case 'L': case 'I': case 'l': case 'i':\n"+ +"return $this->invokeMethod(0,\"castToExact\",array($object));\n"+ +"case 'D': case 'd': case 'F': case 'f':\n"+ +"return $this->invokeMethod(0,\"castToInExact\",array($object));\n"+ +"case 'N': case 'n':\n"+ +"return null;\n"+ +"case 'A': case 'a':\n"+ +"return $this->invokeMethod(0,\"castToArray\",array($object));\n"+ +"case 'O': case 'o':\n"+ +"return $object;\n"+ +"default:\n"+ +"throw new java_RuntimeException(\"$type illegal\");\n"+ +"}\n"+ +"}\n"+ +"function getContext() {\n"+ +"static $cache=null;\n"+ +"if (!is_null($cache)) return $cache;\n"+ +"return $cache=$this->invokeMethod(0,\"getContext\",array());\n"+ +"}\n"+ +"function getSession($args) {\n"+ +"return $this->invokeMethod(0,\"getSession\",$args);\n"+ +"}\n"+ +"function getServerName() {\n"+ +"static $cache=null;\n"+ +"if (!is_null($cache)) return $cache;\n"+ +"return $cache=$this->protocol->getServerName();\n"+ +"}\n"+ +"}\n"+ +"function java_shutdown() {\n"+ +"global $java_initialized;\n"+ +"if (!$java_initialized) return;\n"+ +"if (session_id()) session_write_close();\n"+ +"$client=__javaproxy_Client_getClient();\n"+ +"if (!isset($client->protocol) || $client->inArgs) return;\n"+ +"if ($client->preparedToSendBuffer)\n"+ +"$client->sendBuffer.=$client->preparedToSendBuffer;\n"+ +"$client->sendBuffer.=$client->protocol->getKeepAlive();\n"+ +"$client->protocol->flush();\n"+ +"$client->protocol->keepAlive();\n"+ +"}\n"+ +"register_shutdown_function(\"java_shutdown\");\n"+ +"class java_GlobalRef {\n"+ +"public $map;\n"+ +"function java_GlobalRef() {\n"+ +"$this->map=array();\n"+ +"}\n"+ +"function add($object) {\n"+ +"if(is_null($object)) return 0;\n"+ +"return array_push($this->map,$object);\n"+ +"}\n"+ +"function get($id) {\n"+ +"if(!$id) return 0;\n"+ +"return $this->map[--$id];\n"+ +"}\n"+ +"}\n"+ +"class java_NativeParser {\n"+ +"public $parser,$handler;\n"+ +"public $level,$event;\n"+ +"public $buf;\n"+ +"function java_NativeParser($handler) {\n"+ +"$this->handler=$handler;\n"+ +"$this->parser=xml_parser_create();\n"+ +"xml_parser_set_option($this->parser,XML_OPTION_CASE_FOLDING,0);\n"+ +"xml_set_object($this->parser,$this);\n"+ +"xml_set_element_handler($this->parser,\"begin\",\"end\");\n"+ +"xml_parse($this->parser,\"\");\n"+ +"$this->level=0;\n"+ +"}\n"+ +"function begin($parser,$name,$param) {\n"+ +"$this->event=true;\n"+ +"switch($name) {\n"+ +"case 'X': case 'A': $this->level+=1;\n"+ +"}\n"+ +"$this->handler->begin($name,$param);\n"+ +"}\n"+ +"function end($parser,$name) {\n"+ +"$this->handler->end($name);\n"+ +"switch($name) {\n"+ +"case 'X': case 'A': $this->level-=1;\n"+ +"}\n"+ +"}\n"+ +"function getData($str) {\n"+ +"return base64_decode($str);\n"+ +"}\n"+ +"function parse() {\n"+ +"do {\n"+ +"$this->event=false;\n"+ +"$buf=$this->buf=$this->handler->read(JAVA_RECV_SIZE);\n"+ +"$len=strlen($buf);\n"+ +"if(!xml_parse($this->parser,$buf,$len==0)) {\n"+ +"$this->handler->protocol->handler->shutdownBrokenConnection(\n"+ +"sprintf(\"protocol error: %s,%s at col %d. Check the back end log for OutOfMemoryErrors.\",\n"+ +"$buf,\n"+ +"xml_error_string(xml_get_error_code($this->parser)),\n"+ +"xml_get_current_column_number($this->parser)));\n"+ +"}\n"+ +"} while(!$this->event || $this->level>0);\n"+ +"}\n"+ +"function parserError() {\n"+ +"$this->handler->protocol->handler->shutdownBrokenConnection(\n"+ +"sprintf(\"protocol error: %s. Check the back end log for details.\",$this->buf));\n"+ +"}\n"+ +"}\n"+ +"class java_Parser {\n"+ +"public $parser;\n"+ +"function java_Parser($handler) {\n"+ +"if(function_exists(\"xml_parser_create\")) {\n"+ +"$this->parser=new java_NativeParser($handler);\n"+ +"$handler->RUNTIME[\"PARSER\"]=\"NATIVE\";\n"+ +"} else {\n"+ +"$this->parser=new java_SimpleParser($handler);\n"+ +"$handler->RUNTIME[\"PARSER\"]=\"SIMPLE\";\n"+ +"}\n"+ +"}\n"+ +"function parse() {\n"+ +"$this->parser->parse();\n"+ +"}\n"+ +"function getData($str) {\n"+ +"return $this->parser->getData($str);\n"+ +"}\n"+ +"function parserError() {\n"+ +"$this->parser->parserError();\n"+ +"}\n"+ +"}\n"+ +"function java_getHeader($name,$array) {\n"+ +"if (array_key_exists($name,$array)) return $array[$name];\n"+ +"$name=\"HTTP_$name\";\n"+ +"if (array_key_exists($name,$array)) return $array[$name];\n"+ +"return null;\n"+ +"}\n"+ +"function java_checkCliSapi() {\n"+ +"$sapi=substr(php_sapi_name(),0,3);\n"+ +"return ((($sapi=='cgi') && !get_cfg_var(\"java.session\")) || ($sapi=='cli'));\n"+ +"}\n"+ +"function java_getCompatibilityOption($client) {\n"+ +"static $compatibility=null;\n"+ +"if ($compatibility) return $compatibility;\n"+ +"$compatibility=$client->RUNTIME[\"PARSER\"]==\"NATIVE\"\n"+ +"? (0103-JAVA_PREFER_VALUES)\n"+ +": (0100+JAVA_PREFER_VALUES);\n"+ +"if(is_int(JAVA_LOG_LEVEL)) {\n"+ +"$compatibility |=128 | (7 & JAVA_LOG_LEVEL)<<2;\n"+ +"}\n"+ +"$compatibility=chr ($compatibility);\n"+ +"return $compatibility;\n"+ +"}\n"+ +"class java_EmptyChannel {\n"+ +"protected $handler;\n"+ +"private $res;\n"+ +"function java_EmptyChannel($handler) {\n"+ +"$this->handler=$handler;\n"+ +"}\n"+ +"function shutdownBrokenConnection () {}\n"+ +"function fwrite($data) {\n"+ +"return $this->handler->fwrite($data);\n"+ +"}\n"+ +"function fread($size) {\n"+ +"return $this->handler->fread($size);\n"+ +"}\n"+ +"function getKeepAliveA() {\n"+ +"return \"\";\n"+ +"}\n"+ +"function getKeepAliveE() {\n"+ +"return \"\";\n"+ +"}\n"+ +"function getKeepAlive() {\n"+ +"return $this->getKeepAliveE();\n"+ +"}\n"+ +"function error() {\n"+ +"trigger_error(\"An unchecked exception occured during script execution. Please check the server log files for details.\",E_USER_ERROR);\n"+ +"}\n"+ +"function checkA($peer) {\n"+ +"$val=$this->res[6];\n"+ +"if ($val !='A') fclose($peer);\n"+ +"if ($val !='A' && $val !='E') {\n"+ +"$this->error();\n"+ +"}\n"+ +"}\n"+ +"function checkE() {\n"+ +"$val=$this->res[6];\n"+ +"if ($val !='E') {\n"+ +"$this->error();\n"+ +"}\n"+ +"}\n"+ +"function keepAliveS() {\n"+ +"$this->res=$this->fread(10);\n"+ +"}\n"+ +"function keepAliveSC() {\n"+ +"$this->res=$this->fread(10);\n"+ +"$this->fwrite(\"\");\n"+ +"$this->fread(JAVA_RECV_SIZE);\n"+ +"}\n"+ +"function keepAliveH() {\n"+ +"$this->res=$this->handler->read(10);\n"+ +"}\n"+ +"function keepAlive() {\n"+ +"$this->keepAliveH();\n"+ +"$this->checkE();\n"+ +"}\n"+ +"}\n"+ +"abstract class java_SocketChannel extends java_EmptyChannel {\n"+ +"public $peer,$host;\n"+ +"function java_SocketChannel($peer,$host) {\n"+ +"$this->peer=$peer;\n"+ +"$this->host=$host;\n"+ +"}\n"+ +"function fwrite($data) {\n"+ +"return fwrite($this->peer,$data);\n"+ +"}\n"+ +"function fread($size) {\n"+ +"return fread($this->peer,$size);\n"+ +"}\n"+ +"function shutdownBrokenConnection () {\n"+ +"fclose($this->peer);\n"+ +"}\n"+ +"}\n"+ +"class java_SocketChannelP extends java_SocketChannel {\n"+ +"function getKeepAlive() {return $this->getKeepAliveA();}\n"+ +"function keepAlive() { $this->keepAliveS(); $this->checkA($this->peer); }\n"+ +"}\n"+ +"class java_ChunkedSocketChannel extends java_SocketChannel {\n"+ +"function fwrite($data) {\n"+ +"$len=dechex(strlen($data));\n"+ +"return fwrite($this->peer,\"${len}\\r\\n${data}\\r\\n\");\n"+ +"}\n"+ +"function fread($size) {\n"+ +"$length=hexdec(fgets($this->peer,JAVA_RECV_SIZE));\n"+ +"$data=\"\";\n"+ +"while ($length > 0) {\n"+ +"$str=fread($this->peer,$length);\n"+ +"if (feof ($this->peer)) return null;\n"+ +"$length -=strlen($str);\n"+ +"$data .=$str;\n"+ +"}\n"+ +"fgets($this->peer,3);\n"+ +"return $data;\n"+ +"}\n"+ +"function keepAlive() { $this->keepAliveSC(); $this->checkE(); fclose ($this->peer); }\n"+ +"}\n"+ +"class java_SocketHandler {\n"+ +"public $protocol,$channel;\n"+ +"function java_SocketHandler($protocol,$channel) {\n"+ +"$this->protocol=$protocol;\n"+ +"$this->channel=$channel;\n"+ +"}\n"+ +"function write($data) {\n"+ +"return $this->channel->fwrite($data);\n"+ +"}\n"+ +"function fwrite($data) {return $this->write($data);}\n"+ +"function read($size) {\n"+ +"return $this->channel->fread($size);\n"+ +"}\n"+ +"function fread($size) {return $this->read($size);}\n"+ +"function redirect() {}\n"+ +"function getKeepAlive() {\n"+ +"return $this->channel->getKeepAlive();\n"+ +"}\n"+ +"function keepAlive() {\n"+ +"$this->channel->keepAlive();\n"+ +"}\n"+ +"function dieWithBrokenConnection($msg) {\n"+ +"unset($this->protocol->client->protocol);\n"+ +"trigger_error ($msg?$msg:\"unknown error: please see back end log for details\",E_USER_ERROR);\n"+ +"}\n"+ +"function shutdownBrokenConnection ($msg) {\n"+ +"$this->channel->shutdownBrokenConnection();\n"+ +"$this->dieWithBrokenConnection($msg);\n"+ +"}\n"+ +"}\n"+ +"class java_SimpleHttpHandler extends java_SocketHandler {\n"+ +"public $headers,$cookies;\n"+ +"public $context,$ssl,$port;\n"+ +"public $host;\n"+ +"function createChannel() {\n"+ +"$channelName=java_getHeader(\"X_JAVABRIDGE_REDIRECT\",$_SERVER);\n"+ +"$context=java_getHeader(\"X_JAVABRIDGE_CONTEXT\",$_SERVER);\n"+ +"$len=strlen($context);\n"+ +"$len0=java_getCompatibilityOption($this->protocol->client);\n"+ +"$len1=chr($len&0xFF); $len>>=8;\n"+ +"$len2=chr($len&0xFF);\n"+ +"$this->channel=new java_EmptyChannel($this);\n"+ +"$this->channel=$this->getChannel($channelName);\n"+ +"$this->protocol->socketHandler=new java_SocketHandler($this->protocol,$this->channel);\n"+ +"$this->protocol->write(\"\\177${len0}${len1}${len2}${context}\");\n"+ +"$this->context=sprintf(\"X_JAVABRIDGE_CONTEXT: %s\\r\\n\",$context);\n"+ +"$this->protocol->handler=$this->protocol->socketHandler;\n"+ +"$this->protocol->handler->write($this->protocol->client->sendBuffer)\n"+ +"or $this->protocol->handler->shutdownBrokenConnection(\"Broken local connection handle\");\n"+ +"$this->protocol->client->sendBuffer=null;\n"+ +"$this->protocol->handler->read(1)\n"+ +"or $this->protocol->handler->shutdownBrokenConnection(\"Broken local connection handle\");\n"+ +"}\n"+ +"function java_SimpleHttpHandler($protocol,$ssl,$host,$port) {\n"+ +"$this->cookies=array();\n"+ +"$this->protocol=$protocol;\n"+ +"$this->ssl=$ssl;\n"+ +"$this->host=$host;\n"+ +"$this->port=$port;\n"+ +"$this->createChannel();\n"+ +"}\n"+ +"function getCookies() {\n"+ +"$str=\"\";\n"+ +"$first=true;\n"+ +"foreach($_COOKIE as $k=> $v) {\n"+ +"$str .=($first ? \"Cookie: $k=$v\":\"; $k=$v\");\n"+ +"$first=false;\n"+ +"}\n"+ +"if(!$first) $str .=\"\\r\\n\";\n"+ +"return $str;\n"+ +"}\n"+ +"function getContextFromCgiEnvironment() {\n"+ +"$ctx=java_getHeader('X_JAVABRIDGE_CONTEXT',$_SERVER);\n"+ +"return $ctx;\n"+ +"}\n"+ +"function getContext() {\n"+ +"static $context=null;\n"+ +"if($context) return $context;\n"+ +"$ctx=$this->getContextFromCgiEnvironment();\n"+ +"$context=\"\";\n"+ +"if($ctx) {\n"+ +"$context=sprintf(\"X_JAVABRIDGE_CONTEXT: %s\\r\\n\",$ctx);\n"+ +"}\n"+ +"return $context;\n"+ +"}\n"+ +"function getWebAppInternal() {\n"+ +"$context=$this->protocol->webContext;\n"+ +"if(isset($context)) return $context;\n"+ +"return (JAVA_SERVLET==\"User\" &&\n"+ +"array_key_exists('PHP_SELF',$_SERVER) &&\n"+ +"array_key_exists('HTTP_HOST',$_SERVER))\n"+ +"? $_SERVER['PHP_SELF'].\"javabridge\"\n"+ +": null;\n"+ +"}\n"+ +"function getWebApp() {\n"+ +"$context=$this->getWebAppInternal();\n"+ +"if(is_null($context)) $context=JAVA_SERVLET;\n"+ +"if(is_null($context) || $context[0]!=\"/\")\n"+ +"$context=\"/JavaBridge/JavaBridge.phpjavabridge\";\n"+ +"return $context;\n"+ +"}\n"+ +"function write($data) {\n"+ +"return $this->protocol->socketHandler->write($data);\n"+ +"}\n"+ +"function doSetCookie($key,$val,$path) {\n"+ +"$path=trim($path);\n"+ +"$webapp=$this->getWebAppInternal(); if(!$webapp) $path=\"/\";\n"+ +"setcookie($key,$val,0,$path);\n"+ +"}\n"+ +"function read($size) {\n"+ +"return $this->protocol->socketHandler->read($size);\n"+ +"}\n"+ +"function getChannel($channelName) {\n"+ +"$errstr=null; $errno=null;\n"+ +"$peer=pfsockopen($this->host,$channelName,$errno,$errstr,20);\n"+ +"if (!$peer) throw new java_IllegalStateException(\"No ContextServer for {$this->host}:{$channelName}. Error: $errstr ($errno)\\n\");\n"+ +"stream_set_timeout($peer,-1);\n"+ +"return new java_SocketChannelP($peer,$this->host);\n"+ +"}\n"+ +"function keepAlive() {\n"+ +"parent::keepAlive();\n"+ +"}\n"+ +"function redirect() {}\n"+ +"}\n"+ +"class java_SimpleHttpTunnelHandler extends java_SimpleHttpHandler {\n"+ +"public $socket;\n"+ +"protected $hasContentLength=false;\n"+ +"function createSimpleChannel () {\n"+ +"$this->channel=new java_EmptyChannel($this);\n"+ +"}\n"+ +"function createChannel() {\n"+ +"$this->createSimpleChannel();\n"+ +"}\n"+ +"function shutdownBrokenConnection ($msg) {\n"+ +"fclose($this->socket);\n"+ +"$this->dieWithBrokenConnection($msg);\n"+ +"}\n"+ +"function checkSocket($socket,&$errno,&$errstr) {\n"+ +"if (!$socket) {\n"+ +"$msg=\"Could not connect to the JEE server {$this->ssl}{$this->host}:{$this->port}. Please start it.\";\n"+ +"$msg.=java_checkCliSapi()\n"+ +"?\" Or define('JAVA_HOSTS',9267); define('JAVA_SERVLET',false); before including 'Java.inc' and try again. Error message: $errstr ($errno)\\n\"\n"+ +":\" Error message: $errstr ($errno)\\n\";\n"+ +"throw new java_ConnectException($msg);\n"+ +"}\n"+ +"}\n"+ +"function open() {\n"+ +"$errno=null; $errstr=null;\n"+ +"$socket=fsockopen(\"{$this->ssl}{$this->host}\",$this->port,$errno,$errstr,20);\n"+ +"$this->checkSocket($socket,$errno,$errstr);\n"+ +"stream_set_timeout($socket,-1);\n"+ +"$this->socket=$socket;\n"+ +"}\n"+ +"function fread($size) {\n"+ +"$length=hexdec(fgets($this->socket,JAVA_RECV_SIZE));\n"+ +"$data=\"\";\n"+ +"while ($length > 0) {\n"+ +"$str=fread($this->socket,$length);\n"+ +"if (feof ($this->socket)) return null;\n"+ +"$length -=strlen($str);\n"+ +"$data .=$str;\n"+ +"}\n"+ +"fgets($this->socket,3);\n"+ +"return $data;\n"+ +"}\n"+ +"function fwrite($data) {\n"+ +"$len=dechex(strlen($data));\n"+ +"return fwrite($this->socket,\"${len}\\r\\n${data}\\r\\n\");\n"+ +"}\n"+ +"function close() {\n"+ +"fwrite($this->socket,\"0\\r\\n\\r\\n\");\n"+ +"fgets($this->socket,JAVA_RECV_SIZE);\n"+ +"fgets($this->socket,3);\n"+ +"fclose($this->socket);\n"+ +"}\n"+ +"function java_SimpleHttpTunnelHandler($protocol,$ssl,$host,$port) {\n"+ +"parent::java_SimpleHttpHandler($protocol,$ssl,$host,$port);\n"+ +"$this->open();\n"+ +"}\n"+ +"function read($size) {\n"+ +"if(is_null($this->headers)) $this->parseHeaders();\n"+ +"if (isset($this->headers[\"http_error\"])) {\n"+ +"if (isset($this->headers[\"transfer_chunked\"])) {\n"+ +"$str=$this->fread(JAVA_RECV_SIZE);\n"+ +"} elseif (isset($this->headers['content_length'])) {\n"+ +"$len=$this->headers['content_length'];\n"+ +"for($str=fread($this->socket,$len); strlen($str)<$len; $str.=fread($this->socket,$len-strlen($str)))\n"+ +"if (feof ($this->socket)) break;\n"+ +"} else {\n"+ +"$str=fread($this->socket,JAVA_RECV_SIZE);\n"+ +"}\n"+ +"$this->shutdownBrokenConnection($str);\n"+ +"}\n"+ +"return $this->fread(JAVA_RECV_SIZE);\n"+ +"}\n"+ +"function getBodyFor ($compat,$data) {\n"+ +"$len=dechex(2+strlen($data));\n"+ +"return \"Cache-Control: no-cache\\r\\nPragma: no-cache\\r\\nTransfer-Encoding: chunked\\r\\n\\r\\n${len}\\r\\n\\177${compat}${data}\\r\\n\";\n"+ +"}\n"+ +"function write($data) {\n"+ +"$compat=java_getCompatibilityOption($this->protocol->client);\n"+ +"$this->headers=null;\n"+ +"$socket=$this->socket;\n"+ +"$webapp=$this->getWebApp();\n"+ +"$cookies=$this->getCookies();\n"+ +"$context=$this->getContext();\n"+ +"$res=\"PUT \";\n"+ +"$res .=$webapp;\n"+ +"$res .=\" HTTP/1.1\\r\\n\";\n"+ +"$res .=\"Host: {$this->host}:{$this->port}\\r\\n\";\n"+ +"$res .=$context;\n"+ +"$res .=$cookies;\n"+ +"$res .=$this->getBodyFor($compat,$data);\n"+ +"$count=fwrite($socket,$res) or $this->shutdownBrokenConnection(\"Broken connection handle\");\n"+ +"fflush($socket) or $this->shutdownBrokenConnection(\"Broken connection handle\");\n"+ +"return $count;\n"+ +"}\n"+ +"function parseHeaders() {\n"+ +"$this->headers=array();\n"+ +"$line=trim(fgets($this->socket,JAVA_RECV_SIZE));\n"+ +"$ar=explode (\" \",$line);\n"+ +"$code=((int)$ar[1]);\n"+ +"if ($code !=200) $this->headers[\"http_error\"]=$code;\n"+ +"while (($str=trim(fgets($this->socket,JAVA_RECV_SIZE)))) {\n"+ +"if($str[0]=='X') {\n"+ +"if(!strncasecmp(\"X_JAVABRIDGE_REDIRECT\",$str,21)) {\n"+ +"$this->headers[\"redirect\"]=trim(substr($str,22));\n"+ +"} else if(!strncasecmp(\"X_JAVABRIDGE_CONTEXT\",$str,20)) {\n"+ +"$this->headers[\"context\"]=trim(substr($str,21));\n"+ +"}\n"+ +"} else if($str[0]=='S') {\n"+ +"if(!strncasecmp(\"SET-COOKIE\",$str,10)) {\n"+ +"$str=substr($str,12);\n"+ +"$this->cookies[]=$str;\n"+ +"$ar=explode(\";\",$str);\n"+ +"$cookie=explode(\"=\",$ar[0]);\n"+ +"$path=\"\";\n"+ +"if(isset($ar[1])) $p=explode(\"=\",$ar[1]);\n"+ +"if(isset($p)) $path=$p[1];\n"+ +"$this->doSetCookie($cookie[0],$cookie[1],$path);\n"+ +"}\n"+ +"} else if($str[0]=='C') {\n"+ +"if(!strncasecmp(\"CONTENT-LENGTH\",$str,14)) {\n"+ +"$this->headers[\"content_length\"]=trim(substr($str,15));\n"+ +"$this->hasContentLength=true;\n"+ +"} else if(!strncasecmp(\"CONNECTION\",$str,10) && !strncasecmp(\"close\",trim(substr($str,11)),5)) {\n"+ +"$this->headers[\"connection_close\"]=true;\n"+ +"}\n"+ +"} else if($str[0]=='T') {\n"+ +"if(!strncasecmp(\"TRANSFER-ENCODING\",$str,17) && !strncasecmp(\"chunked\",trim(substr($str,18)),7)) {\n"+ +"$this->headers[\"transfer_chunked\"]=true;\n"+ +"}\n"+ +"}\n"+ +"}\n"+ +"}\n"+ +"function getSimpleChannel() {\n"+ +"return new java_ChunkedSocketChannel($this->socket,$this->protocol,$this->host);\n"+ +"}\n"+ +"function redirect() {\n"+ +"$this->isRedirect=isset($this->headers[\"redirect\"]);\n"+ +"if ($this->isRedirect)\n"+ +"$channelName=$this->headers[\"redirect\"];\n"+ +"$context=$this->headers[\"context\"];\n"+ +"$len=strlen($context);\n"+ +"$len0=chr(0xFF);\n"+ +"$len1=chr($len&0xFF); $len>>=8;\n"+ +"$len2=chr($len&0xFF);\n"+ +"if ($this->isRedirect) {\n"+ +"$this->protocol->socketHandler=new java_SocketHandler($this->protocol,$this->getChannel($channelName));\n"+ +"$this->protocol->write(\"\\177${len0}${len1}${len2}${context}\");\n"+ +"$this->context=sprintf(\"X_JAVABRIDGE_CONTEXT: %s\\r\\n\",$context);\n"+ +"$this->close ();\n"+ +"$this->protocol->handler=$this->protocol->socketHandler;\n"+ +"$this->protocol->handler->write($this->protocol->client->sendBuffer)\n"+ +"or $this->protocol->handler->shutdownBrokenConnection(\"Broken local connection handle\");\n"+ +"$this->protocol->client->sendBuffer=null;\n"+ +"$this->protocol->handler->read(1)\n"+ +"or $this->protocol->handler->shutdownBrokenConnection(\"Broken local connection handle\");\n"+ +"} else {\n"+ +"$this->protocol->handler=$this->protocol->socketHandler=new java_SocketHandler($this->protocol,$this->getSimpleChannel());\n"+ +"}\n"+ +"}\n"+ +"}\n"+ +"class java_HttpTunnelHandler extends java_SimpleHttpTunnelHandler {\n"+ +"function fread($size) {\n"+ +"if ($this->hasContentLength)\n"+ +"return fread($this->socket,$this->headers[\"content_length\"]);\n"+ +"else\n"+ +"return parent::fread($size);\n"+ +"}\n"+ +"function fwrite($data) {\n"+ +"if ($this->hasContentLength)\n"+ +"return fwrite($this->socket,$data);\n"+ +"else\n"+ +"return parent::fwrite($data);\n"+ +"}\n"+ +"function close() {\n"+ +"if ($this->hasContentLength) {\n"+ +"fwrite($this->socket,\"0\\r\\n\\r\\n\");\n"+ +"fclose($this->socket);\n"+ +"} else {\n"+ +"parent::fclose($this->socket);\n"+ +"}\n"+ +"}\n"+ +"}\n"+ +"class java_Protocol {\n"+ +"public $client;\n"+ +"public $webContext;\n"+ +"public $serverName;\n"+ +"function getOverrideHosts() {\n"+ +"if(array_key_exists('X_JAVABRIDGE_OVERRIDE_HOSTS',$_ENV)) {\n"+ +"$override=$_ENV['X_JAVABRIDGE_OVERRIDE_HOSTS'];\n"+ +"if(!is_null($override) && $override!='/') return $override;\n"+ +"}\n"+ +"return\n"+ +"java_getHeader('X_JAVABRIDGE_OVERRIDE_HOSTS_REDIRECT',$_SERVER);\n"+ +"}\n"+ +"static function getHost() {\n"+ +"static $host=null;\n"+ +"if(is_null($host)) {\n"+ +"$hosts=explode(\";\",JAVA_HOSTS);\n"+ +"$host=explode(\":\",$hosts[0]);\n"+ +"while(count ($host) < 3) array_unshift($host,\"\");\n"+ +"if (substr($host[1],0,2)==\"//\") $host[1]=substr($host[1],2);\n"+ +"}\n"+ +"return $host;\n"+ +"}\n"+ +"function createHttpHandler() {\n"+ +"$overrideHosts=$this->getOverrideHosts();\n"+ +"$ssl=\"\";\n"+ +"if($overrideHosts) {\n"+ +"$s=$overrideHosts;\n"+ +"if((strlen($s)>2) && ($s[1]==':')) {\n"+ +"if($s[0]=='s')\n"+ +"$ssl=\"ssl://\";\n"+ +"$s=substr($s,2);\n"+ +"}\n"+ +"$webCtx=strpos($s,\"//\");\n"+ +"if($webCtx)\n"+ +"$host=substr($s,0,$webCtx);\n"+ +"else\n"+ +"$host=$s;\n"+ +"$idx=strpos($host,':');\n"+ +"if($idx) {\n"+ +"if($webCtx)\n"+ +"$port=substr($host,$idx+1,$webCtx);\n"+ +"else\n"+ +"$port=substr($host,$idx+1);\n"+ +"$host=substr($host,0,$idx);\n"+ +"} else {\n"+ +"$port=\"8080\";\n"+ +"}\n"+ +"if($webCtx) $webCtx=substr($s,$webCtx+1);\n"+ +"$this->webContext=$webCtx;\n"+ +"} else {\n"+ +"$hostVec=java_Protocol::getHost();\n"+ +"if ($ssl=$hostVec[0]) $ssl .=\"://\";\n"+ +"$host=$hostVec[1];\n"+ +"$port=$hostVec[2];\n"+ +"}\n"+ +"$this->serverName=\"${ssl}${host}:$port\";\n"+ +"if ((array_key_exists(\"X_JAVABRIDGE_REDIRECT\",$_SERVER)) ||\n"+ +"(array_key_exists(\"HTTP_X_JAVABRIDGE_REDIRECT\",$_SERVER)))\n"+ +"return new java_SimpleHttpHandler($this,$ssl,$host,$port);\n"+ +"return new java_HttpTunnelHandler($this,$ssl,$host,$port);\n"+ +"}\n"+ +"function createSimpleHandler($name,$again=true) {\n"+ +"$channelName=$name;\n"+ +"$errno=null; $errstr=null;\n"+ +"if(is_numeric($channelName)) {\n"+ +"$peer=@pfsockopen($host=\"127.0.0.1\",$channelName,$errno,$errstr,5);\n"+ +"} else {\n"+ +"$type=$channelName[0];\n"+ +"list($host,$channelName)=explode(\":\",$channelName);\n"+ +"$peer=pfsockopen($host,$channelName,$errno,$errstr,20);\n"+ +"if (!$peer)\n"+ +"throw new java_ConnectException(\"No Java server at $host:$channelName. Error message: $errstr ($errno)\");\n"+ +"}\n"+ +"if (!$peer) {\n"+ +"$java=file_exists(ini_get(\"extension_dir\").\"/JavaBridge.jar\")?ini_get(\"extension_dir\").\"/JavaBridge.jar\":(java_get_base().\"/JavaBridge.jar\");\n"+ +"if (!file_exists($java))\n"+ +"throw new java_IOException(\"Could not find $java in \".getcwd().\". Download it from http://sf.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_\".JAVA_PEAR_VERSION.\"/exploded/JavaBridge.jar/download and try again.\");\n"+ +"$java_cmd=\"java -Dphp.java.bridge.daemon=true -jar \\\"${java}\\\" INET_LOCAL:$channelName 0\";\n"+ +"if (!$again)\n"+ +"throw new java_ConnectException(\"No Java back end! Please run it with: $java_cmd. Error message: $errstr ($errno)\");\n"+ +"if (!java_checkCliSapi())\n"+ +"trigger_error(\"This PHP SAPI requires a JEE or SERVLET back end. Start it,define ('JAVA_SERVLET',true); define('JAVA_HOSTS',...); and try again.\",E_USER_ERROR);\n"+ +"system ($java_cmd);\n"+ +"return $this->createSimpleHandler($name,false);\n"+ +"}\n"+ +"stream_set_timeout($peer,-1);\n"+ +"$handler=new java_SocketHandler($this,new java_SocketChannelP($peer,$host));\n"+ +"$compatibility=java_getCompatibilityOption($this->client);\n"+ +"$this->write(\"\\177$compatibility\");\n"+ +"$this->serverName=\"127.0.0.1:$channelName\";\n"+ +"return $handler;\n"+ +"}\n"+ +"function java_get_simple_channel() {\n"+ +"return (JAVA_HOSTS&&(!JAVA_SERVLET||(JAVA_SERVLET==\"Off\"))) ? JAVA_HOSTS : null;\n"+ +"}\n"+ +"function createHandler() {\n"+ +"if(!java_getHeader('X_JAVABRIDGE_OVERRIDE_HOSTS',$_SERVER)&&\n"+ +"((function_exists(\"java_get_default_channel\")&&($defaultChannel=java_get_default_channel())) ||\n"+ +"($defaultChannel=$this->java_get_simple_channel())) ) {\n"+ +"return $this->createSimpleHandler($defaultChannel);\n"+ +"} else {\n"+ +"return $this->createHttpHandler();\n"+ +"}\n"+ +"}\n"+ +"function java_Protocol ($client) {\n"+ +"$this->client=$client;\n"+ +"$this->handler=$this->createHandler();\n"+ +"}\n"+ +"function redirect() {\n"+ +"$this->handler->redirect();\n"+ +"}\n"+ +"function read($size) {\n"+ +"return $this->handler->read($size);\n"+ +"}\n"+ +"function sendData() {\n"+ +"$this->handler->write($this->client->sendBuffer);\n"+ +"$this->client->sendBuffer=null;\n"+ +"}\n"+ +"function flush() {\n"+ +"$this->sendData();\n"+ +"}\n"+ +"function getKeepAlive() {\n"+ +"return $this->handler->getKeepAlive();\n"+ +"}\n"+ +"function keepAlive() {\n"+ +"$this->handler->keepAlive();\n"+ +"}\n"+ +"function handle() {\n"+ +"$this->client->handleRequests();\n"+ +"}\n"+ +"function write($data) {\n"+ +"$this->client->sendBuffer.=$data;\n"+ +"}\n"+ +"function finish() {\n"+ +"$this->flush();\n"+ +"$this->handle();\n"+ +"$this->redirect();\n"+ +"}\n"+ +"function referenceBegin($name) {\n"+ +"$this->client->sendBuffer.=$this->client->preparedToSendBuffer;\n"+ +"$this->client->preparedToSendBuffer=null;\n"+ +"$signature=sprintf(\"\",$name);\n"+ +"$this->write($signature);\n"+ +"$signature[6]=\"2\";\n"+ +"$this->client->currentArgumentsFormat=$signature;\n"+ +"}\n"+ +"function referenceEnd() {\n"+ +"$this->client->currentArgumentsFormat.=$format=\"\";\n"+ +"$this->write($format);\n"+ +"$this->finish();\n"+ +"$this->client->currentCacheKey=null;\n"+ +"}\n"+ +"function createObjectBegin($name) {\n"+ +"$this->client->sendBuffer.=$this->client->preparedToSendBuffer;\n"+ +"$this->client->preparedToSendBuffer=null;\n"+ +"$signature=sprintf(\"\",$name);\n"+ +"$this->write($signature);\n"+ +"$signature[6]=\"2\";\n"+ +"$this->client->currentArgumentsFormat=$signature;\n"+ +"}\n"+ +"function createObjectEnd() {\n"+ +"$this->client->currentArgumentsFormat.=$format=\"\";\n"+ +"$this->write($format);\n"+ +"$this->finish();\n"+ +"$this->client->currentCacheKey=null;\n"+ +"}\n"+ +"function propertyAccessBegin($object,$method) {\n"+ +"$this->client->sendBuffer.=$this->client->preparedToSendBuffer;\n"+ +"$this->client->preparedToSendBuffer=null;\n"+ +"$this->write(sprintf(\"\",$object,$method));\n"+ +"$this->client->currentArgumentsFormat=\"\";\n"+ +"}\n"+ +"function propertyAccessEnd() {\n"+ +"$this->client->currentArgumentsFormat.=$format=\"\";\n"+ +"$this->write($format);\n"+ +"$this->finish();\n"+ +"$this->client->currentCacheKey=null;\n"+ +"}\n"+ +"function invokeBegin($object,$method) {\n"+ +"$this->client->sendBuffer.=$this->client->preparedToSendBuffer;\n"+ +"$this->client->preparedToSendBuffer=null;\n"+ +"$this->write(sprintf(\"\",$object,$method));\n"+ +"$this->client->currentArgumentsFormat=\"\";\n"+ +"}\n"+ +"function invokeEnd() {\n"+ +"$this->client->currentArgumentsFormat.=$format=\"\";\n"+ +"$this->write($format);\n"+ +"$this->finish();\n"+ +"$this->client->currentCacheKey=null;\n"+ +"}\n"+ +"function resultBegin() {\n"+ +"$this->client->sendBuffer.=$this->client->preparedToSendBuffer;\n"+ +"$this->client->preparedToSendBuffer=null;\n"+ +"$this->write(\"\");\n"+ +"}\n"+ +"function resultEnd() {\n"+ +"$this->client->currentCacheKey=null;\n"+ +"$this->write(\"\");\n"+ +"$this->flush();\n"+ +"}\n"+ +"function writeString($name) {\n"+ +"$this->client->currentArgumentsFormat.=$format=\"\";\n"+ +"$this->write(sprintf($format,htmlspecialchars($name,ENT_COMPAT)));\n"+ +"}\n"+ +"function writeBoolean($boolean) {\n"+ +"$this->client->currentArgumentsFormat.=$format=\"\";\n"+ +"$this->write(sprintf($format,$boolean));\n"+ +"}\n"+ +"function writeLong($l) {\n"+ +"$this->client->currentArgumentsFormat.=\"\";\n"+ +"if($l<0) {\n"+ +"$this->write(sprintf(\"\",-$l));\n"+ +"} else {\n"+ +"$this->write(sprintf(\"\",$l));\n"+ +"}\n"+ +"}\n"+ +"function writeULong($l) {\n"+ +"$this->client->currentArgumentsFormat.=$format=\"\";\n"+ +"$this->write(sprintf($format,$l));\n"+ +"}\n"+ +"function writeDouble($d) {\n"+ +"$this->client->currentArgumentsFormat.=$format=\"\";\n"+ +"$this->write(sprintf($format,$d));\n"+ +"}\n"+ +"function writeObject($object) {\n"+ +"$this->client->currentArgumentsFormat.=$format=\"\";\n"+ +"$this->write(sprintf($format,$object));\n"+ +"}\n"+ +"function writeException($object,$str) {\n"+ +"$this->write(sprintf(\"\",$object,htmlspecialchars($str,ENT_COMPAT)));\n"+ +"}\n"+ +"function writeCompositeBegin_a() {\n"+ +"$this->write(\"\");\n"+ +"}\n"+ +"function writeCompositeBegin_h() {\n"+ +"$this->write(\"\");\n"+ +"}\n"+ +"function writeCompositeEnd() {\n"+ +"$this->write(\"\");\n"+ +"}\n"+ +"function writePairBegin_s($key) {\n"+ +"$this->write(sprintf(\"

\",htmlspecialchars($key,ENT_COMPAT)));\n"+ +"}\n"+ +"function writePairBegin_n($key) {\n"+ +"$this->write(sprintf(\"

\",$key));\n"+ +"}\n"+ +"function writePairBegin() {\n"+ +"$this->write(\"

\");\n"+ +"}\n"+ +"function writePairEnd() {\n"+ +"$this->write(\"

\");\n"+ +"}\n"+ +"function writeUnref($object) {\n"+ +"$this->client->sendBuffer.=$this->client->preparedToSendBuffer;\n"+ +"$this->client->preparedToSendBuffer=null;\n"+ +"$this->write(sprintf(\"\",$object));\n"+ +"}\n"+ +"function getServerName() {\n"+ +"return $this->serverName;\n"+ +"}\n"+ +"}\n"+ +"class java_ParserString {\n"+ +"public $string,$off,$length;\n"+ +"function toString() {\n"+ +"return $this->getString();\n"+ +"}\n"+ +"function getString() {\n"+ +"return substr($this->string,$this->off,$this->length);\n"+ +"}\n"+ +"}\n"+ +"class java_ParserTag {\n"+ +"public $n,$strings;\n"+ +"function java_ParserTag() {\n"+ +"$this->strings=array();\n"+ +"$this->n=0;\n"+ +"}\n"+ +"}\n"+ +"class java_SimpleParser {\n"+ +"public $SLEN=256;\n"+ +"public $handler;\n"+ +"public $tag,$buf,$len,$s;\n"+ +"public $type;\n"+ +"function java_SimpleParser($handler) {\n"+ +"$this->handler=$handler;\n"+ +"$this->tag=array(new java_ParserTag(),new java_ParserTag(),new java_ParserTag());\n"+ +"$this->len=$this->SLEN;\n"+ +"$this->s=str_repeat(\" \",$this->SLEN);\n"+ +"$this->type=$this->VOJD;\n"+ +"}\n"+ +"public $BEGIN=0,$KEY=1,$VAL=2,$ENTITY=3,$VOJD=5,$END=6;\n"+ +"public $level=0,$eor=0; public $in_dquote,$eot=false;\n"+ +"public $pos=0,$c=0,$i=0,$i0=0,$e;\n"+ +"function RESET() {\n"+ +"$this->type=$this->VOJD;\n"+ +"$this->level=0;\n"+ +"$this->eor=0;\n"+ +"$this->in_dquote=false;\n"+ +"$this->i=0;\n"+ +"$this->i0=0;\n"+ +"}\n"+ +"function APPEND($c) {\n"+ +"if($this->i>=$this->len-1) {\n"+ +"$this->s=str_repeat($this->s,2);\n"+ +"$this->len*=2;\n"+ +"}\n"+ +"$this->s[$this->i++]=$c;\n"+ +"}\n"+ +"function CALL_BEGIN() {\n"+ +"$pt=&$this->tag[1]->strings;\n"+ +"$st=&$this->tag[2]->strings;\n"+ +"$t=&$this->tag[0]->strings[0];\n"+ +"$name=$t->string[$t->off];\n"+ +"$n=$this->tag[2]->n;\n"+ +"$ar=array();\n"+ +"for($i=0; $i<$n; $i++) {\n"+ +"$ar[$pt[$i]->getString()]=$st[$i]->getString();\n"+ +"}\n"+ +"$this->handler->begin($name,$ar);\n"+ +"}\n"+ +"function CALL_END() {\n"+ +"$t=&$this->tag[0]->strings[0];\n"+ +"$name=$t->string[$t->off];\n"+ +"$this->handler->end($name);\n"+ +"}\n"+ +"function PUSH($t) {\n"+ +"$str=&$this->tag[$t]->strings;\n"+ +"$n=&$this->tag[$t]->n;\n"+ +"$this->s[$this->i]='|';\n"+ +"if(!isset($str[$n])){$h=$this->handler; $str[$n]=$h->createParserString();}\n"+ +"$str[$n]->string=&$this->s;\n"+ +"$str[$n]->off=$this->i0;\n"+ +"$str[$n]->length=$this->i-$this->i0;\n"+ +"++$this->tag[$t]->n;\n"+ +"$this->APPEND('|');\n"+ +"$this->i0=$this->i;\n"+ +"}\n"+ +"function parse() {\n"+ +"while($this->eor==0) {\n"+ +"if($this->c>=$this->pos) {\n"+ +"$this->buf=$this->handler->read(JAVA_RECV_SIZE);\n"+ +"if(is_null($this->buf) || strlen($this->buf)==0)\n"+ +"$this->handler->protocol->handler->shutdownBrokenConnection(\"protocol error. Check the back end log for OutOfMemoryErrors.\");\n"+ +"$this->pos=strlen($this->buf);\n"+ +"if($this->pos==0) break;\n"+ +"$this->c=0;\n"+ +"}\n"+ +"switch(($ch=$this->buf[$this->c]))\n"+ +"{\n"+ +"case '<': if($this->in_dquote) {$this->APPEND($ch); break;}\n"+ +"$this->level+=1;\n"+ +"$this->type=$this->BEGIN;\n"+ +"break;\n"+ +"case '\\t': case '\\f': case '\\n': case '\\r': case ' ': if($this->in_dquote) {$this->APPEND($ch); break;}\n"+ +"if($this->type==$this->BEGIN) {\n"+ +"$this->PUSH($this->type);\n"+ +"$this->type=$this->KEY;\n"+ +"}\n"+ +"break;\n"+ +"case '=': if($this->in_dquote) {$this->APPEND($ch); break;}\n"+ +"$this->PUSH($this->type);\n"+ +"$this->type=$this->VAL;\n"+ +"break;\n"+ +"case '/': if($this->in_dquote) {$this->APPEND($ch); break;}\n"+ +"if($this->type==$this->BEGIN) { $this->type=$this->END; $this->level-=1; }\n"+ +"$this->level-=1;\n"+ +"$this->eot=true;\n"+ +"break;\n"+ +"case '>': if($this->in_dquote) {$this->APPEND($ch); break;}\n"+ +"if($this->type==$this->END){\n"+ +"$this->PUSH($this->BEGIN);\n"+ +"$this->CALL_END();\n"+ +"} else {\n"+ +"if($this->type==$this->VAL) $this->PUSH($this->type);\n"+ +"$this->CALL_BEGIN();\n"+ +"}\n"+ +"$this->tag[0]->n=$this->tag[1]->n=$this->tag[2]->n=0; $this->i0=$this->i=0;\n"+ +"$this->type=$this->VOJD;\n"+ +"if($this->level==0) $this->eor=1;\n"+ +"break;\n"+ +"case ';':\n"+ +"if($this->type==$this->ENTITY) {\n"+ +"switch ($this->s[$this->e+1]) {\n"+ +"case 'l': $this->s[$this->e]='<'; $this->i=$this->e+1; break;\n"+ +"case 'g': $this->s[$this->e]='>'; $this->i=$this->e+1; break;\n"+ +"case 'a': $this->s[$this->e]=($this->s[$this->e+2]=='m'?'&':'\\''); $this->i=$this->e+1; break;\n"+ +"case 'q': $this->s[$this->e]='\"'; $this->i=$this->e+1; break;\n"+ +"default: $this->APPEND($ch);\n"+ +"}\n"+ +"$this->type=$this->VAL;\n"+ +"} else {\n"+ +"$this->APPEND($ch);\n"+ +"}\n"+ +"break;\n"+ +"case '&':\n"+ +"$this->type=$this->ENTITY;\n"+ +"$this->e=$this->i;\n"+ +"$this->APPEND($ch);\n"+ +"break;\n"+ +"case '\"':\n"+ +"$this->in_dquote=!$this->in_dquote;\n"+ +"if(!$this->in_dquote && $this->type==$this->VAL) {\n"+ +"$this->PUSH($this->type);\n"+ +"$this->type=$this->KEY;\n"+ +"}\n"+ +"break;\n"+ +"default:\n"+ +"$this->APPEND($ch);\n"+ +"}\n"+ +"$this->c+=1;\n"+ +"}\n"+ +"$this->RESET();\n"+ +"}\n"+ +"function getData($str) {\n"+ +"return $str;\n"+ +"}\n"+ +"function parserError() {\n"+ +"$this->handler->protocol->handler->shutdownBrokenConnection(\n"+ +"sprintf(\"protocol error: %s. Check the back end log for details.\",$this->s));\n"+ +"}\n"+ +"}\n"+ +"interface java_JavaType {};\n"+ +"$java_initialized=false;\n"+ +"function __javaproxy_Client_getClient() {\n"+ +"static $client=null;\n"+ +"if(!is_null($client)) return $client;\n"+ +"if (function_exists(\"java_create_client\")) $client=java_create_client();\n"+ +"else {\n"+ +"global $java_initialized;\n"+ +"$client=new java_Client();\n"+ +"$java_initialized=true;\n"+ +"}\n"+ +"return $client;\n"+ +"}\n"+ +"function java_last_exception_get() {\n"+ +"$client=__javaproxy_Client_getClient();\n"+ +"return $client->invokeMethod(0,\"getLastException\",array());\n"+ +"}\n"+ +"function java_last_exception_clear() {\n"+ +"$client=__javaproxy_Client_getClient();\n"+ +"$client->invokeMethod(0,\"clearLastException\",array());\n"+ +"}\n"+ +"function java_values_internal($object) {\n"+ +"if(!$object instanceof java_JavaType) return $object;\n"+ +"$client=__javaproxy_Client_getClient();\n"+ +"return $client->invokeMethod(0,\"getValues\",array($object));\n"+ +"}\n"+ +"function java_invoke($object,$method,$args) {\n"+ +"$client=__javaproxy_Client_getClient();\n"+ +"$id=($object==null) ? 0 : $object->__java;\n"+ +"return $client->invokeMethod($id,$method,$args);\n"+ +"}\n"+ +"function java_unwrap ($object) {\n"+ +"if(!$object instanceof java_JavaType) throw new java_IllegalArgumentException($object);\n"+ +"$client=__javaproxy_Client_getClient();\n"+ +"return $client->globalRef->get($client->invokeMethod(0,\"unwrapClosure\",array($object)));\n"+ +"}\n"+ +"function java_values($object) {\n"+ +"return java_values_internal($object);\n"+ +"}\n"+ +"function java_inspect_internal($object) {\n"+ +"if(!$object instanceof java_JavaType) throw new java_IllegalArgumentException($object);\n"+ +"$client=__javaproxy_Client_getClient();\n"+ +"return $client->invokeMethod(0,\"inspect\",array($object));\n"+ +"}\n"+ +"function java_inspect($object) {\n"+ +"return java_inspect_internal($object);\n"+ +"}\n"+ +"function java_set_file_encoding($enc) {\n"+ +"$client=__javaproxy_Client_getClient();\n"+ +"return $client->invokeMethod(0,\"setFileEncoding\",array($enc));\n"+ +"}\n"+ +"function java_instanceof_internal($ob,$clazz) {\n"+ +"if(!$ob instanceof java_JavaType) throw new java_IllegalArgumentException($ob);\n"+ +"if(!$clazz instanceof java_JavaType) throw new java_IllegalArgumentException($clazz);\n"+ +"$client=__javaproxy_Client_getClient();\n"+ +"return $client->invokeMethod(0,\"instanceOf\",array($ob,$clazz));\n"+ +"}\n"+ +"function java_instanceof($ob,$clazz) {\n"+ +"return java_instanceof_internal($ob,$clazz);\n"+ +"}\n"+ +"function java_cast_internal($object,$type) {\n"+ +"if(!$object instanceof java_JavaType) {\n"+ +"switch($type[0]) {\n"+ +"case 'S': case 's':\n"+ +"return (string)$object;\n"+ +"case 'B': case 'b':\n"+ +"return (boolean)$object;\n"+ +"case 'L': case 'I': case 'l': case 'i':\n"+ +"return (integer)$object;\n"+ +"case 'D': case 'd': case 'F': case 'f':\n"+ +"return (float) $object;\n"+ +"case 'N': case 'n':\n"+ +"return null;\n"+ +"case 'A': case 'a':\n"+ +"return (array)$object;\n"+ +"case 'O': case 'o':\n"+ +"return (object)$object;\n"+ +"}\n"+ +"}\n"+ +"return $object->__cast($type);\n"+ +"}\n"+ +"function java_cast($object,$type) {\n"+ +"return java_cast_internal($object,$type);\n"+ +"}\n"+ +"function java_require($arg) {\n"+ +"trigger_error('java_require() not supported anymore. Please use tomcat or jee hot deployment instead',E_USER_WARNING);\n"+ +"}\n"+ +"function java_get_lifetime ()\n"+ +"{\n"+ +"$session_max_lifetime=ini_get(\"session.gc_maxlifetime\");\n"+ +"return $session_max_lifetime ? (int)$session_max_lifetime : 1440;\n"+ +"}\n"+ +"function java_session_array($args) {\n"+ +"$client=__javaproxy_Client_getClient();\n"+ +"if(!isset($args[0])) $args[0]=null;\n"+ +"if(!isset($args[1]))\n"+ +"$args[1]=0;\n"+ +"elseif ($args[1]===true)\n"+ +"$args[1]=1;\n"+ +"else\n"+ +"$args[1]=2;\n"+ +"if(!isset($args[2])) {\n"+ +"$args[2]=java_get_lifetime ();\n"+ +"}\n"+ +"return $client->getSession($args);\n"+ +"}\n"+ +"function java_session() {\n"+ +"return java_session_array(func_get_args());\n"+ +"}\n"+ +"function java_server_name() {\n"+ +"try {\n"+ +"$client=__javaproxy_Client_getClient();\n"+ +"return $client->getServerName();\n"+ +"} catch (java_ConnectException $ex) {\n"+ +"return null;\n"+ +"}\n"+ +"}\n"+ +"function java_context() {\n"+ +"$client=__javaproxy_Client_getClient();\n"+ +"return $client->getContext();\n"+ +"}\n"+ +"function java_closure_array($args) {\n"+ +"if(isset($args[2]) && ((!($args[2] instanceof java_JavaType))&&!is_array($args[2])))\n"+ +"throw new java_IllegalArgumentException($args[2]);\n"+ +"$client=__javaproxy_Client_getClient();\n"+ +"$args[0]=isset($args[0]) ? $client->globalRef->add($args[0]) : 0;\n"+ +"$client->protocol->invokeBegin(0,\"makeClosure\");\n"+ +"$n=count($args);\n"+ +"$client->protocol->writeULong($args[0]);\n"+ +"for($i=1; $i<$n; $i++) {\n"+ +"$client->writeArg($args[$i]);\n"+ +"}\n"+ +"$client->protocol->invokeEnd();\n"+ +"$val=$client->getResult();\n"+ +"return $val;\n"+ +"}\n"+ +"function java_closure() {\n"+ +"return java_closure_array(func_get_args());\n"+ +"}\n"+ +"function java_begin_document() {\n"+ +"}\n"+ +"function java_end_document() {\n"+ +"}\n"+ +"class java_JavaProxy implements java_JavaType {\n"+ +"public $__serialID,$__java;\n"+ +"public $__signature;\n"+ +"public $__client;\n"+ +"public $__tempGlobalRef;\n"+ +"function java_JavaProxy($java,$signature){\n"+ +"$this->__java=$java;\n"+ +"$this->__signature=$signature;\n"+ +"$this->__client=__javaproxy_Client_getClient();\n"+ +"}\n"+ +"function __cast($type) {\n"+ +"return $this->__client->cast($this,$type);\n"+ +"}\n"+ +"function __sleep() {\n"+ +"$args=array($this,java_get_lifetime());\n"+ +"$this->__serialID=$this->__client->invokeMethod(0,\"serialize\",$args);\n"+ +"$this->__tempGlobalRef=$this->__client->globalRef;\n"+ +"return array(\"__serialID\",\"__tempGlobalRef\");\n"+ +"}\n"+ +"function __wakeup() {\n"+ +"$args=array($this->__serialID,java_get_lifetime());\n"+ +"$this->__client=__javaproxy_Client_getClient();\n"+ +"if($this->__tempGlobalRef)\n"+ +"$this->__client->globalRef=$this->__tempGlobalRef;\n"+ +"$this->__tempGlobalRef=null;\n"+ +"$this->__java=$this->__client->invokeMethod(0,\"deserialize\",$args);\n"+ +"}\n"+ +"function __destruct() {\n"+ +"if(isset($this->__client))\n"+ +"$this->__client->unref($this->__java);\n"+ +"}\n"+ +"function __get($key) {\n"+ +"return $this->__client->getProperty($this->__java,$key);\n"+ +"}\n"+ +"function __set($key,$val) {\n"+ +"$this->__client->setProperty($this->__java,$key,$val);\n"+ +"}\n"+ +"function __call($method,$args) {\n"+ +"return $this->__client->invokeMethod($this->__java,$method,$args);\n"+ +"}\n"+ +"function __toString() {\n"+ +"try {\n"+ +"return $this->__client->invokeMethod(0,\"ObjectToString\",array($this));\n"+ +"} catch (JavaException $ex) {\n"+ +"trigger_error(\"Exception in Java::__toString(): \". java_truncate((string)$ex),E_USER_WARNING);\n"+ +"return \"\";\n"+ +"}\n"+ +"}\n"+ +"}\n"+ +"class java_objectIterator implements Iterator {\n"+ +"private $var;\n"+ +"function java_ObjectIterator($javaProxy) {\n"+ +"$this->var=java_cast ($javaProxy,\"A\");\n"+ +"}\n"+ +"function rewind() {\n"+ +"reset($this->var);\n"+ +"}\n"+ +"function valid() {\n"+ +"return $this->current() !==false;\n"+ +"}\n"+ +"function next() {\n"+ +"return next($this->var);\n"+ +"}\n"+ +"function key() {\n"+ +"return key($this->var);\n"+ +"}\n"+ +"function current() {\n"+ +"return current($this->var);\n"+ +"}\n"+ +"}\n"+ +"class java_IteratorProxy extends java_JavaProxy implements IteratorAggregate {\n"+ +"function getIterator() {\n"+ +"return new java_ObjectIterator($this);\n"+ +"}\n"+ +"}\n"+ +"class java_ArrayProxy extends java_IteratorProxy implements ArrayAccess {\n"+ +"function offsetExists($idx) {\n"+ +"$ar=array($this,$idx);\n"+ +"return $this->__client->invokeMethod(0,\"offsetExists\",$ar);\n"+ +"}\n"+ +"function offsetGet($idx) {\n"+ +"$ar=array($this,$idx);\n"+ +"return $this->__client->invokeMethod(0,\"offsetGet\",$ar);\n"+ +"}\n"+ +"function offsetSet($idx,$val) {\n"+ +"$ar=array($this,$idx,$val);\n"+ +"return $this->__client->invokeMethod(0,\"offsetSet\",$ar);\n"+ +"}\n"+ +"function offsetUnset($idx) {\n"+ +"$ar=array($this,$idx);\n"+ +"return $this->__client->invokeMethod(0,\"offsetUnset\",$ar);\n"+ +"}\n"+ +"}\n"+ +"class java_ExceptionProxy extends java_JavaProxy {\n"+ +"function __toExceptionString($trace) {\n"+ +"$args=array($this,$trace);\n"+ +"return $this->__client->invokeMethod(0,\"ObjectToString\",$args);\n"+ +"}\n"+ +"}\n"+ +"abstract class java_AbstractJava implements IteratorAggregate,ArrayAccess,java_JavaType {\n"+ +"public $__client;\n"+ +"public $__delegate;\n"+ +"public $__serialID;\n"+ +"public $__factory;\n"+ +"public $__java,$__signature;\n"+ +"public $__cancelProxyCreationTag;\n"+ +"function __createDelegate() {\n"+ +"$proxy=$this->__delegate=\n"+ +"$this->__factory->create($this->__java,$this->__signature);\n"+ +"$this->__java=$proxy->__java;\n"+ +"$this->__signature=$proxy->__signature;\n"+ +"}\n"+ +"function __cast($type) {\n"+ +"if(!isset($this->__delegate)) $this->__createDelegate();\n"+ +"return $this->__delegate->__cast($type);\n"+ +"}\n"+ +"function __sleep() {\n"+ +"if(!isset($this->__delegate)) $this->__createDelegate();\n"+ +"$this->__delegate->__sleep();\n"+ +"return array(\"__delegate\");\n"+ +"}\n"+ +"function __wakeup() {\n"+ +"if(!isset($this->__delegate)) $this->__createDelegate();\n"+ +"$this->__delegate->__wakeup();\n"+ +"$this->__java=$this->__delegate->__java;\n"+ +"$this->__client=$this->__delegate->__client;\n"+ +"}\n"+ +"function __get($key) {\n"+ +"if(!isset($this->__delegate)) $this->__createDelegate();\n"+ +"return $this->__delegate->__get($key);\n"+ +"}\n"+ +"function __set($key,$val) {\n"+ +"if(!isset($this->__delegate)) $this->__createDelegate();\n"+ +"$this->__delegate->__set($key,$val);\n"+ +"}\n"+ +"function __call($method,$args) {\n"+ +"if(!isset($this->__delegate)) $this->__createDelegate();\n"+ +"return $this->__delegate->__call($method,$args);\n"+ +"}\n"+ +"function __toString() {\n"+ +"if(!isset($this->__delegate)) $this->__createDelegate();\n"+ +"return $this->__delegate->__toString();\n"+ +"}\n"+ +"function getIterator() {\n"+ +"if(!isset($this->__delegate)) $this->__createDelegate();\n"+ +"if(func_num_args()==0) return $this->__delegate->getIterator();\n"+ +"$args=func_get_args(); return $this->__call(\"getIterator\",$args);\n"+ +"}\n"+ +"function offsetExists($idx) {\n"+ +"if(!isset($this->__delegate)) $this->__createDelegate();\n"+ +"if(func_num_args()==1) return $this->__delegate->offsetExists($idx);\n"+ +"$args=func_get_args(); return $this->__call(\"offsetExists\",$args);\n"+ +"}\n"+ +"function offsetGet($idx) {\n"+ +"if(!isset($this->__delegate)) $this->__createDelegate();\n"+ +"if(func_num_args()==1) return $this->__delegate->offsetGet($idx);\n"+ +"$args=func_get_args(); return $this->__call(\"offsetGet\",$args);\n"+ +"}\n"+ +"function offsetSet($idx,$val) {\n"+ +"if(!isset($this->__delegate)) $this->__createDelegate();\n"+ +"if(func_num_args()==2) return $this->__delegate->offsetSet($idx,$val);\n"+ +"$args=func_get_args(); return $this->__call(\"offsetSet\",$args);\n"+ +"}\n"+ +"function offsetUnset($idx) {\n"+ +"if(!isset($this->__delegate)) $this->__createDelegate();\n"+ +"if(func_num_args()==1) return $this->__delegate->offsetUnset($idx);\n"+ +"$args=func_get_args(); return $this->__call(\"offsetUnset\",$args);\n"+ +"}\n"+ +"}\n"+ +"class Java extends java_AbstractJava {\n"+ +"function Java() {\n"+ +"$client=$this->__client=__javaproxy_Client_getClient();\n"+ +"$args=func_get_args();\n"+ +"$name=array_shift($args);\n"+ +"if(is_array($name)) {$args=$name; $name=array_shift($args);}\n"+ +"$sig=\"&{$this->__signature}@{$name}\";\n"+ +"$len=count($args);\n"+ +"$args2=array();\n"+ +"for($i=0; $i<$len; $i++) {\n"+ +"switch(gettype($val=$args[$i])) {\n"+ +"case 'boolean': array_push($args2,$val); $sig.='@b'; break;\n"+ +"case 'integer': array_push($args2,$val); $sig.='@i'; break;\n"+ +"case 'double': array_push($args2,$val); $sig.='@d'; break;\n"+ +"case 'string': array_push($args2,htmlspecialchars($val,ENT_COMPAT)); $sig.='@s'; break;\n"+ +"case 'array':$sig=\"~INVALID\"; break;\n"+ +"case 'object':\n"+ +"if($val instanceof java_JavaType) {\n"+ +"array_push($args2,$val->__java);\n"+ +"$sig.=\"@o{$val->__signature}\";\n"+ +"}\n"+ +"else {\n"+ +"$sig=\"~INVALID\";\n"+ +"}\n"+ +"break;\n"+ +"case 'resource': array_push($args2,$val); $sig.='@r'; break;\n"+ +"case 'NULL': array_push($args2,$val); $sig.='@N'; break;\n"+ +"case 'unknown type': array_push($args2,$val); $sig.='@u'; break;\n"+ +"default: throw new java_IllegalArgumentException($val);\n"+ +"}\n"+ +"}\n"+ +"if(array_key_exists($sig,$client->methodCache)) {\n"+ +"$cacheEntry=&$client->methodCache[$sig];\n"+ +"$client->sendBuffer.=$client->preparedToSendBuffer;\n"+ +"if(strlen($client->sendBuffer)>=JAVA_SEND_SIZE) {\n"+ +"if($client->protocol->handler->write($client->sendBuffer)<=0)\n"+ +"throw new java_IllegalStateException(\"Connection out of sync,check backend log for details.\");\n"+ +"$client->sendBuffer=null;\n"+ +"}\n"+ +"$client->preparedToSendBuffer=vsprintf($cacheEntry->fmt,$args2);\n"+ +"$this->__java=++$client->asyncCtx;\n"+ +"$this->__factory=$cacheEntry->factory;\n"+ +"$this->__signature=$cacheEntry->signature;\n"+ +"$this->__cancelProxyCreationTag=++$client->cancelProxyCreationTag;\n"+ +"} else {\n"+ +"$client->currentCacheKey=$sig;\n"+ +"$delegate=$this->__delegate=$client->createObject($name,$args);\n"+ +"$this->__java=$delegate->__java;\n"+ +"$this->__signature=$delegate->__signature;\n"+ +"}\n"+ +"}\n"+ +"function __destruct() {\n"+ +"if(!isset($this->__client)) return;\n"+ +"$client=$this->__client;\n"+ +"$preparedToSendBuffer=&$client->preparedToSendBuffer;\n"+ +"if($preparedToSendBuffer &&\n"+ +"$client->cancelProxyCreationTag==$this->__cancelProxyCreationTag) {\n"+ +"$preparedToSendBuffer[6]=\"3\";\n"+ +"$client->sendBuffer.=$preparedToSendBuffer;\n"+ +"$preparedToSendBuffer=null;\n"+ +"$client->asyncCtx -=1;\n"+ +"} else {\n"+ +"if(!isset($this->__delegate)) {\n"+ +"$client->unref($this->__java);\n"+ +"}\n"+ +"}\n"+ +"}\n"+ +"function __call($method,$args) {\n"+ +"$client=$this->__client;\n"+ +"$sig=\"@{$this->__signature}@$method\";\n"+ +"$len=count($args);\n"+ +"$args2=array($this->__java);\n"+ +"for($i=0; $i<$len; $i++) {\n"+ +"switch(gettype($val=$args[$i])) {\n"+ +"case 'boolean': array_push($args2,$val); $sig.='@b'; break;\n"+ +"case 'integer': array_push($args2,$val); $sig.='@i'; break;\n"+ +"case 'double': array_push($args2,$val); $sig.='@d'; break;\n"+ +"case 'string': array_push($args2,htmlspecialchars($val,ENT_COMPAT)); $sig.='@s'; break;\n"+ +"case 'array':$sig=\"~INVALID\"; break;\n"+ +"case 'object':\n"+ +"if($val instanceof java_JavaType) {\n"+ +"array_push($args2,$val->__java);\n"+ +"$sig.=\"@o{$val->__signature}\";\n"+ +"}\n"+ +"else {\n"+ +"$sig=\"~INVALID\";\n"+ +"}\n"+ +"break;\n"+ +"case 'resource': array_push($args2,$val); $sig.='@r'; break;\n"+ +"case 'NULL': array_push($args2,$val); $sig.='@N'; break;\n"+ +"case 'unknown type': array_push($args2,$val); $sig.='@u'; break;\n"+ +"default: throw new java_IllegalArgumentException($val);\n"+ +"}\n"+ +"}\n"+ +"if(array_key_exists($sig,$client->methodCache)) {\n"+ +"$cacheEntry=&$client->methodCache[$sig];\n"+ +"$client->sendBuffer.=$client->preparedToSendBuffer;\n"+ +"if(strlen($client->sendBuffer)>=JAVA_SEND_SIZE) {\n"+ +"if($client->protocol->handler->write($client->sendBuffer)<=0)\n"+ +"throw new java_IllegalStateException(\"Out of sync. Check backend log for details.\");\n"+ +"$client->sendBuffer=null;\n"+ +"}\n"+ +"$client->preparedToSendBuffer=vsprintf($cacheEntry->fmt,$args2);\n"+ +"if($cacheEntry->resultVoid) {\n"+ +"$client->cancelProxyCreationTag +=1;\n"+ +"return null;\n"+ +"} else {\n"+ +"$result=clone($client->cachedJavaPrototype);\n"+ +"$result->__factory=$cacheEntry->factory;\n"+ +"$result->__java=++$client->asyncCtx;\n"+ +"$result->__signature=$cacheEntry->signature;\n"+ +"$result->__cancelProxyCreationTag=++$client->cancelProxyCreationTag;\n"+ +"return $result;\n"+ +"}\n"+ +"} else {\n"+ +"$client->currentCacheKey=$sig;\n"+ +"$retval=parent::__call($method,$args);\n"+ +"return $retval;\n"+ +"}\n"+ +"}\n"+ +"}\n"+ +"class java_InternalJava extends Java {\n"+ +"function java_InternalJava($proxy) {\n"+ +"$this->__delegate=$proxy;\n"+ +"$this->__java=$proxy->__java;\n"+ +"$this->__signature=$proxy->__signature;\n"+ +"$this->__client=$proxy->__client;\n"+ +"}\n"+ +"}\n"+ +"class java_class extends Java {\n"+ +"function java_class() {\n"+ +"$this->__client=__javaproxy_Client_getClient();\n"+ +"$args=func_get_args();\n"+ +"$name=array_shift($args);\n"+ +"if(is_array($name)) { $args=$name; $name=array_shift($args); }\n"+ +"$delegate=$this->__delegate=$this->__client->referenceObject($name,$args);\n"+ +"$this->__java=$delegate->__java;\n"+ +"$this->__signature=$delegate->__signature;\n"+ +"}\n"+ +"}\n"+ +"class JavaClass extends java_class{}\n"+ +"class java_exception extends Exception implements java_JavaType {\n"+ +"public $__serialID,$__java,$__client;\n"+ +"public $__delegate;\n"+ +"public $__signature;\n"+ +"public $__hasDeclaredExceptions;\n"+ +"function java_exception() {\n"+ +"$this->__client=__javaproxy_Client_getClient();\n"+ +"$args=func_get_args();\n"+ +"$name=array_shift($args);\n"+ +"if(is_array($name)) { $args=$name; $name=array_shift($args); }\n"+ +"if (count($args)==0)\n"+ +"Exception::__construct($name);\n"+ +"else\n"+ +"Exception::__construct($args[0]);\n"+ +"$delegate=$this->__delegate=$this->__client->createObject($name,$args);\n"+ +"$this->__java=$delegate->__java;\n"+ +"$this->__signature=$delegate->__signature;\n"+ +"$this->__hasDeclaredExceptions='T';\n"+ +"}\n"+ +"function __cast($type) {\n"+ +"return $this->__delegate->__cast($type);\n"+ +"}\n"+ +"function __sleep() {\n"+ +"$this->__delegate->__sleep();\n"+ +"return array(\"__delegate\");\n"+ +"}\n"+ +"function __wakeup() {\n"+ +"$this->__delegate->__wakeup();\n"+ +"$this->__java=$this->__delegate->__java;\n"+ +"$this->__client=$this->__delegate->__client;\n"+ +"}\n"+ +"function __get($key) {\n"+ +"return $this->__delegate->__get($key);\n"+ +"}\n"+ +"function __set($key,$val) {\n"+ +"$this->__delegate->__set($key,$val);\n"+ +"}\n"+ +"function __call($method,$args) {\n"+ +"return $this->__delegate->__call($method,$args);\n"+ +"}\n"+ +"function __toString() {\n"+ +"return $this->__delegate->__toExceptionString($this->getTraceAsString());\n"+ +"}\n"+ +"}\n"+ +"class JavaException extends java_exception {}\n"+ +"class java_InternalException extends JavaException {\n"+ +"function java_InternalException($proxy,$exception) {\n"+ +"$this->__delegate=$proxy;\n"+ +"$this->__java=$proxy->__java;\n"+ +"$this->__signature=$proxy->__signature;\n"+ +"$this->__client=$proxy->__client;\n"+ +"$this->__hasDeclaredExceptions=$exception;\n"+ +"}\n"+ +"}\n"+ +"class java_JavaProxyProxy extends Java {\n"+ +"function java_JavaProxyProxy($client) {\n"+ +"$this->__client=$client;\n"+ +"}\n"+ +"}\n"+ +"}\n"+ +"?>\n"+ +""; + public static final byte[] bytes = data.getBytes(); +} diff --git a/src/main/java/io/soluble/pjb/bridge/JavaProxy.java b/src/main/java/io/soluble/pjb/bridge/JavaProxy.java new file mode 100644 index 0000000..f5e1f5a --- /dev/null +++ b/src/main/java/io/soluble/pjb/bridge/JavaProxy.java @@ -0,0 +1,24 @@ +package io.soluble.pjb.bridge; +public class JavaProxy { + private static final String data = "\n"+ +""; + public static final byte[] bytes = data.getBytes(); +} diff --git a/src/main/java/io/soluble/pjb/bridge/LauncherUnix.java b/src/main/java/io/soluble/pjb/bridge/LauncherUnix.java new file mode 100644 index 0000000..dfaff5c --- /dev/null +++ b/src/main/java/io/soluble/pjb/bridge/LauncherUnix.java @@ -0,0 +1,13 @@ +package io.soluble.pjb.bridge; +public class LauncherUnix { + private static final String data = "#!/bin/sh\n"+ +"# php fcgi launcher\n"+ +"#set -x\n"+ +"\n"+ +"\"$@\" 1>&2 &\n"+ +"trap \"kill $! && exit 0;\" 1 2 15\n"+ +"read result 1>&2\n"+ +"kill $!\n"+ +""; + public static final byte[] bytes = data.getBytes(); +} diff --git a/src/main/java/io/soluble/pjb/bridge/LauncherWindows.java b/src/main/java/io/soluble/pjb/bridge/LauncherWindows.java new file mode 100644 index 0000000..02ff156 --- /dev/null +++ b/src/main/java/io/soluble/pjb/bridge/LauncherWindows.java @@ -0,0 +1,517 @@ +package io.soluble.pjb.bridge; +public class LauncherWindows { + public static final byte[] bytes = new byte[]{ +(byte)0115, (byte)0132, (byte)0220, (byte)00, (byte)03, (byte)00, (byte)00, (byte)00, (byte)04, (byte)00, (byte)00, (byte)00, (byte)0377, (byte)0377, (byte)00, (byte)00, +(byte)0270, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0100, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0200, (byte)00, (byte)00, (byte)00, +(byte)016, (byte)037, (byte)0272, (byte)016, (byte)00, (byte)0264, (byte)011, (byte)0315, (byte)041, (byte)0270, (byte)01, (byte)0114, (byte)0315, (byte)041, (byte)0124, (byte)0150, +(byte)0151, (byte)0163, (byte)040, (byte)0160, (byte)0162, (byte)0157, (byte)0147, (byte)0162, (byte)0141, (byte)0155, (byte)040, (byte)0143, (byte)0141, (byte)0156, (byte)0156, (byte)0157, +(byte)0164, (byte)040, (byte)0142, (byte)0145, (byte)040, (byte)0162, (byte)0165, (byte)0156, (byte)040, (byte)0151, (byte)0156, (byte)040, (byte)0104, (byte)0117, (byte)0123, (byte)040, +(byte)0155, (byte)0157, (byte)0144, (byte)0145, (byte)056, (byte)015, (byte)015, (byte)012, (byte)044, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0120, (byte)0105, (byte)00, (byte)00, (byte)0114, (byte)01, (byte)05, (byte)00, (byte)046, (byte)0371, (byte)0166, (byte)0113, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)0340, (byte)00, (byte)017, (byte)03, (byte)013, (byte)01, (byte)02, (byte)070, (byte)00, (byte)0136, (byte)00, (byte)00, +(byte)00, (byte)0156, (byte)00, (byte)00, (byte)00, (byte)054, (byte)00, (byte)00, (byte)060, (byte)021, (byte)00, (byte)00, (byte)00, (byte)020, (byte)00, (byte)00, +(byte)00, (byte)0160, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0100, (byte)00, (byte)00, (byte)020, (byte)00, (byte)00, (byte)00, (byte)02, (byte)00, (byte)00, +(byte)04, (byte)00, (byte)00, (byte)00, (byte)01, (byte)00, (byte)00, (byte)00, (byte)04, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)0320, (byte)00, (byte)00, (byte)00, (byte)04, (byte)00, (byte)00, (byte)0337, (byte)0265, (byte)00, (byte)00, (byte)03, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)040, (byte)00, (byte)00, (byte)020, (byte)00, (byte)00, (byte)00, (byte)00, (byte)020, (byte)00, (byte)00, (byte)020, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)020, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)0300, (byte)00, (byte)00, (byte)020, (byte)06, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)056, (byte)0164, (byte)0145, (byte)0170, (byte)0164, (byte)00, (byte)00, (byte)00, +(byte)0244, (byte)0134, (byte)00, (byte)00, (byte)00, (byte)020, (byte)00, (byte)00, (byte)00, (byte)0136, (byte)00, (byte)00, (byte)00, (byte)04, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0140, (byte)00, (byte)0120, (byte)0140, +(byte)056, (byte)0144, (byte)0141, (byte)0164, (byte)0141, (byte)00, (byte)00, (byte)00, (byte)064, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0160, (byte)00, (byte)00, +(byte)00, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0142, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)0100, (byte)00, (byte)060, (byte)0300, (byte)056, (byte)0162, (byte)0144, (byte)0141, (byte)0164, (byte)0141, (byte)00, (byte)00, +(byte)00, (byte)06, (byte)00, (byte)00, (byte)00, (byte)0200, (byte)00, (byte)00, (byte)00, (byte)06, (byte)00, (byte)00, (byte)00, (byte)0144, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0100, (byte)00, (byte)0140, (byte)0100, +(byte)056, (byte)0142, (byte)0163, (byte)0163, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0220, (byte)052, (byte)00, (byte)00, (byte)00, (byte)0220, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)0200, (byte)00, (byte)0140, (byte)0300, (byte)056, (byte)0151, (byte)0144, (byte)0141, (byte)0164, (byte)0141, (byte)00, (byte)00, +(byte)020, (byte)06, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)010, (byte)00, (byte)00, (byte)00, (byte)0152, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0100, (byte)00, (byte)060, (byte)0300, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0211, (byte)0345, (byte)0203, (byte)0354, (byte)010, (byte)0241, (byte)0274, (byte)0301, (byte)0100, (byte)00, (byte)0311, (byte)0377, (byte)0340, (byte)0146, (byte)0220, +(byte)0125, (byte)0211, (byte)0345, (byte)0203, (byte)0354, (byte)010, (byte)0241, (byte)0260, (byte)0301, (byte)0100, (byte)00, (byte)0311, (byte)0377, (byte)0340, (byte)0146, (byte)0220, +(byte)0125, (byte)0211, (byte)0345, (byte)0123, (byte)0203, (byte)0354, (byte)064, (byte)0307, (byte)04, (byte)044, (byte)0120, (byte)021, (byte)0100, (byte)00, (byte)0350, (byte)0351, +(byte)0130, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)04, (byte)0350, (byte)0265, (byte)011, (byte)00, (byte)00, (byte)0350, (byte)0160, (byte)013, (byte)00, (byte)00, +(byte)0215, (byte)0105, (byte)0360, (byte)0307, (byte)0105, (byte)0360, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)020, (byte)0241, (byte)014, +(byte)0160, (byte)0100, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)04, (byte)0220, (byte)0100, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)00, (byte)0220, +(byte)0100, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)014, (byte)0215, (byte)0105, (byte)0364, (byte)0211, (byte)0104, (byte)044, (byte)010, (byte)0350, (byte)0356, (byte)0127, +(byte)00, (byte)00, (byte)0241, (byte)024, (byte)0220, (byte)0100, (byte)00, (byte)0205, (byte)0300, (byte)0165, (byte)0112, (byte)0350, (byte)0350, (byte)0127, (byte)00, (byte)00, +(byte)0213, (byte)025, (byte)020, (byte)0160, (byte)0100, (byte)00, (byte)0211, (byte)020, (byte)0350, (byte)0103, (byte)012, (byte)00, (byte)00, (byte)0203, (byte)0344, (byte)0360, +(byte)0350, (byte)0373, (byte)012, (byte)00, (byte)00, (byte)0350, (byte)0326, (byte)0127, (byte)00, (byte)00, (byte)0213, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)010, +(byte)0241, (byte)04, (byte)0220, (byte)0100, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0241, (byte)00, (byte)0220, (byte)0100, (byte)00, (byte)0211, (byte)04, +(byte)044, (byte)0350, (byte)0135, (byte)04, (byte)00, (byte)00, (byte)0211, (byte)0303, (byte)0350, (byte)0273, (byte)0127, (byte)00, (byte)00, (byte)0211, (byte)034, (byte)044, +(byte)0350, (byte)0137, (byte)0130, (byte)00, (byte)00, (byte)0213, (byte)035, (byte)0254, (byte)0301, (byte)0100, (byte)00, (byte)0243, (byte)020, (byte)0160, (byte)0100, (byte)00, +(byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0213, (byte)0103, (byte)020, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0241, (byte)0127, (byte)00, (byte)00, (byte)0241, +(byte)024, (byte)0220, (byte)0100, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0213, (byte)0103, (byte)060, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0215, +(byte)0127, (byte)00, (byte)00, (byte)0241, (byte)024, (byte)0220, (byte)0100, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0213, (byte)0103, (byte)0120, (byte)0211, +(byte)04, (byte)044, (byte)0350, (byte)0171, (byte)0127, (byte)00, (byte)00, (byte)0351, (byte)0157, (byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0125, (byte)0211, (byte)0345, (byte)0203, (byte)0354, (byte)030, (byte)0307, (byte)04, (byte)044, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0377, (byte)025, (byte)0240, +(byte)0301, (byte)0100, (byte)00, (byte)0350, (byte)0370, (byte)0376, (byte)0377, (byte)0377, (byte)0220, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0211, (byte)0345, (byte)0203, (byte)0354, (byte)030, (byte)0307, (byte)04, (byte)044, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0377, (byte)025, (byte)0240, +(byte)0301, (byte)0100, (byte)00, (byte)0350, (byte)0330, (byte)0376, (byte)0377, (byte)0377, (byte)0220, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0211, (byte)0345, (byte)0123, (byte)0203, (byte)0354, (byte)024, (byte)0213, (byte)0105, (byte)010, (byte)0213, (byte)00, (byte)0213, (byte)00, (byte)075, (byte)0221, +(byte)00, (byte)00, (byte)0300, (byte)0167, (byte)073, (byte)075, (byte)0215, (byte)00, (byte)00, (byte)0300, (byte)0162, (byte)0113, (byte)0273, (byte)01, (byte)00, (byte)00, +(byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, +(byte)0350, (byte)03, (byte)0127, (byte)00, (byte)00, (byte)0203, (byte)0370, (byte)01, (byte)017, (byte)0204, (byte)0377, (byte)00, (byte)00, (byte)00, (byte)0205, (byte)0300, +(byte)017, (byte)0205, (byte)0252, (byte)00, (byte)00, (byte)00, (byte)061, (byte)0300, (byte)0203, (byte)0304, (byte)024, (byte)0133, (byte)0135, (byte)0302, (byte)04, (byte)00, +(byte)075, (byte)0224, (byte)00, (byte)00, (byte)0300, (byte)0164, (byte)0131, (byte)075, (byte)0226, (byte)00, (byte)00, (byte)0300, (byte)0164, (byte)033, (byte)075, (byte)0223, +(byte)00, (byte)00, (byte)0300, (byte)0165, (byte)0341, (byte)0353, (byte)0265, (byte)075, (byte)05, (byte)00, (byte)00, (byte)0300, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0164, (byte)0105, (byte)075, (byte)035, (byte)00, (byte)00, (byte)0300, (byte)0165, (byte)0315, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)0307, (byte)04, (byte)044, (byte)04, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0253, (byte)0126, (byte)00, (byte)00, (byte)0203, (byte)0370, (byte)01, +(byte)0164, (byte)0163, (byte)0205, (byte)0300, (byte)0164, (byte)0260, (byte)0307, (byte)04, (byte)044, (byte)04, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0166, (byte)00, +(byte)0377, (byte)0320, (byte)0270, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0353, (byte)0237, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)061, (byte)0333, (byte)0351, (byte)0152, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, +(byte)04, (byte)044, (byte)013, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0155, (byte)0126, (byte)00, (byte)00, (byte)0203, (byte)0370, (byte)01, (byte)0164, (byte)0121, +(byte)0205, (byte)0300, (byte)017, (byte)0204, (byte)0156, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)04, (byte)044, (byte)013, (byte)00, (byte)00, (byte)00, (byte)0220, +(byte)0377, (byte)0320, (byte)0270, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0351, (byte)0134, (byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0307, (byte)04, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, (byte)0377, (byte)0320, (byte)0270, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0146, (byte)0220, +(byte)0351, (byte)0103, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, +(byte)04, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)037, (byte)0126, (byte)00, (byte)00, (byte)0203, (byte)0310, (byte)0377, (byte)0351, (byte)047, (byte)0377, (byte)0377, +(byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)013, (byte)00, (byte)00, (byte)00, +(byte)0350, (byte)03, (byte)0126, (byte)00, (byte)00, (byte)0203, (byte)0310, (byte)0377, (byte)0351, (byte)013, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, +(byte)04, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0347, (byte)0125, (byte)00, +(byte)00, (byte)0205, (byte)0333, (byte)0165, (byte)012, (byte)0270, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0351, (byte)0351, (byte)0376, (byte)0377, (byte)0377, (byte)0220, +(byte)0350, (byte)0373, (byte)010, (byte)00, (byte)00, (byte)0353, (byte)0356, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0125, (byte)0211, (byte)0345, (byte)0203, (byte)0354, (byte)030, (byte)0241, (byte)060, (byte)0160, (byte)0100, (byte)00, (byte)0205, (byte)0300, (byte)0164, (byte)072, (byte)0307, +(byte)04, (byte)044, (byte)00, (byte)0200, (byte)0100, (byte)00, (byte)0350, (byte)0121, (byte)0126, (byte)00, (byte)00, (byte)0211, (byte)0302, (byte)0203, (byte)0354, (byte)04, +(byte)0205, (byte)0322, (byte)0270, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0164, (byte)023, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)015, (byte)0200, (byte)0100, +(byte)00, (byte)0211, (byte)024, (byte)044, (byte)0350, (byte)073, (byte)0126, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)010, (byte)0205, (byte)0300, (byte)0164, (byte)011, +(byte)0307, (byte)04, (byte)044, (byte)060, (byte)0160, (byte)0100, (byte)00, (byte)0377, (byte)0320, (byte)0311, (byte)0303, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0125, (byte)0211, (byte)0345, (byte)0135, (byte)0303, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0125, (byte)0211, (byte)0345, (byte)0203, (byte)0354, (byte)030, (byte)0350, (byte)021, (byte)0126, (byte)00, (byte)00, (byte)0213, (byte)025, (byte)0254, (byte)0301, (byte)0100, +(byte)00, (byte)0215, (byte)0112, (byte)0100, (byte)0213, (byte)0125, (byte)010, (byte)0211, (byte)0124, (byte)044, (byte)014, (byte)0211, (byte)0104, (byte)044, (byte)010, (byte)0307, +(byte)0104, (byte)044, (byte)04, (byte)044, (byte)0200, (byte)0100, (byte)00, (byte)0211, (byte)014, (byte)044, (byte)0350, (byte)0101, (byte)0125, (byte)00, (byte)00, (byte)0307, +(byte)04, (byte)044, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0105, (byte)0125, (byte)00, (byte)00, (byte)0125, (byte)0211, (byte)0345, (byte)0203, (byte)0354, +(byte)030, (byte)0307, (byte)04, (byte)044, (byte)0134, (byte)0200, (byte)0100, (byte)00, (byte)0350, (byte)053, (byte)0125, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, +(byte)0210, (byte)0200, (byte)0100, (byte)00, (byte)0350, (byte)037, (byte)0125, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)0300, (byte)0200, (byte)0100, (byte)00, +(byte)0350, (byte)023, (byte)0125, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)014, (byte)0201, (byte)0100, (byte)00, (byte)0350, (byte)07, (byte)0125, (byte)00, +(byte)00, (byte)0307, (byte)04, (byte)044, (byte)0130, (byte)0201, (byte)0100, (byte)00, (byte)0350, (byte)0373, (byte)0124, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, +(byte)0220, (byte)0201, (byte)0100, (byte)00, (byte)0350, (byte)0357, (byte)0124, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)0334, (byte)0201, (byte)0100, (byte)00, +(byte)0350, (byte)0343, (byte)0124, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0337, (byte)0124, (byte)00, +(byte)00, (byte)0125, (byte)0211, (byte)0345, (byte)0203, (byte)0354, (byte)0130, (byte)0307, (byte)0104, (byte)044, (byte)034, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, +(byte)0104, (byte)044, (byte)030, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)024, (byte)00, (byte)040, (byte)00, (byte)00, (byte)0307, +(byte)0104, (byte)044, (byte)020, (byte)00, (byte)040, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)014, (byte)0377, (byte)00, (byte)00, (byte)00, (byte)0307, +(byte)0104, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)03, (byte)00, (byte)00, (byte)00, (byte)0213, +(byte)0105, (byte)010, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)072, (byte)0125, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)040, (byte)0211, (byte)0105, (byte)0364, +(byte)0203, (byte)0175, (byte)0364, (byte)0377, (byte)0165, (byte)014, (byte)0307, (byte)04, (byte)044, (byte)0122, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0376, (byte)0376, +(byte)0377, (byte)0377, (byte)0213, (byte)0105, (byte)0364, (byte)0243, (byte)0110, (byte)0272, (byte)0100, (byte)00, (byte)0241, (byte)0110, (byte)0272, (byte)0100, (byte)00, (byte)0307, +(byte)0104, (byte)044, (byte)010, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0211, +(byte)04, (byte)044, (byte)0350, (byte)045, (byte)0125, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)014, (byte)0241, (byte)00, (byte)0272, (byte)0100, (byte)00, (byte)0215, +(byte)0125, (byte)0344, (byte)0211, (byte)0124, (byte)044, (byte)044, (byte)0307, (byte)0104, (byte)044, (byte)040, (byte)020, (byte)0272, (byte)0100, (byte)00, (byte)0307, (byte)0104, +(byte)044, (byte)034, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)030, (byte)0307, (byte)0104, (byte)044, (byte)024, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)020, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)014, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)00, (byte)0232, +(byte)0100, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0256, (byte)0124, (byte)00, (byte)00, (byte)0203, (byte)0354, +(byte)050, (byte)0205, (byte)0300, (byte)0165, (byte)014, (byte)0307, (byte)04, (byte)044, (byte)0126, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0157, (byte)0376, (byte)0377, +(byte)0377, (byte)0213, (byte)0105, (byte)0350, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0230, (byte)0124, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)04, (byte)0213, +(byte)0105, (byte)0364, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0212, (byte)0124, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)04, (byte)0213, (byte)0105, (byte)0344, +(byte)0311, (byte)0303, (byte)0125, (byte)0211, (byte)0345, (byte)0201, (byte)0354, (byte)030, (byte)01, (byte)00, (byte)00, (byte)0241, (byte)0254, (byte)0301, (byte)0100, (byte)00, +(byte)0211, (byte)0104, (byte)044, (byte)010, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)00, (byte)01, (byte)00, (byte)00, (byte)0215, (byte)0205, (byte)0370, (byte)0376, +(byte)0377, (byte)0377, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0256, (byte)0123, (byte)00, (byte)00, (byte)0241, (byte)0140, (byte)0272, (byte)0100, (byte)00, (byte)0213, +(byte)00, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0123, (byte)0124, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)04, (byte)0270, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)0311, (byte)0303, (byte)0215, (byte)0114, (byte)044, (byte)04, (byte)0203, (byte)0344, (byte)0360, (byte)0377, (byte)0161, (byte)0374, (byte)0125, (byte)0211, (byte)0345, +(byte)0126, (byte)0123, (byte)0121, (byte)0201, (byte)0354, (byte)0134, (byte)01, (byte)00, (byte)00, (byte)0211, (byte)0313, (byte)0350, (byte)0140, (byte)06, (byte)00, (byte)00, +(byte)0203, (byte)073, (byte)02, (byte)0165, (byte)07, (byte)0350, (byte)041, (byte)0376, (byte)0377, (byte)0377, (byte)0353, (byte)022, (byte)0203, (byte)073, (byte)01, (byte)0177, +(byte)015, (byte)0307, (byte)03, (byte)03, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0103, (byte)04, (byte)00, (byte)0160, (byte)0100, (byte)00, (byte)0307, (byte)0104, +(byte)044, (byte)014, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, +(byte)044, (byte)04, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)010, (byte)0220, (byte)0100, (byte)00, (byte)0350, (byte)0362, (byte)0123, +(byte)00, (byte)00, (byte)0203, (byte)0354, (byte)020, (byte)0211, (byte)0105, (byte)0274, (byte)0203, (byte)0175, (byte)0274, (byte)00, (byte)0165, (byte)014, (byte)0307, (byte)04, +(byte)044, (byte)0162, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0226, (byte)0375, (byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)01, (byte)00, +(byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0105, (byte)0274, (byte)0211, (byte)04, (byte)044, +(byte)0350, (byte)0307, (byte)0123, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)014, (byte)0213, (byte)0105, (byte)0274, (byte)0211, (byte)0104, (byte)044, (byte)014, (byte)0307, +(byte)0104, (byte)044, (byte)010, (byte)053, (byte)0202, (byte)0100, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)00, (byte)01, (byte)00, (byte)00, (byte)0215, +(byte)0205, (byte)0274, (byte)0376, (byte)0377, (byte)0377, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0363, (byte)05, (byte)00, (byte)00, (byte)0350, (byte)0236, (byte)0122, +(byte)00, (byte)00, (byte)0213, (byte)00, (byte)0211, (byte)0105, (byte)0334, (byte)0307, (byte)0105, (byte)0320, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0353, (byte)032, +(byte)0213, (byte)0105, (byte)0334, (byte)0213, (byte)00, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0353, (byte)0122, (byte)00, (byte)00, (byte)03, (byte)0105, (byte)0320, +(byte)0203, (byte)0300, (byte)01, (byte)0211, (byte)0105, (byte)0320, (byte)0203, (byte)0105, (byte)0334, (byte)04, (byte)0213, (byte)0105, (byte)0334, (byte)0213, (byte)00, (byte)0205, +(byte)0300, (byte)0165, (byte)0335, (byte)0203, (byte)0105, (byte)0320, (byte)01, (byte)0215, (byte)0205, (byte)0274, (byte)0376, (byte)0377, (byte)0377, (byte)0211, (byte)04, (byte)044, +(byte)0350, (byte)0303, (byte)0122, (byte)00, (byte)00, (byte)03, (byte)0105, (byte)0320, (byte)0203, (byte)0300, (byte)01, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0245, +(byte)0122, (byte)00, (byte)00, (byte)0243, (byte)00, (byte)0272, (byte)0100, (byte)00, (byte)0241, (byte)00, (byte)0272, (byte)0100, (byte)00, (byte)0211, (byte)0105, (byte)0344, +(byte)0350, (byte)073, (byte)0122, (byte)00, (byte)00, (byte)0213, (byte)00, (byte)0211, (byte)0105, (byte)0334, (byte)0353, (byte)056, (byte)0213, (byte)0105, (byte)0334, (byte)0213, +(byte)00, (byte)0211, (byte)0105, (byte)0340, (byte)0213, (byte)0105, (byte)0340, (byte)017, (byte)0266, (byte)020, (byte)0213, (byte)0105, (byte)0344, (byte)0210, (byte)020, (byte)0213, +(byte)0105, (byte)0344, (byte)017, (byte)0266, (byte)00, (byte)0204, (byte)0300, (byte)017, (byte)0225, (byte)0300, (byte)0203, (byte)0105, (byte)0344, (byte)01, (byte)0203, (byte)0105, +(byte)0340, (byte)01, (byte)0204, (byte)0300, (byte)0165, (byte)0336, (byte)0203, (byte)0105, (byte)0334, (byte)04, (byte)0213, (byte)0105, (byte)0334, (byte)0213, (byte)00, (byte)0205, +(byte)0300, (byte)0165, (byte)0311, (byte)0215, (byte)0205, (byte)0274, (byte)0376, (byte)0377, (byte)0377, (byte)0211, (byte)0105, (byte)0340, (byte)0213, (byte)0105, (byte)0340, (byte)017, +(byte)0266, (byte)020, (byte)0213, (byte)0105, (byte)0344, (byte)0210, (byte)020, (byte)0213, (byte)0105, (byte)0344, (byte)017, (byte)0266, (byte)00, (byte)0204, (byte)0300, (byte)017, +(byte)0225, (byte)0300, (byte)0203, (byte)0105, (byte)0344, (byte)01, (byte)0203, (byte)0105, (byte)0340, (byte)01, (byte)0204, (byte)0300, (byte)0165, (byte)0336, (byte)0213, (byte)0105, +(byte)0344, (byte)0306, (byte)00, (byte)00, (byte)0307, (byte)0105, (byte)0330, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0300, (byte)0121, (byte)00, (byte)00, +(byte)0213, (byte)00, (byte)0211, (byte)0105, (byte)0334, (byte)0353, (byte)0102, (byte)0213, (byte)0105, (byte)0334, (byte)0213, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)010, +(byte)021, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0307, (byte)04, (byte)044, (byte)0105, (byte)0202, (byte)0100, (byte)00, (byte)0350, +(byte)0334, (byte)0121, (byte)00, (byte)00, (byte)0205, (byte)0300, (byte)0165, (byte)035, (byte)0213, (byte)0105, (byte)0334, (byte)0213, (byte)00, (byte)0307, (byte)0104, (byte)044, +(byte)04, (byte)075, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0313, (byte)0121, (byte)00, (byte)00, (byte)0203, (byte)0300, (byte)01, +(byte)0211, (byte)0105, (byte)0330, (byte)0353, (byte)015, (byte)0203, (byte)0105, (byte)0334, (byte)04, (byte)0213, (byte)0105, (byte)0334, (byte)0213, (byte)00, (byte)0205, (byte)0300, +(byte)0165, (byte)0265, (byte)0203, (byte)0175, (byte)0330, (byte)00, (byte)0165, (byte)07, (byte)0307, (byte)0105, (byte)0330, (byte)0127, (byte)0202, (byte)0100, (byte)00, (byte)0213, +(byte)0105, (byte)0330, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0246, (byte)0121, (byte)00, (byte)00, (byte)0211, (byte)0105, (byte)0300, (byte)0213, (byte)0105, (byte)0300, +(byte)0301, (byte)0340, (byte)02, (byte)0203, (byte)0300, (byte)01, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0232, (byte)0121, (byte)00, (byte)00, (byte)0243, (byte)0140, +(byte)0272, (byte)0100, (byte)00, (byte)0241, (byte)0140, (byte)0272, (byte)0100, (byte)00, (byte)0205, (byte)0300, (byte)0165, (byte)05, (byte)0350, (byte)0217, (byte)0121, (byte)00, +(byte)00, (byte)0307, (byte)05, (byte)020, (byte)0220, (byte)0100, (byte)00, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)05, (byte)010, (byte)0220, (byte)0100, +(byte)00, (byte)014, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)05, (byte)020, (byte)0272, (byte)0100, (byte)00, (byte)0104, (byte)00, (byte)00, (byte)00, (byte)0307, +(byte)05, (byte)074, (byte)0272, (byte)0100, (byte)00, (byte)01, (byte)01, (byte)00, (byte)00, (byte)0146, (byte)0307, (byte)05, (byte)0100, (byte)0272, (byte)0100, (byte)00, +(byte)00, (byte)00, (byte)0307, (byte)05, (byte)0120, (byte)0272, (byte)0100, (byte)00, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)05, (byte)0114, (byte)0272, +(byte)0100, (byte)00, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)04, (byte)0203, (byte)0300, (byte)04, (byte)0213, (byte)00, (byte)0211, (byte)0105, +(byte)0324, (byte)0213, (byte)0103, (byte)04, (byte)0215, (byte)0120, (byte)04, (byte)0213, (byte)0103, (byte)04, (byte)0203, (byte)0300, (byte)010, (byte)0213, (byte)00, (byte)0211, +(byte)02, (byte)0213, (byte)0103, (byte)04, (byte)0215, (byte)0120, (byte)010, (byte)0213, (byte)0105, (byte)0324, (byte)0211, (byte)02, (byte)0307, (byte)0105, (byte)0314, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)0306, (byte)05, (byte)00, (byte)0232, (byte)0100, (byte)00, (byte)00, (byte)0307, (byte)0105, (byte)0304, (byte)02, (byte)00, (byte)00, +(byte)00, (byte)0203, (byte)053, (byte)02, (byte)0351, (byte)0237, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0105, (byte)0304, (byte)0301, (byte)0340, (byte)02, (byte)03, +(byte)0103, (byte)04, (byte)0213, (byte)00, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0374, (byte)0120, (byte)00, (byte)00, (byte)03, (byte)0105, (byte)0314, (byte)0203, +(byte)0300, (byte)03, (byte)0211, (byte)0105, (byte)0314, (byte)0201, (byte)0175, (byte)0314, (byte)0377, (byte)037, (byte)00, (byte)00, (byte)0166, (byte)05, (byte)0350, (byte)0335, +(byte)0120, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)0131, +(byte)0202, (byte)0100, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)00, (byte)0232, (byte)0100, (byte)00, (byte)0350, (byte)0311, (byte)0120, (byte)00, (byte)00, (byte)05, +(byte)00, (byte)0232, (byte)0100, (byte)00, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0304, (byte)0120, (byte)00, (byte)00, (byte)0213, (byte)0105, (byte)0304, (byte)0301, +(byte)0340, (byte)02, (byte)03, (byte)0103, (byte)04, (byte)0213, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0307, (byte)04, (byte)044, (byte)00, (byte)0232, +(byte)0100, (byte)00, (byte)0350, (byte)0261, (byte)0120, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)0131, (byte)0202, (byte)0100, (byte)00, (byte)0307, +(byte)04, (byte)044, (byte)00, (byte)0232, (byte)0100, (byte)00, (byte)0350, (byte)0235, (byte)0120, (byte)00, (byte)00, (byte)0203, (byte)073, (byte)00, (byte)0164, (byte)024, +(byte)0307, (byte)0104, (byte)044, (byte)04, (byte)0133, (byte)0202, (byte)0100, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)00, (byte)0232, (byte)0100, (byte)00, (byte)0350, +(byte)0204, (byte)0120, (byte)00, (byte)00, (byte)0203, (byte)0105, (byte)0304, (byte)01, (byte)0203, (byte)073, (byte)00, (byte)017, (byte)0225, (byte)0300, (byte)0203, (byte)053, +(byte)01, (byte)0204, (byte)0300, (byte)017, (byte)0205, (byte)0120, (byte)0377, (byte)0377, (byte)0377, (byte)0213, (byte)065, (byte)0140, (byte)0272, (byte)0100, (byte)00, (byte)0307, +(byte)0104, (byte)044, (byte)014, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, +(byte)0104, (byte)044, (byte)04, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0321, +(byte)0120, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)020, (byte)0211, (byte)06, (byte)0213, (byte)06, (byte)0205, (byte)0300, (byte)0165, (byte)014, (byte)0307, (byte)04, +(byte)044, (byte)0256, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0146, (byte)0372, (byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)04, (byte)0213, (byte)00, (byte)0205, +(byte)0300, (byte)0164, (byte)070, (byte)0270, (byte)0322, (byte)024, (byte)0100, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)024, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0307, (byte)0104, (byte)044, (byte)020, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)014, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0211, (byte)0104, (byte)044, (byte)010, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)0350, (byte)0204, (byte)0120, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)030, (byte)0307, (byte)0105, (byte)0304, (byte)01, (byte)00, +(byte)00, (byte)00, (byte)0353, (byte)044, (byte)0241, (byte)0140, (byte)0272, (byte)0100, (byte)00, (byte)0213, (byte)0125, (byte)0304, (byte)0301, (byte)0342, (byte)02, (byte)0215, +(byte)064, (byte)020, (byte)0213, (byte)0103, (byte)04, (byte)0203, (byte)0300, (byte)04, (byte)0213, (byte)00, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0237, (byte)0372, +(byte)0377, (byte)0377, (byte)0211, (byte)06, (byte)0203, (byte)0105, (byte)0304, (byte)01, (byte)0213, (byte)0105, (byte)0304, (byte)073, (byte)0105, (byte)0300, (byte)0176, (byte)0324, +(byte)0213, (byte)025, (byte)0140, (byte)0272, (byte)0100, (byte)00, (byte)0213, (byte)0105, (byte)0300, (byte)0203, (byte)0300, (byte)01, (byte)0307, (byte)0104, (byte)044, (byte)014, +(byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0124, (byte)044, (byte)04, +(byte)0211, (byte)04, (byte)044, (byte)0350, (byte)054, (byte)0120, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)020, (byte)0211, (byte)0105, (byte)0310, (byte)0203, (byte)0175, +(byte)0310, (byte)0377, (byte)0165, (byte)014, (byte)0307, (byte)04, (byte)044, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0260, (byte)0371, (byte)0377, (byte)0377, +(byte)0203, (byte)0175, (byte)0310, (byte)00, (byte)0164, (byte)042, (byte)0241, (byte)0140, (byte)0272, (byte)0100, (byte)00, (byte)0213, (byte)0125, (byte)0310, (byte)0301, (byte)0342, +(byte)02, (byte)0215, (byte)064, (byte)020, (byte)0213, (byte)0103, (byte)04, (byte)0203, (byte)0300, (byte)04, (byte)0213, (byte)00, (byte)0211, (byte)04, (byte)044, (byte)0350, +(byte)055, (byte)0372, (byte)0377, (byte)0377, (byte)0211, (byte)06, (byte)0353, (byte)0230, (byte)0307, (byte)0105, (byte)0304, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0353, +(byte)046, (byte)0241, (byte)0140, (byte)0272, (byte)0100, (byte)00, (byte)0213, (byte)0125, (byte)0304, (byte)0301, (byte)0342, (byte)02, (byte)01, (byte)0320, (byte)0213, (byte)00, +(byte)0307, (byte)0104, (byte)044, (byte)04, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0314, (byte)0117, (byte)00, (byte)00, +(byte)0203, (byte)0354, (byte)010, (byte)0203, (byte)0105, (byte)0304, (byte)01, (byte)0213, (byte)0105, (byte)0304, (byte)073, (byte)0105, (byte)0300, (byte)0176, (byte)0322, (byte)0270, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0145, (byte)0364, (byte)0203, (byte)0304, (byte)00, (byte)0131, (byte)0133, (byte)0136, (byte)0135, (byte)0215, (byte)0141, +(byte)0374, (byte)0303, (byte)0220, (byte)0220, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0211, (byte)0345, (byte)0123, (byte)0234, (byte)0234, (byte)0130, (byte)0211, (byte)0302, (byte)065, (byte)00, (byte)00, (byte)040, (byte)00, (byte)0120, (byte)0235, +(byte)0234, (byte)0130, (byte)0235, (byte)061, (byte)0320, (byte)0251, (byte)00, (byte)00, (byte)040, (byte)00, (byte)017, (byte)0204, (byte)0243, (byte)00, (byte)00, (byte)00, +(byte)061, (byte)0300, (byte)017, (byte)0242, (byte)0205, (byte)0300, (byte)017, (byte)0204, (byte)0227, (byte)00, (byte)00, (byte)00, (byte)0270, (byte)01, (byte)00, (byte)00, +(byte)00, (byte)017, (byte)0242, (byte)0366, (byte)0306, (byte)01, (byte)0164, (byte)07, (byte)0203, (byte)015, (byte)030, (byte)0220, (byte)0100, (byte)00, (byte)01, (byte)0146, +(byte)0205, (byte)0322, (byte)0171, (byte)07, (byte)0203, (byte)015, (byte)030, (byte)0220, (byte)0100, (byte)00, (byte)02, (byte)0367, (byte)0302, (byte)00, (byte)00, (byte)0200, +(byte)00, (byte)0164, (byte)07, (byte)0203, (byte)015, (byte)030, (byte)0220, (byte)0100, (byte)00, (byte)04, (byte)0367, (byte)0302, (byte)00, (byte)00, (byte)00, (byte)01, +(byte)0164, (byte)07, (byte)0203, (byte)015, (byte)030, (byte)0220, (byte)0100, (byte)00, (byte)010, (byte)0367, (byte)0302, (byte)00, (byte)00, (byte)00, (byte)02, (byte)0164, +(byte)07, (byte)0203, (byte)015, (byte)030, (byte)0220, (byte)0100, (byte)00, (byte)020, (byte)0201, (byte)0342, (byte)00, (byte)00, (byte)00, (byte)04, (byte)0164, (byte)07, +(byte)0203, (byte)015, (byte)030, (byte)0220, (byte)0100, (byte)00, (byte)040, (byte)0366, (byte)0301, (byte)01, (byte)0164, (byte)07, (byte)0203, (byte)015, (byte)030, (byte)0220, +(byte)0100, (byte)00, (byte)0100, (byte)0200, (byte)0345, (byte)040, (byte)0165, (byte)056, (byte)0270, (byte)00, (byte)00, (byte)00, (byte)0200, (byte)017, (byte)0242, (byte)075, +(byte)00, (byte)00, (byte)00, (byte)0200, (byte)0166, (byte)035, (byte)0270, (byte)01, (byte)00, (byte)00, (byte)0200, (byte)017, (byte)0242, (byte)0205, (byte)0322, (byte)0170, +(byte)041, (byte)0201, (byte)0342, (byte)00, (byte)00, (byte)00, (byte)0100, (byte)0164, (byte)012, (byte)0201, (byte)015, (byte)030, (byte)0220, (byte)0100, (byte)00, (byte)00, +(byte)02, (byte)00, (byte)00, (byte)0133, (byte)0135, (byte)0303, (byte)0201, (byte)015, (byte)030, (byte)0220, (byte)0100, (byte)00, (byte)0200, (byte)00, (byte)00, (byte)00, +(byte)0353, (byte)0306, (byte)0201, (byte)015, (byte)030, (byte)0220, (byte)0100, (byte)00, (byte)00, (byte)01, (byte)00, (byte)00, (byte)0353, (byte)0323, (byte)0220, (byte)0220, +(byte)0270, (byte)00, (byte)0206, (byte)0100, (byte)00, (byte)0125, (byte)075, (byte)00, (byte)0206, (byte)0100, (byte)00, (byte)0211, (byte)0345, (byte)0123, (byte)0163, (byte)030, +(byte)0273, (byte)00, (byte)00, (byte)0100, (byte)00, (byte)0213, (byte)0120, (byte)04, (byte)0213, (byte)010, (byte)0203, (byte)0300, (byte)010, (byte)01, (byte)0332, (byte)01, +(byte)012, (byte)075, (byte)00, (byte)0206, (byte)0100, (byte)00, (byte)0162, (byte)0355, (byte)0133, (byte)0135, (byte)0303, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0125, (byte)0211, (byte)0345, (byte)0203, (byte)0354, (byte)010, (byte)0241, (byte)024, (byte)0160, (byte)0100, (byte)00, (byte)0213, (byte)00, (byte)0205, (byte)0300, (byte)0164, +(byte)027, (byte)0377, (byte)0320, (byte)0241, (byte)024, (byte)0160, (byte)0100, (byte)00, (byte)0215, (byte)0120, (byte)04, (byte)0213, (byte)0100, (byte)04, (byte)0211, (byte)025, +(byte)024, (byte)0160, (byte)0100, (byte)00, (byte)0205, (byte)0300, (byte)0165, (byte)0351, (byte)0311, (byte)0303, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0211, (byte)0345, (byte)0126, (byte)0123, (byte)0203, (byte)0354, (byte)020, (byte)0213, (byte)035, (byte)0220, (byte)0154, (byte)0100, (byte)00, (byte)0203, (byte)0373, +(byte)0377, (byte)0164, (byte)055, (byte)0205, (byte)0333, (byte)0164, (byte)023, (byte)0215, (byte)064, (byte)0235, (byte)0220, (byte)0154, (byte)0100, (byte)00, (byte)0146, (byte)0220, +(byte)0377, (byte)026, (byte)0203, (byte)0356, (byte)04, (byte)0203, (byte)0353, (byte)01, (byte)0165, (byte)0366, (byte)0307, (byte)04, (byte)044, (byte)00, (byte)033, (byte)0100, +(byte)00, (byte)0350, (byte)0232, (byte)0364, (byte)0377, (byte)0377, (byte)0203, (byte)0304, (byte)020, (byte)0133, (byte)0136, (byte)0135, (byte)0303, (byte)0215, (byte)0166, (byte)00, +(byte)061, (byte)0333, (byte)0353, (byte)02, (byte)0211, (byte)0303, (byte)0215, (byte)0103, (byte)01, (byte)0213, (byte)024, (byte)0205, (byte)0220, (byte)0154, (byte)0100, (byte)00, +(byte)0205, (byte)0322, (byte)0165, (byte)0360, (byte)0353, (byte)0275, (byte)0215, (byte)0166, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0211, (byte)0345, (byte)0203, (byte)0354, (byte)010, (byte)0213, (byte)015, (byte)034, (byte)0220, (byte)0100, (byte)00, (byte)0205, (byte)0311, (byte)0164, (byte)02, +(byte)0311, (byte)0303, (byte)0307, (byte)05, (byte)034, (byte)0220, (byte)0100, (byte)00, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0311, (byte)0353, (byte)0201, (byte)0220, +(byte)0125, (byte)0211, (byte)0345, (byte)0333, (byte)0343, (byte)0135, (byte)0303, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0203, (byte)0354, (byte)034, (byte)0215, (byte)0104, (byte)044, (byte)054, (byte)0211, (byte)0104, (byte)044, (byte)014, (byte)0213, (byte)0104, (byte)044, (byte)050, (byte)0211, +(byte)0104, (byte)044, (byte)010, (byte)0213, (byte)0104, (byte)044, (byte)044, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0213, (byte)0104, (byte)044, (byte)040, (byte)0211, +(byte)04, (byte)044, (byte)0350, (byte)011, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0304, (byte)034, (byte)0303, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0203, (byte)0354, (byte)054, (byte)0211, (byte)0164, (byte)044, (byte)050, (byte)0213, (byte)0164, (byte)044, (byte)064, (byte)0211, (byte)0134, (byte)044, (byte)044, (byte)0213, +(byte)0104, (byte)044, (byte)070, (byte)0213, (byte)0134, (byte)044, (byte)060, (byte)0213, (byte)0124, (byte)044, (byte)074, (byte)0205, (byte)0366, (byte)0164, (byte)071, (byte)0203, +(byte)0356, (byte)01, (byte)0211, (byte)0124, (byte)044, (byte)020, (byte)0211, (byte)0104, (byte)044, (byte)014, (byte)0211, (byte)0164, (byte)044, (byte)010, (byte)0211, (byte)0134, +(byte)044, (byte)04, (byte)0307, (byte)04, (byte)044, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0142, (byte)024, (byte)00, (byte)00, (byte)071, (byte)0360, +(byte)0211, (byte)0302, (byte)0167, (byte)020, (byte)0306, (byte)04, (byte)023, (byte)00, (byte)0213, (byte)0134, (byte)044, (byte)044, (byte)0213, (byte)0164, (byte)044, (byte)050, +(byte)0203, (byte)0304, (byte)054, (byte)0303, (byte)0211, (byte)0362, (byte)0353, (byte)0354, (byte)0211, (byte)0134, (byte)044, (byte)04, (byte)0211, (byte)0124, (byte)044, (byte)020, +(byte)0211, (byte)0104, (byte)044, (byte)014, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)0350, (byte)050, (byte)024, (byte)00, (byte)00, (byte)0213, (byte)0134, (byte)044, (byte)044, (byte)0213, (byte)0164, (byte)044, (byte)050, +(byte)0203, (byte)0304, (byte)054, (byte)0303, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0123, (byte)0211, (byte)0302, (byte)0203, (byte)0354, (byte)0110, (byte)0213, (byte)0104, (byte)044, (byte)0120, (byte)0211, (byte)0104, (byte)044, (byte)040, (byte)0213, (byte)0104, +(byte)044, (byte)0124, (byte)0211, (byte)0104, (byte)044, (byte)044, (byte)0213, (byte)0104, (byte)044, (byte)0130, (byte)0211, (byte)0104, (byte)044, (byte)050, (byte)0213, (byte)0104, +(byte)044, (byte)0134, (byte)0333, (byte)0154, (byte)044, (byte)040, (byte)0211, (byte)0104, (byte)044, (byte)054, (byte)0331, (byte)0345, (byte)0233, (byte)0337, (byte)0340, (byte)0335, +(byte)0330, (byte)017, (byte)0267, (byte)0300, (byte)0366, (byte)0304, (byte)01, (byte)0164, (byte)032, (byte)0366, (byte)0304, (byte)04, (byte)017, (byte)0204, (byte)0216, (byte)00, +(byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)074, (byte)03, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0277, (byte)0104, (byte)044, (byte)050, (byte)061, +(byte)0311, (byte)0353, (byte)024, (byte)0366, (byte)0304, (byte)04, (byte)0165, (byte)0133, (byte)017, (byte)0277, (byte)0104, (byte)044, (byte)050, (byte)061, (byte)0311, (byte)0307, +(byte)0104, (byte)044, (byte)074, (byte)00, (byte)00, (byte)00, (byte)00, (byte)045, (byte)00, (byte)0200, (byte)00, (byte)00, (byte)0213, (byte)0134, (byte)044, (byte)0150, +(byte)0211, (byte)03, (byte)0215, (byte)0104, (byte)044, (byte)070, (byte)0211, (byte)0104, (byte)044, (byte)034, (byte)0213, (byte)0104, (byte)044, (byte)0144, (byte)0211, (byte)0124, +(byte)044, (byte)020, (byte)0211, (byte)0114, (byte)044, (byte)04, (byte)0307, (byte)04, (byte)044, (byte)030, (byte)0160, (byte)0100, (byte)00, (byte)0211, (byte)0104, (byte)044, +(byte)030, (byte)0213, (byte)0104, (byte)044, (byte)0140, (byte)0211, (byte)0104, (byte)044, (byte)024, (byte)0215, (byte)0104, (byte)044, (byte)074, (byte)0211, (byte)0104, (byte)044, +(byte)014, (byte)0215, (byte)0104, (byte)044, (byte)040, (byte)0211, (byte)0104, (byte)044, (byte)010, (byte)0350, (byte)0302, (byte)036, (byte)00, (byte)00, (byte)0203, (byte)0304, +(byte)0110, (byte)0133, (byte)0303, (byte)0366, (byte)0304, (byte)0100, (byte)0164, (byte)050, (byte)0307, (byte)0104, (byte)044, (byte)074, (byte)02, (byte)00, (byte)00, (byte)00, +(byte)017, (byte)0277, (byte)0104, (byte)044, (byte)050, (byte)0271, (byte)0303, (byte)0277, (byte)0377, (byte)0377, (byte)0353, (byte)0233, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0307, (byte)0104, (byte)044, (byte)074, (byte)04, (byte)00, (byte)00, (byte)00, (byte)061, (byte)0311, (byte)061, (byte)0300, (byte)0353, (byte)0216, (byte)0146, (byte)0220, +(byte)017, (byte)0277, (byte)0104, (byte)044, (byte)050, (byte)0307, (byte)0104, (byte)044, (byte)074, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0301, (byte)0201, +(byte)0341, (byte)0377, (byte)0177, (byte)00, (byte)00, (byte)0201, (byte)0351, (byte)076, (byte)0100, (byte)00, (byte)00, (byte)0351, (byte)0147, (byte)0377, (byte)0377, (byte)0377, +(byte)0123, (byte)0203, (byte)0354, (byte)050, (byte)0213, (byte)0112, (byte)04, (byte)0366, (byte)0305, (byte)040, (byte)0165, (byte)010, (byte)0213, (byte)0132, (byte)030, (byte)071, +(byte)0132, (byte)034, (byte)0176, (byte)020, (byte)0200, (byte)0345, (byte)020, (byte)0165, (byte)027, (byte)0213, (byte)032, (byte)0213, (byte)0112, (byte)030, (byte)0210, (byte)04, +(byte)013, (byte)0213, (byte)0132, (byte)030, (byte)0203, (byte)0303, (byte)01, (byte)0211, (byte)0132, (byte)030, (byte)0203, (byte)0304, (byte)050, (byte)0133, (byte)0303, (byte)0220, +(byte)0213, (byte)012, (byte)0211, (byte)0124, (byte)044, (byte)034, (byte)0211, (byte)04, (byte)044, (byte)0211, (byte)0114, (byte)044, (byte)04, (byte)0350, (byte)056, (byte)0113, +(byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)034, (byte)0213, (byte)0132, (byte)030, (byte)0203, (byte)0303, (byte)01, (byte)0211, (byte)0132, (byte)030, (byte)0203, +(byte)0304, (byte)050, (byte)0133, (byte)0303, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0277, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0211, (byte)0305, (byte)0127, (byte)0126, (byte)0211, (byte)0326, (byte)0123, (byte)0211, (byte)0313, (byte)0203, (byte)0354, (byte)0114, (byte)0215, (byte)0104, (byte)044, +(byte)074, (byte)0211, (byte)0104, (byte)044, (byte)010, (byte)0215, (byte)0104, (byte)044, (byte)054, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0147, (byte)067, (byte)00, (byte)00, (byte)0213, (byte)0103, (byte)014, (byte)0205, (byte)0300, (byte)0170, (byte)010, +(byte)071, (byte)0306, (byte)017, (byte)0217, (byte)0250, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0103, (byte)010, (byte)071, (byte)0306, (byte)017, (byte)0215, (byte)0216, +(byte)00, (byte)00, (byte)00, (byte)051, (byte)0360, (byte)0205, (byte)0300, (byte)0211, (byte)0103, (byte)010, (byte)0176, (byte)012, (byte)0366, (byte)0103, (byte)05, (byte)04, +(byte)017, (byte)0204, (byte)0221, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0134, (byte)044, (byte)034, (byte)0353, (byte)0107, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0215, (byte)0104, (byte)044, (byte)074, (byte)0211, (byte)0104, (byte)044, (byte)010, (byte)017, (byte)0267, (byte)0105, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)04, +(byte)0215, (byte)0104, (byte)044, (byte)054, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)024, (byte)067, (byte)00, (byte)00, (byte)0205, (byte)0300, (byte)0211, (byte)0303, +(byte)0176, (byte)045, (byte)061, (byte)0377, (byte)017, (byte)0276, (byte)0104, (byte)074, (byte)054, (byte)0203, (byte)0307, (byte)01, (byte)0213, (byte)0124, (byte)044, (byte)034, +(byte)0350, (byte)013, (byte)0377, (byte)0377, (byte)0377, (byte)0211, (byte)0330, (byte)051, (byte)0370, (byte)0205, (byte)0300, (byte)0177, (byte)0347, (byte)0203, (byte)0305, (byte)02, +(byte)0203, (byte)0356, (byte)01, (byte)0205, (byte)0366, (byte)0177, (byte)0271, (byte)0213, (byte)0134, (byte)044, (byte)034, (byte)0353, (byte)017, (byte)0215, (byte)0166, (byte)00, +(byte)0211, (byte)0332, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0344, (byte)0376, (byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)010, (byte)0215, +(byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0123, (byte)010, (byte)0177, (byte)0347, (byte)0203, (byte)0304, (byte)0114, (byte)0133, (byte)0136, (byte)0137, (byte)0135, +(byte)0303, (byte)0307, (byte)0103, (byte)010, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0351, (byte)0171, (byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0166, (byte)00, +(byte)0211, (byte)0306, (byte)0351, (byte)0121, (byte)0377, (byte)0377, (byte)0377, (byte)0203, (byte)0350, (byte)01, (byte)0211, (byte)0103, (byte)010, (byte)0215, (byte)0166, (byte)00, +(byte)0211, (byte)0332, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0244, (byte)0376, (byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)010, (byte)0215, +(byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0123, (byte)010, (byte)0165, (byte)0347, (byte)0351, (byte)0110, (byte)0377, (byte)0377, (byte)0377, (byte)0146, (byte)0220, +(byte)0125, (byte)0211, (byte)0305, (byte)0127, (byte)0126, (byte)0211, (byte)0316, (byte)0123, (byte)0211, (byte)0323, (byte)0203, (byte)0354, (byte)014, (byte)0213, (byte)0101, (byte)014, +(byte)0205, (byte)0300, (byte)0170, (byte)04, (byte)071, (byte)0302, (byte)0177, (byte)0150, (byte)0213, (byte)0106, (byte)010, (byte)071, (byte)0303, (byte)0175, (byte)0126, (byte)051, +(byte)0330, (byte)0205, (byte)0300, (byte)0211, (byte)0106, (byte)010, (byte)0176, (byte)06, (byte)0366, (byte)0106, (byte)05, (byte)04, (byte)0164, (byte)0126, (byte)0205, (byte)0333, +(byte)0164, (byte)056, (byte)061, (byte)0377, (byte)017, (byte)0276, (byte)0104, (byte)075, (byte)00, (byte)0211, (byte)0362, (byte)0203, (byte)0307, (byte)01, (byte)0350, (byte)0115, +(byte)0376, (byte)0377, (byte)0377, (byte)071, (byte)0337, (byte)0165, (byte)0355, (byte)0213, (byte)0106, (byte)010, (byte)0215, (byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, +(byte)0126, (byte)010, (byte)0176, (byte)031, (byte)0211, (byte)0362, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)060, (byte)0376, (byte)0377, (byte)0377, +(byte)0213, (byte)0106, (byte)010, (byte)0215, (byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0126, (byte)010, (byte)0177, (byte)0347, (byte)0203, (byte)0304, (byte)014, +(byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0307, (byte)0106, (byte)010, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0353, (byte)0260, (byte)0146, (byte)0220, +(byte)0211, (byte)0303, (byte)0353, (byte)0224, (byte)0203, (byte)0350, (byte)01, (byte)0211, (byte)0106, (byte)010, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0211, (byte)0362, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0364, (byte)0375, (byte)0377, (byte)0377, (byte)0213, (byte)0106, (byte)010, (byte)0215, +(byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0126, (byte)010, (byte)0165, (byte)0347, (byte)0353, (byte)0203, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0125, (byte)0127, (byte)0126, (byte)0123, (byte)0203, (byte)0354, (byte)034, (byte)0205, (byte)0300, (byte)0307, (byte)0101, (byte)014, (byte)0377, (byte)0377, (byte)0377, (byte)0377, +(byte)0164, (byte)076, (byte)0213, (byte)0151, (byte)04, (byte)0215, (byte)0174, (byte)044, (byte)015, (byte)0306, (byte)0104, (byte)044, (byte)014, (byte)055, (byte)0215, (byte)0104, +(byte)044, (byte)014, (byte)061, (byte)0366, (byte)0203, (byte)0345, (byte)040, (byte)017, (byte)0266, (byte)034, (byte)062, (byte)0203, (byte)0343, (byte)0337, (byte)011, (byte)0353, +(byte)0210, (byte)034, (byte)067, (byte)0203, (byte)0306, (byte)01, (byte)0203, (byte)0376, (byte)03, (byte)0165, (byte)0354, (byte)0215, (byte)0127, (byte)03, (byte)051, (byte)0302, +(byte)0350, (byte)013, (byte)0377, (byte)0377, (byte)0377, (byte)0203, (byte)0304, (byte)034, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0215, (byte)0166, (byte)00, +(byte)0213, (byte)0151, (byte)04, (byte)0367, (byte)0305, (byte)00, (byte)01, (byte)00, (byte)00, (byte)0164, (byte)025, (byte)0306, (byte)0104, (byte)044, (byte)014, (byte)053, +(byte)0215, (byte)0174, (byte)044, (byte)015, (byte)0215, (byte)0104, (byte)044, (byte)014, (byte)0353, (byte)0270, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0215, (byte)0104, (byte)044, (byte)014, (byte)0367, (byte)0305, (byte)0100, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0307, (byte)0164, (byte)0244, (byte)0306, (byte)0104, +(byte)044, (byte)014, (byte)040, (byte)0215, (byte)0174, (byte)044, (byte)015, (byte)0215, (byte)0104, (byte)044, (byte)014, (byte)0353, (byte)0225, (byte)0215, (byte)0166, (byte)00, +(byte)0125, (byte)0211, (byte)0345, (byte)0127, (byte)0211, (byte)0317, (byte)0126, (byte)0211, (byte)0326, (byte)0123, (byte)0211, (byte)0303, (byte)0203, (byte)0354, (byte)054, (byte)0213, +(byte)0121, (byte)014, (byte)0213, (byte)0111, (byte)010, (byte)0211, (byte)0320, (byte)0301, (byte)0370, (byte)037, (byte)0367, (byte)0320, (byte)041, (byte)0320, (byte)0203, (byte)0300, +(byte)027, (byte)071, (byte)0310, (byte)0175, (byte)02, (byte)0211, (byte)0310, (byte)0203, (byte)0300, (byte)036, (byte)0203, (byte)0340, (byte)0360, (byte)0350, (byte)0316, (byte)0113, +(byte)00, (byte)00, (byte)0215, (byte)0104, (byte)044, (byte)037, (byte)0203, (byte)0340, (byte)0360, (byte)0211, (byte)0105, (byte)0344, (byte)0213, (byte)0107, (byte)04, (byte)0204, +(byte)0300, (byte)0171, (byte)015, (byte)0205, (byte)0366, (byte)017, (byte)0210, (byte)0225, (byte)01, (byte)00, (byte)00, (byte)044, (byte)0177, (byte)0211, (byte)0107, (byte)04, +(byte)0211, (byte)0331, (byte)0211, (byte)0360, (byte)0213, (byte)0135, (byte)0344, (byte)011, (byte)0310, (byte)0164, (byte)0130, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0211, (byte)014, (byte)044, (byte)0211, (byte)0164, (byte)044, (byte)04, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)012, (byte)00, (byte)00, (byte)00, (byte)0307, +(byte)0104, (byte)044, (byte)014, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0115, (byte)0340, (byte)0350, (byte)061, (byte)0111, (byte)00, (byte)00, (byte)0203, +(byte)0300, (byte)060, (byte)0210, (byte)03, (byte)0213, (byte)0115, (byte)0340, (byte)0203, (byte)0303, (byte)01, (byte)0211, (byte)0164, (byte)044, (byte)04, (byte)0307, (byte)0104, +(byte)044, (byte)010, (byte)012, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)014, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)014, +(byte)044, (byte)0350, (byte)0132, (byte)0112, (byte)00, (byte)00, (byte)0211, (byte)0301, (byte)0211, (byte)0320, (byte)011, (byte)0310, (byte)0211, (byte)0326, (byte)0165, (byte)0260, +(byte)0213, (byte)0127, (byte)014, (byte)0205, (byte)0322, (byte)0176, (byte)030, (byte)03, (byte)0125, (byte)0344, (byte)051, (byte)0332, (byte)0205, (byte)0322, (byte)0176, (byte)017, +(byte)061, (byte)0300, (byte)0306, (byte)04, (byte)03, (byte)060, (byte)0203, (byte)0300, (byte)01, (byte)071, (byte)0320, (byte)0165, (byte)0365, (byte)01, (byte)0303, (byte)073, +(byte)0135, (byte)0344, (byte)017, (byte)0204, (byte)030, (byte)01, (byte)00, (byte)00, (byte)0213, (byte)0107, (byte)010, (byte)0205, (byte)0300, (byte)0176, (byte)0132, (byte)03, +(byte)0105, (byte)0344, (byte)051, (byte)0330, (byte)0205, (byte)0300, (byte)0211, (byte)0107, (byte)010, (byte)0176, (byte)0116, (byte)0213, (byte)0117, (byte)04, (byte)0367, (byte)0301, +(byte)0300, (byte)01, (byte)00, (byte)00, (byte)0211, (byte)0312, (byte)0164, (byte)06, (byte)0203, (byte)0350, (byte)01, (byte)0211, (byte)0107, (byte)010, (byte)0213, (byte)0107, +(byte)014, (byte)0205, (byte)0300, (byte)017, (byte)0210, (byte)0231, (byte)00, (byte)00, (byte)00, (byte)0366, (byte)0305, (byte)04, (byte)0165, (byte)056, (byte)0213, (byte)0107, +(byte)010, (byte)0215, (byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0127, (byte)010, (byte)0211, (byte)0312, (byte)0176, (byte)037, (byte)0215, (byte)0166, (byte)00, +(byte)0211, (byte)0372, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)044, (byte)0374, (byte)0377, (byte)0377, (byte)0213, (byte)0107, (byte)010, (byte)0215, +(byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0127, (byte)010, (byte)0177, (byte)0347, (byte)0213, (byte)0127, (byte)04, (byte)0204, (byte)0322, (byte)0171, (byte)0110, +(byte)0306, (byte)03, (byte)055, (byte)0203, (byte)0303, (byte)01, (byte)0353, (byte)015, (byte)0203, (byte)0353, (byte)01, (byte)0211, (byte)0372, (byte)017, (byte)0276, (byte)03, +(byte)0350, (byte)0373, (byte)0373, (byte)0377, (byte)0377, (byte)071, (byte)0135, (byte)0344, (byte)0162, (byte)0356, (byte)0213, (byte)0107, (byte)010, (byte)0215, (byte)0120, (byte)0377, +(byte)0205, (byte)0300, (byte)0211, (byte)0127, (byte)010, (byte)0176, (byte)031, (byte)0211, (byte)0372, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0335, +(byte)0373, (byte)0377, (byte)0377, (byte)0213, (byte)0107, (byte)010, (byte)0215, (byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0127, (byte)010, (byte)0177, (byte)0347, +(byte)0215, (byte)0145, (byte)0364, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0366, (byte)0306, (byte)01, (byte)0164, (byte)010, (byte)0306, (byte)03, (byte)053, +(byte)0203, (byte)0303, (byte)01, (byte)0353, (byte)0300, (byte)0203, (byte)0342, (byte)0100, (byte)0164, (byte)0273, (byte)0306, (byte)03, (byte)040, (byte)0203, (byte)0303, (byte)01, +(byte)0353, (byte)0263, (byte)0211, (byte)0310, (byte)045, (byte)00, (byte)06, (byte)00, (byte)00, (byte)075, (byte)00, (byte)02, (byte)00, (byte)00, (byte)017, (byte)0205, +(byte)0125, (byte)0377, (byte)0377, (byte)0377, (byte)0213, (byte)0107, (byte)010, (byte)0215, (byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0127, (byte)010, (byte)0211, +(byte)0312, (byte)017, (byte)0216, (byte)0165, (byte)0377, (byte)0377, (byte)0377, (byte)0306, (byte)03, (byte)060, (byte)0213, (byte)0107, (byte)010, (byte)0203, (byte)0303, (byte)01, +(byte)0215, (byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0127, (byte)010, (byte)0177, (byte)0355, (byte)0351, (byte)0132, (byte)0377, (byte)0377, (byte)0377, (byte)0220, +(byte)0367, (byte)0333, (byte)0203, (byte)0326, (byte)00, (byte)0367, (byte)0336, (byte)0351, (byte)0144, (byte)0376, (byte)0377, (byte)0377, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0213, (byte)0127, (byte)014, (byte)0205, (byte)0322, (byte)017, (byte)0204, (byte)0335, (byte)0376, (byte)0377, (byte)0377, (byte)0306, (byte)03, (byte)060, (byte)0203, (byte)0303, +(byte)01, (byte)0351, (byte)0322, (byte)0376, (byte)0377, (byte)0377, (byte)0215, (byte)0166, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0211, (byte)0345, (byte)0127, (byte)0126, (byte)0123, (byte)061, (byte)0333, (byte)0203, (byte)0354, (byte)054, (byte)0203, (byte)0370, (byte)0157, (byte)0213, (byte)0165, +(byte)010, (byte)017, (byte)0224, (byte)0303, (byte)0203, (byte)0353, (byte)01, (byte)0203, (byte)0343, (byte)0372, (byte)0203, (byte)0370, (byte)0157, (byte)0211, (byte)0105, (byte)0334, +(byte)017, (byte)0225, (byte)0300, (byte)017, (byte)0266, (byte)0370, (byte)017, (byte)0266, (byte)0300, (byte)0215, (byte)074, (byte)0375, (byte)07, (byte)00, (byte)00, (byte)00, +(byte)0203, (byte)0300, (byte)03, (byte)0211, (byte)0175, (byte)0344, (byte)0213, (byte)0176, (byte)014, (byte)0211, (byte)0105, (byte)0324, (byte)0211, (byte)0370, (byte)0301, (byte)0370, +(byte)037, (byte)0367, (byte)0320, (byte)041, (byte)0370, (byte)0215, (byte)0104, (byte)03, (byte)030, (byte)0213, (byte)0136, (byte)010, (byte)071, (byte)0330, (byte)0175, (byte)02, +(byte)0211, (byte)0330, (byte)0203, (byte)0300, (byte)036, (byte)0203, (byte)0340, (byte)0360, (byte)0350, (byte)0223, (byte)0111, (byte)00, (byte)00, (byte)0215, (byte)0104, (byte)044, +(byte)017, (byte)0203, (byte)0340, (byte)0360, (byte)0211, (byte)0105, (byte)0340, (byte)0211, (byte)0320, (byte)0211, (byte)0312, (byte)011, (byte)0301, (byte)017, (byte)0204, (byte)0326, +(byte)01, (byte)00, (byte)00, (byte)017, (byte)0266, (byte)0115, (byte)0334, (byte)0213, (byte)0135, (byte)0340, (byte)0213, (byte)0175, (byte)0324, (byte)0211, (byte)0165, (byte)0324, +(byte)0203, (byte)0341, (byte)040, (byte)0210, (byte)0115, (byte)0333, (byte)017, (byte)0266, (byte)0115, (byte)0344, (byte)041, (byte)0301, (byte)0211, (byte)0316, (byte)0215, (byte)0116, +(byte)060, (byte)0210, (byte)013, (byte)0203, (byte)0303, (byte)01, (byte)0200, (byte)0371, (byte)071, (byte)0176, (byte)011, (byte)0215, (byte)0116, (byte)067, (byte)012, (byte)0115, +(byte)0333, (byte)0210, (byte)0113, (byte)0377, (byte)0211, (byte)0371, (byte)017, (byte)0255, (byte)0320, (byte)0323, (byte)0352, (byte)0366, (byte)0301, (byte)040, (byte)0164, (byte)04, +(byte)0211, (byte)0320, (byte)061, (byte)0322, (byte)0211, (byte)0321, (byte)011, (byte)0301, (byte)0165, (byte)0314, (byte)073, (byte)0135, (byte)0340, (byte)0213, (byte)0165, (byte)0324, +(byte)017, (byte)0204, (byte)0200, (byte)01, (byte)00, (byte)00, (byte)0213, (byte)0176, (byte)014, (byte)0205, (byte)0377, (byte)017, (byte)0216, (byte)04, (byte)01, (byte)00, +(byte)00, (byte)03, (byte)0175, (byte)0340, (byte)051, (byte)0337, (byte)0205, (byte)0377, (byte)017, (byte)0216, (byte)0367, (byte)00, (byte)00, (byte)00, (byte)061, (byte)0300, +(byte)0306, (byte)04, (byte)03, (byte)060, (byte)0203, (byte)0300, (byte)01, (byte)071, (byte)0370, (byte)0165, (byte)0365, (byte)01, (byte)0303, (byte)073, (byte)0135, (byte)0340, +(byte)017, (byte)0204, (byte)072, (byte)01, (byte)00, (byte)00, (byte)0213, (byte)0126, (byte)010, (byte)0211, (byte)0330, (byte)053, (byte)0105, (byte)0340, (byte)071, (byte)0302, +(byte)017, (byte)0216, (byte)0272, (byte)00, (byte)00, (byte)00, (byte)051, (byte)0302, (byte)0205, (byte)0322, (byte)0211, (byte)0125, (byte)0344, (byte)0211, (byte)0126, (byte)010, +(byte)0176, (byte)042, (byte)0203, (byte)0175, (byte)0334, (byte)0157, (byte)0164, (byte)021, (byte)0366, (byte)0106, (byte)05, (byte)010, (byte)0164, (byte)013, (byte)0203, (byte)0155, +(byte)0344, (byte)02, (byte)0213, (byte)0125, (byte)0344, (byte)0205, (byte)0322, (byte)0176, (byte)031, (byte)0213, (byte)0106, (byte)014, (byte)0205, (byte)0300, (byte)017, (byte)0210, +(byte)0301, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0175, (byte)0334, (byte)0157, (byte)0164, (byte)025, (byte)0366, (byte)0106, (byte)05, (byte)010, (byte)0146, (byte)0220, +(byte)0164, (byte)015, (byte)017, (byte)0266, (byte)0105, (byte)0334, (byte)0306, (byte)0103, (byte)01, (byte)060, (byte)0210, (byte)03, (byte)0203, (byte)0303, (byte)02, (byte)0213, +(byte)0175, (byte)0344, (byte)0205, (byte)0377, (byte)0176, (byte)011, (byte)0366, (byte)0106, (byte)05, (byte)04, (byte)0213, (byte)0175, (byte)0344, (byte)0164, (byte)0101, (byte)073, +(byte)0135, (byte)0340, (byte)0166, (byte)024, (byte)0213, (byte)0175, (byte)0340, (byte)0203, (byte)0353, (byte)01, (byte)0211, (byte)0362, (byte)017, (byte)0276, (byte)03, (byte)0350, +(byte)0314, (byte)0371, (byte)0377, (byte)0377, (byte)071, (byte)0337, (byte)0162, (byte)0357, (byte)0213, (byte)0115, (byte)0344, (byte)0205, (byte)0311, (byte)0176, (byte)026, (byte)0213, +(byte)0135, (byte)0344, (byte)0211, (byte)0362, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0353, (byte)01, (byte)0350, (byte)0257, (byte)0371, (byte)0377, +(byte)0377, (byte)0205, (byte)0333, (byte)0177, (byte)0355, (byte)0215, (byte)0145, (byte)0364, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0215, (byte)0166, (byte)00, +(byte)0211, (byte)0362, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0357, (byte)01, (byte)0350, (byte)0221, (byte)0371, (byte)0377, (byte)0377, (byte)0205, +(byte)0377, (byte)0177, (byte)0355, (byte)0307, (byte)0105, (byte)0344, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0353, (byte)0243, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0307, (byte)0106, (byte)010, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)0105, (byte)0344, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0146, (byte)0220, +(byte)0351, (byte)0137, (byte)0377, (byte)0377, (byte)0377, (byte)0203, (byte)0175, (byte)0334, (byte)0157, (byte)017, (byte)0205, (byte)016, (byte)0377, (byte)0377, (byte)0377, (byte)0366, +(byte)0106, (byte)05, (byte)010, (byte)017, (byte)0204, (byte)04, (byte)0377, (byte)0377, (byte)0377, (byte)0306, (byte)03, (byte)060, (byte)0203, (byte)0303, (byte)01, (byte)0220, +(byte)0351, (byte)0370, (byte)0376, (byte)0377, (byte)0377, (byte)0213, (byte)0106, (byte)04, (byte)045, (byte)00, (byte)06, (byte)00, (byte)00, (byte)075, (byte)00, (byte)02, +(byte)00, (byte)00, (byte)017, (byte)0205, (byte)054, (byte)0377, (byte)0377, (byte)0377, (byte)0213, (byte)0125, (byte)0344, (byte)0146, (byte)061, (byte)0300, (byte)0146, (byte)0220, +(byte)0306, (byte)04, (byte)03, (byte)060, (byte)0203, (byte)0300, (byte)01, (byte)071, (byte)0320, (byte)0165, (byte)0365, (byte)03, (byte)0135, (byte)0344, (byte)0307, (byte)0105, +(byte)0344, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0351, (byte)012, (byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0213, (byte)0116, (byte)014, (byte)0205, (byte)0311, (byte)017, (byte)0204, (byte)0273, (byte)0376, (byte)0377, (byte)0377, (byte)0306, (byte)03, (byte)060, (byte)0203, (byte)0303, +(byte)01, (byte)0351, (byte)0260, (byte)0376, (byte)0377, (byte)0377, (byte)0213, (byte)0176, (byte)014, (byte)0201, (byte)0146, (byte)04, (byte)0377, (byte)0367, (byte)0377, (byte)0377, +(byte)0213, (byte)0135, (byte)0340, (byte)0351, (byte)0161, (byte)0376, (byte)0377, (byte)0377, (byte)0220, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0211, (byte)0345, (byte)0127, (byte)0126, (byte)0211, (byte)0306, (byte)0123, (byte)0203, (byte)0354, (byte)074, (byte)0203, (byte)0170, (byte)020, (byte)0375, (byte)017, +(byte)0204, (byte)0221, (byte)00, (byte)00, (byte)00, (byte)0146, (byte)0203, (byte)0176, (byte)024, (byte)00, (byte)0164, (byte)0150, (byte)0213, (byte)0106, (byte)020, (byte)0211, +(byte)0145, (byte)0320, (byte)0203, (byte)0300, (byte)036, (byte)0203, (byte)0340, (byte)0360, (byte)0350, (byte)0143, (byte)0107, (byte)00, (byte)00, (byte)0215, (byte)0104, (byte)044, +(byte)037, (byte)0203, (byte)0340, (byte)0360, (byte)0211, (byte)0105, (byte)0324, (byte)0215, (byte)0105, (byte)0340, (byte)0307, (byte)0105, (byte)0340, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)0211, (byte)0104, (byte)044, (byte)010, (byte)017, (byte)0267, (byte)0106, (byte)024, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0213, (byte)0125, (byte)0324, +(byte)0211, (byte)024, (byte)044, (byte)0350, (byte)0170, (byte)060, (byte)00, (byte)00, (byte)0205, (byte)0300, (byte)0211, (byte)0307, (byte)0176, (byte)072, (byte)061, (byte)0333, +(byte)0213, (byte)0125, (byte)0324, (byte)017, (byte)0276, (byte)04, (byte)032, (byte)0211, (byte)0362, (byte)0203, (byte)0303, (byte)01, (byte)0350, (byte)0157, (byte)0370, (byte)0377, +(byte)0377, (byte)0211, (byte)0370, (byte)051, (byte)0330, (byte)0205, (byte)0300, (byte)0177, (byte)0347, (byte)0213, (byte)0145, (byte)0320, (byte)0215, (byte)0145, (byte)0364, (byte)0133, +(byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0211, (byte)0362, (byte)0270, (byte)056, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0120, (byte)0370, (byte)0377, (byte)0377, +(byte)0215, (byte)0145, (byte)0364, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0211, (byte)0362, (byte)0270, (byte)056, (byte)00, (byte)00, (byte)00, (byte)0350, +(byte)074, (byte)0370, (byte)0377, (byte)0377, (byte)0353, (byte)0323, (byte)0307, (byte)0105, (byte)0340, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0246, (byte)0103, +(byte)00, (byte)00, (byte)0215, (byte)0125, (byte)0340, (byte)0211, (byte)0124, (byte)044, (byte)014, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)020, (byte)00, (byte)00, +(byte)00, (byte)0213, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0215, (byte)0105, (byte)0346, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)056, (byte)063, +(byte)00, (byte)00, (byte)0205, (byte)0300, (byte)0176, (byte)010, (byte)017, (byte)0267, (byte)0125, (byte)0346, (byte)0146, (byte)0211, (byte)0126, (byte)024, (byte)0211, (byte)0106, +(byte)020, (byte)0351, (byte)057, (byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0166, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0211, (byte)0305, (byte)0127, (byte)0211, (byte)0317, (byte)0126, (byte)0123, (byte)0211, (byte)0323, (byte)0203, (byte)0354, (byte)014, (byte)0205, (byte)0311, (byte)0213, +(byte)0164, (byte)044, (byte)040, (byte)017, (byte)0216, (byte)0154, (byte)01, (byte)00, (byte)00, (byte)0213, (byte)0106, (byte)010, (byte)071, (byte)0301, (byte)017, (byte)0214, +(byte)0274, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0106, (byte)010, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)0106, (byte)010, (byte)0377, (byte)0377, +(byte)0377, (byte)0377, (byte)0205, (byte)0355, (byte)017, (byte)0205, (byte)070, (byte)01, (byte)00, (byte)00, (byte)0213, (byte)0106, (byte)04, (byte)0366, (byte)0304, (byte)01, +(byte)017, (byte)0205, (byte)0160, (byte)01, (byte)00, (byte)00, (byte)0250, (byte)0100, (byte)017, (byte)0205, (byte)0327, (byte)01, (byte)00, (byte)00, (byte)0213, (byte)0126, +(byte)010, (byte)0205, (byte)0322, (byte)0176, (byte)023, (byte)0213, (byte)0106, (byte)04, (byte)045, (byte)00, (byte)06, (byte)00, (byte)00, (byte)075, (byte)00, (byte)02, +(byte)00, (byte)00, (byte)017, (byte)0204, (byte)0150, (byte)01, (byte)00, (byte)00, (byte)0205, (byte)0377, (byte)017, (byte)0216, (byte)0207, (byte)01, (byte)00, (byte)00, +(byte)017, (byte)0266, (byte)023, (byte)0270, (byte)060, (byte)00, (byte)00, (byte)00, (byte)0204, (byte)0322, (byte)0164, (byte)06, (byte)017, (byte)0276, (byte)0302, (byte)0203, +(byte)0303, (byte)01, (byte)0211, (byte)0362, (byte)0203, (byte)0357, (byte)01, (byte)0350, (byte)0144, (byte)0367, (byte)0377, (byte)0377, (byte)0205, (byte)0377, (byte)0177, (byte)0340, +(byte)061, (byte)0377, (byte)0213, (byte)0106, (byte)014, (byte)0205, (byte)0300, (byte)0177, (byte)06, (byte)0366, (byte)0106, (byte)05, (byte)010, (byte)0164, (byte)012, (byte)0211, +(byte)0360, (byte)0350, (byte)0152, (byte)0376, (byte)0377, (byte)0377, (byte)0213, (byte)0106, (byte)014, (byte)0205, (byte)0377, (byte)0164, (byte)041, (byte)0351, (byte)0351, (byte)00, +(byte)00, (byte)00, (byte)017, (byte)0266, (byte)023, (byte)0270, (byte)060, (byte)00, (byte)00, (byte)00, (byte)0204, (byte)0322, (byte)0164, (byte)06, (byte)017, (byte)0276, +(byte)0302, (byte)0203, (byte)0303, (byte)01, (byte)0211, (byte)0362, (byte)0350, (byte)045, (byte)0367, (byte)0377, (byte)0377, (byte)0213, (byte)0106, (byte)014, (byte)0215, (byte)0120, +(byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0126, (byte)014, (byte)0177, (byte)0332, (byte)0203, (byte)0304, (byte)014, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, +(byte)051, (byte)0310, (byte)0211, (byte)0106, (byte)010, (byte)0205, (byte)0300, (byte)017, (byte)0210, (byte)076, (byte)0377, (byte)0377, (byte)0377, (byte)0213, (byte)0126, (byte)014, +(byte)071, (byte)0302, (byte)017, (byte)0215, (byte)063, (byte)0377, (byte)0377, (byte)0377, (byte)051, (byte)0320, (byte)0205, (byte)0300, (byte)0211, (byte)0106, (byte)010, (byte)017, +(byte)0216, (byte)055, (byte)0377, (byte)0377, (byte)0377, (byte)0213, (byte)0126, (byte)014, (byte)0205, (byte)0322, (byte)017, (byte)0216, (byte)00, (byte)01, (byte)00, (byte)00, +(byte)0203, (byte)0350, (byte)01, (byte)0205, (byte)0300, (byte)0211, (byte)0106, (byte)010, (byte)017, (byte)0204, (byte)024, (byte)0377, (byte)0377, (byte)0377, (byte)0205, (byte)0355, +(byte)0165, (byte)017, (byte)0213, (byte)0126, (byte)04, (byte)0367, (byte)0302, (byte)0300, (byte)01, (byte)00, (byte)00, (byte)017, (byte)0204, (byte)0327, (byte)00, (byte)00, +(byte)00, (byte)0203, (byte)0350, (byte)01, (byte)0205, (byte)0300, (byte)0211, (byte)0106, (byte)010, (byte)017, (byte)0204, (byte)0363, (byte)0376, (byte)0377, (byte)0377, (byte)0213, +(byte)0126, (byte)04, (byte)0200, (byte)0346, (byte)06, (byte)017, (byte)0205, (byte)0347, (byte)0376, (byte)0377, (byte)0377, (byte)0203, (byte)0350, (byte)01, (byte)0211, (byte)0106, +(byte)010, (byte)0211, (byte)0362, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0223, (byte)0366, (byte)0377, (byte)0377, (byte)0213, (byte)0106, (byte)010, +(byte)0215, (byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0126, (byte)010, (byte)0177, (byte)0347, (byte)0205, (byte)0355, (byte)017, (byte)0204, (byte)0310, (byte)0376, +(byte)0377, (byte)0377, (byte)0211, (byte)0362, (byte)0270, (byte)055, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0162, (byte)0366, (byte)0377, (byte)0377, (byte)0146, (byte)0220, +(byte)0351, (byte)0311, (byte)0376, (byte)0377, (byte)0377, (byte)0213, (byte)0106, (byte)010, (byte)0205, (byte)0300, (byte)017, (byte)0216, (byte)0125, (byte)0377, (byte)0377, (byte)0377, +(byte)0203, (byte)0350, (byte)01, (byte)0211, (byte)0106, (byte)010, (byte)0351, (byte)0122, (byte)0377, (byte)0377, (byte)0377, (byte)01, (byte)0370, (byte)0211, (byte)0106, (byte)014, +(byte)0211, (byte)0362, (byte)0270, (byte)060, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0104, (byte)0366, (byte)0377, (byte)0377, (byte)0203, (byte)0307, (byte)01, (byte)0170, +(byte)0357, (byte)0351, (byte)025, (byte)0377, (byte)0377, (byte)0377, (byte)0211, (byte)0362, (byte)0270, (byte)053, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0166, (byte)00, +(byte)0350, (byte)053, (byte)0366, (byte)0377, (byte)0377, (byte)0351, (byte)0204, (byte)0376, (byte)0377, (byte)0377, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0203, (byte)0352, (byte)01, (byte)0211, (byte)0126, (byte)010, (byte)0211, (byte)0362, (byte)0270, (byte)060, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)016, (byte)0366, +(byte)0377, (byte)0377, (byte)0213, (byte)0106, (byte)010, (byte)0215, (byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0126, (byte)010, (byte)0177, (byte)0347, (byte)0205, +(byte)0377, (byte)017, (byte)0217, (byte)0171, (byte)0376, (byte)0377, (byte)0377, (byte)0211, (byte)0362, (byte)0270, (byte)060, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0355, +(byte)0365, (byte)0377, (byte)0377, (byte)0351, (byte)0212, (byte)0376, (byte)0377, (byte)0377, (byte)0213, (byte)0106, (byte)010, (byte)0351, (byte)062, (byte)0377, (byte)0377, (byte)0377, +(byte)0366, (byte)0106, (byte)05, (byte)010, (byte)017, (byte)0204, (byte)04, (byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0351, (byte)0353, (byte)0376, (byte)0377, (byte)0377, (byte)0211, (byte)0362, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0350, (byte)0273, (byte)0365, (byte)0377, (byte)0377, (byte)0351, (byte)024, (byte)0376, (byte)0377, (byte)0377, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0203, (byte)0351, (byte)01, (byte)0127, (byte)0211, (byte)0325, (byte)0126, (byte)0272, (byte)0147, (byte)0146, (byte)0146, (byte)0146, (byte)0123, (byte)0276, (byte)01, +(byte)00, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)054, (byte)0211, (byte)0104, (byte)044, (byte)034, (byte)0211, (byte)0310, (byte)0213, (byte)0134, (byte)044, (byte)0100, +(byte)0367, (byte)0352, (byte)0211, (byte)0114, (byte)044, (byte)030, (byte)0301, (byte)0371, (byte)037, (byte)0301, (byte)0372, (byte)02, (byte)051, (byte)0312, (byte)0211, (byte)0321, +(byte)0164, (byte)030, (byte)0277, (byte)0147, (byte)0146, (byte)0146, (byte)0146, (byte)0211, (byte)0310, (byte)0203, (byte)0306, (byte)01, (byte)0367, (byte)0357, (byte)0301, (byte)0371, +(byte)037, (byte)0301, (byte)0372, (byte)02, (byte)051, (byte)0312, (byte)0211, (byte)0321, (byte)0165, (byte)0355, (byte)0213, (byte)0103, (byte)040, (byte)071, (byte)0306, (byte)0175, +(byte)02, (byte)0211, (byte)0306, (byte)0213, (byte)0103, (byte)010, (byte)0203, (byte)0306, (byte)02, (byte)071, (byte)0360, (byte)0177, (byte)0131, (byte)0307, (byte)0103, (byte)010, +(byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0213, (byte)0104, (byte)044, (byte)034, (byte)0271, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0352, (byte)0211, +(byte)034, (byte)044, (byte)0350, (byte)0111, (byte)0375, (byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)040, (byte)0211, (byte)0332, (byte)0211, (byte)0103, (byte)014, (byte)0213, +(byte)0103, (byte)04, (byte)015, (byte)0300, (byte)01, (byte)00, (byte)00, (byte)0211, (byte)0103, (byte)04, (byte)0203, (byte)0340, (byte)040, (byte)0203, (byte)0310, (byte)0105, +(byte)0350, (byte)033, (byte)0365, (byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)010, (byte)0211, (byte)0331, (byte)0215, (byte)0104, (byte)06, (byte)0377, (byte)0211, (byte)0103, +(byte)010, (byte)0213, (byte)0104, (byte)044, (byte)030, (byte)0203, (byte)0304, (byte)054, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0211, (byte)0302, (byte)0301, (byte)0372, +(byte)037, (byte)0351, (byte)0252, (byte)0367, (byte)0377, (byte)0377, (byte)051, (byte)0360, (byte)0211, (byte)0103, (byte)010, (byte)0353, (byte)0247, (byte)0215, (byte)0166, (byte)00, +(byte)0126, (byte)0211, (byte)0306, (byte)0123, (byte)0203, (byte)0354, (byte)0104, (byte)0213, (byte)0100, (byte)014, (byte)0205, (byte)0300, (byte)017, (byte)0210, (byte)0202, (byte)00, +(byte)00, (byte)00, (byte)0203, (byte)0300, (byte)01, (byte)0213, (byte)0124, (byte)044, (byte)0120, (byte)0213, (byte)0114, (byte)044, (byte)0124, (byte)0211, (byte)0104, (byte)044, +(byte)020, (byte)0213, (byte)0134, (byte)044, (byte)0130, (byte)0211, (byte)0124, (byte)044, (byte)050, (byte)0213, (byte)0104, (byte)044, (byte)050, (byte)0215, (byte)0124, (byte)044, +(byte)074, (byte)0211, (byte)0114, (byte)044, (byte)054, (byte)0211, (byte)0134, (byte)044, (byte)060, (byte)0211, (byte)0124, (byte)044, (byte)030, (byte)0215, (byte)0124, (byte)044, +(byte)070, (byte)0211, (byte)04, (byte)044, (byte)0213, (byte)0104, (byte)044, (byte)054, (byte)0211, (byte)0124, (byte)044, (byte)024, (byte)0211, (byte)0104, (byte)044, (byte)04, +(byte)0213, (byte)0104, (byte)044, (byte)060, (byte)0211, (byte)0104, (byte)044, (byte)010, (byte)0213, (byte)0104, (byte)044, (byte)064, (byte)0211, (byte)0104, (byte)044, (byte)014, +(byte)0270, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0206, (byte)0363, (byte)0377, (byte)0377, (byte)0213, (byte)0114, (byte)044, (byte)070, (byte)0201, (byte)0371, +(byte)00, (byte)0200, (byte)0377, (byte)0377, (byte)0211, (byte)0303, (byte)0164, (byte)055, (byte)0211, (byte)0302, (byte)0213, (byte)0104, (byte)044, (byte)074, (byte)0211, (byte)064, +(byte)044, (byte)0350, (byte)0272, (byte)0376, (byte)0377, (byte)0377, (byte)0211, (byte)034, (byte)044, (byte)0350, (byte)0362, (byte)061, (byte)00, (byte)00, (byte)0203, (byte)0304, +(byte)0104, (byte)0133, (byte)0136, (byte)0303, (byte)0307, (byte)0106, (byte)014, (byte)06, (byte)00, (byte)00, (byte)00, (byte)0270, (byte)07, (byte)00, (byte)00, (byte)00, +(byte)0351, (byte)0160, (byte)0377, (byte)0377, (byte)0377, (byte)0211, (byte)0302, (byte)0213, (byte)0104, (byte)044, (byte)074, (byte)0211, (byte)0361, (byte)0350, (byte)0136, (byte)0366, +(byte)0377, (byte)0377, (byte)0211, (byte)034, (byte)044, (byte)0350, (byte)0306, (byte)061, (byte)00, (byte)00, (byte)0203, (byte)0304, (byte)0104, (byte)0133, (byte)0136, (byte)0303, +(byte)0125, (byte)0127, (byte)0126, (byte)0123, (byte)0211, (byte)0303, (byte)0203, (byte)0354, (byte)0114, (byte)0213, (byte)0100, (byte)014, (byte)0205, (byte)0300, (byte)017, (byte)0210, +(byte)0234, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0164, (byte)044, (byte)0140, (byte)0215, (byte)0124, (byte)044, (byte)074, (byte)0213, (byte)0174, (byte)044, (byte)0144, +(byte)0211, (byte)0104, (byte)044, (byte)020, (byte)0213, (byte)0154, (byte)044, (byte)0150, (byte)0211, (byte)0124, (byte)044, (byte)030, (byte)0215, (byte)0124, (byte)044, (byte)070, +(byte)0211, (byte)0164, (byte)044, (byte)050, (byte)0213, (byte)0104, (byte)044, (byte)050, (byte)0211, (byte)0174, (byte)044, (byte)054, (byte)0211, (byte)0154, (byte)044, (byte)060, +(byte)0211, (byte)0124, (byte)044, (byte)024, (byte)0211, (byte)04, (byte)044, (byte)0213, (byte)0104, (byte)044, (byte)054, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0213, +(byte)0104, (byte)044, (byte)060, (byte)0211, (byte)0104, (byte)044, (byte)010, (byte)0213, (byte)0104, (byte)044, (byte)064, (byte)0211, (byte)0104, (byte)044, (byte)014, (byte)0270, +(byte)03, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0307, (byte)0362, (byte)0377, (byte)0377, (byte)0213, (byte)0114, (byte)044, (byte)070, (byte)0201, (byte)0371, (byte)00, +(byte)0200, (byte)0377, (byte)0377, (byte)0211, (byte)0306, (byte)0164, (byte)0112, (byte)0211, (byte)0302, (byte)0213, (byte)0104, (byte)044, (byte)074, (byte)0211, (byte)034, (byte)044, +(byte)0350, (byte)0273, (byte)0373, (byte)0377, (byte)0377, (byte)0353, (byte)014, (byte)0211, (byte)0332, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0235, +(byte)0363, (byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)010, (byte)0215, (byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0123, (byte)010, (byte)0177, (byte)0347, +(byte)0211, (byte)064, (byte)044, (byte)0350, (byte)030, (byte)061, (byte)00, (byte)00, (byte)0203, (byte)0304, (byte)0114, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, +(byte)0307, (byte)0103, (byte)014, (byte)06, (byte)00, (byte)00, (byte)00, (byte)0270, (byte)06, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0123, (byte)0377, (byte)0377, +(byte)0377, (byte)0211, (byte)0302, (byte)0213, (byte)0104, (byte)044, (byte)074, (byte)0211, (byte)0331, (byte)0350, (byte)0202, (byte)0365, (byte)0377, (byte)0377, (byte)0211, (byte)064, +(byte)044, (byte)0350, (byte)0352, (byte)060, (byte)00, (byte)00, (byte)0203, (byte)0304, (byte)0114, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0146, (byte)0220, +(byte)0125, (byte)0127, (byte)0126, (byte)0123, (byte)0211, (byte)0303, (byte)0203, (byte)0354, (byte)0114, (byte)0213, (byte)0100, (byte)014, (byte)0203, (byte)0370, (byte)00, (byte)017, +(byte)0214, (byte)053, (byte)01, (byte)00, (byte)00, (byte)017, (byte)0204, (byte)011, (byte)01, (byte)00, (byte)00, (byte)0213, (byte)0164, (byte)044, (byte)0140, (byte)0215, +(byte)0124, (byte)044, (byte)074, (byte)0213, (byte)0174, (byte)044, (byte)0144, (byte)0211, (byte)0104, (byte)044, (byte)020, (byte)0213, (byte)0154, (byte)044, (byte)0150, (byte)0211, +(byte)0124, (byte)044, (byte)030, (byte)0215, (byte)0124, (byte)044, (byte)070, (byte)0211, (byte)0164, (byte)044, (byte)050, (byte)0213, (byte)0104, (byte)044, (byte)050, (byte)0211, +(byte)0174, (byte)044, (byte)054, (byte)0211, (byte)0154, (byte)044, (byte)060, (byte)0211, (byte)0124, (byte)044, (byte)024, (byte)0211, (byte)04, (byte)044, (byte)0213, (byte)0104, +(byte)044, (byte)054, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0213, (byte)0104, (byte)044, (byte)060, (byte)0211, (byte)0104, (byte)044, (byte)010, (byte)0213, (byte)0104, +(byte)044, (byte)064, (byte)0211, (byte)0104, (byte)044, (byte)014, (byte)0270, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0340, (byte)0361, (byte)0377, (byte)0377, +(byte)0213, (byte)0174, (byte)044, (byte)070, (byte)0201, (byte)0377, (byte)00, (byte)0200, (byte)0377, (byte)0377, (byte)0211, (byte)0306, (byte)017, (byte)0204, (byte)0336, (byte)00, +(byte)00, (byte)00, (byte)0203, (byte)0377, (byte)0375, (byte)0174, (byte)0151, (byte)0213, (byte)0103, (byte)014, (byte)071, (byte)0307, (byte)0177, (byte)0142, (byte)0366, (byte)0103, +(byte)05, (byte)010, (byte)017, (byte)0205, (byte)0271, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)064, (byte)044, (byte)0350, (byte)010, (byte)076, (byte)00, (byte)00, +(byte)051, (byte)0370, (byte)0205, (byte)0300, (byte)0211, (byte)0103, (byte)014, (byte)017, (byte)0210, (byte)0303, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, +(byte)074, (byte)0211, (byte)0371, (byte)0211, (byte)0362, (byte)0211, (byte)034, (byte)044, (byte)0350, (byte)0243, (byte)0372, (byte)0377, (byte)0377, (byte)0353, (byte)015, (byte)0220, +(byte)0211, (byte)0332, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0204, (byte)0362, (byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)010, (byte)0215, +(byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0123, (byte)010, (byte)0177, (byte)0347, (byte)0211, (byte)064, (byte)044, (byte)0350, (byte)0377, (byte)057, (byte)00, +(byte)00, (byte)0203, (byte)0304, (byte)0114, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0366, (byte)0103, (byte)05, (byte)010, (byte)0165, (byte)077, (byte)0211, (byte)064, (byte)044, (byte)0350, (byte)0252, (byte)075, (byte)00, (byte)00, (byte)0203, (byte)0350, +(byte)01, (byte)0211, (byte)0103, (byte)014, (byte)0213, (byte)0104, (byte)044, (byte)074, (byte)0211, (byte)0371, (byte)0211, (byte)0362, (byte)0211, (byte)034, (byte)044, (byte)0350, +(byte)0214, (byte)0374, (byte)0377, (byte)0377, (byte)0211, (byte)064, (byte)044, (byte)0350, (byte)0304, (byte)057, (byte)00, (byte)00, (byte)0203, (byte)0304, (byte)0114, (byte)0133, +(byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0307, (byte)0103, (byte)014, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0270, (byte)01, (byte)00, (byte)00, (byte)00, +(byte)0351, (byte)0346, (byte)0376, (byte)0377, (byte)0377, (byte)0203, (byte)0153, (byte)014, (byte)01, (byte)0353, (byte)0311, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0307, (byte)0103, (byte)014, (byte)06, (byte)00, (byte)00, (byte)00, (byte)0270, (byte)06, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0312, (byte)0376, (byte)0377, +(byte)0377, (byte)051, (byte)0370, (byte)0211, (byte)0103, (byte)014, (byte)0351, (byte)0122, (byte)0377, (byte)0377, (byte)0377, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0211, (byte)0302, (byte)0213, (byte)0104, (byte)044, (byte)074, (byte)0211, (byte)0331, (byte)0350, (byte)03, (byte)0364, (byte)0377, (byte)0377, (byte)0353, (byte)0245, (byte)0220, +(byte)0213, (byte)0123, (byte)010, (byte)0205, (byte)0322, (byte)017, (byte)0216, (byte)062, (byte)0377, (byte)0377, (byte)0377, (byte)01, (byte)0320, (byte)0211, (byte)0103, (byte)010, +(byte)0351, (byte)050, (byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0164, (byte)046, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0127, (byte)0126, (byte)0123, (byte)0203, (byte)0354, (byte)0174, (byte)0213, (byte)0204, (byte)044, (byte)0220, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0234, +(byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)0100, (byte)0213, (byte)0204, (byte)044, (byte)0224, (byte)00, (byte)00, (byte)00, +(byte)0213, (byte)0153, (byte)014, (byte)0211, (byte)0104, (byte)044, (byte)0104, (byte)0213, (byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0375, +(byte)016, (byte)0211, (byte)0104, (byte)044, (byte)0110, (byte)0213, (byte)0204, (byte)044, (byte)0234, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)0114, + }; +} diff --git a/src/main/java/io/soluble/pjb/bridge/LauncherWindows2.java b/src/main/java/io/soluble/pjb/bridge/LauncherWindows2.java new file mode 100644 index 0000000..a595125 --- /dev/null +++ b/src/main/java/io/soluble/pjb/bridge/LauncherWindows2.java @@ -0,0 +1,517 @@ +package io.soluble.pjb.bridge; +public class LauncherWindows2 { + public static final byte[] bytes = new byte[]{ +(byte)017, (byte)0206, (byte)032, (byte)03, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)0100, (byte)0213, (byte)0124, (byte)044, (byte)0104, (byte)0211, (byte)0321, +(byte)011, (byte)0301, (byte)017, (byte)0204, (byte)055, (byte)04, (byte)00, (byte)00, (byte)017, (byte)0267, (byte)0114, (byte)044, (byte)0110, (byte)0215, (byte)0164, (byte)044, +(byte)0136, (byte)0211, (byte)0104, (byte)044, (byte)014, (byte)0213, (byte)0174, (byte)044, (byte)0100, (byte)0211, (byte)0164, (byte)044, (byte)060, (byte)0213, (byte)0154, (byte)044, +(byte)0104, (byte)0211, (byte)0164, (byte)044, (byte)030, (byte)0211, (byte)0306, (byte)0146, (byte)0211, (byte)0114, (byte)044, (byte)040, (byte)0213, (byte)0113, (byte)04, (byte)0211, +(byte)0124, (byte)044, (byte)034, (byte)0211, (byte)0134, (byte)044, (byte)054, (byte)0211, (byte)0114, (byte)044, (byte)070, (byte)0201, (byte)0341, (byte)00, (byte)010, (byte)00, +(byte)00, (byte)0211, (byte)0114, (byte)044, (byte)074, (byte)017, (byte)0266, (byte)0114, (byte)044, (byte)070, (byte)0203, (byte)0341, (byte)040, (byte)0210, (byte)0114, (byte)044, +(byte)067, (byte)017, (byte)0267, (byte)0114, (byte)044, (byte)040, (byte)0146, (byte)0211, (byte)0114, (byte)044, (byte)014, (byte)0353, (byte)0144, (byte)0215, (byte)0166, (byte)00, +(byte)0213, (byte)0104, (byte)044, (byte)054, (byte)0211, (byte)0352, (byte)0213, (byte)0160, (byte)014, (byte)0211, (byte)0370, (byte)0205, (byte)0366, (byte)0176, (byte)016, (byte)0213, +(byte)0124, (byte)044, (byte)054, (byte)0203, (byte)0356, (byte)01, (byte)0211, (byte)0370, (byte)0211, (byte)0162, (byte)014, (byte)0211, (byte)0352, (byte)0205, (byte)0333, (byte)017, +(byte)0204, (byte)0313, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0373, (byte)011, (byte)017, (byte)0216, (byte)0333, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0303, +(byte)067, (byte)012, (byte)0134, (byte)044, (byte)067, (byte)0213, (byte)0114, (byte)044, (byte)030, (byte)0210, (byte)031, (byte)0203, (byte)0301, (byte)01, (byte)0211, (byte)0114, +(byte)044, (byte)030, (byte)0211, (byte)0325, (byte)0211, (byte)0307, (byte)017, (byte)0254, (byte)0357, (byte)04, (byte)0301, (byte)0355, (byte)04, (byte)0211, (byte)0356, (byte)011, +(byte)0376, (byte)017, (byte)0204, (byte)0272, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0370, (byte)0211, (byte)0352, (byte)0211, (byte)0376, (byte)0211, (byte)0154, (byte)044, +(byte)034, (byte)0211, (byte)0363, (byte)0203, (byte)0343, (byte)017, (byte)0211, (byte)0331, (byte)0301, (byte)0371, (byte)037, (byte)0211, (byte)0114, (byte)044, (byte)044, (byte)0213, +(byte)0114, (byte)044, (byte)034, (byte)0211, (byte)0134, (byte)044, (byte)040, (byte)063, (byte)0114, (byte)044, (byte)044, (byte)063, (byte)0164, (byte)044, (byte)040, (byte)011, +(byte)0316, (byte)017, (byte)0205, (byte)0171, (byte)0377, (byte)0377, (byte)0377, (byte)0213, (byte)0164, (byte)044, (byte)060, (byte)071, (byte)0164, (byte)044, (byte)030, (byte)0167, +(byte)023, (byte)0213, (byte)0114, (byte)044, (byte)074, (byte)0205, (byte)0311, (byte)0165, (byte)013, (byte)0213, (byte)0114, (byte)044, (byte)054, (byte)0213, (byte)0161, (byte)014, +(byte)0205, (byte)0366, (byte)0176, (byte)016, (byte)0213, (byte)0164, (byte)044, (byte)030, (byte)0306, (byte)06, (byte)056, (byte)0203, (byte)0306, (byte)01, (byte)0211, (byte)0164, +(byte)044, (byte)030, (byte)0203, (byte)0372, (byte)00, (byte)0167, (byte)011, (byte)0203, (byte)0370, (byte)01, (byte)017, (byte)0206, (byte)0135, (byte)0377, (byte)0377, (byte)0377, +(byte)017, (byte)0267, (byte)0114, (byte)044, (byte)014, (byte)0211, (byte)0370, (byte)0211, (byte)0352, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)017, (byte)0254, (byte)0320, (byte)01, (byte)0203, (byte)0351, (byte)01, (byte)0321, (byte)0352, (byte)0203, (byte)0372, (byte)00, (byte)0167, (byte)0362, (byte)0203, (byte)0370, +(byte)01, (byte)0167, (byte)0355, (byte)0205, (byte)0333, (byte)0146, (byte)0211, (byte)0114, (byte)044, (byte)014, (byte)017, (byte)0205, (byte)065, (byte)0377, (byte)0377, (byte)0377, +(byte)0213, (byte)0114, (byte)044, (byte)060, (byte)071, (byte)0114, (byte)044, (byte)030, (byte)0167, (byte)017, (byte)0213, (byte)0164, (byte)044, (byte)054, (byte)0213, (byte)0116, +(byte)014, (byte)0205, (byte)0311, (byte)017, (byte)0210, (byte)071, (byte)0377, (byte)0377, (byte)0377, (byte)0203, (byte)0303, (byte)060, (byte)0351, (byte)044, (byte)0377, (byte)0377, +(byte)0377, (byte)017, (byte)0267, (byte)0104, (byte)044, (byte)014, (byte)0213, (byte)0164, (byte)044, (byte)030, (byte)073, (byte)0164, (byte)044, (byte)060, (byte)0213, (byte)0134, +(byte)044, (byte)054, (byte)0211, (byte)0174, (byte)044, (byte)0100, (byte)0211, (byte)0154, (byte)044, (byte)0104, (byte)0146, (byte)0211, (byte)0104, (byte)044, (byte)0110, (byte)017, +(byte)0204, (byte)0310, (byte)02, (byte)00, (byte)00, (byte)0213, (byte)0123, (byte)010, (byte)0205, (byte)0322, (byte)0211, (byte)0124, (byte)044, (byte)034, (byte)017, (byte)0216, +(byte)0115, (byte)02, (byte)00, (byte)00, (byte)0213, (byte)0113, (byte)014, (byte)0211, (byte)0360, (byte)053, (byte)0104, (byte)044, (byte)060, (byte)017, (byte)0267, (byte)0124, +(byte)044, (byte)0110, (byte)0205, (byte)0311, (byte)0176, (byte)02, (byte)01, (byte)0310, (byte)0213, (byte)0114, (byte)044, (byte)070, (byte)017, (byte)0277, (byte)0322, (byte)0277, +(byte)02, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0124, (byte)044, (byte)030, (byte)0272, (byte)0147, (byte)0146, (byte)0146, (byte)0146, (byte)0201, (byte)0341, (byte)0300, +(byte)01, (byte)00, (byte)00, (byte)0203, (byte)0371, (byte)01, (byte)031, (byte)0311, (byte)0215, (byte)0154, (byte)010, (byte)06, (byte)0213, (byte)0104, (byte)044, (byte)030, +(byte)0213, (byte)0114, (byte)044, (byte)030, (byte)0367, (byte)0352, (byte)0301, (byte)0371, (byte)037, (byte)0301, (byte)0372, (byte)02, (byte)051, (byte)0312, (byte)0211, (byte)0321, +(byte)0164, (byte)031, (byte)0270, (byte)0147, (byte)0146, (byte)0146, (byte)0146, (byte)0203, (byte)0305, (byte)01, (byte)0367, (byte)0351, (byte)0203, (byte)0307, (byte)01, (byte)0301, +(byte)0371, (byte)037, (byte)0301, (byte)0372, (byte)02, (byte)051, (byte)0312, (byte)0211, (byte)0321, (byte)0165, (byte)0347, (byte)071, (byte)0154, (byte)044, (byte)034, (byte)017, +(byte)0217, (byte)0173, (byte)01, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)070, (byte)0307, (byte)0103, (byte)010, (byte)0377, (byte)0377, (byte)0377, (byte)0377, +(byte)0204, (byte)0300, (byte)017, (byte)0210, (byte)0270, (byte)01, (byte)00, (byte)00, (byte)0366, (byte)0304, (byte)01, (byte)017, (byte)0205, (byte)0327, (byte)01, (byte)00, +(byte)00, (byte)0250, (byte)0100, (byte)017, (byte)0205, (byte)0353, (byte)01, (byte)00, (byte)00, (byte)0211, (byte)0332, (byte)0270, (byte)060, (byte)00, (byte)00, (byte)00, +(byte)0350, (byte)053, (byte)0357, (byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)04, (byte)0211, (byte)0332, (byte)0203, (byte)0340, (byte)040, (byte)0203, (byte)0310, (byte)0130, +(byte)0350, (byte)033, (byte)0357, (byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)010, (byte)0205, (byte)0300, (byte)0176, (byte)045, (byte)0366, (byte)0103, (byte)05, (byte)02, +(byte)0164, (byte)037, (byte)0203, (byte)0350, (byte)01, (byte)0211, (byte)0103, (byte)010, (byte)0211, (byte)0332, (byte)0270, (byte)060, (byte)00, (byte)00, (byte)00, (byte)0350, +(byte)0374, (byte)0356, (byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)010, (byte)0215, (byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0123, (byte)010, (byte)0177, +(byte)0347, (byte)073, (byte)0164, (byte)044, (byte)060, (byte)0166, (byte)0105, (byte)0211, (byte)0375, (byte)0213, (byte)0174, (byte)044, (byte)060, (byte)0353, (byte)014, (byte)0220, +(byte)0211, (byte)0332, (byte)0350, (byte)0331, (byte)0356, (byte)0377, (byte)0377, (byte)071, (byte)0376, (byte)0166, (byte)026, (byte)0203, (byte)0356, (byte)01, (byte)017, (byte)0276, +(byte)06, (byte)0203, (byte)0370, (byte)056, (byte)0165, (byte)0352, (byte)0211, (byte)0330, (byte)0350, (byte)0343, (byte)0365, (byte)0377, (byte)0377, (byte)071, (byte)0376, (byte)0167, +(byte)0352, (byte)0213, (byte)0103, (byte)014, (byte)0211, (byte)0357, (byte)0215, (byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0123, (byte)014, (byte)0176, (byte)031, +(byte)0211, (byte)0332, (byte)0270, (byte)060, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0244, (byte)0356, (byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)014, (byte)0215, +(byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0123, (byte)014, (byte)0177, (byte)0347, (byte)0213, (byte)0103, (byte)04, (byte)0211, (byte)0332, (byte)017, (byte)0277, +(byte)0377, (byte)0203, (byte)0340, (byte)040, (byte)0203, (byte)0310, (byte)0120, (byte)0350, (byte)0204, (byte)0356, (byte)0377, (byte)0377, (byte)0213, (byte)0104, (byte)044, (byte)030, +(byte)0211, (byte)0331, (byte)01, (byte)0173, (byte)010, (byte)0201, (byte)0113, (byte)04, (byte)0300, (byte)01, (byte)00, (byte)00, (byte)0211, (byte)0302, (byte)0301, (byte)0372, +(byte)037, (byte)0350, (byte)032, (byte)0361, (byte)0377, (byte)0377, (byte)0203, (byte)0304, (byte)0174, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0146, (byte)0220, +(byte)0213, (byte)0124, (byte)044, (byte)0104, (byte)0213, (byte)0104, (byte)044, (byte)0100, (byte)0201, (byte)0372, (byte)0377, (byte)0377, (byte)0377, (byte)0177, (byte)0167, (byte)016, +(byte)017, (byte)0244, (byte)0302, (byte)01, (byte)01, (byte)0300, (byte)0201, (byte)0372, (byte)0377, (byte)0377, (byte)0377, (byte)0177, (byte)0166, (byte)0362, (byte)0271, (byte)016, +(byte)00, (byte)00, (byte)00, (byte)0276, (byte)04, (byte)00, (byte)00, (byte)00, (byte)051, (byte)0351, (byte)061, (byte)0377, (byte)0301, (byte)0341, (byte)02, (byte)017, +(byte)0254, (byte)0320, (byte)01, (byte)017, (byte)0245, (byte)0367, (byte)0321, (byte)0352, (byte)0323, (byte)0346, (byte)0366, (byte)0301, (byte)040, (byte)0164, (byte)04, (byte)0211, +(byte)0367, (byte)061, (byte)0366, (byte)01, (byte)0360, (byte)021, (byte)0372, (byte)0205, (byte)0322, (byte)017, (byte)0210, (byte)0272, (byte)00, (byte)00, (byte)00, (byte)017, +(byte)0244, (byte)0302, (byte)01, (byte)01, (byte)0300, (byte)0271, (byte)017, (byte)00, (byte)00, (byte)00, (byte)051, (byte)0351, (byte)0301, (byte)0341, (byte)02, (byte)017, +(byte)0255, (byte)0320, (byte)0323, (byte)0352, (byte)0366, (byte)0301, (byte)040, (byte)0164, (byte)04, (byte)0211, (byte)0320, (byte)061, (byte)0322, (byte)0211, (byte)0104, (byte)044, +(byte)0100, (byte)0211, (byte)0124, (byte)044, (byte)0104, (byte)0351, (byte)0164, (byte)0374, (byte)0377, (byte)0377, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0213, (byte)0124, (byte)044, (byte)034, (byte)0213, (byte)0104, (byte)044, (byte)070, (byte)051, (byte)0352, (byte)0366, (byte)0304, (byte)06, (byte)0211, (byte)0325, (byte)0211, +(byte)0123, (byte)010, (byte)017, (byte)0205, (byte)0170, (byte)0376, (byte)0377, (byte)0377, (byte)0215, (byte)0122, (byte)0377, (byte)0205, (byte)0355, (byte)0211, (byte)0123, (byte)010, +(byte)017, (byte)0216, (byte)0152, (byte)0376, (byte)0377, (byte)0377, (byte)0211, (byte)0332, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0256, (byte)0355, +(byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)010, (byte)0215, (byte)0120, (byte)0377, (byte)0205, (byte)0300, (byte)0211, (byte)0123, (byte)010, (byte)0177, (byte)0347, (byte)0213, +(byte)0103, (byte)04, (byte)0204, (byte)0300, (byte)017, (byte)0211, (byte)0116, (byte)0376, (byte)0377, (byte)0377, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0211, (byte)0332, (byte)0270, (byte)055, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0204, (byte)0355, (byte)0377, (byte)0377, (byte)0351, (byte)0110, (byte)0376, (byte)0377, +(byte)0377, (byte)017, (byte)0277, (byte)0114, (byte)044, (byte)0110, (byte)0277, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)070, (byte)0211, +(byte)0114, (byte)044, (byte)030, (byte)0351, (byte)030, (byte)0376, (byte)0377, (byte)0377, (byte)0211, (byte)0332, (byte)0270, (byte)053, (byte)00, (byte)00, (byte)00, (byte)0350, +(byte)0134, (byte)0355, (byte)0377, (byte)0377, (byte)0351, (byte)040, (byte)0376, (byte)0377, (byte)0377, (byte)0146, (byte)0203, (byte)0104, (byte)044, (byte)0110, (byte)01, (byte)0351, +(byte)0101, (byte)0377, (byte)0377, (byte)0377, (byte)0211, (byte)0332, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0100, (byte)0355, (byte)0377, (byte)0377, +(byte)0351, (byte)04, (byte)0376, (byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)04, (byte)0215, (byte)0164, (byte)044, (byte)0136, (byte)0211, (byte)0164, (byte)044, (byte)060, +(byte)0211, (byte)0104, (byte)044, (byte)070, (byte)0205, (byte)0355, (byte)0176, (byte)032, (byte)0306, (byte)0104, (byte)044, (byte)0136, (byte)056, (byte)0215, (byte)0164, (byte)044, +(byte)0140, (byte)0215, (byte)0104, (byte)044, (byte)0137, (byte)0306, (byte)00, (byte)060, (byte)0351, (byte)070, (byte)0375, (byte)0377, (byte)0377, (byte)0213, (byte)0153, (byte)014, +(byte)0353, (byte)0342, (byte)0367, (byte)0104, (byte)044, (byte)070, (byte)00, (byte)010, (byte)00, (byte)00, (byte)0165, (byte)0334, (byte)0215, (byte)0164, (byte)044, (byte)0137, +(byte)0213, (byte)0104, (byte)044, (byte)060, (byte)0353, (byte)0337, (byte)0215, (byte)0166, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0127, (byte)0126, (byte)0123, (byte)0201, (byte)0354, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)0201, (byte)0244, (byte)044, (byte)0300, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)060, (byte)00, (byte)00, (byte)0213, (byte)0234, (byte)044, (byte)0314, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0264, (byte)044, (byte)0320, +(byte)00, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)0200, (byte)0202, (byte)0100, (byte)00, (byte)0350, (byte)0101, (byte)070, (byte)00, (byte)00, (byte)0205, +(byte)0300, (byte)017, (byte)0204, (byte)0331, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0276, (byte)00, (byte)0203, (byte)0350, (byte)060, (byte)0203, (byte)0370, (byte)02, +(byte)017, (byte)0207, (byte)0312, (byte)00, (byte)00, (byte)00, (byte)0272, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0204, (byte)044, (byte)0304, (byte)00, +(byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)0134, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)0140, (byte)0377, (byte)0377, +(byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)0144, (byte)0375, (byte)0377, (byte)0377, (byte)0377, (byte)0211, (byte)0104, (byte)044, (byte)0124, (byte)0213, (byte)0204, +(byte)044, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0146, (byte)0307, (byte)0104, (byte)044, (byte)0150, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)0154, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0124, (byte)044, (byte)0164, (byte)0211, (byte)0104, (byte)044, (byte)0130, (byte)0213, (byte)0204, (byte)044, (byte)0310, +(byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)0160, (byte)017, (byte)0266, (byte)023, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)017, (byte)0276, (byte)0302, (byte)0205, (byte)0300, (byte)017, (byte)0204, (byte)0226, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0370, (byte)045, (byte)0215, (byte)0173, +(byte)01, (byte)0165, (byte)0164, (byte)0213, (byte)0224, (byte)044, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0114, (byte)044, (byte)0134, (byte)061, (byte)0355, +(byte)0307, (byte)0104, (byte)044, (byte)0140, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)0134, (byte)0377, (byte)0377, (byte)0377, (byte)0377, +(byte)0211, (byte)0124, (byte)044, (byte)0130, (byte)017, (byte)0266, (byte)0123, (byte)01, (byte)0211, (byte)0373, (byte)0211, (byte)0114, (byte)044, (byte)0114, (byte)061, (byte)0311, +(byte)0204, (byte)0322, (byte)0164, (byte)0274, (byte)017, (byte)0276, (byte)0302, (byte)0203, (byte)0352, (byte)040, (byte)0203, (byte)0303, (byte)01, (byte)0200, (byte)0372, (byte)0132, +(byte)0166, (byte)0136, (byte)0203, (byte)0370, (byte)071, (byte)017, (byte)0216, (byte)0245, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0124, (byte)044, (byte)0124, (byte)0270, +(byte)045, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0347, (byte)0353, (byte)0377, (byte)0377, (byte)0211, (byte)0373, (byte)017, (byte)0266, (byte)027, (byte)0353, (byte)0220, +(byte)0350, (byte)0143, (byte)067, (byte)00, (byte)00, (byte)0272, (byte)03, (byte)00, (byte)00, (byte)00, (byte)0250, (byte)01, (byte)017, (byte)0204, (byte)051, (byte)0377, +(byte)0377, (byte)0377, (byte)0351, (byte)037, (byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0124, (byte)044, (byte)0124, (byte)0350, (byte)0300, (byte)0353, (byte)0377, (byte)0377, +(byte)017, (byte)0266, (byte)0123, (byte)01, (byte)0211, (byte)0373, (byte)017, (byte)0276, (byte)0302, (byte)0205, (byte)0300, (byte)017, (byte)0205, (byte)0152, (byte)0377, (byte)0377, +(byte)0377, (byte)0213, (byte)0104, (byte)044, (byte)0154, (byte)0201, (byte)0304, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, +(byte)017, (byte)0266, (byte)0322, (byte)0377, (byte)044, (byte)0225, (byte)0270, (byte)0202, (byte)0100, (byte)00, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0211, (byte)0360, (byte)017, (byte)0266, (byte)023, (byte)0275, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0271, (byte)04, (byte)00, (byte)00, (byte)00, (byte)0211, +(byte)0306, (byte)0351, (byte)0152, (byte)0377, (byte)0377, (byte)0377, (byte)0200, (byte)073, (byte)0154, (byte)0275, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0165, (byte)07, +(byte)0203, (byte)0303, (byte)01, (byte)0146, (byte)0275, (byte)03, (byte)00, (byte)0203, (byte)0114, (byte)044, (byte)0130, (byte)04, (byte)0211, (byte)0360, (byte)017, (byte)0266, +(byte)023, (byte)0271, (byte)04, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0306, (byte)0351, (byte)0103, (byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0166, (byte)00, +(byte)0203, (byte)0371, (byte)03, (byte)017, (byte)0207, (byte)0122, (byte)0377, (byte)0377, (byte)0377, (byte)0203, (byte)0370, (byte)057, (byte)017, (byte)0216, (byte)0111, (byte)0377, +(byte)0377, (byte)0377, (byte)0205, (byte)0311, (byte)017, (byte)0205, (byte)0226, (byte)06, (byte)00, (byte)00, (byte)0261, (byte)01, (byte)0213, (byte)0124, (byte)044, (byte)0114, +(byte)0205, (byte)0322, (byte)0164, (byte)043, (byte)0213, (byte)0124, (byte)044, (byte)0114, (byte)0213, (byte)022, (byte)0205, (byte)0322, (byte)0211, (byte)0124, (byte)044, (byte)074, +(byte)017, (byte)0210, (byte)0174, (byte)07, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)074, (byte)0215, (byte)024, (byte)0222, (byte)0215, (byte)0104, (byte)0120, +(byte)0320, (byte)0213, (byte)0124, (byte)044, (byte)0114, (byte)0211, (byte)02, (byte)0211, (byte)0360, (byte)017, (byte)0266, (byte)023, (byte)0211, (byte)0306, (byte)0351, (byte)0355, +(byte)0376, (byte)0377, (byte)0377, (byte)0203, (byte)0355, (byte)02, (byte)0203, (byte)0375, (byte)01, (byte)017, (byte)0206, (byte)0221, (byte)06, (byte)00, (byte)00, (byte)0213, +(byte)076, (byte)0205, (byte)0377, (byte)017, (byte)0204, (byte)0110, (byte)010, (byte)00, (byte)00, (byte)0211, (byte)074, (byte)044, (byte)0350, (byte)067, (byte)066, (byte)00, +(byte)00, (byte)0211, (byte)0302, (byte)0215, (byte)0114, (byte)044, (byte)0124, (byte)0211, (byte)0370, (byte)0350, (byte)0102, (byte)0354, (byte)0377, (byte)0377, (byte)0203, (byte)0306, +(byte)04, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)0167, (byte)0376, (byte)0377, (byte)0377, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0201, (byte)0114, (byte)044, (byte)0130, (byte)00, (byte)010, (byte)00, (byte)00, (byte)061, (byte)0311, (byte)0213, (byte)026, (byte)0215, (byte)0176, (byte)04, (byte)0270, +(byte)0170, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0164, (byte)044, (byte)0124, (byte)0211, (byte)064, (byte)044, (byte)0211, (byte)0376, (byte)0211, (byte)0214, (byte)044, +(byte)0234, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0224, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0120, (byte)0357, (byte)0377, (byte)0377, +(byte)017, (byte)0266, (byte)023, (byte)0351, (byte)070, (byte)0376, (byte)0377, (byte)0377, (byte)0203, (byte)0375, (byte)04, (byte)0211, (byte)0360, (byte)017, (byte)0204, (byte)0364, +(byte)06, (byte)00, (byte)00, (byte)0203, (byte)0375, (byte)01, (byte)017, (byte)0204, (byte)0245, (byte)06, (byte)00, (byte)00, (byte)0203, (byte)0375, (byte)02, (byte)0220, +(byte)0164, (byte)011, (byte)0203, (byte)0375, (byte)03, (byte)017, (byte)0204, (byte)0127, (byte)010, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)0154, (byte)0203, +(byte)0306, (byte)04, (byte)0213, (byte)00, (byte)0211, (byte)020, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)02, (byte)0376, (byte)0377, (byte)0377, (byte)0146, (byte)0220, +(byte)0211, (byte)0360, (byte)017, (byte)0266, (byte)023, (byte)0275, (byte)03, (byte)00, (byte)00, (byte)00, (byte)0271, (byte)04, (byte)00, (byte)00, (byte)00, (byte)0211, +(byte)0306, (byte)0351, (byte)052, (byte)0376, (byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)023, (byte)0200, (byte)0372, (byte)0150, (byte)017, (byte)0204, (byte)021, (byte)07, +(byte)00, (byte)00, (byte)0211, (byte)0360, (byte)0275, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0271, (byte)04, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0306, +(byte)0351, (byte)013, (byte)0376, (byte)0377, (byte)0377, (byte)0213, (byte)0104, (byte)044, (byte)0130, (byte)0211, (byte)0362, (byte)0203, (byte)0310, (byte)040, (byte)0250, (byte)04, +(byte)0211, (byte)0104, (byte)044, (byte)0130, (byte)017, (byte)0204, (byte)0304, (byte)02, (byte)00, (byte)00, (byte)0213, (byte)02, (byte)0203, (byte)0306, (byte)014, (byte)0213, +(byte)0112, (byte)010, (byte)0213, (byte)0122, (byte)04, (byte)0211, (byte)04, (byte)044, (byte)0215, (byte)0104, (byte)044, (byte)0124, (byte)0211, (byte)0114, (byte)044, (byte)010, +(byte)0211, (byte)0124, (byte)044, (byte)04, (byte)0350, (byte)0227, (byte)0366, (byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)0217, (byte)0375, (byte)0377, +(byte)0377, (byte)0213, (byte)0104, (byte)044, (byte)0130, (byte)0211, (byte)0362, (byte)0203, (byte)0310, (byte)040, (byte)0250, (byte)04, (byte)0211, (byte)0104, (byte)044, (byte)0130, +(byte)017, (byte)0204, (byte)0257, (byte)02, (byte)00, (byte)00, (byte)0213, (byte)02, (byte)0203, (byte)0306, (byte)014, (byte)0213, (byte)0112, (byte)010, (byte)0213, (byte)0122, +(byte)04, (byte)0211, (byte)04, (byte)044, (byte)0215, (byte)0104, (byte)044, (byte)0124, (byte)0211, (byte)0114, (byte)044, (byte)010, (byte)0211, (byte)0124, (byte)044, (byte)04, +(byte)0350, (byte)0173, (byte)0365, (byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)0123, (byte)0375, (byte)0377, (byte)0377, (byte)0215, (byte)0166, (byte)00, +(byte)0213, (byte)0104, (byte)044, (byte)0130, (byte)0211, (byte)0362, (byte)0203, (byte)0310, (byte)040, (byte)0250, (byte)04, (byte)0211, (byte)0104, (byte)044, (byte)0130, (byte)017, +(byte)0204, (byte)0231, (byte)02, (byte)00, (byte)00, (byte)0213, (byte)02, (byte)0203, (byte)0306, (byte)014, (byte)0213, (byte)0112, (byte)010, (byte)0213, (byte)0122, (byte)04, +(byte)0211, (byte)04, (byte)044, (byte)0215, (byte)0104, (byte)044, (byte)0124, (byte)0211, (byte)0114, (byte)044, (byte)010, (byte)0211, (byte)0124, (byte)044, (byte)04, (byte)0350, +(byte)0174, (byte)0364, (byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)024, (byte)0375, (byte)0377, (byte)0377, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0203, (byte)0355, (byte)02, (byte)0211, (byte)0360, (byte)0203, (byte)0375, (byte)01, (byte)0307, (byte)0104, (byte)044, (byte)0140, (byte)0377, (byte)0377, (byte)0377, (byte)0377, +(byte)017, (byte)0206, (byte)0173, (byte)02, (byte)00, (byte)00, (byte)0213, (byte)00, (byte)0272, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0306, (byte)04, +(byte)0215, (byte)0114, (byte)044, (byte)0124, (byte)0210, (byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0204, (byte)044, (byte)0230, (byte)00, +(byte)00, (byte)00, (byte)0350, (byte)0231, (byte)0352, (byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)0321, (byte)0374, (byte)0377, (byte)0377, (byte)0220, +(byte)0201, (byte)0114, (byte)044, (byte)0130, (byte)0200, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0375, (byte)03, (byte)0211, (byte)0360, (byte)017, (byte)0204, (byte)0262, +(byte)05, (byte)00, (byte)00, (byte)0203, (byte)0375, (byte)02, (byte)017, (byte)0204, (byte)0111, (byte)05, (byte)00, (byte)00, (byte)0213, (byte)00, (byte)0203, (byte)0306, +(byte)04, (byte)0211, (byte)0302, (byte)0301, (byte)0372, (byte)037, (byte)0203, (byte)0375, (byte)01, (byte)0211, (byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, +(byte)0211, (byte)0224, (byte)044, (byte)0234, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0204, (byte)0212, (byte)06, (byte)00, (byte)00, (byte)0203, (byte)0375, (byte)04, +(byte)017, (byte)0204, (byte)06, (byte)07, (byte)00, (byte)00, (byte)0213, (byte)0224, (byte)044, (byte)0234, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0114, (byte)044, +(byte)0124, (byte)0213, (byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0163, (byte)0353, (byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)023, +(byte)0351, (byte)0153, (byte)0374, (byte)0377, (byte)0377, (byte)0213, (byte)0124, (byte)044, (byte)0130, (byte)0211, (byte)0360, (byte)0203, (byte)0312, (byte)040, (byte)0366, (byte)0302, +(byte)04, (byte)0211, (byte)0124, (byte)044, (byte)0130, (byte)017, (byte)0204, (byte)032, (byte)02, (byte)00, (byte)00, (byte)0333, (byte)050, (byte)0203, (byte)0306, (byte)014, +(byte)0331, (byte)0300, (byte)0333, (byte)0274, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0331, (byte)0345, (byte)0233, (byte)0337, (byte)0340, (byte)045, (byte)00, +(byte)0105, (byte)00, (byte)00, (byte)075, (byte)00, (byte)01, (byte)00, (byte)00, (byte)017, (byte)0204, (byte)0237, (byte)05, (byte)00, (byte)00, (byte)017, (byte)0267, +(byte)0214, (byte)044, (byte)0220, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0317, (byte)0201, (byte)0347, (byte)00, (byte)0200, (byte)00, (byte)00, (byte)017, (byte)0205, +(byte)0334, (byte)03, (byte)00, (byte)00, (byte)0331, (byte)0345, (byte)0233, (byte)0337, (byte)0340, (byte)0335, (byte)0330, (byte)045, (byte)00, (byte)0105, (byte)00, (byte)00, +(byte)075, (byte)00, (byte)05, (byte)00, (byte)00, (byte)017, (byte)0204, (byte)0305, (byte)05, (byte)00, (byte)00, (byte)0146, (byte)0201, (byte)0341, (byte)0377, (byte)0177, +(byte)0146, (byte)0205, (byte)0311, (byte)0146, (byte)0211, (byte)0214, (byte)044, (byte)0220, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0204, (byte)0277, (byte)03, (byte)00, +(byte)00, (byte)0146, (byte)0201, (byte)0351, (byte)0377, (byte)077, (byte)0146, (byte)0211, (byte)0214, (byte)044, (byte)0220, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0104, +(byte)044, (byte)0124, (byte)0211, (byte)0104, (byte)044, (byte)020, (byte)0213, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)04, (byte)044, +(byte)0213, (byte)0204, (byte)044, (byte)0214, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0213, (byte)0204, (byte)044, (byte)0220, (byte)00, +(byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)010, (byte)0213, (byte)0204, (byte)044, (byte)0224, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, +(byte)014, (byte)0350, (byte)072, (byte)0366, (byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)0242, (byte)0373, (byte)0377, (byte)0377, (byte)0146, (byte)0220, +(byte)0203, (byte)0375, (byte)03, (byte)0211, (byte)0362, (byte)017, (byte)0204, (byte)0157, (byte)04, (byte)00, (byte)00, (byte)0203, (byte)0375, (byte)02, (byte)0146, (byte)0220, +(byte)017, (byte)0204, (byte)0357, (byte)03, (byte)00, (byte)00, (byte)0213, (byte)012, (byte)0203, (byte)0306, (byte)04, (byte)0203, (byte)0375, (byte)01, (byte)0307, (byte)0204, +(byte)044, (byte)0234, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0214, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, +(byte)017, (byte)0204, (byte)0102, (byte)05, (byte)00, (byte)00, (byte)0203, (byte)0375, (byte)04, (byte)017, (byte)0204, (byte)0276, (byte)05, (byte)00, (byte)00, (byte)0203, +(byte)0370, (byte)0165, (byte)017, (byte)0204, (byte)0316, (byte)0376, (byte)0377, (byte)0377, (byte)0215, (byte)0124, (byte)044, (byte)0124, (byte)0213, (byte)0214, (byte)044, (byte)0234, +(byte)00, (byte)00, (byte)00, (byte)0211, (byte)024, (byte)044, (byte)0213, (byte)0224, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0116, (byte)0354, +(byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)066, (byte)0373, (byte)0377, (byte)0377, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)017, (byte)0266, (byte)023, (byte)0200, (byte)0372, (byte)066, (byte)017, (byte)0204, (byte)064, (byte)04, (byte)00, (byte)00, (byte)0200, (byte)0372, (byte)063, (byte)0220, +(byte)017, (byte)0204, (byte)064, (byte)03, (byte)00, (byte)00, (byte)0211, (byte)0360, (byte)0275, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0271, (byte)04, (byte)00, +(byte)00, (byte)00, (byte)0211, (byte)0306, (byte)0351, (byte)0107, (byte)0373, (byte)0377, (byte)0377, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0213, (byte)0104, (byte)044, (byte)0130, (byte)0211, (byte)0362, (byte)0250, (byte)04, (byte)017, (byte)0205, (byte)074, (byte)0375, (byte)0377, (byte)0377, (byte)0335, (byte)02, +(byte)0215, (byte)0104, (byte)044, (byte)0124, (byte)0203, (byte)0306, (byte)010, (byte)0333, (byte)074, (byte)044, (byte)0350, (byte)0341, (byte)0363, (byte)0377, (byte)0377, (byte)017, +(byte)0266, (byte)023, (byte)0351, (byte)0331, (byte)0372, (byte)0377, (byte)0377, (byte)0213, (byte)0104, (byte)044, (byte)0130, (byte)0211, (byte)0362, (byte)0250, (byte)04, (byte)017, +(byte)0205, (byte)0121, (byte)0375, (byte)0377, (byte)0377, (byte)0335, (byte)02, (byte)0215, (byte)0104, (byte)044, (byte)0124, (byte)0203, (byte)0306, (byte)010, (byte)0333, (byte)074, +(byte)044, (byte)0350, (byte)0332, (byte)0362, (byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)0262, (byte)0372, (byte)0377, (byte)0377, (byte)0146, (byte)0220, +(byte)0213, (byte)0104, (byte)044, (byte)0130, (byte)0211, (byte)0362, (byte)0250, (byte)04, (byte)017, (byte)0205, (byte)0147, (byte)0375, (byte)0377, (byte)0377, (byte)0335, (byte)02, +(byte)0215, (byte)0104, (byte)044, (byte)0124, (byte)0203, (byte)0306, (byte)010, (byte)0333, (byte)074, (byte)044, (byte)0350, (byte)0361, (byte)0361, (byte)0377, (byte)0377, (byte)017, +(byte)0266, (byte)023, (byte)0351, (byte)0211, (byte)0372, (byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)0140, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0211, +(byte)0360, (byte)017, (byte)0267, (byte)00, (byte)0272, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0306, (byte)04, (byte)0215, (byte)0114, (byte)044, (byte)0124, +(byte)0307, (byte)0204, (byte)044, (byte)0234, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0204, (byte)044, (byte)0230, (byte)00, +(byte)00, (byte)00, (byte)0215, (byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)02, (byte)0347, (byte)0377, (byte)0377, (byte)017, (byte)0266, +(byte)023, (byte)0351, (byte)0112, (byte)0372, (byte)0377, (byte)0377, (byte)0213, (byte)0124, (byte)044, (byte)0130, (byte)0211, (byte)0360, (byte)0366, (byte)0302, (byte)04, (byte)017, +(byte)0205, (byte)0346, (byte)0375, (byte)0377, (byte)0377, (byte)0335, (byte)00, (byte)0203, (byte)0306, (byte)010, (byte)0335, (byte)0124, (byte)044, (byte)0170, (byte)0331, (byte)0345, +(byte)0233, (byte)0337, (byte)0340, (byte)045, (byte)00, (byte)0105, (byte)00, (byte)00, (byte)075, (byte)00, (byte)01, (byte)00, (byte)00, (byte)017, (byte)0204, (byte)0216, +(byte)03, (byte)00, (byte)00, (byte)017, (byte)0267, (byte)0154, (byte)044, (byte)0176, (byte)0211, (byte)0357, (byte)0201, (byte)0347, (byte)00, (byte)0200, (byte)00, (byte)00, +(byte)0164, (byte)07, (byte)0200, (byte)0312, (byte)0200, (byte)0211, (byte)0124, (byte)044, (byte)0130, (byte)0335, (byte)034, (byte)044, (byte)0350, (byte)0237, (byte)044, (byte)00, +(byte)00, (byte)075, (byte)00, (byte)05, (byte)00, (byte)00, (byte)017, (byte)0204, (byte)0264, (byte)03, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)0170, +(byte)0146, (byte)0301, (byte)0355, (byte)04, (byte)0213, (byte)0124, (byte)044, (byte)0174, (byte)0146, (byte)0201, (byte)0345, (byte)0377, (byte)07, (byte)0146, (byte)0211, (byte)0254, +(byte)044, (byte)0200, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0244, (byte)0302, (byte)010, (byte)0301, (byte)0340, (byte)010, (byte)0211, (byte)0124, (byte)044, (byte)0174, +(byte)0211, (byte)0104, (byte)044, (byte)0170, (byte)017, (byte)0267, (byte)0104, (byte)044, (byte)0176, (byte)0146, (byte)045, (byte)0377, (byte)017, (byte)0146, (byte)0205, (byte)0355, +(byte)0146, (byte)0211, (byte)0104, (byte)044, (byte)0176, (byte)017, (byte)0205, (byte)0101, (byte)03, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)0174, (byte)013, +(byte)0104, (byte)044, (byte)0170, (byte)0164, (byte)012, (byte)0146, (byte)0307, (byte)0204, (byte)044, (byte)0200, (byte)00, (byte)00, (byte)00, (byte)01, (byte)0374, (byte)0213, +(byte)0104, (byte)044, (byte)0170, (byte)0215, (byte)0124, (byte)044, (byte)0124, (byte)0211, (byte)0124, (byte)044, (byte)020, (byte)0211, (byte)04, (byte)044, (byte)0213, (byte)0104, +(byte)044, (byte)0174, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0213, (byte)0204, (byte)044, (byte)0200, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, +(byte)010, (byte)0213, (byte)0204, (byte)044, (byte)0204, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)014, (byte)0350, (byte)0377, (byte)0363, (byte)0377, +(byte)0377, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)0147, (byte)0371, (byte)0377, (byte)0377, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0205, (byte)0311, (byte)017, (byte)0205, (byte)0252, (byte)0371, (byte)0377, (byte)0377, (byte)0201, (byte)0114, (byte)044, (byte)0130, (byte)00, (byte)02, (byte)00, (byte)00, +(byte)0211, (byte)0360, (byte)017, (byte)0266, (byte)023, (byte)0211, (byte)0306, (byte)0351, (byte)0204, (byte)0371, (byte)0377, (byte)0377, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0203, (byte)0371, (byte)01, (byte)017, (byte)0206, (byte)0203, (byte)02, (byte)00, (byte)00, (byte)0211, (byte)0360, (byte)017, (byte)0266, (byte)023, (byte)0271, (byte)04, +(byte)00, (byte)00, (byte)00, (byte)0211, (byte)0306, (byte)0351, (byte)0146, (byte)0371, (byte)0377, (byte)0377, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0205, (byte)0311, (byte)017, (byte)0205, (byte)0137, (byte)0372, (byte)0377, (byte)0377, (byte)0201, (byte)0114, (byte)044, (byte)0130, (byte)00, (byte)04, (byte)00, (byte)00, +(byte)0211, (byte)0360, (byte)017, (byte)0266, (byte)023, (byte)0211, (byte)0306, (byte)0351, (byte)0104, (byte)0371, (byte)0377, (byte)0377, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0205, (byte)0311, (byte)017, (byte)0205, (byte)077, (byte)0372, (byte)0377, (byte)0377, (byte)0201, (byte)0114, (byte)044, (byte)0130, (byte)00, (byte)01, (byte)00, (byte)00, +(byte)0211, (byte)0360, (byte)017, (byte)0266, (byte)023, (byte)0211, (byte)0306, (byte)0351, (byte)044, (byte)0371, (byte)0377, (byte)0377, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0213, (byte)0104, (byte)044, (byte)0114, (byte)0205, (byte)0300, (byte)0164, (byte)0241, (byte)0205, (byte)0311, (byte)017, (byte)0224, (byte)0104, (byte)044, (byte)057, (byte)0203, +(byte)0371, (byte)02, (byte)017, (byte)0204, (byte)010, (byte)01, (byte)00, (byte)00, (byte)0200, (byte)0174, (byte)044, (byte)057, (byte)00, (byte)017, (byte)0205, (byte)0375, +(byte)00, (byte)00, (byte)00, (byte)0211, (byte)0360, (byte)017, (byte)0266, (byte)023, (byte)0271, (byte)04, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, +(byte)0114, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0306, (byte)0351, (byte)0344, (byte)0370, (byte)0377, (byte)0377, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0215, (byte)0124, (byte)044, (byte)0124, (byte)0350, (byte)0347, (byte)0344, (byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)0217, (byte)0370, (byte)0377, +(byte)0377, (byte)0205, (byte)0311, (byte)017, (byte)0205, (byte)0316, (byte)0371, (byte)0377, (byte)0377, (byte)0201, (byte)0114, (byte)044, (byte)0130, (byte)00, (byte)010, (byte)00, +(byte)00, (byte)0211, (byte)0360, (byte)017, (byte)0266, (byte)023, (byte)0211, (byte)0306, (byte)0351, (byte)0263, (byte)0370, (byte)0377, (byte)0377, (byte)0215, (byte)0166, (byte)00, +(byte)0205, (byte)0311, (byte)017, (byte)0205, (byte)0257, (byte)0371, (byte)0377, (byte)0377, (byte)0203, (byte)0114, (byte)044, (byte)0130, (byte)0100, (byte)0211, (byte)0360, (byte)017, +(byte)0266, (byte)023, (byte)0211, (byte)0306, (byte)0351, (byte)0227, (byte)0370, (byte)0377, (byte)0377, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0203, (byte)0371, (byte)02, (byte)017, (byte)0205, (byte)0143, (byte)0371, (byte)0377, (byte)0377, (byte)0261, (byte)03, (byte)0351, (byte)0134, (byte)0371, (byte)0377, (byte)0377, +(byte)0200, (byte)0312, (byte)0200, (byte)0211, (byte)0124, (byte)044, (byte)0130, (byte)0351, (byte)030, (byte)0374, (byte)0377, (byte)0377, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0213, (byte)0204, (byte)044, (byte)0214, (byte)00, (byte)00, (byte)00, (byte)013, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0204, +(byte)072, (byte)0374, (byte)0377, (byte)0377, (byte)0351, (byte)050, (byte)0374, (byte)0377, (byte)0377, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0213, (byte)076, (byte)0205, (byte)0377, (byte)017, (byte)0204, (byte)0242, (byte)02, (byte)00, (byte)00, (byte)0211, (byte)074, (byte)044, (byte)0203, (byte)0306, (byte)04, +(byte)0350, (byte)0327, (byte)057, (byte)00, (byte)00, (byte)0215, (byte)0114, (byte)044, (byte)0124, (byte)0211, (byte)0302, (byte)0211, (byte)0370, (byte)0350, (byte)0236, (byte)0344, +(byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)0346, (byte)0367, (byte)0377, (byte)0377, (byte)0200, (byte)0173, (byte)01, (byte)062, (byte)017, (byte)0205, +(byte)0302, (byte)0374, (byte)0377, (byte)0377, (byte)0203, (byte)0303, (byte)02, (byte)0211, (byte)0360, (byte)017, (byte)0266, (byte)023, (byte)0275, (byte)02, (byte)00, (byte)00, +(byte)00, (byte)0271, (byte)04, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0306, (byte)0351, (byte)03, (byte)0370, (byte)0377, (byte)0377, (byte)0215, (byte)0166, (byte)00, +(byte)0215, (byte)0106, (byte)04, (byte)0213, (byte)066, (byte)0213, (byte)0124, (byte)044, (byte)0114, (byte)0205, (byte)0366, (byte)0211, (byte)062, (byte)017, (byte)0210, (byte)0304, +(byte)01, (byte)00, (byte)00, (byte)017, (byte)0266, (byte)023, (byte)0211, (byte)0306, (byte)0307, (byte)0104, (byte)044, (byte)0114, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0351, (byte)0333, (byte)0367, (byte)0377, (byte)0377, (byte)0213, (byte)012, (byte)0203, (byte)0306, (byte)04, (byte)0307, (byte)0204, (byte)044, (byte)0234, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0214, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)036, (byte)0374, (byte)0377, +(byte)0377, (byte)0213, (byte)0124, (byte)044, (byte)0154, (byte)0203, (byte)0306, (byte)04, (byte)0213, (byte)00, (byte)0146, (byte)0211, (byte)020, (byte)017, (byte)0266, (byte)023, +(byte)0351, (byte)0153, (byte)0367, (byte)0377, (byte)0377, (byte)0213, (byte)00, (byte)0203, (byte)0306, (byte)04, (byte)0211, (byte)0301, (byte)0301, (byte)0371, (byte)037, (byte)0211, +(byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0214, (byte)044, (byte)0234, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0304, (byte)0372, +(byte)0377, (byte)0377, (byte)0213, (byte)0124, (byte)044, (byte)0114, (byte)0203, (byte)0350, (byte)060, (byte)0211, (byte)02, (byte)0211, (byte)0360, (byte)017, (byte)0266, (byte)023, +(byte)0211, (byte)0306, (byte)0351, (byte)0171, (byte)0367, (byte)0377, (byte)0377, (byte)0213, (byte)0124, (byte)044, (byte)0154, (byte)0203, (byte)0306, (byte)04, (byte)0213, (byte)00, +(byte)0210, (byte)020, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)046, (byte)0367, (byte)0377, (byte)0377, (byte)0213, (byte)0112, (byte)04, (byte)0203, (byte)0306, (byte)010, +(byte)0213, (byte)022, (byte)0211, (byte)0214, (byte)044, (byte)0234, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0224, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, +(byte)0351, (byte)0252, (byte)0373, (byte)0377, (byte)0377, (byte)0213, (byte)0120, (byte)04, (byte)0203, (byte)0306, (byte)010, (byte)0213, (byte)00, (byte)0211, (byte)0224, (byte)044, +(byte)0234, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0146, (byte)0372, (byte)0377, (byte)0377, +(byte)0200, (byte)0173, (byte)01, (byte)064, (byte)017, (byte)0205, (byte)0314, (byte)0373, (byte)0377, (byte)0377, (byte)0203, (byte)0303, (byte)02, (byte)0211, (byte)0360, (byte)017, +(byte)0266, (byte)023, (byte)0275, (byte)03, (byte)00, (byte)00, (byte)00, (byte)0271, (byte)04, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0306, (byte)0351, (byte)015, +(byte)0367, (byte)0377, (byte)0377, (byte)0203, (byte)0303, (byte)01, (byte)0211, (byte)0360, (byte)017, (byte)0266, (byte)023, (byte)0275, (byte)04, (byte)00, (byte)00, (byte)00, +(byte)0271, (byte)04, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0306, (byte)0351, (byte)0364, (byte)0366, (byte)0377, (byte)0377, (byte)0211, (byte)0360, (byte)0271, (byte)02, +(byte)00, (byte)00, (byte)00, (byte)0215, (byte)0164, (byte)044, (byte)0140, (byte)0307, (byte)0104, (byte)044, (byte)0140, (byte)00, (byte)00, (byte)00, (byte)00, (byte)017, +(byte)0266, (byte)023, (byte)0211, (byte)0164, (byte)044, (byte)0114, (byte)0211, (byte)0306, (byte)0351, (byte)0323, (byte)0366, (byte)0377, (byte)0377, (byte)0335, (byte)0330, (byte)0353, +(byte)02, (byte)0335, (byte)0330, (byte)0272, (byte)0255, (byte)0202, (byte)0100, (byte)00, (byte)0146, (byte)061, (byte)0300, (byte)0215, (byte)0114, (byte)044, (byte)0124, (byte)0350, +(byte)0354, (byte)0344, (byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)0164, (byte)0366, (byte)0377, (byte)0377, (byte)0146, (byte)0201, (byte)0355, (byte)0377, +(byte)03, (byte)0146, (byte)0203, (byte)0375, (byte)0203, (byte)0146, (byte)0211, (byte)0254, (byte)044, (byte)0200, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0214, (byte)0274, +(byte)0374, (byte)0377, (byte)0377, (byte)0146, (byte)05, (byte)00, (byte)020, (byte)0146, (byte)0211, (byte)0104, (byte)044, (byte)0176, (byte)0351, (byte)0256, (byte)0374, (byte)0377, +(byte)0377, (byte)0272, (byte)06, (byte)00, (byte)00, (byte)00, (byte)0277, (byte)0246, (byte)0202, (byte)0100, (byte)00, (byte)0351, (byte)0263, (byte)0367, (byte)0377, (byte)0377, +(byte)0272, (byte)0261, (byte)0202, (byte)0100, (byte)00, (byte)0211, (byte)0370, (byte)0215, (byte)0114, (byte)044, (byte)0124, (byte)0350, (byte)0240, (byte)0344, (byte)0377, (byte)0377, +(byte)017, (byte)0266, (byte)023, (byte)0351, (byte)050, (byte)0366, (byte)0377, (byte)0377, (byte)017, (byte)0267, (byte)0224, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, +(byte)0307, (byte)0204, (byte)044, (byte)0234, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0224, (byte)044, (byte)0230, (byte)00, +(byte)00, (byte)00, (byte)0351, (byte)0250, (byte)0372, (byte)0377, (byte)0377, (byte)017, (byte)0277, (byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0211, +(byte)0301, (byte)0301, (byte)0371, (byte)037, (byte)0211, (byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0214, (byte)044, (byte)0234, (byte)00, +(byte)00, (byte)00, (byte)0351, (byte)0137, (byte)0371, (byte)0377, (byte)0377, (byte)0200, (byte)0174, (byte)044, (byte)057, (byte)00, (byte)017, (byte)0204, (byte)0204, (byte)00, +(byte)00, (byte)00, (byte)0201, (byte)0114, (byte)044, (byte)0130, (byte)00, (byte)04, (byte)00, (byte)00, (byte)061, (byte)0311, (byte)0367, (byte)0134, (byte)044, (byte)0134, +(byte)0211, (byte)0306, (byte)017, (byte)0266, (byte)023, (byte)0307, (byte)0104, (byte)044, (byte)0114, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0376, (byte)0365, +(byte)0377, (byte)0377, (byte)0213, (byte)0124, (byte)044, (byte)0154, (byte)0203, (byte)0306, (byte)04, (byte)0213, (byte)00, (byte)0211, (byte)0321, (byte)0301, (byte)0371, (byte)037, +(byte)0211, (byte)020, (byte)0211, (byte)0110, (byte)04, (byte)017, (byte)0266, (byte)023, (byte)0351, (byte)0243, (byte)0365, (byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)0224, +(byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0204, (byte)044, (byte)0234, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0211, (byte)0224, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)043, (byte)0372, (byte)0377, (byte)0377, (byte)017, (byte)0276, (byte)0204, (byte)044, +(byte)0230, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0302, (byte)0301, (byte)0372, (byte)037, (byte)0211, (byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, +(byte)0211, (byte)0224, (byte)044, (byte)0234, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0332, (byte)0370, (byte)0377, (byte)0377, (byte)0277, (byte)0230, (byte)0202, (byte)0100, +(byte)00, (byte)0351, (byte)0124, (byte)0375, (byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)0140, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0351, (byte)0240, +(byte)0375, (byte)0377, (byte)0377, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0125, (byte)061, (byte)0322, (byte)0127, (byte)0126, (byte)0123, (byte)0201, (byte)0354, (byte)0274, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0234, (byte)044, (byte)0334, +(byte)00, (byte)00, (byte)00, (byte)0213, (byte)03, (byte)0211, (byte)0305, (byte)0203, (byte)0340, (byte)07, (byte)0203, (byte)0345, (byte)0317, (byte)0203, (byte)0370, (byte)04, +(byte)0211, (byte)053, (byte)017, (byte)0207, (byte)0252, (byte)05, (byte)00, (byte)00, (byte)0377, (byte)044, (byte)0205, (byte)070, (byte)0204, (byte)0100, (byte)00, (byte)0220, +(byte)0215, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0211, (byte)064, (byte)044, (byte)0350, (byte)0135, +(byte)040, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)0124, (byte)0213, (byte)0114, (byte)044, (byte)0120, (byte)0215, (byte)0124, (byte)010, (byte)0377, (byte)0335, +(byte)0234, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0204, (byte)044, (byte)0244, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0321, (byte)0211, +(byte)0224, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0301, (byte)0371, (byte)037, (byte)045, (byte)0377, (byte)0377, (byte)017, (byte)00, (byte)015, (byte)00, +(byte)00, (byte)0360, (byte)077, (byte)0211, (byte)0204, (byte)044, (byte)0244, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0310, (byte)0335, (byte)0204, (byte)044, (byte)0240, +(byte)00, (byte)00, (byte)00, (byte)061, (byte)0320, (byte)0330, (byte)045, (byte)0114, (byte)0204, (byte)0100, (byte)00, (byte)051, (byte)0310, (byte)055, (byte)065, (byte)04, +(byte)00, (byte)00, (byte)0205, (byte)0300, (byte)0334, (byte)015, (byte)0120, (byte)0204, (byte)0100, (byte)00, (byte)0334, (byte)05, (byte)0130, (byte)0204, (byte)0100, (byte)00, +(byte)0333, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0334, (byte)015, (byte)0140, (byte)0204, (byte)0100, (byte)00, (byte)0336, (byte)0301, (byte)0176, +(byte)026, (byte)0211, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0333, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0334, +(byte)015, (byte)0150, (byte)0204, (byte)0100, (byte)00, (byte)0336, (byte)0301, (byte)0331, (byte)0274, (byte)044, (byte)0216, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0267, +(byte)0204, (byte)044, (byte)0216, (byte)00, (byte)00, (byte)00, (byte)0264, (byte)014, (byte)0146, (byte)0211, (byte)0204, (byte)044, (byte)0214, (byte)00, (byte)00, (byte)00, +(byte)0331, (byte)0254, (byte)044, (byte)0214, (byte)00, (byte)00, (byte)00, (byte)0333, (byte)0124, (byte)044, (byte)070, (byte)0331, (byte)0254, (byte)044, (byte)0216, (byte)00, +(byte)00, (byte)00, (byte)0331, (byte)0356, (byte)0335, (byte)0351, (byte)0337, (byte)0340, (byte)0236, (byte)0166, (byte)032, (byte)0333, (byte)0104, (byte)044, (byte)070, (byte)0332, +(byte)0351, (byte)0337, (byte)0340, (byte)0236, (byte)017, (byte)0225, (byte)0300, (byte)017, (byte)0232, (byte)0301, (byte)011, (byte)0310, (byte)017, (byte)0266, (byte)0300, (byte)051, +(byte)0104, (byte)044, (byte)070, (byte)0353, (byte)02, (byte)0335, (byte)0330, (byte)0211, (byte)0320, (byte)0301, (byte)0340, (byte)024, (byte)03, (byte)0204, (byte)044, (byte)0244, +(byte)00, (byte)00, (byte)00, (byte)0203, (byte)0174, (byte)044, (byte)070, (byte)026, (byte)0307, (byte)0104, (byte)044, (byte)0154, (byte)01, (byte)00, (byte)00, (byte)00, +(byte)0211, (byte)0204, (byte)044, (byte)0244, (byte)00, (byte)00, (byte)00, (byte)0167, (byte)050, (byte)0213, (byte)0114, (byte)044, (byte)070, (byte)0307, (byte)0104, (byte)044, +(byte)0154, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0335, (byte)04, (byte)0315, (byte)040, (byte)0205, (byte)0100, (byte)00, (byte)0335, (byte)0204, (byte)044, (byte)0240, +(byte)00, (byte)00, (byte)00, (byte)0331, (byte)0311, (byte)0332, (byte)0351, (byte)0337, (byte)0340, (byte)0236, (byte)0166, (byte)05, (byte)0203, (byte)0154, (byte)044, (byte)070, +(byte)01, (byte)0213, (byte)0114, (byte)044, (byte)0120, (byte)0203, (byte)0351, (byte)01, (byte)051, (byte)0321, (byte)017, (byte)0210, (byte)0140, (byte)014, (byte)00, (byte)00, +(byte)0307, (byte)0104, (byte)044, (byte)0144, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)070, (byte)0205, (byte)0300, (byte)017, (byte)0210, +(byte)055, (byte)014, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)070, (byte)03, (byte)0114, (byte)044, (byte)070, (byte)0307, (byte)0104, (byte)044, (byte)0150, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0124, (byte)044, (byte)0160, (byte)0203, (byte)0274, (byte)044, (byte)0340, (byte)00, (byte)00, (byte)00, (byte)011, +(byte)017, (byte)0207, (byte)012, (byte)06, (byte)00, (byte)00, (byte)0203, (byte)0274, (byte)044, (byte)0340, (byte)00, (byte)00, (byte)00, (byte)05, (byte)017, (byte)0216, +(byte)061, (byte)026, (byte)00, (byte)00, (byte)0203, (byte)0254, (byte)044, (byte)0340, (byte)00, (byte)00, (byte)00, (byte)04, (byte)061, (byte)0300, (byte)0203, (byte)0274, +(byte)044, (byte)0340, (byte)00, (byte)00, (byte)00, (byte)03, (byte)017, (byte)0204, (byte)0225, (byte)012, (byte)00, (byte)00, (byte)017, (byte)0217, (byte)0320, (byte)014, +(byte)00, (byte)00, (byte)0203, (byte)0274, (byte)044, (byte)0340, (byte)00, (byte)00, (byte)00, (byte)02, (byte)017, (byte)0205, (byte)0333, (byte)05, (byte)00, (byte)00, +(byte)0307, (byte)0104, (byte)044, (byte)0164, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0224, (byte)044, (byte)0344, (byte)00, (byte)00, (byte)00, (byte)0205, +(byte)0322, (byte)017, (byte)0216, (byte)0126, (byte)017, (byte)00, (byte)00, (byte)0213, (byte)0224, (byte)044, (byte)0344, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0372, +(byte)016, (byte)017, (byte)0226, (byte)0104, (byte)044, (byte)0130, (byte)040, (byte)0104, (byte)044, (byte)0130, (byte)0211, (byte)0320, (byte)0211, (byte)0224, (byte)044, (byte)0254, +(byte)00, (byte)00, (byte)00, (byte)0211, (byte)0124, (byte)044, (byte)0170, (byte)0211, (byte)0124, (byte)044, (byte)0134, (byte)0211, (byte)0114, (byte)044, (byte)060, (byte)0211, +(byte)04, (byte)044, (byte)0350, (byte)051, (byte)035, (byte)00, (byte)00, (byte)0213, (byte)0114, (byte)044, (byte)060, (byte)0211, (byte)0302, (byte)0213, (byte)0204, (byte)044, +(byte)0320, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0100, (byte)014, (byte)0203, (byte)0350, (byte)01, (byte)0203, (byte)0370, (byte)00, (byte)0211, (byte)0104, (byte)044, +(byte)0140, (byte)0164, (byte)034, (byte)0175, (byte)010, (byte)0307, (byte)0104, (byte)044, (byte)0140, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0345, (byte)010, +(byte)0164, (byte)015, (byte)0270, (byte)03, (byte)00, (byte)00, (byte)00, (byte)053, (byte)0104, (byte)044, (byte)0140, (byte)0211, (byte)0104, (byte)044, (byte)0140, (byte)0200, +(byte)0174, (byte)044, (byte)0130, (byte)00, (byte)0164, (byte)014, (byte)0213, (byte)0104, (byte)044, (byte)0140, (byte)0205, (byte)0300, (byte)017, (byte)0204, (byte)0216, (byte)07, +(byte)00, (byte)00, (byte)0203, (byte)0174, (byte)044, (byte)070, (byte)016, (byte)017, (byte)0216, (byte)031, (byte)06, (byte)00, (byte)00, (byte)0213, (byte)0154, (byte)044, +(byte)0164, (byte)0205, (byte)0355, (byte)017, (byte)0205, (byte)0207, (byte)013, (byte)00, (byte)00, (byte)0213, (byte)0154, (byte)044, (byte)0150, (byte)0213, (byte)0174, (byte)044, +(byte)0144, (byte)0307, (byte)0104, (byte)044, (byte)0130, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0205, (byte)0311, (byte)0176, (byte)033, (byte)0205, (byte)0377, (byte)0176, +(byte)027, (byte)071, (byte)0371, (byte)0211, (byte)0310, (byte)0176, (byte)02, (byte)0211, (byte)0370, (byte)051, (byte)0104, (byte)044, (byte)0144, (byte)051, (byte)0307, (byte)051, +(byte)0301, (byte)0211, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)0150, (byte)0205, (byte)0300, (byte)0176, (byte)0136, +(byte)0213, (byte)0104, (byte)044, (byte)0164, (byte)0205, (byte)0300, (byte)017, (byte)0204, (byte)0221, (byte)016, (byte)00, (byte)00, (byte)0205, (byte)0355, (byte)0176, (byte)0102, +(byte)0213, (byte)0104, (byte)044, (byte)0130, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0114, (byte)044, (byte)060, (byte)0211, (byte)0154, (byte)044, (byte)04, +(byte)0211, (byte)04, (byte)044, (byte)0350, (byte)050, (byte)047, (byte)00, (byte)00, (byte)0211, (byte)0164, (byte)044, (byte)04, (byte)0211, (byte)0104, (byte)044, (byte)0130, +(byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0170, (byte)044, (byte)00, (byte)00, (byte)0211, (byte)064, (byte)044, (byte)0211, (byte)0104, (byte)044, (byte)064, (byte)0350, +(byte)0314, (byte)037, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)064, (byte)0213, (byte)0114, (byte)044, (byte)060, (byte)0213, (byte)0124, (byte)044, (byte)054, +(byte)0211, (byte)0306, (byte)0213, (byte)0104, (byte)044, (byte)0150, (byte)051, (byte)0350, (byte)017, (byte)0205, (byte)0142, (byte)017, (byte)00, (byte)00, (byte)0211, (byte)0124, +(byte)044, (byte)054, (byte)0211, (byte)0114, (byte)044, (byte)060, (byte)0307, (byte)04, (byte)044, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0236, (byte)045, +(byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0213, (byte)0114, (byte)044, (byte)060, (byte)0211, (byte)0104, (byte)044, (byte)0124, (byte)0213, (byte)0104, +(byte)044, (byte)0160, (byte)0205, (byte)0300, (byte)0176, (byte)040, (byte)0213, (byte)0104, (byte)044, (byte)0160, (byte)0213, (byte)0154, (byte)044, (byte)0124, (byte)0211, (byte)0104, +(byte)044, (byte)04, (byte)0211, (byte)054, (byte)044, (byte)0350, (byte)0266, (byte)046, (byte)00, (byte)00, (byte)0213, (byte)0114, (byte)044, (byte)060, (byte)0213, (byte)0124, +(byte)044, (byte)054, (byte)0211, (byte)0104, (byte)044, (byte)0124, (byte)0203, (byte)0274, (byte)044, (byte)0340, (byte)00, (byte)00, (byte)00, (byte)01, (byte)017, (byte)0216, +(byte)034, (byte)014, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)0104, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0154, (byte)044, (byte)0160, +(byte)0270, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0205, (byte)0355, (byte)0164, (byte)032, (byte)0213, (byte)0104, (byte)044, (byte)0124, (byte)0213, (byte)0154, (byte)044, +(byte)0124, (byte)0213, (byte)0100, (byte)020, (byte)017, (byte)0275, (byte)0154, (byte)0205, (byte)020, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0365, +(byte)037, (byte)051, (byte)0350, (byte)0215, (byte)054, (byte)010, (byte)061, (byte)0300, (byte)0203, (byte)0345, (byte)037, (byte)017, (byte)0205, (byte)057, (byte)012, (byte)00, +(byte)00, (byte)0203, (byte)0300, (byte)034, (byte)01, (byte)0104, (byte)044, (byte)0144, (byte)01, (byte)0307, (byte)01, (byte)0301, (byte)0211, (byte)0204, (byte)044, (byte)0254, +(byte)00, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)0144, (byte)0205, (byte)0300, (byte)0176, (byte)042, (byte)0213, (byte)0104, (byte)044, (byte)0144, (byte)0211, +(byte)064, (byte)044, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0114, (byte)044, (byte)060, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0350, (byte)0235, +(byte)042, (byte)00, (byte)00, (byte)0213, (byte)0114, (byte)044, (byte)060, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0306, (byte)0205, (byte)0311, (byte)0176, +(byte)034, (byte)0211, (byte)0114, (byte)044, (byte)04, (byte)0213, (byte)0114, (byte)044, (byte)0124, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)014, (byte)044, +(byte)0350, (byte)0173, (byte)042, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0104, (byte)044, (byte)0124, (byte)0213, (byte)0154, (byte)044, +(byte)0154, (byte)0205, (byte)0355, (byte)017, (byte)0205, (byte)0360, (byte)012, (byte)00, (byte)00, (byte)0213, (byte)0114, (byte)044, (byte)0134, (byte)0205, (byte)0311, (byte)017, +(byte)0216, (byte)0312, (byte)015, (byte)00, (byte)00, (byte)0213, (byte)0154, (byte)044, (byte)0164, (byte)0205, (byte)0355, (byte)017, (byte)0204, (byte)0231, (byte)013, (byte)00, +(byte)00, (byte)0205, (byte)0377, (byte)0176, (byte)034, (byte)0213, (byte)0104, (byte)044, (byte)0130, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0174, (byte)044, +(byte)04, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)067, (byte)042, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0104, (byte)044, +(byte)0130, (byte)0213, (byte)0114, (byte)044, (byte)0104, (byte)0213, (byte)0174, (byte)044, (byte)0130, (byte)0205, (byte)0311, (byte)017, (byte)0205, (byte)0237, (byte)021, (byte)00, +(byte)00, (byte)0211, (byte)0134, (byte)044, (byte)0144, (byte)0213, (byte)0134, (byte)044, (byte)0130, (byte)0307, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, +(byte)01, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0124, (byte)044, (byte)0120, (byte)0211, (byte)0124, (byte)044, (byte)074, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0213, (byte)0154, (byte)044, (byte)0124, (byte)0211, (byte)064, (byte)044, (byte)0211, (byte)0154, (byte)044, (byte)04, (byte)0350, (byte)0200, (byte)030, (byte)00, (byte)00, +(byte)0211, (byte)0134, (byte)044, (byte)04, (byte)0211, (byte)064, (byte)044, (byte)0203, (byte)0300, (byte)060, (byte)0211, (byte)0104, (byte)044, (byte)0104, (byte)0350, (byte)0135, +(byte)033, (byte)00, (byte)00, (byte)0211, (byte)054, (byte)044, (byte)0211, (byte)0174, (byte)044, (byte)04, (byte)0211, (byte)0104, (byte)044, (byte)0110, (byte)0350, (byte)055, +(byte)040, (byte)00, (byte)00, (byte)0211, (byte)0305, (byte)0270, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0125, (byte)014, (byte)0205, (byte)0322, (byte)017, +(byte)0204, (byte)0333, (byte)010, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)064, (byte)0211, (byte)054, (byte)044, (byte)0350, (byte)0377, (byte)035, (byte)00, +(byte)00, (byte)0213, (byte)0104, (byte)044, (byte)064, (byte)0205, (byte)0300, (byte)017, (byte)0205, (byte)0304, (byte)07, (byte)00, (byte)00, (byte)0213, (byte)0214, (byte)044, +(byte)0340, (byte)00, (byte)00, (byte)00, (byte)0205, (byte)0311, (byte)017, (byte)0205, (byte)0265, (byte)07, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)0140, +(byte)0205, (byte)0322, (byte)017, (byte)0205, (byte)0251, (byte)07, (byte)00, (byte)00, (byte)0213, (byte)0224, (byte)044, (byte)0330, (byte)00, (byte)00, (byte)00, (byte)0366, +(byte)02, (byte)01, (byte)017, (byte)0205, (byte)0231, (byte)07, (byte)00, (byte)00, (byte)0203, (byte)0174, (byte)044, (byte)0104, (byte)071, (byte)0211, (byte)0134, (byte)044, +(byte)0130, (byte)0213, (byte)0124, (byte)044, (byte)0120, (byte)0213, (byte)0154, (byte)044, (byte)074, (byte)0213, (byte)0134, (byte)044, (byte)0144, (byte)017, (byte)0204, (byte)041, +(byte)022, (byte)00, (byte)00, (byte)0203, (byte)0174, (byte)044, (byte)0110, (byte)00, (byte)017, (byte)0216, (byte)0175, (byte)022, (byte)00, (byte)00, (byte)0203, (byte)0104, +(byte)044, (byte)0104, (byte)01, (byte)0307, (byte)0104, (byte)044, (byte)0100, (byte)040, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0266, (byte)0114, (byte)044, (byte)0104, +(byte)0210, (byte)0115, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)070, (byte)0203, (byte)0305, (byte)01, (byte)0203, (byte)0300, (byte)01, (byte)0211, (byte)0104, (byte)044, +(byte)074, (byte)0213, (byte)0104, (byte)044, (byte)0124, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0157, (byte)035, (byte)00, +(byte)00, (byte)0205, (byte)0377, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0164, (byte)056, (byte)071, (byte)0174, (byte)044, (byte)0130, (byte)0164, (byte)030, (byte)0213, +(byte)0114, (byte)044, (byte)0130, (byte)0205, (byte)0311, (byte)0164, (byte)020, (byte)0213, (byte)0114, (byte)044, (byte)0130, (byte)0211, (byte)014, (byte)044, (byte)0350, (byte)0115, +(byte)035, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)074, (byte)044, (byte)0350, (byte)075, +(byte)035, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)064, (byte)044, (byte)0350, (byte)055, +(byte)035, (byte)00, (byte)00, (byte)0306, (byte)0105, (byte)00, (byte)00, (byte)0213, (byte)0204, (byte)044, (byte)0350, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0114, +(byte)044, (byte)074, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)010, (byte)0213, (byte)0204, (byte)044, (byte)0354, (byte)00, (byte)00, (byte)00, (byte)0205, +(byte)0300, (byte)0164, (byte)011, (byte)0213, (byte)0204, (byte)044, (byte)0354, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)050, (byte)0213, (byte)0114, (byte)044, (byte)0100, +(byte)011, (byte)013, (byte)0201, (byte)0304, (byte)0274, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0320, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0220, +(byte)0213, (byte)0204, (byte)044, (byte)0320, (byte)00, (byte)00, (byte)00, (byte)061, (byte)0322, (byte)0213, (byte)070, (byte)0270, (byte)040, (byte)00, (byte)00, (byte)00, +(byte)0203, (byte)0377, (byte)040, (byte)0176, (byte)011, (byte)01, (byte)0300, (byte)0203, (byte)0302, (byte)01, (byte)071, (byte)0307, (byte)0177, (byte)0367, (byte)0211, (byte)024, +(byte)044, (byte)0350, (byte)012, (byte)035, (byte)00, (byte)00, (byte)0213, (byte)0224, (byte)044, (byte)0330, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0306, (byte)0215, +(byte)0107, (byte)0377, (byte)0301, (byte)0370, (byte)05, (byte)0215, (byte)04, (byte)0202, (byte)0211, (byte)0104, (byte)044, (byte)070, (byte)0213, (byte)0204, (byte)044, (byte)0330, +(byte)00, (byte)00, (byte)00, (byte)0215, (byte)0116, (byte)024, (byte)0211, (byte)0114, (byte)044, (byte)0120, (byte)0211, (byte)0312, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0213, (byte)010, (byte)0203, (byte)0300, (byte)04, (byte)0211, (byte)012, (byte)0203, (byte)0302, (byte)04, (byte)071, (byte)0104, (byte)044, (byte)070, (byte)0163, (byte)0360, +(byte)053, (byte)0124, (byte)044, (byte)0120, (byte)0301, (byte)0372, (byte)02, (byte)0215, (byte)0104, (byte)0226, (byte)020, (byte)0353, (byte)05, (byte)0215, (byte)0166, (byte)00, +(byte)0211, (byte)0312, (byte)0203, (byte)070, (byte)00, (byte)0215, (byte)0112, (byte)0377, (byte)017, (byte)0205, (byte)062, (byte)01, (byte)00, (byte)00, (byte)0203, (byte)0350, +(byte)04, (byte)0205, (byte)0311, (byte)0165, (byte)0353, (byte)0307, (byte)0106, (byte)020, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)0120, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)064, (byte)044, (byte)0350, (byte)0264, (byte)045, (byte)00, (byte)00, (byte)0213, (byte)0224, (byte)044, (byte)0324, +(byte)00, (byte)00, (byte)00, (byte)0211, (byte)0124, (byte)044, (byte)0124, (byte)0205, (byte)0300, (byte)0211, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, +(byte)017, (byte)0205, (byte)0312, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0126, (byte)020, (byte)0205, (byte)0322, (byte)017, (byte)0205, (byte)0217, (byte)0371, (byte)0377, +(byte)0377, (byte)0211, (byte)064, (byte)044, (byte)0350, (byte)047, (byte)034, (byte)00, (byte)00, (byte)0213, (byte)0254, (byte)044, (byte)0350, (byte)00, (byte)00, (byte)00, +(byte)0213, (byte)0204, (byte)044, (byte)0354, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0105, (byte)00, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, +(byte)044, (byte)010, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0307, (byte)04, (byte)044, (byte)065, (byte)0204, (byte)0100, +(byte)00, (byte)0350, (byte)0272, (byte)030, (byte)00, (byte)00, (byte)0201, (byte)0304, (byte)0274, (byte)00, (byte)00, (byte)00, (byte)0133, (byte)0136, (byte)0137, (byte)0135, +(byte)0211, (byte)0302, (byte)0211, (byte)0320, (byte)0303, (byte)0213, (byte)0214, (byte)044, (byte)0350, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0254, (byte)044, (byte)0354, +(byte)00, (byte)00, (byte)00, (byte)0307, (byte)01, (byte)00, (byte)0200, (byte)0377, (byte)0377, (byte)0211, (byte)0154, (byte)044, (byte)04, (byte)0307, (byte)0104, (byte)044, +(byte)010, (byte)03, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)061, (byte)0204, (byte)0100, (byte)00, (byte)0350, (byte)0177, (byte)030, (byte)00, +(byte)00, (byte)0201, (byte)0304, (byte)0274, (byte)00, (byte)00, (byte)00, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0211, (byte)0302, (byte)0211, (byte)0320, (byte)0303, +(byte)0213, (byte)0204, (byte)044, (byte)0350, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0224, (byte)044, (byte)0354, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)00, +(byte)00, (byte)0200, (byte)0377, (byte)0377, (byte)0211, (byte)0124, (byte)044, (byte)04, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)010, (byte)00, (byte)00, (byte)00, +(byte)0307, (byte)04, (byte)044, (byte)050, (byte)0204, (byte)0100, (byte)00, (byte)0350, (byte)0104, (byte)030, (byte)00, (byte)00, (byte)0201, (byte)0304, (byte)0274, (byte)00, +(byte)00, (byte)00, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0211, (byte)0302, (byte)0211, (byte)0320, (byte)0303, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0211, (byte)064, (byte)044, (byte)0350, (byte)0264, (byte)043, (byte)00, (byte)00, (byte)0213, (byte)0204, (byte)044, (byte)0254, +(byte)00, (byte)00, (byte)00, (byte)0213, (byte)0214, (byte)044, (byte)0324, (byte)00, (byte)00, (byte)00, (byte)051, (byte)0104, (byte)044, (byte)0120, (byte)01, (byte)0301, +(byte)0211, (byte)0114, (byte)044, (byte)0124, (byte)0351, (byte)015, (byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)017, (byte)0275, (byte)0104, (byte)0226, (byte)020, (byte)0211, (byte)0126, (byte)020, (byte)0301, (byte)0342, (byte)05, (byte)0203, (byte)0360, (byte)037, (byte)051, (byte)0302, +(byte)0211, (byte)0124, (byte)044, (byte)0120, (byte)0351, (byte)0313, (byte)0376, (byte)0377, (byte)0377, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0307, (byte)0204, (byte)044, (byte)0340, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0274, (byte)044, (byte)0210, (byte)00, +(byte)00, (byte)00, (byte)0333, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0334, (byte)015, (byte)0160, (byte)0204, (byte)0100, (byte)00, (byte)0306, +(byte)0104, (byte)044, (byte)0130, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)0164, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)0170, +(byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)0134, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)0204, (byte)044, (byte)0344, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0331, (byte)0254, (byte)044, (byte)0214, (byte)00, (byte)00, (byte)00, (byte)0333, (byte)0234, +(byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0331, (byte)0254, (byte)044, (byte)0216, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0204, (byte)044, (byte)0210, +(byte)00, (byte)00, (byte)00, (byte)0203, (byte)0300, (byte)03, (byte)0211, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0371, (byte)0371, +(byte)0377, (byte)0377, (byte)0331, (byte)0300, (byte)0330, (byte)0301, (byte)0215, (byte)0254, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0154, (byte)044, +(byte)0130, (byte)0213, (byte)0154, (byte)044, (byte)0134, (byte)0330, (byte)05, (byte)0204, (byte)0204, (byte)0100, (byte)00, (byte)0335, (byte)0234, (byte)044, (byte)0230, (byte)00, +(byte)00, (byte)00, (byte)0201, (byte)0254, (byte)044, (byte)0234, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0100, (byte)03, (byte)0205, (byte)0355, (byte)017, +(byte)0205, (byte)023, (byte)012, (byte)00, (byte)00, (byte)0331, (byte)0300, (byte)0330, (byte)045, (byte)0210, (byte)0204, (byte)0100, (byte)00, (byte)0335, (byte)0224, (byte)044, +(byte)0240, (byte)00, (byte)00, (byte)00, (byte)0335, (byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0331, (byte)0311, (byte)0335, (byte)0341, (byte)0337, +(byte)0340, (byte)0236, (byte)017, (byte)0207, (byte)0147, (byte)013, (byte)00, (byte)00, (byte)0331, (byte)0311, (byte)0331, (byte)0340, (byte)0332, (byte)0351, (byte)0337, (byte)0340, +(byte)0236, (byte)017, (byte)0207, (byte)0104, (byte)06, (byte)00, (byte)00, (byte)0353, (byte)06, (byte)0335, (byte)0330, (byte)0353, (byte)02, (byte)0335, (byte)0330, (byte)0335, +(byte)0234, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0154, (byte)044, (byte)0124, (byte)0205, (byte)0355, (byte)017, (byte)0210, (byte)0333, (byte)0371, +(byte)0377, (byte)0377, (byte)0213, (byte)0104, (byte)044, (byte)0134, (byte)0213, (byte)0114, (byte)044, (byte)070, (byte)0205, (byte)0300, (byte)0335, (byte)04, (byte)0315, (byte)040, +(byte)0205, (byte)0100, (byte)00, (byte)017, (byte)0216, (byte)0313, (byte)010, (byte)00, (byte)00, (byte)0335, (byte)0204, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, +(byte)0215, (byte)0152, (byte)01, (byte)0331, (byte)0300, (byte)0330, (byte)0362, (byte)0331, (byte)0274, (byte)044, (byte)0216, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0204, +(byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)01, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0267, (byte)0204, (byte)044, (byte)0216, (byte)00, (byte)00, +(byte)00, (byte)0264, (byte)014, (byte)0146, (byte)0211, (byte)0204, (byte)044, (byte)0214, (byte)00, (byte)00, (byte)00, (byte)0331, (byte)0254, (byte)044, (byte)0214, (byte)00, +(byte)00, (byte)00, (byte)0333, (byte)0234, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0331, (byte)0254, (byte)044, (byte)0216, (byte)00, (byte)00, (byte)00, +(byte)0213, (byte)0214, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0214, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0101, +(byte)060, (byte)0333, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0330, (byte)0312, (byte)0336, (byte)0351, (byte)0335, (byte)0234, (byte)044, (byte)0240, +(byte)00, (byte)00, (byte)00, (byte)0210, (byte)02, (byte)0335, (byte)0204, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0331, (byte)0356, (byte)0331, (byte)0311, +(byte)0335, (byte)0341, (byte)0337, (byte)0340, (byte)0335, (byte)0331, (byte)0236, (byte)017, (byte)0204, (byte)041, (byte)016, (byte)00, (byte)00, (byte)0213, (byte)0204, (byte)044, +(byte)0254, (byte)00, (byte)00, (byte)00, (byte)071, (byte)0104, (byte)044, (byte)0134, (byte)017, (byte)0204, (byte)0127, (byte)07, (byte)00, (byte)00, (byte)0211, (byte)0327, +(byte)0331, (byte)05, (byte)0174, (byte)0204, (byte)0100, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)0134, (byte)0353, (byte)025, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0213, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)071, (byte)0302, (byte)017, (byte)0204, (byte)062, (byte)07, (byte)00, (byte)00, (byte)0331, +(byte)0311, (byte)0203, (byte)0300, (byte)01, (byte)0334, (byte)0311, (byte)0211, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)0331, (byte)0301, (byte)0330, +(byte)0363, (byte)0331, (byte)0254, (byte)044, (byte)0214, (byte)00, (byte)00, (byte)00, (byte)0333, (byte)0234, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0331, +(byte)0254, (byte)044, (byte)0216, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0214, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0214, (byte)044, +(byte)0210, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0101, (byte)060, (byte)0333, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0330, (byte)0313, +(byte)0336, (byte)0352, (byte)0331, (byte)0311, (byte)0335, (byte)0234, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0210, (byte)0105, (byte)00, (byte)0203, (byte)0305, +(byte)01, (byte)0335, (byte)0204, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0331, (byte)0356, (byte)0331, (byte)0311, (byte)0335, (byte)0341, (byte)0337, (byte)0340, +(byte)0335, (byte)0331, (byte)0236, (byte)0165, (byte)0213, (byte)0172, (byte)0211, (byte)0335, (byte)0330, (byte)0335, (byte)0330, (byte)0335, (byte)0330, (byte)0211, (byte)0372, (byte)0353, +(byte)04, (byte)0335, (byte)0330, (byte)0335, (byte)0330, (byte)0213, (byte)0114, (byte)044, (byte)070, (byte)0307, (byte)0104, (byte)044, (byte)0100, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)0203, (byte)0301, (byte)01, (byte)0211, (byte)0114, (byte)044, (byte)074, (byte)0351, (byte)0232, (byte)0373, (byte)0377, (byte)0377, (byte)0215, (byte)0166, (byte)00, +(byte)0213, (byte)0154, (byte)044, (byte)070, (byte)0205, (byte)0355, (byte)017, (byte)0205, (byte)0146, (byte)0370, (byte)0377, (byte)0377, (byte)0213, (byte)0104, (byte)044, (byte)0154, +(byte)0307, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0335, (byte)0204, (byte)044, (byte)0240, (byte)00, +(byte)00, (byte)00, (byte)0205, (byte)0300, (byte)017, (byte)0204, (byte)0370, (byte)0375, (byte)0377, (byte)0377, (byte)0213, (byte)0154, (byte)044, (byte)0134, (byte)0205, (byte)0355, +(byte)017, (byte)0216, (byte)0354, (byte)0375, (byte)0377, (byte)0377, (byte)0331, (byte)0350, (byte)0335, (byte)0351, (byte)0337, (byte)0340, (byte)0236, (byte)017, (byte)0206, (byte)0337, +(byte)0375, (byte)0377, (byte)0377, (byte)0213, (byte)0104, (byte)044, (byte)0170, (byte)0205, (byte)0300, (byte)017, (byte)0216, (byte)0100, (byte)0376, (byte)0377, (byte)0377, (byte)0331, +(byte)0300, (byte)0213, (byte)0104, (byte)044, (byte)0170, (byte)0330, (byte)015, (byte)0174, (byte)0204, (byte)0100, (byte)00, (byte)0307, (byte)0204, (byte)044, (byte)0200, (byte)00, +(byte)00, (byte)00, (byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0254, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0154, (byte)044, +(byte)0130, (byte)0211, (byte)0104, (byte)044, (byte)0174, (byte)0335, (byte)0224, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0330, (byte)015, (byte)0200, (byte)0204, +(byte)0100, (byte)00, (byte)0330, (byte)05, (byte)0204, (byte)0204, (byte)0100, (byte)00, (byte)0335, (byte)0234, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0201, +(byte)0254, (byte)044, (byte)0234, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0100, (byte)03, (byte)0213, (byte)0104, (byte)044, (byte)0164, (byte)0205, (byte)0300, +(byte)017, (byte)0204, (byte)0375, (byte)07, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)0174, (byte)0331, (byte)05, (byte)0214, (byte)0204, (byte)0100, (byte)00, +(byte)0213, (byte)0154, (byte)044, (byte)0130, (byte)0334, (byte)064, (byte)0305, (byte)030, (byte)0205, (byte)0100, (byte)00, (byte)0334, (byte)0244, (byte)044, (byte)0230, (byte)00, +(byte)00, (byte)00, (byte)0335, (byte)0135, (byte)00, (byte)0331, (byte)0274, (byte)044, (byte)0216, (byte)00, (byte)00, (byte)00, (byte)0335, (byte)0204, (byte)044, (byte)0240, +(byte)00, (byte)00, (byte)00, (byte)0215, (byte)0152, (byte)01, (byte)0307, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)017, (byte)0267, (byte)0204, (byte)044, (byte)0216, (byte)00, (byte)00, (byte)00, (byte)0264, (byte)014, (byte)0146, (byte)0211, (byte)0204, (byte)044, (byte)0214, +(byte)00, (byte)00, (byte)00, (byte)0331, (byte)0254, (byte)044, (byte)0214, (byte)00, (byte)00, (byte)00, (byte)0333, (byte)0224, (byte)044, (byte)0210, (byte)00, (byte)00, +(byte)00, (byte)0331, (byte)0254, (byte)044, (byte)0216, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0211, +(byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0300, (byte)060, (byte)0333, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, +(byte)0336, (byte)0351, (byte)0335, (byte)0234, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0210, (byte)02, (byte)0335, (byte)0204, (byte)044, (byte)0240, (byte)00, +(byte)00, (byte)00, (byte)0335, (byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0335, (byte)0341, (byte)0337, (byte)0340, (byte)0236, (byte)017, (byte)0207, +(byte)0357, (byte)00, (byte)00, (byte)00, (byte)0331, (byte)0311, (byte)0330, (byte)055, (byte)0170, (byte)0204, (byte)0100, (byte)00, (byte)0331, (byte)0311, (byte)0335, (byte)0341, +(byte)0337, (byte)0340, (byte)0335, (byte)0331, (byte)0236, (byte)017, (byte)0207, (byte)0107, (byte)011, (byte)00, (byte)00, (byte)0213, (byte)0204, (byte)044, (byte)0254, (byte)00, +(byte)00, (byte)00, (byte)0203, (byte)0300, (byte)01, (byte)073, (byte)0104, (byte)044, (byte)0174, (byte)0211, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, +(byte)017, (byte)0215, (byte)023, (byte)0375, (byte)0377, (byte)0377, (byte)0211, (byte)0214, (byte)044, (byte)0204, (byte)00, (byte)00, (byte)00, (byte)0331, (byte)05, (byte)0174, +(byte)0204, (byte)0100, (byte)00, (byte)0213, (byte)0114, (byte)044, (byte)0174, (byte)0211, (byte)0174, (byte)044, (byte)0174, (byte)0211, (byte)0327, (byte)0213, (byte)0124, (byte)044, +(byte)0130, (byte)0353, (byte)062, (byte)0331, (byte)0311, (byte)0330, (byte)055, (byte)0170, (byte)0204, (byte)0100, (byte)00, (byte)0331, (byte)0311, (byte)0335, (byte)0341, (byte)0337, +(byte)0340, (byte)0335, (byte)0331, (byte)0236, (byte)017, (byte)0207, (byte)0356, (byte)010, (byte)00, (byte)00, (byte)0213, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, +(byte)00, (byte)0203, (byte)0300, (byte)01, (byte)071, (byte)0310, (byte)0211, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0215, (byte)0130, +(byte)013, (byte)00, (byte)00, (byte)0331, (byte)0311, (byte)0334, (byte)0311, (byte)0331, (byte)0311, (byte)0335, (byte)032, (byte)0335, (byte)0204, (byte)044, (byte)0240, (byte)00, +(byte)00, (byte)00, (byte)0330, (byte)0311, (byte)0331, (byte)0254, (byte)044, (byte)0214, (byte)00, (byte)00, (byte)00, (byte)0333, (byte)0224, (byte)044, (byte)0210, (byte)00, +(byte)00, (byte)00, (byte)0331, (byte)0254, (byte)044, (byte)0216, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, +(byte)0211, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0300, (byte)060, (byte)0333, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, +(byte)00, (byte)0336, (byte)0351, (byte)0335, (byte)0234, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0210, (byte)0105, (byte)00, (byte)0203, (byte)0305, (byte)01, +(byte)0335, (byte)0204, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0335, (byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0335, (byte)0341, +(byte)0337, (byte)0340, (byte)0236, (byte)017, (byte)0206, (byte)0152, (byte)0377, (byte)0377, (byte)0377, (byte)0335, (byte)0330, (byte)0335, (byte)0331, (byte)0335, (byte)0331, (byte)0211, +(byte)0372, (byte)0353, (byte)04, (byte)0335, (byte)0330, (byte)0335, (byte)0331, (byte)0331, (byte)0356, (byte)0331, (byte)0311, (byte)0332, (byte)0351, (byte)0337, (byte)0340, (byte)0236, +(byte)017, (byte)0204, (byte)0170, (byte)07, (byte)00, (byte)00, (byte)0213, (byte)0204, (byte)044, (byte)0200, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, +(byte)0100, (byte)020, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0300, (byte)01, (byte)0211, (byte)0104, (byte)044, (byte)074, (byte)0351, (byte)066, (byte)0371, (byte)0377, +(byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)0164, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)070, (byte)03, (byte)0224, (byte)044, +(byte)0344, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0124, (byte)044, (byte)0170, (byte)0203, (byte)0302, (byte)01, (byte)0205, (byte)0322, (byte)0211, (byte)0124, (byte)044, +(byte)0134, (byte)0211, (byte)0224, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0216, (byte)0234, (byte)04, (byte)00, (byte)00, (byte)0203, (byte)0372, +(byte)016, (byte)017, (byte)0226, (byte)0104, (byte)044, (byte)0130, (byte)040, (byte)0104, (byte)044, (byte)0130, (byte)0211, (byte)0320, (byte)0351, (byte)0172, (byte)0365, (byte)0377, +(byte)0377, (byte)0203, (byte)0174, (byte)044, (byte)0110, (byte)00, (byte)017, (byte)0214, (byte)056, (byte)010, (byte)00, (byte)00, (byte)0165, (byte)033, (byte)0213, (byte)0254, +(byte)044, (byte)0340, (byte)00, (byte)00, (byte)00, (byte)0205, (byte)0355, (byte)0165, (byte)020, (byte)0213, (byte)0224, (byte)044, (byte)0330, (byte)00, (byte)00, (byte)00, +(byte)0366, (byte)02, (byte)01, (byte)017, (byte)0204, (byte)021, (byte)010, (byte)00, (byte)00, (byte)0205, (byte)0300, (byte)0176, (byte)0110, (byte)0203, (byte)0174, (byte)044, +(byte)0140, (byte)02, (byte)0164, (byte)0101, (byte)0203, (byte)0174, (byte)044, (byte)0104, (byte)071, (byte)0211, (byte)0134, (byte)044, (byte)0130, (byte)0213, (byte)0124, (byte)044, +(byte)0120, (byte)0213, (byte)0154, (byte)044, (byte)074, (byte)0213, (byte)0134, (byte)044, (byte)0144, (byte)017, (byte)0204, (byte)0125, (byte)012, (byte)00, (byte)00, (byte)017, +(byte)0266, (byte)0104, (byte)044, (byte)0104, (byte)0203, (byte)0300, (byte)01, (byte)0210, (byte)0105, (byte)00, (byte)0213, (byte)0114, (byte)044, (byte)070, (byte)0203, (byte)0305, +(byte)01, (byte)0307, (byte)0104, (byte)044, (byte)0100, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0301, (byte)01, (byte)0211, (byte)0114, (byte)044, (byte)074, +(byte)0351, (byte)074, (byte)0370, (byte)0377, (byte)0377, (byte)0213, (byte)0124, (byte)044, (byte)074, (byte)017, (byte)0266, (byte)0104, (byte)044, (byte)0104, (byte)0210, (byte)02, +(byte)0213, (byte)0114, (byte)044, (byte)0134, (byte)0203, (byte)0302, (byte)01, (byte)071, (byte)0214, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0124, +(byte)044, (byte)074, (byte)017, (byte)0204, (byte)0267, (byte)011, (byte)00, (byte)00, (byte)0211, (byte)064, (byte)044, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)012, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0260, (byte)033, (byte)00, (byte)00, +(byte)071, (byte)0373, (byte)0211, (byte)0306, (byte)017, (byte)0204, (byte)047, (byte)01, (byte)00, (byte)00, (byte)0211, (byte)034, (byte)044, (byte)0307, (byte)0104, (byte)044, +(byte)010, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)012, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0216, (byte)033, +(byte)00, (byte)00, (byte)0211, (byte)074, (byte)044, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, +(byte)04, (byte)012, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0303, (byte)0350, (byte)0164, (byte)033, (byte)00, (byte)00, (byte)0211, (byte)0307, (byte)0203, (byte)0204, +(byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)01, (byte)0351, (byte)0345, (byte)0366, (byte)0377, (byte)0377, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0211, (byte)0154, (byte)044, (byte)04, (byte)0211, (byte)064, (byte)044, (byte)0350, (byte)0124, (byte)022, (byte)00, (byte)00, (byte)0351, (byte)024, (byte)0367, (byte)0377, +(byte)0377, (byte)0213, (byte)0104, (byte)044, (byte)070, (byte)051, (byte)0104, (byte)044, (byte)0144, (byte)0307, (byte)0104, (byte)044, (byte)0160, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)0367, (byte)0330, (byte)0211, (byte)0104, (byte)044, (byte)0150, (byte)0351, (byte)0314, (byte)0363, (byte)0377, (byte)0377, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0367, (byte)0331, (byte)0211, (byte)0114, (byte)044, (byte)0144, (byte)061, (byte)0311, (byte)0351, (byte)0233, (byte)0363, (byte)0377, (byte)0377, (byte)0215, (byte)0166, (byte)00, +(byte)0260, (byte)040, (byte)051, (byte)0350, (byte)0203, (byte)0370, (byte)04, (byte)0211, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0216, +(byte)0331, (byte)011, (byte)00, (byte)00, (byte)0203, (byte)0350, (byte)04, (byte)0211, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)01, (byte)0307, +(byte)01, (byte)0301, (byte)01, (byte)0104, (byte)044, (byte)0144, (byte)0351, (byte)0270, (byte)0365, (byte)0377, (byte)0377, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0203, (byte)0274, (byte)044, (byte)0340, (byte)00, (byte)00, (byte)00, (byte)01, (byte)017, (byte)0216, (byte)0344, (byte)05, (byte)00, (byte)00, (byte)0213, (byte)0154, +(byte)044, (byte)0134, (byte)0203, (byte)0355, (byte)01, (byte)071, (byte)0154, (byte)044, (byte)0150, (byte)017, (byte)0214, (byte)046, (byte)04, (byte)00, (byte)00, (byte)0213, +(byte)0104, (byte)044, (byte)0150, (byte)051, (byte)0350, (byte)0211, (byte)0305, (byte)0213, (byte)0104, (byte)044, (byte)0134, (byte)0213, (byte)0174, (byte)044, (byte)0144, (byte)0205, +(byte)0300, (byte)0211, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)074, (byte)017, (byte)0210, (byte)0156, (byte)06, +(byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)074, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)01, (byte)0104, (byte)044, (byte)0144, (byte)01, (byte)0301, +(byte)0211, (byte)0114, (byte)044, (byte)060, (byte)0307, (byte)04, (byte)044, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0140, (byte)032, (byte)00, (byte)00, +(byte)0213, (byte)0114, (byte)044, (byte)060, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0104, (byte)044, (byte)0130, (byte)0351, (byte)030, (byte)0364, (byte)0377, +(byte)0377, (byte)0211, (byte)034, (byte)044, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, +(byte)012, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0147, (byte)032, (byte)00, (byte)00, (byte)0211, (byte)0303, (byte)0211, (byte)0307, (byte)0351, (byte)0354, (byte)0376, +(byte)0377, (byte)0377, (byte)0203, (byte)0274, (byte)044, (byte)0340, (byte)00, (byte)00, (byte)00, (byte)04, (byte)017, (byte)0204, (byte)0155, (byte)02, (byte)00, (byte)00, +(byte)0203, (byte)0274, (byte)044, (byte)0340, (byte)00, (byte)00, (byte)00, (byte)05, (byte)017, (byte)0205, (byte)0375, (byte)0370, (byte)0377, (byte)0377, (byte)0307, (byte)0104, +(byte)044, (byte)0164, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0236, (byte)0375, (byte)0377, (byte)0377, (byte)0335, (byte)0330, (byte)0353, (byte)02, (byte)0335, +(byte)0330, (byte)0307, (byte)0104, (byte)044, (byte)0124, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)0130, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)0213, (byte)0254, (byte)044, (byte)0344, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0174, (byte)044, (byte)0130, (byte)0307, (byte)0104, (byte)044, (byte)0100, +(byte)020, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)0130, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0367, (byte)0335, (byte)0211, (byte)0154, +(byte)044, (byte)074, (byte)0211, (byte)0325, (byte)0351, (byte)0110, (byte)0366, (byte)0377, (byte)0377, (byte)0213, (byte)0154, (byte)044, (byte)0124, (byte)0211, (byte)0124, (byte)044, +(byte)054, (byte)0211, (byte)064, (byte)044, (byte)0211, (byte)0154, (byte)044, (byte)04, (byte)0350, (byte)0343, (byte)020, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, +(byte)054, (byte)0205, (byte)0300, (byte)017, (byte)0211, (byte)0360, (byte)0364, (byte)0377, (byte)0377, (byte)0203, (byte)0154, (byte)044, (byte)070, (byte)01, (byte)0211, (byte)064, +(byte)044, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)012, (byte)00, (byte)00, +(byte)00, (byte)0350, (byte)0272, (byte)031, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0203, (byte)0174, (byte)044, (byte)0164, (byte)00, (byte)0211, +(byte)0306, (byte)0213, (byte)0104, (byte)044, (byte)0170, (byte)0211, (byte)0104, (byte)044, (byte)0134, (byte)017, (byte)0204, (byte)0272, (byte)0364, (byte)0377, (byte)0377, (byte)0213, +(byte)0114, (byte)044, (byte)0130, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)012, +(byte)00, (byte)00, (byte)00, (byte)0211, (byte)014, (byte)044, (byte)0350, (byte)0205, (byte)031, (byte)00, (byte)00, (byte)0213, (byte)0154, (byte)044, (byte)0170, (byte)0213, +(byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0154, (byte)044, (byte)0134, (byte)0211, (byte)0104, (byte)044, (byte)0130, (byte)0351, (byte)0211, (byte)0364, (byte)0377, (byte)0377, +(byte)0203, (byte)0174, (byte)044, (byte)0120, (byte)01, (byte)017, (byte)0205, (byte)0331, (byte)0363, (byte)0377, (byte)0377, (byte)0213, (byte)0254, (byte)044, (byte)0320, (byte)00, +(byte)00, (byte)00, (byte)0213, (byte)0105, (byte)04, (byte)0203, (byte)0300, (byte)01, (byte)071, (byte)0204, (byte)044, (byte)0324, (byte)00, (byte)00, (byte)00, (byte)017, +(byte)0216, (byte)0277, (byte)0363, (byte)0377, (byte)0377, (byte)0203, (byte)0104, (byte)044, (byte)0144, (byte)01, (byte)0203, (byte)0301, (byte)01, (byte)0307, (byte)0104, (byte)044, +(byte)0104, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0262, (byte)0363, (byte)0377, (byte)0377, (byte)0211, (byte)0134, (byte)044, (byte)0114, (byte)0211, (byte)0325, +(byte)0213, (byte)0174, (byte)044, (byte)0124, (byte)0307, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0213, +(byte)0134, (byte)044, (byte)0134, (byte)0211, (byte)0124, (byte)044, (byte)0100, (byte)0353, (byte)051, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0211, (byte)064, (byte)044, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)012, +(byte)00, (byte)00, (byte)00, (byte)0350, (byte)0370, (byte)030, (byte)00, (byte)00, (byte)0203, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)01, + }; +} diff --git a/src/main/java/io/soluble/pjb/bridge/LauncherWindows3.java b/src/main/java/io/soluble/pjb/bridge/LauncherWindows3.java new file mode 100644 index 0000000..d066085 --- /dev/null +++ b/src/main/java/io/soluble/pjb/bridge/LauncherWindows3.java @@ -0,0 +1,517 @@ +package io.soluble.pjb.bridge; +public class LauncherWindows3 { + public static final byte[] bytes = new byte[]{ +(byte)0211, (byte)0306, (byte)0211, (byte)0174, (byte)044, (byte)04, (byte)0211, (byte)064, (byte)044, (byte)0350, (byte)0362, (byte)014, (byte)00, (byte)00, (byte)0203, (byte)0300, +(byte)060, (byte)0210, (byte)0105, (byte)00, (byte)0203, (byte)0305, (byte)01, (byte)073, (byte)0234, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)0177, (byte)0300, +(byte)0213, (byte)0124, (byte)044, (byte)0100, (byte)0213, (byte)0134, (byte)044, (byte)0114, (byte)0213, (byte)0174, (byte)044, (byte)0130, (byte)0211, (byte)0104, (byte)044, (byte)0104, +(byte)0307, (byte)0104, (byte)044, (byte)0130, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)0140, (byte)0205, (byte)0300, (byte)017, (byte)0204, +(byte)075, (byte)05, (byte)00, (byte)00, (byte)0203, (byte)0174, (byte)044, (byte)0140, (byte)02, (byte)017, (byte)0204, (byte)0162, (byte)05, (byte)00, (byte)00, (byte)0203, +(byte)0176, (byte)020, (byte)01, (byte)0177, (byte)015, (byte)0351, (byte)0232, (byte)06, (byte)00, (byte)00, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0211, (byte)0305, (byte)017, (byte)0266, (byte)0115, (byte)0377, (byte)0215, (byte)0105, (byte)0377, (byte)0200, (byte)0371, (byte)071, (byte)017, (byte)0205, (byte)0316, (byte)05, +(byte)00, (byte)00, (byte)071, (byte)0302, (byte)0165, (byte)0352, (byte)0306, (byte)02, (byte)061, (byte)0213, (byte)0114, (byte)044, (byte)070, (byte)0307, (byte)0104, (byte)044, +(byte)0100, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0301, (byte)02, (byte)0211, (byte)0114, (byte)044, (byte)074, (byte)0351, (byte)0260, (byte)0364, (byte)0377, +(byte)0377, (byte)0335, (byte)0331, (byte)0211, (byte)0372, (byte)0213, (byte)0104, (byte)044, (byte)0140, (byte)0205, (byte)0300, (byte)017, (byte)0204, (byte)0254, (byte)03, (byte)00, +(byte)00, (byte)0335, (byte)0330, (byte)0335, (byte)0330, (byte)0203, (byte)0174, (byte)044, (byte)0140, (byte)01, (byte)0164, (byte)044, (byte)0213, (byte)0104, (byte)044, (byte)070, +(byte)0307, (byte)0104, (byte)044, (byte)0100, (byte)020, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0300, (byte)01, (byte)0211, (byte)0104, (byte)044, (byte)074, (byte)0351, +(byte)0303, (byte)0364, (byte)0377, (byte)0377, (byte)0211, (byte)0305, (byte)0353, (byte)010, (byte)0335, (byte)0330, (byte)0335, (byte)0330, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)017, (byte)0266, (byte)0115, (byte)0377, (byte)0215, (byte)0105, (byte)0377, (byte)0200, (byte)0371, (byte)071, (byte)017, (byte)0205, (byte)0175, (byte)05, (byte)00, (byte)00, +(byte)071, (byte)0302, (byte)0165, (byte)0340, (byte)0203, (byte)0104, (byte)044, (byte)070, (byte)01, (byte)0211, (byte)0320, (byte)0271, (byte)061, (byte)00, (byte)00, (byte)00, +(byte)0306, (byte)02, (byte)060, (byte)0210, (byte)010, (byte)0213, (byte)0104, (byte)044, (byte)070, (byte)0307, (byte)0104, (byte)044, (byte)0100, (byte)040, (byte)00, (byte)00, +(byte)00, (byte)0203, (byte)0300, (byte)01, (byte)0211, (byte)0104, (byte)044, (byte)074, (byte)0351, (byte)0172, (byte)0364, (byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, +(byte)0164, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0276, (byte)0360, (byte)0377, (byte)0377, (byte)0203, (byte)0174, (byte)044, (byte)0134, (byte)016, (byte)0307, +(byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)01, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0226, (byte)0104, (byte)044, (byte)0130, (byte)040, +(byte)0104, (byte)044, (byte)0130, (byte)0270, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0316, (byte)0360, (byte)0377, (byte)0377, (byte)0307, (byte)0204, (byte)044, +(byte)0344, (byte)00, (byte)00, (byte)00, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0232, (byte)0360, (byte)0377, (byte)0377, (byte)0213, (byte)0154, (byte)044, +(byte)0150, (byte)0211, (byte)064, (byte)044, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0114, (byte)044, (byte)060, (byte)0211, (byte)0154, (byte)044, (byte)04, +(byte)0350, (byte)0233, (byte)030, (byte)00, (byte)00, (byte)0213, (byte)0114, (byte)044, (byte)060, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0306, (byte)0351, +(byte)0232, (byte)0361, (byte)0377, (byte)0377, (byte)0213, (byte)0254, (byte)044, (byte)0344, (byte)00, (byte)00, (byte)00, (byte)0205, (byte)0355, (byte)017, (byte)0211, (byte)046, +(byte)0367, (byte)0377, (byte)0377, (byte)0213, (byte)0174, (byte)044, (byte)0134, (byte)0205, (byte)0377, (byte)017, (byte)0205, (byte)060, (byte)0375, (byte)0377, (byte)0377, (byte)0330, +(byte)015, (byte)0210, (byte)0204, (byte)0100, (byte)00, (byte)0335, (byte)0204, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0331, (byte)0311, (byte)0332, (byte)0351, +(byte)0337, (byte)0340, (byte)0236, (byte)017, (byte)0203, (byte)030, (byte)0375, (byte)0377, (byte)0377, (byte)0203, (byte)0301, (byte)02, (byte)0211, (byte)0114, (byte)044, (byte)074, +(byte)0307, (byte)0104, (byte)044, (byte)0124, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)0130, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0306, (byte)02, (byte)061, (byte)0215, (byte)0152, (byte)01, (byte)0213, (byte)0174, (byte)044, (byte)0130, (byte)0307, (byte)0104, (byte)044, (byte)0100, (byte)040, (byte)00, +(byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)0130, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0142, (byte)0363, (byte)0377, (byte)0377, (byte)0203, +(byte)0274, (byte)044, (byte)0340, (byte)00, (byte)00, (byte)00, (byte)02, (byte)017, (byte)0216, (byte)050, (byte)0362, (byte)0377, (byte)0377, (byte)0213, (byte)0104, (byte)044, +(byte)0134, (byte)0205, (byte)0300, (byte)017, (byte)0205, (byte)0330, (byte)0374, (byte)0377, (byte)0377, (byte)0213, (byte)0104, (byte)044, (byte)0124, (byte)0211, (byte)0124, (byte)044, +(byte)054, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)05, (byte)00, (byte)00, +(byte)00, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0327, (byte)026, (byte)00, (byte)00, (byte)0211, (byte)064, (byte)044, (byte)0211, (byte)0104, (byte)044, (byte)0124, +(byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0350, (byte)0307, (byte)015, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0205, (byte)0300, (byte)017, +(byte)0216, (byte)0234, (byte)0374, (byte)0377, (byte)0377, (byte)0213, (byte)0114, (byte)044, (byte)070, (byte)0203, (byte)0301, (byte)02, (byte)0211, (byte)0114, (byte)044, (byte)074, +(byte)0351, (byte)0173, (byte)0377, (byte)0377, (byte)0377, (byte)053, (byte)0154, (byte)044, (byte)0150, (byte)01, (byte)0154, (byte)044, (byte)0160, (byte)01, (byte)0154, (byte)044, +(byte)0150, (byte)061, (byte)0355, (byte)0351, (byte)0317, (byte)0373, (byte)0377, (byte)0377, (byte)0213, (byte)0154, (byte)044, (byte)0134, (byte)0307, (byte)0204, (byte)044, (byte)0200, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0154, (byte)044, (byte)0174, (byte)0351, (byte)032, (byte)0370, (byte)0377, (byte)0377, +(byte)0211, (byte)064, (byte)044, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0114, (byte)044, (byte)060, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0350, +(byte)0174, (byte)027, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0213, (byte)0114, (byte)044, (byte)060, (byte)0211, (byte)0306, (byte)0351, (byte)0173, +(byte)0360, (byte)0377, (byte)0377, (byte)0213, (byte)0154, (byte)044, (byte)0174, (byte)0335, (byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0104, +(byte)044, (byte)0130, (byte)0334, (byte)014, (byte)0355, (byte)030, (byte)0205, (byte)0100, (byte)00, (byte)0211, (byte)0325, (byte)0335, (byte)030, (byte)0331, (byte)0274, (byte)044, +(byte)0216, (byte)00, (byte)00, (byte)00, (byte)0331, (byte)05, (byte)0174, (byte)0204, (byte)0100, (byte)00, (byte)0211, (byte)0124, (byte)044, (byte)0130, (byte)0213, (byte)0124, +(byte)044, (byte)0174, (byte)0307, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)01, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0267, (byte)0204, +(byte)044, (byte)0216, (byte)00, (byte)00, (byte)00, (byte)0264, (byte)014, (byte)0146, (byte)0211, (byte)0204, (byte)044, (byte)0214, (byte)00, (byte)00, (byte)00, (byte)0353, +(byte)032, (byte)0335, (byte)0204, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0300, (byte)01, (byte)0330, (byte)0311, (byte)0211, (byte)0204, (byte)044, +(byte)0254, (byte)00, (byte)00, (byte)00, (byte)0335, (byte)0234, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0335, (byte)0204, (byte)044, (byte)0240, (byte)00, +(byte)00, (byte)00, (byte)0331, (byte)0254, (byte)044, (byte)0214, (byte)00, (byte)00, (byte)00, (byte)0333, (byte)0224, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, +(byte)0331, (byte)0254, (byte)044, (byte)0216, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0205, (byte)0300, +(byte)0164, (byte)036, (byte)0211, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, (byte)0333, (byte)0204, (byte)044, (byte)0210, (byte)00, (byte)00, (byte)00, +(byte)0336, (byte)0351, (byte)0335, (byte)0234, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0353, (byte)07, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0335, (byte)0330, (byte)0203, (byte)0300, (byte)060, (byte)0210, (byte)0105, (byte)00, (byte)0213, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)0203, +(byte)0305, (byte)01, (byte)071, (byte)0320, (byte)0165, (byte)0213, (byte)0335, (byte)0330, (byte)0335, (byte)0204, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0335, +(byte)0204, (byte)044, (byte)0230, (byte)00, (byte)00, (byte)00, (byte)0331, (byte)05, (byte)0214, (byte)0204, (byte)0100, (byte)00, (byte)0331, (byte)0301, (byte)0213, (byte)0124, +(byte)044, (byte)0130, (byte)0330, (byte)0301, (byte)0331, (byte)0313, (byte)0335, (byte)0343, (byte)0337, (byte)0340, (byte)0335, (byte)0333, (byte)0236, (byte)017, (byte)0207, (byte)025, +(byte)01, (byte)00, (byte)00, (byte)0336, (byte)0341, (byte)0335, (byte)0351, (byte)0337, (byte)0340, (byte)0236, (byte)017, (byte)0206, (byte)0355, (byte)0364, (byte)0377, (byte)0377, +(byte)0335, (byte)0331, (byte)0353, (byte)02, (byte)0211, (byte)0305, (byte)0200, (byte)0175, (byte)0377, (byte)060, (byte)0215, (byte)0105, (byte)0377, (byte)0164, (byte)0365, (byte)0331, +(byte)0356, (byte)0331, (byte)0311, (byte)0332, (byte)0351, (byte)0337, (byte)0340, (byte)0236, (byte)017, (byte)0205, (byte)0210, (byte)0370, (byte)0377, (byte)0377, (byte)017, (byte)0212, +(byte)0202, (byte)0370, (byte)0377, (byte)0377, (byte)0213, (byte)0214, (byte)044, (byte)0200, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)0100, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)0203, (byte)0301, (byte)01, (byte)0211, (byte)0114, (byte)044, (byte)074, (byte)0351, (byte)0270, (byte)0361, (byte)0377, (byte)0377, (byte)0335, +(byte)0330, (byte)0335, (byte)0330, (byte)0335, (byte)0330, (byte)0307, (byte)0104, (byte)044, (byte)074, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, +(byte)0124, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)0130, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0316, (byte)0375, +(byte)0377, (byte)0377, (byte)0213, (byte)0254, (byte)044, (byte)0320, (byte)00, (byte)00, (byte)00, (byte)053, (byte)0174, (byte)044, (byte)0120, (byte)0213, (byte)0155, (byte)04, +(byte)0215, (byte)0107, (byte)01, (byte)0211, (byte)0104, (byte)044, (byte)074, (byte)0211, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0154, +(byte)044, (byte)0130, (byte)0213, (byte)0154, (byte)044, (byte)0124, (byte)0213, (byte)0104, (byte)044, (byte)0130, (byte)051, (byte)0375, (byte)0213, (byte)0174, (byte)044, (byte)0144, +(byte)0211, (byte)0154, (byte)044, (byte)0174, (byte)0213, (byte)0154, (byte)044, (byte)0150, (byte)071, (byte)0104, (byte)044, (byte)0174, (byte)017, (byte)0215, (byte)020, (byte)0372, +(byte)0377, (byte)0377, (byte)0213, (byte)0104, (byte)044, (byte)0124, (byte)053, (byte)0104, (byte)044, (byte)0130, (byte)0203, (byte)0300, (byte)01, (byte)0211, (byte)0104, (byte)044, +(byte)074, (byte)0211, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0365, (byte)0371, (byte)0377, (byte)0377, (byte)0330, (byte)0300, (byte)0335, +(byte)0224, (byte)044, (byte)0240, (byte)00, (byte)00, (byte)00, (byte)0335, (byte)0341, (byte)0337, (byte)0340, (byte)0236, (byte)017, (byte)0207, (byte)0147, (byte)0374, (byte)0377, +(byte)0377, (byte)0331, (byte)0311, (byte)0332, (byte)0351, (byte)0337, (byte)0340, (byte)0236, (byte)0172, (byte)06, (byte)017, (byte)0204, (byte)0320, (byte)02, (byte)00, (byte)00, +(byte)0213, (byte)0114, (byte)044, (byte)070, (byte)0307, (byte)0104, (byte)044, (byte)0100, (byte)020, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0301, (byte)01, (byte)0211, +(byte)0114, (byte)044, (byte)074, (byte)0351, (byte)0377, (byte)0360, (byte)0377, (byte)0377, (byte)0335, (byte)0330, (byte)0335, (byte)0330, (byte)0335, (byte)0330, (byte)0211, (byte)0372, +(byte)0353, (byte)016, (byte)0335, (byte)0330, (byte)0335, (byte)0330, (byte)0353, (byte)010, (byte)0335, (byte)0330, (byte)0335, (byte)0330, (byte)0335, (byte)0330, (byte)0335, (byte)0330, +(byte)0213, (byte)0214, (byte)044, (byte)0200, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0114, (byte)044, (byte)070, (byte)0351, (byte)040, (byte)0374, (byte)0377, (byte)0377, +(byte)051, (byte)0307, (byte)0307, (byte)0204, (byte)044, (byte)0254, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, +(byte)074, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0170, (byte)0371, (byte)0377, (byte)0377, (byte)0213, (byte)0114, (byte)044, (byte)0140, (byte)0211, (byte)0134, +(byte)044, (byte)0130, (byte)0213, (byte)0124, (byte)044, (byte)0120, (byte)0213, (byte)0154, (byte)044, (byte)074, (byte)0213, (byte)0134, (byte)044, (byte)0144, (byte)0205, (byte)0311, +(byte)017, (byte)0204, (byte)0211, (byte)01, (byte)00, (byte)00, (byte)0203, (byte)0176, (byte)020, (byte)01, (byte)017, (byte)0216, (byte)0165, (byte)01, (byte)00, (byte)00, +(byte)0203, (byte)0174, (byte)044, (byte)0140, (byte)02, (byte)017, (byte)0204, (byte)0327, (byte)01, (byte)00, (byte)00, (byte)0211, (byte)0134, (byte)044, (byte)074, (byte)0213, +(byte)0134, (byte)044, (byte)0124, (byte)0211, (byte)0124, (byte)044, (byte)0114, (byte)0353, (byte)064, (byte)0211, (byte)064, (byte)044, (byte)0203, (byte)0305, (byte)01, (byte)0307, +(byte)0104, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)012, (byte)00, (byte)00, (byte)00, (byte)0350, +(byte)0314, (byte)023, (byte)00, (byte)00, (byte)0211, (byte)0134, (byte)044, (byte)04, (byte)0211, (byte)0306, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0316, (byte)07, +(byte)00, (byte)00, (byte)0213, (byte)0174, (byte)044, (byte)0100, (byte)0203, (byte)0300, (byte)060, (byte)0211, (byte)0104, (byte)044, (byte)0104, (byte)0211, (byte)0174, (byte)044, +(byte)04, (byte)0211, (byte)034, (byte)044, (byte)0350, (byte)0247, (byte)012, (byte)00, (byte)00, (byte)0205, (byte)0300, (byte)017, (byte)0216, (byte)0320, (byte)01, (byte)00, +(byte)00, (byte)017, (byte)0266, (byte)0114, (byte)044, (byte)0104, (byte)0210, (byte)0115, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)012, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)074, (byte)044, (byte)0350, (byte)0177, (byte)023, (byte)00, +(byte)00, (byte)071, (byte)0174, (byte)044, (byte)0130, (byte)0211, (byte)0104, (byte)044, (byte)0100, (byte)0165, (byte)0216, (byte)0211, (byte)0104, (byte)044, (byte)0130, (byte)0353, +(byte)0210, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)064, (byte)044, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)01, (byte)00, (byte)00, (byte)00, +(byte)0350, (byte)0333, (byte)020, (byte)00, (byte)00, (byte)0211, (byte)0306, (byte)0213, (byte)0104, (byte)044, (byte)0124, (byte)0211, (byte)064, (byte)044, (byte)0211, (byte)0104, +(byte)044, (byte)04, (byte)0350, (byte)0111, (byte)012, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0203, (byte)0370, (byte)00, (byte)017, (byte)0217, +(byte)0256, (byte)0372, (byte)0377, (byte)0377, (byte)0165, (byte)013, (byte)0366, (byte)0104, (byte)044, (byte)0104, (byte)01, (byte)017, (byte)0205, (byte)0241, (byte)0372, (byte)0377, +(byte)0377, (byte)0203, (byte)0176, (byte)020, (byte)01, (byte)017, (byte)0216, (byte)0277, (byte)01, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)0100, (byte)020, +(byte)00, (byte)00, (byte)00, (byte)0353, (byte)02, (byte)0211, (byte)0305, (byte)0200, (byte)0175, (byte)0377, (byte)060, (byte)0215, (byte)0105, (byte)0377, (byte)0164, (byte)0365, +(byte)0213, (byte)0114, (byte)044, (byte)070, (byte)0203, (byte)0301, (byte)01, (byte)0211, (byte)0114, (byte)044, (byte)074, (byte)0351, (byte)0121, (byte)0357, (byte)0377, (byte)0377, +(byte)0213, (byte)0107, (byte)04, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)01, (byte)015, (byte)00, (byte)00, (byte)0213, +(byte)0114, (byte)044, (byte)0130, (byte)0211, (byte)0307, (byte)0215, (byte)0150, (byte)014, (byte)0213, (byte)0101, (byte)020, (byte)0203, (byte)0301, (byte)014, (byte)0211, (byte)0114, +(byte)044, (byte)04, (byte)0211, (byte)054, (byte)044, (byte)0215, (byte)04, (byte)0205, (byte)010, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)010, +(byte)0350, (byte)0273, (byte)026, (byte)00, (byte)00, (byte)0211, (byte)074, (byte)044, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)01, (byte)00, (byte)00, (byte)00, +(byte)0350, (byte)073, (byte)020, (byte)00, (byte)00, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0307, (byte)0351, (byte)021, (byte)0356, (byte)0377, (byte)0377, +(byte)0203, (byte)0301, (byte)01, (byte)0210, (byte)010, (byte)0213, (byte)0104, (byte)044, (byte)070, (byte)0307, (byte)0104, (byte)044, (byte)0100, (byte)040, (byte)00, (byte)00, +(byte)00, (byte)0203, (byte)0300, (byte)01, (byte)0211, (byte)0104, (byte)044, (byte)074, (byte)0351, (byte)0344, (byte)0356, (byte)0377, (byte)0377, (byte)0203, (byte)0301, (byte)01, +(byte)0351, (byte)0216, (byte)0372, (byte)0377, (byte)0377, (byte)0203, (byte)0176, (byte)024, (byte)00, (byte)017, (byte)0205, (byte)0201, (byte)0376, (byte)0377, (byte)0377, (byte)0205, +(byte)0300, (byte)0307, (byte)0104, (byte)044, (byte)0100, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0176, (byte)0107, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)0211, +(byte)064, (byte)044, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0341, (byte)017, (byte)00, (byte)00, (byte)0211, +(byte)0306, (byte)0213, (byte)0104, (byte)044, (byte)0124, (byte)0211, (byte)064, (byte)044, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0350, (byte)0117, (byte)011, (byte)00, +(byte)00, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0203, (byte)0370, (byte)00, (byte)017, (byte)0216, (byte)0267, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0174, +(byte)044, (byte)0104, (byte)071, (byte)0164, (byte)0177, (byte)0203, (byte)0104, (byte)044, (byte)0104, (byte)01, (byte)0307, (byte)0104, (byte)044, (byte)0100, (byte)040, (byte)00, +(byte)00, (byte)00, (byte)0203, (byte)0176, (byte)020, (byte)01, (byte)0177, (byte)012, (byte)0203, (byte)0176, (byte)024, (byte)00, (byte)017, (byte)0204, (byte)0131, (byte)0356, +(byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)0100, (byte)020, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0114, (byte)0356, (byte)0377, (byte)0377, (byte)0211, +(byte)0134, (byte)044, (byte)0130, (byte)0213, (byte)0124, (byte)044, (byte)0120, (byte)0213, (byte)0154, (byte)044, (byte)074, (byte)0213, (byte)0134, (byte)044, (byte)0144, (byte)0351, +(byte)0104, (byte)0371, (byte)0377, (byte)0377, (byte)0203, (byte)0176, (byte)024, (byte)00, (byte)017, (byte)0205, (byte)0144, (byte)0371, (byte)0377, (byte)0377, (byte)0307, (byte)0104, +(byte)044, (byte)0100, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0314, (byte)0376, (byte)0377, (byte)0377, (byte)0335, (byte)0330, (byte)0335, (byte)0330, (byte)0211, +(byte)0372, (byte)0213, (byte)0214, (byte)044, (byte)0204, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0174, (byte)044, (byte)0174, (byte)0351, (byte)0136, (byte)0361, (byte)0377, +(byte)0377, (byte)0203, (byte)0174, (byte)044, (byte)0104, (byte)071, (byte)0213, (byte)0124, (byte)044, (byte)0114, (byte)0213, (byte)0134, (byte)044, (byte)074, (byte)017, (byte)0205, +(byte)0352, (byte)0355, (byte)0377, (byte)0377, (byte)0306, (byte)0105, (byte)00, (byte)071, (byte)0203, (byte)0305, (byte)01, (byte)0351, (byte)042, (byte)0371, (byte)0377, (byte)0377, +(byte)0200, (byte)0341, (byte)01, (byte)017, (byte)0205, (byte)0207, (byte)0371, (byte)0377, (byte)0377, (byte)0351, (byte)0136, (byte)0371, (byte)0377, (byte)0377, (byte)0146, (byte)0220, +(byte)017, (byte)0213, (byte)0173, (byte)0362, (byte)0377, (byte)0377, (byte)0215, (byte)0166, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0351, (byte)0310, (byte)0361, (byte)0377, (byte)0377, (byte)0215, (byte)0164, (byte)046, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0165, (byte)013, (byte)0366, (byte)0104, (byte)044, (byte)0104, (byte)01, (byte)017, (byte)0205, (byte)061, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, +(byte)0100, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)070, (byte)0377, (byte)0377, (byte)0377, (byte)0203, (byte)0176, (byte)024, (byte)00, (byte)0146, (byte)0220, +(byte)017, (byte)0205, (byte)065, (byte)0376, (byte)0377, (byte)0377, (byte)0351, (byte)0143, (byte)0377, (byte)0377, (byte)0377, (byte)0203, (byte)0176, (byte)020, (byte)01, (byte)0220, +(byte)017, (byte)0217, (byte)054, (byte)0377, (byte)0377, (byte)0377, (byte)0203, (byte)0176, (byte)024, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)0100, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)017, (byte)0204, (byte)0163, (byte)0355, (byte)0377, (byte)0377, (byte)0351, (byte)025, (byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0166, (byte)00, +(byte)017, (byte)0204, (byte)0355, (byte)0353, (byte)0377, (byte)0377, (byte)0215, (byte)0166, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0351, (byte)0314, (byte)0353, (byte)0377, (byte)0377, (byte)0270, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0351, (byte)0311, (byte)0351, (byte)0377, (byte)0377, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0203, (byte)0354, (byte)0114, (byte)0205, (byte)0311, (byte)0146, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)0165, (byte)024, (byte)0146, (byte)0201, (byte)0372, (byte)0377, +(byte)00, (byte)0167, (byte)0140, (byte)0210, (byte)020, (byte)0270, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0304, (byte)0114, (byte)0303, (byte)0146, (byte)0220, +(byte)0215, (byte)0124, (byte)044, (byte)074, (byte)0211, (byte)0124, (byte)044, (byte)034, (byte)0213, (byte)0124, (byte)044, (byte)0120, (byte)0211, (byte)0104, (byte)044, (byte)020, +(byte)0215, (byte)0104, (byte)044, (byte)054, (byte)0307, (byte)0104, (byte)044, (byte)074, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)030, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0124, (byte)044, (byte)024, (byte)0307, (byte)0104, (byte)044, (byte)014, (byte)01, (byte)00, (byte)00, (byte)00, +(byte)0211, (byte)0104, (byte)044, (byte)010, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)014, (byte)044, (byte)0350, +(byte)0100, (byte)025, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)040, (byte)0205, (byte)0300, (byte)0164, (byte)010, (byte)0213, (byte)0124, (byte)044, (byte)074, (byte)0205, +(byte)0322, (byte)0164, (byte)0247, (byte)0350, (byte)0254, (byte)024, (byte)00, (byte)00, (byte)0307, (byte)00, (byte)052, (byte)00, (byte)00, (byte)00, (byte)0270, (byte)0377, +(byte)0377, (byte)0377, (byte)0377, (byte)0353, (byte)0225, (byte)0215, (byte)0164, (byte)046, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0127, (byte)0126, (byte)0123, (byte)0203, (byte)0354, (byte)074, (byte)0241, (byte)0220, (byte)0301, (byte)0100, (byte)00, (byte)0213, (byte)0134, (byte)044, (byte)0120, +(byte)0213, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)034, (byte)0241, (byte)0224, (byte)0301, (byte)0100, (byte)00, (byte)0213, (byte)050, (byte)0213, (byte)0104, (byte)044, +(byte)0124, (byte)0213, (byte)060, (byte)0205, (byte)0366, (byte)0164, (byte)0160, (byte)0205, (byte)0333, (byte)0164, (byte)0170, (byte)0213, (byte)0114, (byte)044, (byte)0130, (byte)061, +(byte)0377, (byte)0205, (byte)0311, (byte)0165, (byte)025, (byte)0353, (byte)071, (byte)01, (byte)0303, (byte)01, (byte)0307, (byte)0200, (byte)0173, (byte)0377, (byte)00, (byte)0164, +(byte)077, (byte)0203, (byte)0306, (byte)02, (byte)071, (byte)0174, (byte)044, (byte)0130, (byte)0166, (byte)046, (byte)017, (byte)0267, (byte)026, (byte)0211, (byte)0330, (byte)0213, +(byte)0114, (byte)044, (byte)034, (byte)0211, (byte)054, (byte)044, (byte)0350, (byte)025, (byte)0377, (byte)0377, (byte)0377, (byte)0205, (byte)0300, (byte)0177, (byte)0330, (byte)0277, +(byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0203, (byte)0304, (byte)074, (byte)0211, (byte)0370, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0146, (byte)0220, +(byte)0213, (byte)0104, (byte)044, (byte)0124, (byte)0211, (byte)060, (byte)0203, (byte)0304, (byte)074, (byte)0211, (byte)0370, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, +(byte)0213, (byte)0104, (byte)044, (byte)0124, (byte)0203, (byte)0357, (byte)01, (byte)0307, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0304, (byte)074, +(byte)0211, (byte)0370, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)061, (byte)0377, (byte)0203, (byte)0304, (byte)074, (byte)0211, (byte)0370, (byte)0133, (byte)0136, +(byte)0137, (byte)0135, (byte)0303, (byte)0213, (byte)0104, (byte)044, (byte)0130, (byte)061, (byte)0377, (byte)0215, (byte)0134, (byte)044, (byte)056, (byte)0205, (byte)0300, (byte)0165, +(byte)024, (byte)0353, (byte)0344, (byte)01, (byte)0307, (byte)0200, (byte)0174, (byte)04, (byte)055, (byte)00, (byte)0164, (byte)040, (byte)071, (byte)0174, (byte)044, (byte)0130, +(byte)0166, (byte)0242, (byte)0203, (byte)0306, (byte)02, (byte)017, (byte)0267, (byte)026, (byte)0211, (byte)0330, (byte)0213, (byte)0114, (byte)044, (byte)034, (byte)0211, (byte)054, +(byte)044, (byte)0350, (byte)0232, (byte)0376, (byte)0377, (byte)0377, (byte)0205, (byte)0300, (byte)0177, (byte)0331, (byte)0353, (byte)0203, (byte)0203, (byte)0357, (byte)01, (byte)0220, +(byte)0353, (byte)0202, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0203, (byte)0354, (byte)054, (byte)0213, (byte)0104, (byte)044, (byte)060, (byte)017, (byte)0267, (byte)0124, (byte)044, (byte)064, (byte)0205, (byte)0300, (byte)0164, (byte)040, +(byte)0213, (byte)015, (byte)0224, (byte)0301, (byte)0100, (byte)00, (byte)017, (byte)0267, (byte)0322, (byte)0213, (byte)011, (byte)0211, (byte)014, (byte)044, (byte)0213, (byte)015, +(byte)0220, (byte)0301, (byte)0100, (byte)00, (byte)0213, (byte)011, (byte)0350, (byte)0125, (byte)0376, (byte)0377, (byte)0377, (byte)0203, (byte)0304, (byte)054, (byte)0303, (byte)0220, +(byte)0215, (byte)0104, (byte)044, (byte)036, (byte)0353, (byte)0332, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0203, (byte)0354, (byte)0114, (byte)0211, (byte)0134, (byte)044, (byte)0100, (byte)0211, (byte)0303, (byte)061, (byte)0300, (byte)0205, (byte)0322, (byte)0211, (byte)0164, (byte)044, +(byte)0104, (byte)0213, (byte)0164, (byte)044, (byte)0120, (byte)0211, (byte)0174, (byte)044, (byte)0110, (byte)0213, (byte)0174, (byte)044, (byte)0124, (byte)0165, (byte)021, (byte)0213, +(byte)0134, (byte)044, (byte)0100, (byte)0213, (byte)0164, (byte)044, (byte)0104, (byte)0213, (byte)0174, (byte)044, (byte)0110, (byte)0203, (byte)0304, (byte)0114, (byte)0303, (byte)0220, +(byte)0205, (byte)0311, (byte)0270, (byte)0376, (byte)0377, (byte)0377, (byte)0377, (byte)0164, (byte)0346, (byte)0213, (byte)06, (byte)0211, (byte)0104, (byte)044, (byte)074, (byte)0307, +(byte)06, (byte)00, (byte)00, (byte)00, (byte)00, (byte)017, (byte)0266, (byte)02, (byte)0204, (byte)0300, (byte)017, (byte)0204, (byte)0240, (byte)00, (byte)00, (byte)00, +(byte)0203, (byte)0174, (byte)044, (byte)0130, (byte)01, (byte)017, (byte)0206, (byte)0245, (byte)00, (byte)00, (byte)00, (byte)0200, (byte)0174, (byte)044, (byte)074, (byte)00, +(byte)0164, (byte)0105, (byte)0210, (byte)0104, (byte)044, (byte)075, (byte)0215, (byte)0104, (byte)044, (byte)074, (byte)0307, (byte)0104, (byte)044, (byte)024, (byte)01, (byte)00, +(byte)00, (byte)00, (byte)0211, (byte)0134, (byte)044, (byte)020, (byte)0307, (byte)0104, (byte)044, (byte)014, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, +(byte)044, (byte)010, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)010, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)074, (byte)044, (byte)0350, (byte)0142, (byte)023, +(byte)00, (byte)00, (byte)0203, (byte)0354, (byte)030, (byte)0205, (byte)0300, (byte)017, (byte)0204, (byte)0260, (byte)00, (byte)00, (byte)00, (byte)0270, (byte)02, (byte)00, +(byte)00, (byte)00, (byte)0351, (byte)0170, (byte)0377, (byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)0300, (byte)0211, (byte)0124, (byte)044, (byte)054, (byte)0211, (byte)0114, +(byte)044, (byte)050, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0211, (byte)074, (byte)044, (byte)0350, (byte)056, (byte)023, (byte)00, (byte)00, (byte)0203, (byte)0354, +(byte)010, (byte)0205, (byte)0300, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)0213, (byte)0114, (byte)044, (byte)050, (byte)0164, (byte)063, (byte)0203, (byte)0371, (byte)01, +(byte)017, (byte)0206, (byte)0217, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)024, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0134, +(byte)044, (byte)020, (byte)0307, (byte)0104, (byte)044, (byte)014, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0124, (byte)044, (byte)010, (byte)0353, (byte)0222, +(byte)0146, (byte)0307, (byte)03, (byte)00, (byte)00, (byte)061, (byte)0300, (byte)0351, (byte)043, (byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0205, (byte)0377, (byte)0165, (byte)020, (byte)017, (byte)0266, (byte)02, (byte)0146, (byte)0211, (byte)03, (byte)0270, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0351, +(byte)013, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)0104, (byte)044, (byte)024, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0134, (byte)044, (byte)020, +(byte)0307, (byte)0104, (byte)044, (byte)014, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0124, (byte)044, (byte)010, (byte)0307, (byte)0104, (byte)044, (byte)04, +(byte)010, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)074, (byte)044, (byte)0350, (byte)0270, (byte)022, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)030, (byte)0205, +(byte)0300, (byte)0164, (byte)012, (byte)0270, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0322, (byte)0376, (byte)0377, (byte)0377, (byte)0215, (byte)0166, (byte)00, +(byte)0350, (byte)017, (byte)022, (byte)00, (byte)00, (byte)0307, (byte)00, (byte)052, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0310, (byte)0377, (byte)0146, (byte)0220, +(byte)0351, (byte)0272, (byte)0376, (byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)02, (byte)0210, (byte)06, (byte)0270, (byte)0376, (byte)0377, (byte)0377, (byte)0377, (byte)0351, +(byte)0253, (byte)0376, (byte)0377, (byte)0377, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0277, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0123, (byte)0203, (byte)0354, (byte)050, (byte)0213, (byte)025, (byte)0224, (byte)0301, (byte)0100, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)070, (byte)0213, (byte)032, +(byte)0213, (byte)025, (byte)0220, (byte)0301, (byte)0100, (byte)00, (byte)0205, (byte)0300, (byte)0213, (byte)012, (byte)0272, (byte)044, (byte)0220, (byte)0100, (byte)00, (byte)0164, +(byte)02, (byte)0211, (byte)0302, (byte)0211, (byte)0114, (byte)044, (byte)04, (byte)0213, (byte)0114, (byte)044, (byte)064, (byte)0215, (byte)0104, (byte)044, (byte)036, (byte)0211, +(byte)024, (byte)044, (byte)0213, (byte)0124, (byte)044, (byte)060, (byte)0211, (byte)0134, (byte)044, (byte)010, (byte)0146, (byte)0307, (byte)0104, (byte)044, (byte)036, (byte)00, +(byte)00, (byte)0350, (byte)072, (byte)0376, (byte)0377, (byte)0377, (byte)0203, (byte)0304, (byte)050, (byte)0133, (byte)0303, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0125, (byte)0127, (byte)0126, (byte)0123, (byte)0203, (byte)0354, (byte)074, (byte)0213, (byte)0104, (byte)044, (byte)0134, (byte)0213, (byte)0174, (byte)044, (byte)0120, (byte)0213, +(byte)0164, (byte)044, (byte)0124, (byte)0213, (byte)0154, (byte)044, (byte)0130, (byte)0205, (byte)0300, (byte)0307, (byte)0104, (byte)044, (byte)020, (byte)050, (byte)0220, (byte)0100, +(byte)00, (byte)0164, (byte)04, (byte)0211, (byte)0104, (byte)044, (byte)020, (byte)0241, (byte)0220, (byte)0301, (byte)0100, (byte)00, (byte)0205, (byte)0366, (byte)0213, (byte)00, +(byte)0211, (byte)0104, (byte)044, (byte)024, (byte)0241, (byte)0224, (byte)0301, (byte)0100, (byte)00, (byte)0213, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)030, (byte)0164, +(byte)0157, (byte)0213, (byte)026, (byte)0205, (byte)0322, (byte)0164, (byte)0151, (byte)0205, (byte)0377, (byte)0164, (byte)0165, (byte)061, (byte)0333, (byte)0205, (byte)0355, (byte)0165, +(byte)021, (byte)0353, (byte)0135, (byte)0213, (byte)026, (byte)01, (byte)0303, (byte)01, (byte)0302, (byte)071, (byte)0335, (byte)0211, (byte)026, (byte)0166, (byte)051, (byte)0203, +(byte)0307, (byte)02, (byte)0213, (byte)0104, (byte)044, (byte)030, (byte)0211, (byte)0351, (byte)051, (byte)0331, (byte)0211, (byte)0104, (byte)044, (byte)010, (byte)0213, (byte)0104, +(byte)044, (byte)024, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0213, (byte)0104, (byte)044, (byte)020, (byte)0211, (byte)04, (byte)044, (byte)0211, (byte)0370, (byte)0350, +(byte)0254, (byte)0375, (byte)0377, (byte)0377, (byte)0205, (byte)0300, (byte)0177, (byte)0313, (byte)0205, (byte)0300, (byte)0164, (byte)012, (byte)0203, (byte)0304, (byte)074, (byte)0211, +(byte)0330, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)071, (byte)0353, (byte)0163, (byte)0362, (byte)0307, (byte)06, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0211, (byte)0330, (byte)0203, (byte)0304, (byte)074, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)061, (byte)0333, (byte)0203, (byte)0304, (byte)074, (byte)0211, (byte)0330, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0205, (byte)0355, (byte)0164, (byte)0354, (byte)0211, (byte)0154, (byte)044, (byte)034, (byte)061, (byte)0333, (byte)0213, (byte)0154, (byte)044, (byte)030, (byte)0146, (byte)0307, +(byte)0104, (byte)044, (byte)056, (byte)00, (byte)00, (byte)0215, (byte)0174, (byte)044, (byte)056, (byte)0353, (byte)023, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0213, (byte)026, (byte)01, (byte)0303, (byte)01, (byte)0302, (byte)071, (byte)0134, (byte)044, (byte)034, (byte)0211, (byte)026, (byte)0166, (byte)0236, (byte)0213, (byte)0104, +(byte)044, (byte)024, (byte)0211, (byte)0351, (byte)0211, (byte)0154, (byte)044, (byte)010, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0213, (byte)0104, (byte)044, (byte)020, +(byte)0211, (byte)04, (byte)044, (byte)0211, (byte)0370, (byte)0350, (byte)046, (byte)0375, (byte)0377, (byte)0377, (byte)0205, (byte)0300, (byte)0177, (byte)0322, (byte)0351, (byte)0171, +(byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0126, (byte)0123, (byte)0203, (byte)0354, (byte)044, (byte)0213, (byte)0104, (byte)044, (byte)060, (byte)0213, (byte)0114, (byte)044, (byte)074, (byte)0205, (byte)0300, (byte)0164, +(byte)0100, (byte)0213, (byte)025, (byte)0224, (byte)0301, (byte)0100, (byte)00, (byte)0205, (byte)0311, (byte)0213, (byte)062, (byte)0213, (byte)025, (byte)0220, (byte)0301, (byte)0100, +(byte)00, (byte)0213, (byte)032, (byte)0272, (byte)054, (byte)0220, (byte)0100, (byte)00, (byte)0164, (byte)02, (byte)0211, (byte)0312, (byte)0211, (byte)024, (byte)044, (byte)0213, +(byte)0114, (byte)044, (byte)070, (byte)0213, (byte)0124, (byte)044, (byte)064, (byte)0211, (byte)0164, (byte)044, (byte)010, (byte)0211, (byte)0134, (byte)044, (byte)04, (byte)0146, +(byte)0307, (byte)0104, (byte)044, (byte)036, (byte)00, (byte)00, (byte)0350, (byte)0305, (byte)0374, (byte)0377, (byte)0377, (byte)0203, (byte)0304, (byte)044, (byte)0133, (byte)0136, +(byte)0303, (byte)0215, (byte)0104, (byte)044, (byte)036, (byte)0353, (byte)0272, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0125, (byte)0127, (byte)0126, (byte)0123, (byte)0203, (byte)0354, (byte)0134, (byte)0213, (byte)0104, (byte)044, (byte)0164, (byte)0213, (byte)0114, (byte)044, (byte)0160, (byte)0213, +(byte)0120, (byte)020, (byte)061, (byte)0300, (byte)073, (byte)0121, (byte)020, (byte)017, (byte)0217, (byte)0346, (byte)01, (byte)00, (byte)00, (byte)0213, (byte)0154, (byte)044, +(byte)0164, (byte)0215, (byte)0162, (byte)0377, (byte)0203, (byte)0302, (byte)03, (byte)0211, (byte)0164, (byte)044, (byte)0100, (byte)0213, (byte)0164, (byte)044, (byte)0164, (byte)0211, +(byte)0310, (byte)0203, (byte)0300, (byte)024, (byte)0213, (byte)0134, (byte)044, (byte)0164, (byte)0211, (byte)0104, (byte)044, (byte)0104, (byte)0215, (byte)0154, (byte)0225, (byte)04, +(byte)0211, (byte)0154, (byte)044, (byte)070, (byte)0213, (byte)0154, (byte)044, (byte)0160, (byte)0213, (byte)0114, (byte)0226, (byte)04, (byte)0203, (byte)0303, (byte)024, (byte)0213, +(byte)0104, (byte)0225, (byte)04, (byte)061, (byte)0322, (byte)0203, (byte)0301, (byte)01, (byte)0367, (byte)0361, (byte)0205, (byte)0300, (byte)0211, (byte)0104, (byte)044, (byte)074, +(byte)0211, (byte)0104, (byte)044, (byte)0110, (byte)017, (byte)0204, (byte)0325, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0114, (byte)044, (byte)0104, (byte)0211, (byte)0336, +(byte)061, (byte)0377, (byte)061, (byte)0355, (byte)0307, (byte)0104, (byte)044, (byte)050, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0104, (byte)044, (byte)054, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0134, (byte)044, (byte)0114, (byte)0213, (byte)0104, (byte)044, (byte)074, (byte)0367, (byte)046, (byte)0307, (byte)0104, +(byte)044, (byte)064, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)030, (byte)0213, (byte)01, (byte)01, (byte)0174, (byte)044, (byte)030, +(byte)0213, (byte)0134, (byte)044, (byte)030, (byte)0211, (byte)0124, (byte)044, (byte)034, (byte)021, (byte)0154, (byte)044, (byte)034, (byte)0203, (byte)0306, (byte)04, (byte)0213, +(byte)0154, (byte)044, (byte)034, (byte)061, (byte)0322, (byte)0211, (byte)0134, (byte)044, (byte)060, (byte)0211, (byte)0357, (byte)061, (byte)0355, (byte)053, (byte)0104, (byte)044, +(byte)060, (byte)033, (byte)0124, (byte)044, (byte)064, (byte)053, (byte)0104, (byte)044, (byte)050, (byte)033, (byte)0124, (byte)044, (byte)054, (byte)0307, (byte)0104, (byte)044, +(byte)054, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)01, (byte)0203, (byte)0301, (byte)04, (byte)0211, (byte)0323, (byte)0203, (byte)0343, (byte)01, (byte)071, +(byte)0164, (byte)044, (byte)070, (byte)0211, (byte)0134, (byte)044, (byte)050, (byte)0163, (byte)0237, (byte)0213, (byte)0104, (byte)044, (byte)0100, (byte)0213, (byte)0164, (byte)044, +(byte)0160, (byte)0213, (byte)0134, (byte)044, (byte)0114, (byte)0203, (byte)0300, (byte)04, (byte)0213, (byte)0114, (byte)0206, (byte)04, (byte)0205, (byte)0311, (byte)0165, (byte)077, +(byte)0215, (byte)04, (byte)0206, (byte)071, (byte)0104, (byte)044, (byte)0104, (byte)0163, (byte)053, (byte)0213, (byte)020, (byte)0205, (byte)0322, (byte)0165, (byte)045, (byte)0213, +(byte)0114, (byte)044, (byte)0104, (byte)0213, (byte)0124, (byte)044, (byte)0100, (byte)0353, (byte)015, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0213, (byte)050, (byte)0205, (byte)0355, (byte)0165, (byte)012, (byte)0203, (byte)0350, (byte)04, (byte)0203, (byte)0352, (byte)01, (byte)071, (byte)0301, (byte)0162, (byte)0360, +(byte)0211, (byte)0124, (byte)044, (byte)0100, (byte)0213, (byte)0104, (byte)044, (byte)0100, (byte)0213, (byte)0154, (byte)044, (byte)0160, (byte)0211, (byte)0105, (byte)020, (byte)0213, +(byte)0124, (byte)044, (byte)0164, (byte)0213, (byte)0114, (byte)044, (byte)0160, (byte)0211, (byte)0124, (byte)044, (byte)04, (byte)0211, (byte)014, (byte)044, (byte)0350, (byte)0235, +(byte)01, (byte)00, (byte)00, (byte)0205, (byte)0300, (byte)017, (byte)0210, (byte)0244, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0164, (byte)044, (byte)074, (byte)061, +(byte)0377, (byte)0213, (byte)0114, (byte)044, (byte)0104, (byte)0203, (byte)0306, (byte)01, (byte)0211, (byte)0164, (byte)044, (byte)0110, (byte)061, (byte)0366, (byte)0146, (byte)0220, +(byte)0213, (byte)03, (byte)061, (byte)0322, (byte)0203, (byte)0303, (byte)04, (byte)0211, (byte)0124, (byte)044, (byte)034, (byte)061, (byte)0322, (byte)0307, (byte)0104, (byte)044, +(byte)044, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)030, (byte)0213, (byte)0154, (byte)044, (byte)030, (byte)0213, (byte)01, (byte)0211, +(byte)0154, (byte)044, (byte)040, (byte)053, (byte)0104, (byte)044, (byte)040, (byte)033, (byte)0124, (byte)044, (byte)044, (byte)051, (byte)0360, (byte)031, (byte)0372, (byte)061, +(byte)0377, (byte)0211, (byte)0326, (byte)0203, (byte)0346, (byte)01, (byte)0211, (byte)01, (byte)0203, (byte)0301, (byte)04, (byte)071, (byte)0134, (byte)044, (byte)070, (byte)0163, +(byte)0277, (byte)0213, (byte)0104, (byte)044, (byte)0100, (byte)0213, (byte)0124, (byte)044, (byte)0160, (byte)0203, (byte)0300, (byte)04, (byte)0213, (byte)0174, (byte)0202, (byte)04, +(byte)0205, (byte)0377, (byte)0165, (byte)073, (byte)0215, (byte)04, (byte)0202, (byte)071, (byte)0104, (byte)044, (byte)0104, (byte)0163, (byte)047, (byte)0213, (byte)060, (byte)0205, +(byte)0366, (byte)0165, (byte)041, (byte)0213, (byte)0114, (byte)044, (byte)0104, (byte)0213, (byte)0124, (byte)044, (byte)0100, (byte)0353, (byte)011, (byte)0215, (byte)0166, (byte)00, +(byte)0213, (byte)030, (byte)0205, (byte)0333, (byte)0165, (byte)012, (byte)0203, (byte)0350, (byte)04, (byte)0203, (byte)0352, (byte)01, (byte)071, (byte)0301, (byte)0162, (byte)0360, +(byte)0211, (byte)0124, (byte)044, (byte)0100, (byte)0213, (byte)0134, (byte)044, (byte)0100, (byte)0213, (byte)0114, (byte)044, (byte)0160, (byte)0211, (byte)0131, (byte)020, (byte)0213, +(byte)0104, (byte)044, (byte)0110, (byte)0203, (byte)0304, (byte)0134, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0203, (byte)0354, (byte)014, (byte)0213, (byte)0124, (byte)044, (byte)020, (byte)0213, (byte)0112, (byte)0374, (byte)0215, (byte)0102, (byte)0374, (byte)0272, (byte)01, (byte)00, +(byte)00, (byte)00, (byte)0323, (byte)0342, (byte)0211, (byte)0110, (byte)04, (byte)0211, (byte)0120, (byte)010, (byte)0211, (byte)0104, (byte)044, (byte)020, (byte)0203, (byte)0304, +(byte)014, (byte)0351, (byte)0212, (byte)03, (byte)00, (byte)00, (byte)0215, (byte)0166, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0123, (byte)061, (byte)0333, (byte)0203, (byte)0354, (byte)030, (byte)0270, (byte)04, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0114, (byte)044, (byte)040, (byte)0203, +(byte)0371, (byte)023, (byte)0166, (byte)014, (byte)01, (byte)0300, (byte)0203, (byte)0303, (byte)01, (byte)0215, (byte)0120, (byte)020, (byte)071, (byte)0312, (byte)0166, (byte)0364, +(byte)0211, (byte)034, (byte)044, (byte)0350, (byte)0230, (byte)03, (byte)00, (byte)00, (byte)0211, (byte)030, (byte)0203, (byte)0300, (byte)04, (byte)0203, (byte)0304, (byte)030, +(byte)0133, (byte)0303, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0126, (byte)0123, (byte)0203, (byte)0354, (byte)024, (byte)0213, (byte)0104, (byte)044, (byte)050, (byte)0213, (byte)0134, (byte)044, (byte)040, (byte)0213, (byte)0164, (byte)044, +(byte)044, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0247, (byte)0377, (byte)0377, (byte)0377, (byte)017, (byte)0266, (byte)013, (byte)0204, (byte)0311, (byte)0210, (byte)010, +(byte)0211, (byte)0302, (byte)0164, (byte)022, (byte)0203, (byte)0303, (byte)01, (byte)017, (byte)0266, (byte)013, (byte)0203, (byte)0302, (byte)01, (byte)0203, (byte)0303, (byte)01, +(byte)0204, (byte)0311, (byte)0210, (byte)012, (byte)0165, (byte)0361, (byte)0205, (byte)0366, (byte)0164, (byte)02, (byte)0211, (byte)026, (byte)0203, (byte)0304, (byte)024, (byte)0133, +(byte)0136, (byte)0303, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0335, (byte)0104, (byte)044, (byte)04, (byte)0331, (byte)0345, (byte)0233, (byte)0337, (byte)0340, (byte)0335, (byte)0330, (byte)045, (byte)00, (byte)0105, (byte)00, (byte)00, +(byte)0303, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0203, (byte)0354, (byte)014, (byte)0211, (byte)034, (byte)044, (byte)0213, (byte)0114, (byte)044, (byte)020, (byte)0213, (byte)0134, (byte)044, (byte)024, (byte)0211, (byte)0164, +(byte)044, (byte)04, (byte)0211, (byte)0174, (byte)044, (byte)010, (byte)0213, (byte)0101, (byte)020, (byte)0213, (byte)0123, (byte)020, (byte)051, (byte)0320, (byte)0165, (byte)042, +(byte)0215, (byte)074, (byte)0225, (byte)020, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0161, (byte)024, (byte)0215, (byte)0124, (byte)071, (byte)04, (byte)0215, (byte)0114, +(byte)073, (byte)04, (byte)0203, (byte)0351, (byte)04, (byte)0203, (byte)0352, (byte)04, (byte)0213, (byte)031, (byte)071, (byte)032, (byte)0165, (byte)023, (byte)071, (byte)0326, +(byte)0162, (byte)0360, (byte)0213, (byte)034, (byte)044, (byte)0213, (byte)0164, (byte)044, (byte)04, (byte)0213, (byte)0174, (byte)044, (byte)010, (byte)0203, (byte)0304, (byte)014, +(byte)0303, (byte)031, (byte)0300, (byte)0213, (byte)034, (byte)044, (byte)0203, (byte)0310, (byte)01, (byte)0213, (byte)0164, (byte)044, (byte)04, (byte)0213, (byte)0174, (byte)044, +(byte)010, (byte)0203, (byte)0304, (byte)014, (byte)0303, (byte)0215, (byte)0164, (byte)046, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0213, (byte)0124, (byte)044, (byte)010, (byte)0213, (byte)0104, (byte)044, (byte)04, (byte)017, (byte)0266, (byte)012, (byte)0204, (byte)0311, (byte)0210, (byte)010, (byte)0164, +(byte)022, (byte)0203, (byte)0302, (byte)01, (byte)017, (byte)0266, (byte)012, (byte)0203, (byte)0300, (byte)01, (byte)0203, (byte)0302, (byte)01, (byte)0204, (byte)0311, (byte)0210, +(byte)010, (byte)0165, (byte)0361, (byte)0363, (byte)0303, (byte)0215, (byte)0164, (byte)046, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0203, (byte)0354, (byte)054, (byte)0271, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)060, (byte)0211, (byte)0164, (byte)044, (byte)040, +(byte)0211, (byte)0174, (byte)044, (byte)044, (byte)0211, (byte)0154, (byte)044, (byte)050, (byte)0213, (byte)0154, (byte)044, (byte)064, (byte)0211, (byte)0134, (byte)044, (byte)034, +(byte)0213, (byte)0120, (byte)020, (byte)0215, (byte)0170, (byte)024, (byte)0215, (byte)0124, (byte)0220, (byte)020, (byte)0213, (byte)032, (byte)0211, (byte)0326, (byte)017, (byte)0275, +(byte)0303, (byte)0203, (byte)0360, (byte)037, (byte)051, (byte)0301, (byte)0203, (byte)0370, (byte)012, (byte)0211, (byte)0115, (byte)00, (byte)0177, (byte)0106, (byte)0271, (byte)013, +(byte)00, (byte)00, (byte)00, (byte)0211, (byte)0336, (byte)051, (byte)0301, (byte)0323, (byte)0356, (byte)0201, (byte)0316, (byte)00, (byte)00, (byte)0360, (byte)077, (byte)0211, +(byte)0164, (byte)044, (byte)024, (byte)061, (byte)0366, (byte)071, (byte)0327, (byte)0215, (byte)0154, (byte)044, (byte)020, (byte)0163, (byte)05, (byte)0213, (byte)0162, (byte)0374, +(byte)0323, (byte)0356, (byte)0215, (byte)0110, (byte)025, (byte)0323, (byte)0343, (byte)011, (byte)0363, (byte)0211, (byte)0135, (byte)00, (byte)0335, (byte)0104, (byte)044, (byte)020, +(byte)0213, (byte)0134, (byte)044, (byte)034, (byte)0213, (byte)0164, (byte)044, (byte)040, (byte)0213, (byte)0174, (byte)044, (byte)044, (byte)0213, (byte)0154, (byte)044, (byte)050, +(byte)0203, (byte)0304, (byte)054, (byte)0303, (byte)061, (byte)0355, (byte)071, (byte)0327, (byte)0162, (byte)0126, (byte)0203, (byte)0350, (byte)013, (byte)0164, (byte)0101, (byte)0307, +(byte)0104, (byte)044, (byte)04, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0301, (byte)0211, (byte)0352, (byte)051, (byte)0104, (byte)044, (byte)04, (byte)0323, +(byte)0343, (byte)017, (byte)0266, (byte)0114, (byte)044, (byte)04, (byte)0201, (byte)0313, (byte)00, (byte)00, (byte)0360, (byte)077, (byte)0323, (byte)0352, (byte)011, (byte)0323, +(byte)061, (byte)0322, (byte)071, (byte)0376, (byte)0211, (byte)0134, (byte)044, (byte)024, (byte)0166, (byte)05, (byte)0213, (byte)0126, (byte)0374, (byte)0323, (byte)0352, (byte)0211, +(byte)0301, (byte)0323, (byte)0345, (byte)0211, (byte)0350, (byte)011, (byte)0320, (byte)0211, (byte)0104, (byte)044, (byte)020, (byte)0353, (byte)0237, (byte)0215, (byte)0166, (byte)00, +(byte)0201, (byte)0313, (byte)00, (byte)00, (byte)0360, (byte)077, (byte)0211, (byte)0134, (byte)044, (byte)024, (byte)0211, (byte)0154, (byte)044, (byte)020, (byte)0353, (byte)0214, +(byte)0203, (byte)0356, (byte)04, (byte)0203, (byte)0350, (byte)013, (byte)0213, (byte)0152, (byte)0374, (byte)0164, (byte)0345, (byte)0353, (byte)0242, (byte)0215, (byte)0166, (byte)00, +(byte)0123, (byte)0211, (byte)0303, (byte)0203, (byte)0354, (byte)030, (byte)0241, (byte)0100, (byte)0220, (byte)0100, (byte)00, (byte)0203, (byte)0370, (byte)02, (byte)0164, (byte)0173, +(byte)0205, (byte)0300, (byte)0165, (byte)031, (byte)0353, (byte)046, (byte)0307, (byte)04, (byte)044, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0166, (byte)00, +(byte)0350, (byte)07, (byte)014, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)04, (byte)0241, (byte)0100, (byte)0220, (byte)0100, (byte)00, (byte)0203, (byte)0370, (byte)01, +(byte)0164, (byte)0344, (byte)0203, (byte)0370, (byte)02, (byte)0164, (byte)0124, (byte)0203, (byte)0304, (byte)030, (byte)0133, (byte)0303, (byte)0307, (byte)0104, (byte)044, (byte)04, +(byte)01, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)0100, (byte)0220, (byte)0100, (byte)00, (byte)0350, (byte)0364, (byte)013, (byte)00, (byte)00, +(byte)0203, (byte)0354, (byte)010, (byte)0205, (byte)0300, (byte)0165, (byte)0116, (byte)0307, (byte)04, (byte)044, (byte)0140, (byte)0220, (byte)0100, (byte)00, (byte)0350, (byte)0321, +(byte)013, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)04, (byte)0307, (byte)04, (byte)044, (byte)0170, (byte)0220, (byte)0100, (byte)00, (byte)0350, (byte)0302, (byte)013, +(byte)00, (byte)00, (byte)0203, (byte)0354, (byte)04, (byte)0307, (byte)04, (byte)044, (byte)0100, (byte)0136, (byte)0100, (byte)00, (byte)0350, (byte)0377, (byte)0261, (byte)0377, +(byte)0377, (byte)0307, (byte)05, (byte)0100, (byte)0220, (byte)0100, (byte)00, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)04, (byte)0133, (byte)0215, (byte)04, +(byte)0305, (byte)0140, (byte)0220, (byte)0100, (byte)00, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0237, (byte)013, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)04, +(byte)0203, (byte)0304, (byte)030, (byte)0133, (byte)0303, (byte)0203, (byte)0370, (byte)02, (byte)017, (byte)0205, (byte)0172, (byte)0377, (byte)0377, (byte)0377, (byte)0307, (byte)05, +(byte)0100, (byte)0220, (byte)0100, (byte)00, (byte)02, (byte)00, (byte)00, (byte)00, (byte)0353, (byte)0321, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0203, (byte)0354, (byte)034, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)03, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)04, (byte)044, (byte)0100, (byte)0220, +(byte)0100, (byte)00, (byte)0350, (byte)0155, (byte)013, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)010, (byte)0203, (byte)0370, (byte)02, (byte)0165, (byte)036, (byte)0307, +(byte)04, (byte)044, (byte)0140, (byte)0220, (byte)0100, (byte)00, (byte)0350, (byte)0141, (byte)013, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)04, (byte)0307, (byte)04, +(byte)044, (byte)0170, (byte)0220, (byte)0100, (byte)00, (byte)0350, (byte)0122, (byte)013, (byte)00, (byte)00, (byte)0203, (byte)0354, (byte)04, (byte)0203, (byte)0304, (byte)034, +(byte)0303, (byte)0353, (byte)015, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0203, (byte)0354, (byte)034, (byte)0203, (byte)075, (byte)0100, (byte)0220, (byte)0100, (byte)00, (byte)02, (byte)0164, (byte)04, (byte)0203, (byte)0304, (byte)034, (byte)0303, +(byte)0215, (byte)04, (byte)0100, (byte)0215, (byte)04, (byte)0305, (byte)0140, (byte)0220, (byte)0100, (byte)00, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)042, (byte)013, +(byte)00, (byte)00, (byte)0203, (byte)0354, (byte)04, (byte)0203, (byte)0304, (byte)034, (byte)0303, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0123, (byte)0203, (byte)0354, (byte)010, (byte)0213, (byte)0134, (byte)044, (byte)020, (byte)0205, (byte)0333, (byte)0164, (byte)044, (byte)061, (byte)0300, (byte)0350, (byte)0255, +(byte)0376, (byte)0377, (byte)0377, (byte)0213, (byte)0103, (byte)04, (byte)0213, (byte)024, (byte)0205, (byte)0240, (byte)0220, (byte)0100, (byte)00, (byte)0211, (byte)023, (byte)0211, +(byte)034, (byte)0205, (byte)0240, (byte)0220, (byte)0100, (byte)00, (byte)0203, (byte)0304, (byte)010, (byte)061, (byte)0300, (byte)0133, (byte)0353, (byte)0242, (byte)0146, (byte)0220, +(byte)0203, (byte)0304, (byte)010, (byte)0133, (byte)0303, (byte)0215, (byte)0164, (byte)046, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0203, (byte)0354, (byte)034, (byte)061, (byte)0300, (byte)0211, (byte)0174, (byte)044, (byte)030, (byte)0213, (byte)0174, (byte)044, (byte)040, (byte)0211, (byte)0164, (byte)044, +(byte)024, (byte)0211, (byte)0134, (byte)044, (byte)020, (byte)0350, (byte)0146, (byte)0376, (byte)0377, (byte)0377, (byte)0213, (byte)064, (byte)0275, (byte)0240, (byte)0220, (byte)0100, +(byte)00, (byte)0205, (byte)0366, (byte)0164, (byte)060, (byte)0213, (byte)06, (byte)0211, (byte)04, (byte)0275, (byte)0240, (byte)0220, (byte)0100, (byte)00, (byte)061, (byte)0300, +(byte)0350, (byte)0133, (byte)0377, (byte)0377, (byte)0377, (byte)0211, (byte)0360, (byte)0307, (byte)0106, (byte)020, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0307, (byte)0106, +(byte)014, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0134, (byte)044, (byte)020, (byte)0213, (byte)0164, (byte)044, (byte)024, (byte)0213, (byte)0174, (byte)044, +(byte)030, (byte)0203, (byte)0304, (byte)034, (byte)0303, (byte)0213, (byte)065, (byte)054, (byte)0160, (byte)0100, (byte)00, (byte)0273, (byte)01, (byte)00, (byte)00, (byte)00, +(byte)0211, (byte)0371, (byte)0323, (byte)0343, (byte)0215, (byte)04, (byte)0235, (byte)033, (byte)00, (byte)00, (byte)00, (byte)0301, (byte)0350, (byte)03, (byte)0211, (byte)0362, +(byte)0201, (byte)0352, (byte)0340, (byte)0220, (byte)0100, (byte)00, (byte)0301, (byte)0372, (byte)03, (byte)0215, (byte)024, (byte)020, (byte)0201, (byte)0372, (byte)040, (byte)01, +(byte)00, (byte)00, (byte)0167, (byte)020, (byte)0215, (byte)04, (byte)0306, (byte)0243, (byte)054, (byte)0160, (byte)0100, (byte)00, (byte)0211, (byte)0176, (byte)04, (byte)0211, +(byte)0136, (byte)010, (byte)0353, (byte)0232, (byte)0301, (byte)0340, (byte)03, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)051, (byte)011, (byte)00, (byte)00, (byte)0211, +(byte)0306, (byte)0353, (byte)0351, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0203, (byte)0354, (byte)0134, (byte)0213, (byte)0104, (byte)044, (byte)0140, (byte)0211, (byte)0164, (byte)044, (byte)0120, (byte)0211, (byte)0154, (byte)044, (byte)0130, (byte)0213, +(byte)0154, (byte)044, (byte)0150, (byte)0211, (byte)0134, (byte)044, (byte)0114, (byte)0211, (byte)0104, (byte)044, (byte)070, (byte)0213, (byte)0104, (byte)044, (byte)0144, (byte)0211, +(byte)0174, (byte)044, (byte)0124, (byte)0307, (byte)04, (byte)044, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)074, (byte)0350, (byte)035, +(byte)0377, (byte)0377, (byte)0377, (byte)0213, (byte)0164, (byte)044, (byte)074, (byte)0211, (byte)0362, (byte)0211, (byte)0361, (byte)0301, (byte)0356, (byte)024, (byte)0201, (byte)0341, +(byte)0377, (byte)0377, (byte)0377, (byte)0177, (byte)0201, (byte)0342, (byte)0377, (byte)0377, (byte)017, (byte)00, (byte)0205, (byte)0366, (byte)0211, (byte)0114, (byte)044, (byte)074, +(byte)0164, (byte)06, (byte)0201, (byte)0312, (byte)00, (byte)00, (byte)020, (byte)00, (byte)0213, (byte)0174, (byte)044, (byte)070, (byte)0205, (byte)0377, (byte)0164, (byte)0105, +(byte)017, (byte)0274, (byte)0337, (byte)0211, (byte)0331, (byte)0323, (byte)0357, (byte)0205, (byte)0333, (byte)0211, (byte)0174, (byte)044, (byte)034, (byte)017, (byte)0205, (byte)0175, +(byte)00, (byte)00, (byte)00, (byte)0213, (byte)0174, (byte)044, (byte)034, (byte)0211, (byte)0170, (byte)024, (byte)0203, (byte)0372, (byte)01, (byte)0211, (byte)0120, (byte)030, +(byte)031, (byte)0322, (byte)0203, (byte)0302, (byte)02, (byte)0205, (byte)0366, (byte)0211, (byte)0120, (byte)020, (byte)0164, (byte)064, (byte)0213, (byte)0114, (byte)044, (byte)0154, +(byte)0215, (byte)0224, (byte)063, (byte)0315, (byte)0373, (byte)0377, (byte)0377, (byte)0211, (byte)0125, (byte)00, (byte)0272, (byte)065, (byte)00, (byte)00, (byte)00, (byte)051, +(byte)0332, (byte)0211, (byte)021, (byte)0353, (byte)067, (byte)017, (byte)0274, (byte)0312, (byte)0307, (byte)0100, (byte)020, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0323, +(byte)0352, (byte)0205, (byte)0366, (byte)0211, (byte)0120, (byte)024, (byte)0215, (byte)0131, (byte)040, (byte)0272, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0165, (byte)0314, +(byte)017, (byte)0275, (byte)0114, (byte)0220, (byte)020, (byte)0213, (byte)0174, (byte)044, (byte)0154, (byte)0301, (byte)0342, (byte)05, (byte)0201, (byte)0353, (byte)062, (byte)04, +(byte)00, (byte)00, (byte)0211, (byte)0135, (byte)00, (byte)0203, (byte)0361, (byte)037, (byte)051, (byte)0312, (byte)0211, (byte)027, (byte)0213, (byte)0134, (byte)044, (byte)0114, +(byte)0213, (byte)0164, (byte)044, (byte)0120, (byte)0213, (byte)0174, (byte)044, (byte)0124, (byte)0213, (byte)0154, (byte)044, (byte)0130, (byte)0203, (byte)0304, (byte)0134, (byte)0303, +(byte)0307, (byte)0104, (byte)044, (byte)054, (byte)040, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0327, (byte)051, (byte)0134, (byte)044, (byte)054, (byte)017, (byte)0266, +(byte)0114, (byte)044, (byte)054, (byte)0323, (byte)0347, (byte)0213, (byte)0114, (byte)044, (byte)034, (byte)011, (byte)0317, (byte)0211, (byte)0331, (byte)0211, (byte)0170, (byte)024, +(byte)0323, (byte)0352, (byte)0351, (byte)0143, (byte)0377, (byte)0377, (byte)0377, (byte)0211, (byte)0366, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0127, (byte)0126, (byte)0123, (byte)0203, (byte)0354, (byte)0114, (byte)0213, (byte)0154, (byte)044, (byte)0140, (byte)0213, (byte)0164, (byte)044, (byte)0144, (byte)0213, +(byte)0175, (byte)020, (byte)0213, (byte)0106, (byte)020, (byte)051, (byte)0307, (byte)0203, (byte)0377, (byte)00, (byte)017, (byte)0204, (byte)07, (byte)01, (byte)00, (byte)00, +(byte)017, (byte)0214, (byte)0140, (byte)01, (byte)00, (byte)00, (byte)061, (byte)0377, (byte)0215, (byte)0135, (byte)024, (byte)0213, (byte)0105, (byte)04, (byte)0211, (byte)04, +(byte)044, (byte)0350, (byte)0372, (byte)0375, (byte)0377, (byte)0377, (byte)061, (byte)0311, (byte)0211, (byte)0104, (byte)044, (byte)070, (byte)0211, (byte)0170, (byte)014, (byte)0213, +(byte)0105, (byte)020, (byte)0211, (byte)0104, (byte)044, (byte)074, (byte)0213, (byte)0124, (byte)044, (byte)074, (byte)0211, (byte)0330, (byte)061, (byte)0333, (byte)0211, (byte)0307, +(byte)0215, (byte)0154, (byte)0225, (byte)024, (byte)0213, (byte)0126, (byte)020, (byte)0211, (byte)0154, (byte)044, (byte)060, (byte)0215, (byte)0156, (byte)024, (byte)0215, (byte)0124, +(byte)0226, (byte)024, (byte)0211, (byte)0336, (byte)0211, (byte)0124, (byte)044, (byte)064, (byte)0213, (byte)0124, (byte)044, (byte)070, (byte)0211, (byte)0313, (byte)0211, (byte)0134, +(byte)044, (byte)030, (byte)0211, (byte)0164, (byte)044, (byte)034, (byte)0203, (byte)0302, (byte)024, (byte)0211, (byte)0321, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0213, (byte)0105, (byte)00, (byte)061, (byte)0366, (byte)061, (byte)0322, (byte)0213, (byte)037, (byte)051, (byte)0303, (byte)031, (byte)0326, (byte)053, (byte)0134, (byte)044, +(byte)030, (byte)033, (byte)0164, (byte)044, (byte)034, (byte)0203, (byte)0307, (byte)04, (byte)0203, (byte)0305, (byte)04, (byte)0211, (byte)031, (byte)0203, (byte)0301, (byte)04, +(byte)0211, (byte)0360, (byte)0203, (byte)0340, (byte)01, (byte)071, (byte)0154, (byte)044, (byte)064, (byte)0211, (byte)0104, (byte)044, (byte)030, (byte)0307, (byte)0104, (byte)044, +(byte)034, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0167, (byte)0311, (byte)073, (byte)0174, (byte)044, (byte)060, (byte)0211, (byte)0316, (byte)0213, (byte)0134, (byte)044, +(byte)034, (byte)0211, (byte)0370, (byte)0211, (byte)0362, (byte)0213, (byte)0114, (byte)044, (byte)030, (byte)0163, (byte)042, (byte)0211, (byte)0317, (byte)0211, (byte)0335, (byte)0220, +(byte)0213, (byte)030, (byte)061, (byte)0366, (byte)051, (byte)0373, (byte)031, (byte)0356, (byte)0203, (byte)0300, (byte)04, (byte)0211, (byte)0367, (byte)061, (byte)0355, (byte)0203, +(byte)0347, (byte)01, (byte)0211, (byte)032, (byte)0203, (byte)0302, (byte)04, (byte)071, (byte)0104, (byte)044, (byte)060, (byte)0167, (byte)0343, (byte)0213, (byte)0132, (byte)0374, +(byte)0215, (byte)0102, (byte)0374, (byte)0205, (byte)0333, (byte)0165, (byte)031, (byte)0213, (byte)0124, (byte)044, (byte)074, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0203, (byte)0350, (byte)04, (byte)0203, (byte)0352, (byte)01, (byte)0213, (byte)010, (byte)0205, (byte)0311, (byte)0164, (byte)0364, (byte)0211, (byte)0124, (byte)044, (byte)074, +(byte)0213, (byte)0104, (byte)044, (byte)074, (byte)0213, (byte)0124, (byte)044, (byte)070, (byte)0211, (byte)0102, (byte)020, (byte)0213, (byte)0104, (byte)044, (byte)070, (byte)0203, +(byte)0304, (byte)0114, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0215, (byte)024, (byte)0205, (byte)020, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0104, +(byte)025, (byte)04, (byte)0215, (byte)0135, (byte)024, (byte)0215, (byte)0124, (byte)026, (byte)04, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0203, (byte)0352, (byte)04, (byte)0203, (byte)0350, (byte)04, (byte)0213, (byte)012, (byte)071, (byte)010, (byte)0165, (byte)064, (byte)071, (byte)0303, (byte)0162, (byte)0360, +(byte)0307, (byte)04, (byte)044, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0324, (byte)0374, (byte)0377, (byte)0377, (byte)0307, (byte)0100, (byte)020, (byte)01, +(byte)00, (byte)00, (byte)00, (byte)0307, (byte)0100, (byte)024, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)070, (byte)0213, (byte)0104, +(byte)044, (byte)070, (byte)0203, (byte)0304, (byte)0114, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)017, (byte)0203, (byte)0245, (byte)0376, (byte)0377, (byte)0377, (byte)0211, (byte)0350, (byte)0211, (byte)0365, (byte)0277, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0211, +(byte)0306, (byte)0215, (byte)0135, (byte)024, (byte)0351, (byte)0222, (byte)0376, (byte)0377, (byte)0377, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0127, (byte)0126, (byte)0123, (byte)0203, (byte)0354, (byte)054, (byte)0213, (byte)0154, (byte)044, (byte)0100, (byte)0213, (byte)0174, (byte)044, (byte)0104, (byte)0213, +(byte)0105, (byte)020, (byte)0211, (byte)0376, (byte)0213, (byte)0125, (byte)04, (byte)0301, (byte)0376, (byte)05, (byte)0215, (byte)0134, (byte)06, (byte)01, (byte)0213, (byte)0105, +(byte)010, (byte)071, (byte)0303, (byte)0176, (byte)011, (byte)01, (byte)0300, (byte)0203, (byte)0302, (byte)01, (byte)071, (byte)0303, (byte)0177, (byte)0367, (byte)0211, (byte)024, +(byte)044, (byte)0350, (byte)0132, (byte)0374, (byte)0377, (byte)0377, (byte)0211, (byte)0104, (byte)044, (byte)024, (byte)0203, (byte)0300, (byte)024, (byte)0205, (byte)0366, (byte)0176, +(byte)030, (byte)061, (byte)0322, (byte)0307, (byte)04, (byte)0220, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0302, (byte)01, (byte)071, (byte)0362, (byte)0165, +(byte)0362, (byte)0213, (byte)0114, (byte)044, (byte)024, (byte)0215, (byte)0104, (byte)0221, (byte)024, (byte)0213, (byte)0115, (byte)020, (byte)0211, (byte)0376, (byte)0203, (byte)0346, +(byte)037, (byte)0215, (byte)0125, (byte)024, (byte)0215, (byte)0114, (byte)0215, (byte)024, (byte)0211, (byte)0114, (byte)044, (byte)020, (byte)0164, (byte)0142, (byte)0271, (byte)040, +(byte)00, (byte)00, (byte)00, (byte)061, (byte)0377, (byte)051, (byte)0361, (byte)0211, (byte)0154, (byte)044, (byte)034, (byte)0211, (byte)0315, (byte)0211, (byte)0134, (byte)044, +(byte)030, (byte)0213, (byte)032, (byte)0211, (byte)0361, (byte)0323, (byte)0343, (byte)0211, (byte)0351, (byte)011, (byte)0373, (byte)0211, (byte)030, (byte)0213, (byte)072, (byte)0203, +(byte)0300, (byte)04, (byte)0203, (byte)0302, (byte)04, (byte)0323, (byte)0357, (byte)071, (byte)0124, (byte)044, (byte)020, (byte)0167, (byte)0344, (byte)0213, (byte)0134, (byte)044, +(byte)030, (byte)0203, (byte)0377, (byte)01, (byte)0213, (byte)0154, (byte)044, (byte)034, (byte)0211, (byte)070, (byte)0203, (byte)0333, (byte)0377, (byte)0213, (byte)0104, (byte)044, +(byte)024, (byte)0203, (byte)0353, (byte)01, (byte)0211, (byte)0130, (byte)020, (byte)0211, (byte)054, (byte)044, (byte)0350, (byte)0221, (byte)0373, (byte)0377, (byte)0377, (byte)0213, +(byte)0104, (byte)044, (byte)024, (byte)0203, (byte)0304, (byte)054, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0213, (byte)0164, (byte)044, (byte)020, (byte)0213, (byte)012, (byte)0203, (byte)0302, (byte)04, (byte)0211, (byte)010, (byte)0203, (byte)0300, (byte)04, (byte)071, (byte)0326, +(byte)0167, (byte)0362, (byte)0353, (byte)0311, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0277, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0127, (byte)0126, (byte)0123, (byte)0203, (byte)0354, (byte)0134, (byte)0213, (byte)0164, (byte)044, (byte)0160, (byte)0213, (byte)0174, (byte)044, (byte)0164, (byte)0213, +(byte)0136, (byte)020, (byte)0213, (byte)0157, (byte)020, (byte)071, (byte)0353, (byte)017, (byte)0214, (byte)052, (byte)01, (byte)00, (byte)00, (byte)0211, (byte)0350, (byte)0211, +(byte)0335, (byte)0211, (byte)0303, (byte)0215, (byte)0104, (byte)035, (byte)00, (byte)073, (byte)0106, (byte)010, (byte)0211, (byte)0104, (byte)044, (byte)0100, (byte)017, (byte)0237, +(byte)0300, (byte)017, (byte)0266, (byte)0300, (byte)03, (byte)0106, (byte)04, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0141, (byte)0373, (byte)0377, (byte)0377, (byte)0213, +(byte)0114, (byte)044, (byte)0100, (byte)0211, (byte)0302, (byte)0215, (byte)0114, (byte)0210, (byte)024, (byte)0203, (byte)0302, (byte)024, (byte)071, (byte)0312, (byte)0211, (byte)0104, +(byte)044, (byte)0110, (byte)0211, (byte)0114, (byte)044, (byte)0114, (byte)0163, (byte)025, (byte)0211, (byte)0320, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0307, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0300, (byte)04, (byte)071, (byte)0301, (byte)0167, (byte)0363, (byte)0215, (byte)0117, (byte)024, +(byte)0215, (byte)0174, (byte)0237, (byte)024, (byte)0215, (byte)0106, (byte)024, (byte)071, (byte)0371, (byte)0215, (byte)0164, (byte)0256, (byte)024, (byte)0211, (byte)0104, (byte)044, +(byte)0104, (byte)0211, (byte)0164, (byte)044, (byte)064, (byte)0211, (byte)0114, (byte)044, (byte)060, (byte)0211, (byte)0174, (byte)044, (byte)074, (byte)0163, (byte)0161, (byte)0211, +(byte)0124, (byte)044, (byte)070, (byte)0213, (byte)0104, (byte)044, (byte)060, (byte)0213, (byte)050, (byte)0203, (byte)0300, (byte)04, (byte)0211, (byte)0104, (byte)044, (byte)060, +(byte)0205, (byte)0355, (byte)0164, (byte)0110, (byte)0213, (byte)0114, (byte)044, (byte)070, (byte)061, (byte)0366, (byte)061, (byte)0377, (byte)0213, (byte)0134, (byte)044, (byte)0104, +(byte)0213, (byte)03, (byte)0367, (byte)0345, (byte)0211, (byte)0104, (byte)044, (byte)030, (byte)0213, (byte)01, (byte)0211, (byte)0124, (byte)044, (byte)034, (byte)061, (byte)0322, +(byte)01, (byte)0104, (byte)044, (byte)030, (byte)021, (byte)0124, (byte)044, (byte)034, (byte)01, (byte)0164, (byte)044, (byte)030, (byte)021, (byte)0174, (byte)044, (byte)034, +(byte)0203, (byte)0303, (byte)04, (byte)0213, (byte)0174, (byte)044, (byte)034, (byte)0213, (byte)0124, (byte)044, (byte)030, (byte)0211, (byte)0376, (byte)061, (byte)0377, (byte)0211, +(byte)021, (byte)0203, (byte)0301, (byte)04, (byte)071, (byte)0134, (byte)044, (byte)064, (byte)0167, (byte)0306, (byte)0211, (byte)061, (byte)0213, (byte)0114, (byte)044, (byte)060, +(byte)071, (byte)0114, (byte)044, (byte)074, (byte)0166, (byte)012, (byte)0203, (byte)0104, (byte)044, (byte)070, (byte)04, (byte)0353, (byte)0226, (byte)0215, (byte)0166, (byte)00, +(byte)0213, (byte)0154, (byte)044, (byte)0100, (byte)0205, (byte)0355, (byte)0176, (byte)052, (byte)0213, (byte)0124, (byte)044, (byte)0114, (byte)0213, (byte)0104, (byte)044, (byte)0114, +(byte)0213, (byte)0172, (byte)0374, (byte)0203, (byte)0350, (byte)04, (byte)0205, (byte)0377, (byte)0165, (byte)030, (byte)0213, (byte)0124, (byte)044, (byte)0100, (byte)0353, (byte)011, +(byte)0203, (byte)0350, (byte)04, (byte)0213, (byte)060, (byte)0205, (byte)0366, (byte)0165, (byte)05, (byte)0203, (byte)0352, (byte)01, (byte)0165, (byte)0362, (byte)0211, (byte)0124, +(byte)044, (byte)0100, (byte)0213, (byte)0104, (byte)044, (byte)0100, (byte)0213, (byte)0114, (byte)044, (byte)0110, (byte)0211, (byte)0101, (byte)020, (byte)0203, (byte)0304, (byte)0134, +(byte)0211, (byte)0310, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0211, (byte)0360, (byte)0211, (byte)0376, (byte)0211, (byte)0307, (byte)0351, (byte)0321, (byte)0376, +(byte)0377, (byte)0377, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0203, (byte)0354, (byte)034, (byte)0307, (byte)04, (byte)044, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)061, (byte)0372, (byte)0377, (byte)0377, (byte)0213, +(byte)0124, (byte)044, (byte)040, (byte)0211, (byte)0120, (byte)024, (byte)0307, (byte)0100, (byte)020, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0304, (byte)034, +(byte)0303, (byte)0353, (byte)015, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0125, (byte)0127, (byte)0126, (byte)0123, (byte)0203, (byte)0354, (byte)074, (byte)0213, (byte)0104, (byte)044, (byte)0120, (byte)0213, (byte)0134, (byte)044, (byte)0130, (byte)0213, +(byte)0174, (byte)044, (byte)0120, (byte)0213, (byte)0100, (byte)020, (byte)0211, (byte)0336, (byte)0203, (byte)0307, (byte)024, (byte)0301, (byte)0376, (byte)037, (byte)0211, (byte)0104, +(byte)044, (byte)054, (byte)0213, (byte)0104, (byte)044, (byte)0124, (byte)0211, (byte)0302, (byte)0211, (byte)0104, (byte)044, (byte)040, (byte)0301, (byte)0372, (byte)037, (byte)061, +(byte)0300, (byte)0211, (byte)0124, (byte)044, (byte)044, (byte)0211, (byte)0104, (byte)044, (byte)024, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0213, (byte)0124, (byte)044, (byte)024, (byte)0213, (byte)0154, (byte)044, (byte)044, (byte)0213, (byte)04, (byte)0227, (byte)0211, (byte)0104, (byte)044, (byte)030, (byte)017, +(byte)0257, (byte)0350, (byte)0213, (byte)0104, (byte)044, (byte)040, (byte)0367, (byte)0144, (byte)044, (byte)030, (byte)01, (byte)0352, (byte)0211, (byte)0104, (byte)044, (byte)030, +(byte)0213, (byte)0104, (byte)044, (byte)024, (byte)0211, (byte)0124, (byte)044, (byte)034, (byte)0213, (byte)0124, (byte)044, (byte)030, (byte)0213, (byte)0114, (byte)044, (byte)034, +(byte)01, (byte)0332, (byte)021, (byte)0361, (byte)0211, (byte)0316, (byte)0211, (byte)0363, (byte)061, (byte)0366, (byte)0211, (byte)024, (byte)0207, (byte)0203, (byte)0300, (byte)01, +(byte)071, (byte)0104, (byte)044, (byte)054, (byte)0211, (byte)0104, (byte)044, (byte)024, (byte)0177, (byte)0266, (byte)0211, (byte)0362, (byte)011, (byte)0332, (byte)0164, (byte)045, +(byte)0213, (byte)0104, (byte)044, (byte)0120, (byte)0213, (byte)0124, (byte)044, (byte)054, (byte)073, (byte)0120, (byte)010, (byte)0175, (byte)044, (byte)0213, (byte)0124, (byte)044, +(byte)054, (byte)0213, (byte)0104, (byte)044, (byte)0120, (byte)0211, (byte)0134, (byte)0220, (byte)024, (byte)0211, (byte)0320, (byte)0213, (byte)0124, (byte)044, (byte)0120, (byte)0203, +(byte)0300, (byte)01, (byte)0211, (byte)0102, (byte)020, (byte)0213, (byte)0104, (byte)044, (byte)0120, (byte)0203, (byte)0304, (byte)074, (byte)0133, (byte)0136, (byte)0137, (byte)0135, +(byte)0303, (byte)0213, (byte)0100, (byte)04, (byte)0203, (byte)0300, (byte)01, (byte)0211, (byte)04, (byte)044, (byte)0350, (byte)0101, (byte)0371, (byte)0377, (byte)0377, (byte)0213, +(byte)0124, (byte)044, (byte)0120, (byte)0215, (byte)0110, (byte)014, (byte)0211, (byte)0307, (byte)0213, (byte)0102, (byte)020, (byte)0211, (byte)014, (byte)044, (byte)0215, (byte)024, +(byte)0205, (byte)010, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)0120, (byte)0211, (byte)0124, (byte)044, (byte)010, (byte)0203, (byte)0300, (byte)014, +(byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0350, (byte)0367, (byte)02, (byte)00, (byte)00, (byte)0213, (byte)0104, (byte)044, (byte)0120, (byte)0211, (byte)04, (byte)044, +(byte)0350, (byte)0313, (byte)0370, (byte)0377, (byte)0377, (byte)0211, (byte)0174, (byte)044, (byte)0120, (byte)0353, (byte)0222, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0125, (byte)0127, (byte)0126, (byte)0123, (byte)0203, (byte)0354, (byte)034, (byte)0213, (byte)0134, (byte)044, (byte)064, (byte)0213, (byte)0174, (byte)044, (byte)060, (byte)0211, +(byte)0330, (byte)0203, (byte)0340, (byte)03, (byte)0165, (byte)0172, (byte)0301, (byte)0373, (byte)02, (byte)0205, (byte)0333, (byte)0164, (byte)0103, (byte)0213, (byte)065, (byte)0340, +(byte)0231, (byte)0100, (byte)00, (byte)0205, (byte)0366, (byte)0165, (byte)025, (byte)0351, (byte)0206, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0321, (byte)0373, (byte)0164, (byte)054, (byte)0213, (byte)06, (byte)0205, (byte)0300, (byte)0164, (byte)066, (byte)0211, (byte)0306, (byte)0366, (byte)0303, (byte)01, (byte)0164, +(byte)0357, (byte)0211, (byte)074, (byte)044, (byte)0211, (byte)0164, (byte)044, (byte)04, (byte)0350, (byte)023, (byte)0375, (byte)0377, (byte)0377, (byte)0211, (byte)074, (byte)044, +(byte)0211, (byte)0305, (byte)0350, (byte)0151, (byte)0370, (byte)0377, (byte)0377, (byte)0321, (byte)0373, (byte)0211, (byte)0357, (byte)0165, (byte)0327, (byte)0215, (byte)0166, (byte)00, +(byte)0203, (byte)0304, (byte)034, (byte)0211, (byte)0370, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0260, (byte)01, (byte)0350, (byte)011, (byte)0367, (byte)0377, (byte)0377, (byte)0213, (byte)056, (byte)0205, (byte)0355, (byte)0164, (byte)0130, (byte)0270, (byte)01, (byte)00, +(byte)00, (byte)00, (byte)0211, (byte)0356, (byte)0350, (byte)07, (byte)0370, (byte)0377, (byte)0377, (byte)0353, (byte)0261, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0213, (byte)04, (byte)0205, (byte)0324, (byte)0205, (byte)0100, (byte)00, (byte)0211, (byte)074, (byte)044, (byte)0307, (byte)0104, (byte)044, (byte)010, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)0211, (byte)0104, (byte)044, (byte)04, (byte)0350, (byte)0105, (byte)0376, (byte)0377, (byte)0377, (byte)0211, (byte)0307, (byte)0351, (byte)0144, (byte)0377, +(byte)0377, (byte)0377, (byte)0270, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0304, (byte)0366, (byte)0377, (byte)0377, (byte)0213, (byte)065, (byte)0340, (byte)0231, +(byte)0100, (byte)00, (byte)0205, (byte)0366, (byte)0164, (byte)047, (byte)0270, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0300, (byte)0367, (byte)0377, (byte)0377, +(byte)0351, (byte)0147, (byte)0377, (byte)0377, (byte)0377, (byte)0211, (byte)0164, (byte)044, (byte)04, (byte)0211, (byte)064, (byte)044, (byte)0350, (byte)0177, (byte)0374, (byte)0377, +(byte)0377, (byte)0211, (byte)06, (byte)0211, (byte)0305, (byte)0307, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0353, (byte)0220, (byte)0307, (byte)04, (byte)044, +(byte)0161, (byte)02, (byte)00, (byte)00, (byte)0350, (byte)0307, (byte)0375, (byte)0377, (byte)0377, (byte)0243, (byte)0340, (byte)0231, (byte)0100, (byte)00, (byte)0211, (byte)0306, +(byte)0307, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0353, (byte)0276, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0125, (byte)0127, (byte)0126, (byte)0123, (byte)0203, (byte)0354, (byte)020, (byte)0213, (byte)0154, (byte)044, (byte)044, (byte)0213, (byte)0114, (byte)044, (byte)050, (byte)0213, +(byte)0125, (byte)020, (byte)0215, (byte)0175, (byte)024, (byte)0211, (byte)0313, (byte)0211, (byte)0370, (byte)0301, (byte)0373, (byte)05, (byte)071, (byte)0323, (byte)017, (byte)0215, +(byte)0215, (byte)00, (byte)00, (byte)00, (byte)0215, (byte)0124, (byte)0225, (byte)020, (byte)0203, (byte)0303, (byte)04, (byte)0211, (byte)024, (byte)044, (byte)0203, (byte)0302, +(byte)04, (byte)0203, (byte)0341, (byte)037, (byte)0211, (byte)0124, (byte)044, (byte)010, (byte)0215, (byte)0124, (byte)0235, (byte)00, (byte)0215, (byte)0162, (byte)04, (byte)0211, +(byte)0114, (byte)044, (byte)014, (byte)017, (byte)0204, (byte)0207, (byte)00, (byte)00, (byte)00, (byte)0213, (byte)0114, (byte)044, (byte)014, (byte)0213, (byte)0134, (byte)0235, +(byte)04, (byte)0307, (byte)0104, (byte)044, (byte)04, (byte)040, (byte)00, (byte)00, (byte)00, (byte)051, (byte)0114, (byte)044, (byte)04, (byte)0323, (byte)0353, (byte)0215, +(byte)0112, (byte)010, (byte)071, (byte)0114, (byte)044, (byte)010, (byte)0166, (byte)0103, (byte)0213, (byte)04, (byte)044, (byte)0211, (byte)0154, (byte)044, (byte)010, (byte)0213, +(byte)0154, (byte)044, (byte)014, (byte)051, (byte)0320, (byte)0215, (byte)0100, (byte)0373, (byte)0301, (byte)0350, (byte)02, (byte)0203, (byte)0300, (byte)01, (byte)0211, (byte)04, +(byte)044, (byte)061, (byte)0300, (byte)0213, (byte)0124, (byte)0206, (byte)04, (byte)017, (byte)0266, (byte)0114, (byte)044, (byte)04, (byte)0323, (byte)0342, (byte)0211, (byte)0351, +(byte)011, (byte)0332, (byte)0211, (byte)024, (byte)0207, (byte)0213, (byte)0134, (byte)0206, (byte)04, (byte)0203, (byte)0300, (byte)01, (byte)0323, (byte)0353, (byte)073, (byte)04, +(byte)044, (byte)0165, (byte)0340, (byte)0213, (byte)0154, (byte)044, (byte)010, (byte)0215, (byte)0104, (byte)0205, (byte)024, (byte)0205, (byte)0333, (byte)0211, (byte)030, (byte)0165, +(byte)0117, (byte)051, (byte)0370, (byte)0301, (byte)0370, (byte)02, (byte)0205, (byte)0300, (byte)0211, (byte)0105, (byte)020, (byte)0165, (byte)07, (byte)0307, (byte)0105, (byte)024, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)0203, (byte)0304, (byte)020, (byte)0133, (byte)0136, (byte)0137, (byte)0135, (byte)0303, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)071, (byte)0164, (byte)044, (byte)010, (byte)0166, (byte)0333, (byte)0213, (byte)04, (byte)044, (byte)0367, (byte)0322, (byte)0215, (byte)014, (byte)02, (byte)061, (byte)0300, +(byte)0301, (byte)0351, (byte)02, (byte)0203, (byte)0301, (byte)01, (byte)0213, (byte)024, (byte)0206, (byte)0211, (byte)024, (byte)0207, (byte)0203, (byte)0300, (byte)01, (byte)071, +(byte)0310, (byte)0165, (byte)0363, (byte)0215, (byte)0104, (byte)0205, (byte)024, (byte)0353, (byte)0270, (byte)0215, (byte)0264, (byte)046, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0203, (byte)0300, (byte)04, (byte)0353, (byte)0254, (byte)0215, (byte)0164, (byte)046, (byte)00, (byte)0215, (byte)0274, (byte)047, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0123, (byte)0213, (byte)0114, (byte)044, (byte)010, (byte)0213, (byte)0101, (byte)020, (byte)0215, (byte)0121, (byte)024, (byte)0215, (byte)0134, (byte)0201, (byte)024, (byte)061, +(byte)0300, (byte)071, (byte)0332, (byte)0163, (byte)033, (byte)0203, (byte)0171, (byte)024, (byte)00, (byte)0164, (byte)013, (byte)0353, (byte)025, (byte)0215, (byte)0166, (byte)00, +(byte)0213, (byte)012, (byte)0205, (byte)0311, (byte)0165, (byte)017, (byte)0203, (byte)0302, (byte)04, (byte)0203, (byte)0300, (byte)040, (byte)071, (byte)0323, (byte)0167, (byte)0360, +(byte)0133, (byte)0303, (byte)0213, (byte)0111, (byte)024, (byte)017, (byte)0274, (byte)0311, (byte)0133, (byte)01, (byte)0310, (byte)0303, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0377, (byte)045, (byte)0214, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0234, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, +(byte)0377, (byte)045, (byte)0230, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0244, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, +(byte)0377, (byte)045, (byte)0264, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0350, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, +(byte)0377, (byte)045, (byte)0314, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0344, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, +(byte)0377, (byte)045, (byte)0304, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0310, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, +(byte)0377, (byte)045, (byte)0370, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0360, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, +(byte)0377, (byte)045, (byte)0300, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0334, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, +(byte)0377, (byte)045, (byte)0270, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0364, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, +(byte)0377, (byte)045, (byte)0340, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0354, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, +(byte)0377, (byte)045, (byte)0320, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0330, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, +(byte)0377, (byte)045, (byte)0324, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)061, (byte)0300, (byte)0303, (byte)0220, (byte)0377, (byte)045, (byte)0374, (byte)0301, +(byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0250, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0160, (byte)0301, +(byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0104, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0114, (byte)0301, +(byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0120, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0110, (byte)0301, +(byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)054, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)060, (byte)0301, +(byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)044, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0150, (byte)0301, +(byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)064, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0154, (byte)0301, +(byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)050, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)070, (byte)0301, +(byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0174, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0170, (byte)0301, +(byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0200, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0134, (byte)0301, +(byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0144, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0164, (byte)0301, +(byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0124, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0100, (byte)0301, +(byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0130, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)074, (byte)0301, +(byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)0377, (byte)045, (byte)0140, (byte)0301, (byte)0100, (byte)00, (byte)0220, (byte)0220, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0211, (byte)0345, (byte)0203, (byte)0354, (byte)050, (byte)0211, (byte)0175, (byte)0374, (byte)0213, (byte)0175, (byte)024, (byte)0213, (byte)0125, (byte)010, (byte)0211, +(byte)0135, (byte)0364, (byte)0213, (byte)0135, (byte)014, (byte)0211, (byte)0165, (byte)0370, (byte)0213, (byte)0165, (byte)020, (byte)0205, (byte)0377, (byte)0211, (byte)0320, (byte)0211, +(byte)0321, (byte)0165, (byte)035, (byte)071, (byte)0336, (byte)0166, (byte)0111, (byte)0211, (byte)0332, (byte)0367, (byte)0366, (byte)0211, (byte)0320, (byte)0213, (byte)0135, (byte)0364, +(byte)061, (byte)0322, (byte)0213, (byte)0165, (byte)0370, (byte)0213, (byte)0175, (byte)0374, (byte)0211, (byte)0354, (byte)0135, (byte)0303, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)071, (byte)0337, (byte)0167, (byte)0114, (byte)017, (byte)0275, (byte)0327, (byte)0203, (byte)0362, (byte)037, (byte)0211, (byte)0125, (byte)0344, (byte)0165, (byte)0122, (byte)071, +(byte)0306, (byte)017, (byte)0206, (byte)0314, (byte)00, (byte)00, (byte)00, (byte)071, (byte)0337, (byte)017, (byte)0202, (byte)0304, (byte)00, (byte)00, (byte)00, (byte)0211, +(byte)0332, (byte)0213, (byte)0165, (byte)0370, (byte)0211, (byte)0310, (byte)0213, (byte)0135, (byte)0364, (byte)0213, (byte)0175, (byte)0374, (byte)0211, (byte)0354, (byte)0135, (byte)0303, +(byte)0205, (byte)0366, (byte)0165, (byte)013, (byte)0270, (byte)01, (byte)00, (byte)00, (byte)00, (byte)061, (byte)0322, (byte)0367, (byte)0366, (byte)0211, (byte)0306, (byte)0211, +(byte)0330, (byte)061, (byte)0322, (byte)0367, (byte)0366, (byte)0211, (byte)0310, (byte)0367, (byte)0366, (byte)0353, (byte)0240, (byte)0220, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)0211, (byte)0320, (byte)0213, (byte)0165, (byte)0370, (byte)0211, (byte)0332, (byte)0213, (byte)0175, (byte)0374, (byte)0213, (byte)0135, (byte)0364, (byte)0211, (byte)0354, (byte)0135, +(byte)0303, (byte)017, (byte)0266, (byte)0115, (byte)0344, (byte)0211, (byte)0372, (byte)0211, (byte)0367, (byte)0323, (byte)0342, (byte)0271, (byte)040, (byte)00, (byte)00, (byte)00, +(byte)053, (byte)0115, (byte)0344, (byte)0211, (byte)0115, (byte)0340, (byte)0323, (byte)0357, (byte)017, (byte)0266, (byte)0115, (byte)0344, (byte)011, (byte)0327, (byte)0211, (byte)0302, +(byte)0211, (byte)0175, (byte)0330, (byte)0211, (byte)0307, (byte)0323, (byte)0346, (byte)017, (byte)0266, (byte)0115, (byte)0340, (byte)0211, (byte)0165, (byte)0334, (byte)0211, (byte)0336, +(byte)0323, (byte)0356, (byte)017, (byte)0266, (byte)0115, (byte)0344, (byte)0323, (byte)0343, (byte)017, (byte)0266, (byte)0115, (byte)0340, (byte)0323, (byte)0352, (byte)017, (byte)0266, +(byte)0115, (byte)0344, (byte)011, (byte)0323, (byte)0211, (byte)0362, (byte)0211, (byte)0330, (byte)0367, (byte)0165, (byte)0330, (byte)0211, (byte)0326, (byte)0323, (byte)0347, (byte)0367, +(byte)0145, (byte)0334, (byte)071, (byte)0326, (byte)0162, (byte)076, (byte)071, (byte)0307, (byte)0162, (byte)066, (byte)017, (byte)0266, (byte)0115, (byte)0344, (byte)051, (byte)0307, +(byte)031, (byte)0326, (byte)0211, (byte)0360, (byte)0211, (byte)0362, (byte)0213, (byte)0135, (byte)0364, (byte)0213, (byte)0165, (byte)0370, (byte)0323, (byte)0357, (byte)017, (byte)0266, +(byte)0115, (byte)0340, (byte)0323, (byte)0340, (byte)017, (byte)0266, (byte)0115, (byte)0344, (byte)011, (byte)0370, (byte)0213, (byte)0175, (byte)0374, (byte)0211, (byte)0354, (byte)0135, +(byte)0323, (byte)0352, (byte)0303, (byte)051, (byte)0361, (byte)031, (byte)0373, (byte)0351, (byte)063, (byte)0377, (byte)0377, (byte)0377, (byte)0215, (byte)0164, (byte)046, (byte)00, +(byte)071, (byte)0326, (byte)0165, (byte)0306, (byte)053, (byte)0105, (byte)0334, (byte)033, (byte)0125, (byte)0330, (byte)0215, (byte)0266, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0353, (byte)0270, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0125, (byte)0211, (byte)0345, (byte)0203, (byte)0354, (byte)050, (byte)0213, (byte)0105, (byte)024, (byte)0211, (byte)0135, (byte)0364, (byte)0213, (byte)0135, (byte)020, (byte)0211, +(byte)0165, (byte)0370, (byte)0213, (byte)0165, (byte)014, (byte)0211, (byte)0175, (byte)0374, (byte)0213, (byte)0175, (byte)010, (byte)0205, (byte)0300, (byte)0165, (byte)043, (byte)071, +(byte)0363, (byte)0167, (byte)0123, (byte)0205, (byte)0333, (byte)0165, (byte)013, (byte)0270, (byte)01, (byte)00, (byte)00, (byte)00, (byte)061, (byte)0322, (byte)0367, (byte)0363, +(byte)0211, (byte)0303, (byte)0211, (byte)0360, (byte)061, (byte)0322, (byte)0367, (byte)0363, (byte)0211, (byte)0306, (byte)0211, (byte)0370, (byte)0367, (byte)0363, (byte)0211, (byte)0307, +(byte)0353, (byte)043, (byte)071, (byte)0360, (byte)0167, (byte)033, (byte)017, (byte)0275, (byte)0320, (byte)0203, (byte)0362, (byte)037, (byte)0211, (byte)0125, (byte)0344, (byte)0165, +(byte)061, (byte)071, (byte)0373, (byte)017, (byte)0206, (byte)0211, (byte)00, (byte)00, (byte)00, (byte)071, (byte)0360, (byte)017, (byte)0202, (byte)0201, (byte)00, (byte)00, +(byte)00, (byte)061, (byte)0366, (byte)061, (byte)0377, (byte)0211, (byte)0370, (byte)0211, (byte)0362, (byte)0213, (byte)0135, (byte)0364, (byte)0213, (byte)0165, (byte)0370, (byte)0213, +(byte)0175, (byte)0374, (byte)0211, (byte)0354, (byte)0135, (byte)0303, (byte)0211, (byte)0362, (byte)0211, (byte)0370, (byte)061, (byte)0366, (byte)0367, (byte)0363, (byte)0211, (byte)0307, +(byte)0353, (byte)0343, (byte)017, (byte)0266, (byte)0115, (byte)0344, (byte)0272, (byte)040, (byte)00, (byte)00, (byte)00, (byte)053, (byte)0125, (byte)0344, (byte)0323, (byte)0340, +(byte)0211, (byte)0321, (byte)0211, (byte)0105, (byte)0340, (byte)0211, (byte)0330, (byte)0323, (byte)0350, (byte)017, (byte)0266, (byte)0115, (byte)0344, (byte)013, (byte)0105, (byte)0340, +(byte)0323, (byte)0343, (byte)0211, (byte)0321, (byte)0211, (byte)0135, (byte)0334, (byte)0211, (byte)0363, (byte)0323, (byte)0353, (byte)017, (byte)0266, (byte)0115, (byte)0344, (byte)0211, +(byte)0105, (byte)0340, (byte)0211, (byte)0370, (byte)0323, (byte)0346, (byte)0211, (byte)0321, (byte)0323, (byte)0350, (byte)0211, (byte)0332, (byte)011, (byte)0306, (byte)0211, (byte)0360, +(byte)0367, (byte)0165, (byte)0340, (byte)0211, (byte)0323, (byte)0211, (byte)0306, (byte)0367, (byte)0145, (byte)0334, (byte)071, (byte)0323, (byte)0162, (byte)042, (byte)017, (byte)0266, + }; +} diff --git a/src/main/java/io/soluble/pjb/bridge/LauncherWindows4.java b/src/main/java/io/soluble/pjb/bridge/LauncherWindows4.java new file mode 100644 index 0000000..0c54fa4 --- /dev/null +++ b/src/main/java/io/soluble/pjb/bridge/LauncherWindows4.java @@ -0,0 +1,293 @@ +package io.soluble.pjb.bridge; +public class LauncherWindows4 { + public static final byte[] bytes = new byte[]{ +(byte)0115, (byte)0344, (byte)0323, (byte)0347, (byte)071, (byte)0307, (byte)0163, (byte)04, (byte)071, (byte)0323, (byte)0164, (byte)024, (byte)0211, (byte)0367, (byte)061, (byte)0366, +(byte)0353, (byte)0203, (byte)061, (byte)0366, (byte)0277, (byte)01, (byte)00, (byte)00, (byte)00, (byte)0351, (byte)0167, (byte)0377, (byte)0377, (byte)0377, (byte)0146, (byte)0220, +(byte)0215, (byte)0176, (byte)0377, (byte)061, (byte)0366, (byte)0351, (byte)0153, (byte)0377, (byte)0377, (byte)0377, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0121, (byte)0215, (byte)0114, (byte)044, (byte)010, (byte)075, (byte)00, (byte)020, (byte)00, (byte)00, (byte)0162, (byte)025, (byte)0201, (byte)0351, (byte)00, (byte)020, +(byte)00, (byte)00, (byte)0203, (byte)011, (byte)00, (byte)055, (byte)00, (byte)020, (byte)00, (byte)00, (byte)075, (byte)00, (byte)020, (byte)00, (byte)00, (byte)0167, +(byte)0353, (byte)051, (byte)0301, (byte)0203, (byte)011, (byte)00, (byte)0211, (byte)0340, (byte)0211, (byte)0314, (byte)0213, (byte)010, (byte)0213, (byte)0100, (byte)04, (byte)0120, +(byte)0303, (byte)0220, (byte)0220, (byte)0220, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0125, (byte)0211, (byte)0345, (byte)0203, (byte)0354, (byte)030, (byte)0350, (byte)0105, (byte)0246, (byte)0377, (byte)0377, (byte)0307, (byte)04, (byte)044, (byte)020, (byte)023, +(byte)0100, (byte)00, (byte)0350, (byte)0171, (byte)0243, (byte)0377, (byte)0377, (byte)0311, (byte)0303, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, (byte)0220, +(byte)0377, (byte)0377, (byte)0377, (byte)0377, (byte)0160, (byte)0154, (byte)0100, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0377, (byte)0377, (byte)0377, (byte)0377, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)0135, (byte)0202, (byte)0100, (byte)00, (byte)0145, (byte)0202, (byte)0100, (byte)00, (byte)0377, (byte)0377, (byte)0377, (byte)0377, +(byte)00, (byte)0100, (byte)00, (byte)00, (byte)0240, (byte)0154, (byte)0100, (byte)00, (byte)0100, (byte)00, (byte)00, (byte)00, (byte)0303, (byte)0277, (byte)0377, (byte)0377, +(byte)0300, (byte)077, (byte)00, (byte)00, (byte)01, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0340, (byte)0220, (byte)0100, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0154, (byte)0151, (byte)0142, (byte)0147, (byte)0143, (byte)0152, (byte)0137, (byte)0163, (byte)056, (byte)0144, (byte)0154, (byte)0154, (byte)00, (byte)0137, (byte)0112, (byte)0166, +(byte)0137, (byte)0122, (byte)0145, (byte)0147, (byte)0151, (byte)0163, (byte)0164, (byte)0145, (byte)0162, (byte)0103, (byte)0154, (byte)0141, (byte)0163, (byte)0163, (byte)0145, (byte)0163, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)0154, (byte)0141, (byte)0165, (byte)0156, (byte)0143, (byte)0150, (byte)0145, (byte)0162, (byte)056, (byte)0145, (byte)0170, (byte)0145, +(byte)040, (byte)0164, (byte)0145, (byte)0162, (byte)0155, (byte)0151, (byte)0156, (byte)0141, (byte)0164, (byte)0145, (byte)0144, (byte)040, (byte)0167, (byte)0151, (byte)0164, (byte)0150, +(byte)040, (byte)0145, (byte)0162, (byte)0162, (byte)0157, (byte)0162, (byte)040, (byte)0143, (byte)0157, (byte)0144, (byte)0145, (byte)040, (byte)045, (byte)0144, (byte)040, (byte)0151, +(byte)0156, (byte)040, (byte)0154, (byte)0151, (byte)0156, (byte)0145, (byte)040, (byte)045, (byte)0144, (byte)056, (byte)012, (byte)00, (byte)0124, (byte)0150, (byte)0151, (byte)0163, +(byte)040, (byte)0146, (byte)0151, (byte)0154, (byte)0145, (byte)040, (byte)0151, (byte)0163, (byte)040, (byte)0160, (byte)0141, (byte)0162, (byte)0164, (byte)040, (byte)0157, (byte)0146, +(byte)040, (byte)0164, (byte)0150, (byte)0145, (byte)040, (byte)0120, (byte)0110, (byte)0120, (byte)057, (byte)0112, (byte)0141, (byte)0166, (byte)0141, (byte)040, (byte)0102, (byte)0162, +(byte)0151, (byte)0144, (byte)0147, (byte)0145, (byte)056, (byte)00, (byte)00, (byte)00, (byte)0103, (byte)0157, (byte)0160, (byte)0171, (byte)0162, (byte)0151, (byte)0147, (byte)0150, +(byte)0164, (byte)040, (byte)050, (byte)0103, (byte)051, (byte)040, (byte)062, (byte)060, (byte)060, (byte)063, (byte)054, (byte)040, (byte)062, (byte)060, (byte)060, (byte)066, +(byte)040, (byte)0112, (byte)0157, (byte)0163, (byte)0164, (byte)040, (byte)0102, (byte)0157, (byte)0145, (byte)0153, (byte)0145, (byte)0155, (byte)0145, (byte)0151, (byte)0145, (byte)0162, +(byte)040, (byte)0141, (byte)0156, (byte)0144, (byte)040, (byte)0157, (byte)0164, (byte)0150, (byte)0145, (byte)0162, (byte)0163, (byte)056, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0124, (byte)0150, (byte)0151, (byte)0163, (byte)040, (byte)0151, (byte)0163, (byte)040, (byte)0146, (byte)0162, (byte)0145, (byte)0145, (byte)040, (byte)0163, (byte)0157, (byte)0146, +(byte)0164, (byte)0167, (byte)0141, (byte)0162, (byte)0145, (byte)073, (byte)040, (byte)0163, (byte)0145, (byte)0145, (byte)040, (byte)0164, (byte)0150, (byte)0145, (byte)040, (byte)0163, +(byte)0157, (byte)0165, (byte)0162, (byte)0143, (byte)0145, (byte)040, (byte)0146, (byte)0157, (byte)0162, (byte)040, (byte)0143, (byte)0157, (byte)0160, (byte)0171, (byte)0151, (byte)0156, +(byte)0147, (byte)040, (byte)0143, (byte)0157, (byte)0156, (byte)0144, (byte)0151, (byte)0164, (byte)0151, (byte)0157, (byte)0156, (byte)0163, (byte)056, (byte)040, (byte)040, (byte)0124, +(byte)0150, (byte)0145, (byte)0162, (byte)0145, (byte)040, (byte)0151, (byte)0163, (byte)040, (byte)0116, (byte)0117, (byte)00, (byte)00, (byte)0167, (byte)0141, (byte)0162, (byte)0162, +(byte)0141, (byte)0156, (byte)0164, (byte)0171, (byte)073, (byte)040, (byte)0156, (byte)0157, (byte)0164, (byte)040, (byte)0145, (byte)0166, (byte)0145, (byte)0156, (byte)040, (byte)0146, +(byte)0157, (byte)0162, (byte)040, (byte)0115, (byte)0105, (byte)0122, (byte)0103, (byte)0110, (byte)0101, (byte)0116, (byte)0124, (byte)0101, (byte)0102, (byte)0111, (byte)0114, (byte)0111, +(byte)0124, (byte)0131, (byte)040, (byte)0157, (byte)0162, (byte)040, (byte)0106, (byte)0111, (byte)0124, (byte)0116, (byte)0105, (byte)0123, (byte)0123, (byte)040, (byte)0106, (byte)0117, +(byte)0122, (byte)040, (byte)0101, (byte)040, (byte)0120, (byte)0101, (byte)0122, (byte)0124, (byte)0111, (byte)0103, (byte)0125, (byte)0114, (byte)0101, (byte)0122, (byte)040, (byte)0120, +(byte)0125, (byte)0122, (byte)0120, (byte)0117, (byte)0123, (byte)0105, (byte)056, (byte)00, (byte)0125, (byte)0163, (byte)0141, (byte)0147, (byte)0145, (byte)072, (byte)040, (byte)0154, +(byte)0141, (byte)0165, (byte)0156, (byte)0143, (byte)0150, (byte)0145, (byte)0162, (byte)056, (byte)0145, (byte)0170, (byte)0145, (byte)040, (byte)0160, (byte)0150, (byte)0160, (byte)055, +(byte)0143, (byte)0147, (byte)0151, (byte)056, (byte)0145, (byte)0170, (byte)0145, (byte)040, (byte)0143, (byte)0150, (byte)0141, (byte)0156, (byte)0156, (byte)0145, (byte)0154, (byte)0116, +(byte)0141, (byte)0155, (byte)0145, (byte)040, (byte)0160, (byte)0150, (byte)0160, (byte)055, (byte)0157, (byte)0160, (byte)0164, (byte)0151, (byte)0157, (byte)0156, (byte)0163, (byte)00, +(byte)0111, (byte)0156, (byte)0146, (byte)0154, (byte)0165, (byte)0145, (byte)0156, (byte)0164, (byte)0151, (byte)0141, (byte)0154, (byte)040, (byte)0145, (byte)0156, (byte)0166, (byte)0151, +(byte)0162, (byte)0157, (byte)0156, (byte)0155, (byte)0145, (byte)0156, (byte)0164, (byte)040, (byte)0166, (byte)0141, (byte)0162, (byte)0151, (byte)0141, (byte)0142, (byte)0154, (byte)0145, +(byte)0163, (byte)072, (byte)040, (byte)0120, (byte)0110, (byte)0120, (byte)0137, (byte)0106, (byte)0103, (byte)0107, (byte)0111, (byte)0137, (byte)0115, (byte)0101, (byte)0130, (byte)0137, +(byte)0122, (byte)0105, (byte)0121, (byte)0125, (byte)0105, (byte)0123, (byte)0124, (byte)0123, (byte)054, (byte)040, (byte)0120, (byte)0110, (byte)0120, (byte)0137, (byte)0106, (byte)0103, +(byte)0107, (byte)0111, (byte)0137, (byte)0103, (byte)0110, (byte)0111, (byte)0114, (byte)0104, (byte)0122, (byte)0105, (byte)0116, (byte)00, (byte)0105, (byte)0170, (byte)0141, (byte)0155, +(byte)0160, (byte)0154, (byte)0145, (byte)072, (byte)040, (byte)0154, (byte)0141, (byte)0165, (byte)0156, (byte)0143, (byte)0150, (byte)0145, (byte)0162, (byte)056, (byte)0145, (byte)0170, +(byte)0145, (byte)040, (byte)0160, (byte)0150, (byte)0160, (byte)055, (byte)0143, (byte)0147, (byte)0151, (byte)040, (byte)0134, (byte)0134, (byte)056, (byte)0134, (byte)0160, (byte)0151, +(byte)0160, (byte)0145, (byte)0134, (byte)0112, (byte)0141, (byte)0166, (byte)0141, (byte)0102, (byte)0162, (byte)0151, (byte)0144, (byte)0147, (byte)0145, (byte)0100, (byte)071, (byte)066, +(byte)066, (byte)067, (byte)040, (byte)055, (byte)0144, (byte)040, (byte)0141, (byte)0154, (byte)0154, (byte)0157, (byte)0167, (byte)0137, (byte)0165, (byte)0162, (byte)0154, (byte)0137, +(byte)0151, (byte)0156, (byte)0143, (byte)0154, (byte)0165, (byte)0144, (byte)0145, (byte)075, (byte)0117, (byte)0156, (byte)00, (byte)0137, (byte)0106, (byte)0103, (byte)0107, (byte)0111, +(byte)0137, (byte)0123, (byte)0110, (byte)0125, (byte)0124, (byte)0104, (byte)0117, (byte)0127, (byte)0116, (byte)0137, (byte)0105, (byte)0126, (byte)0105, (byte)0116, (byte)0124, (byte)0137, +(byte)075, (byte)045, (byte)0154, (byte)0144, (byte)00, (byte)0120, (byte)0110, (byte)0120, (byte)0137, (byte)0106, (byte)0103, (byte)0107, (byte)0111, (byte)0137, (byte)0103, (byte)0110, +(byte)0111, (byte)0114, (byte)0104, (byte)0122, (byte)0105, (byte)0116, (byte)00, (byte)065, (byte)00, (byte)042, (byte)00, (byte)040, (byte)00, (byte)0160, (byte)0150, (byte)0160, +(byte)055, (byte)0143, (byte)0147, (byte)0151, (byte)00, (byte)0134, (byte)0134, (byte)056, (byte)0134, (byte)0160, (byte)0151, (byte)0160, (byte)0145, (byte)0134, (byte)0112, (byte)0141, +(byte)0166, (byte)0141, (byte)0102, (byte)0162, (byte)0151, (byte)0144, (byte)0147, (byte)0145, (byte)0100, (byte)071, (byte)066, (byte)066, (byte)067, (byte)00, (byte)00, (byte)00, +(byte)0120, (byte)0122, (byte)0111, (byte)0116, (byte)0124, (byte)0106, (byte)0137, (byte)0105, (byte)0130, (byte)0120, (byte)0117, (byte)0116, (byte)0105, (byte)0116, (byte)0124, (byte)0137, +(byte)0104, (byte)0111, (byte)0107, (byte)0111, (byte)0124, (byte)0123, (byte)00, (byte)00, (byte)050, (byte)00, (byte)0156, (byte)00, (byte)0165, (byte)00, (byte)0154, (byte)00, +(byte)0154, (byte)00, (byte)051, (byte)00, (byte)00, (byte)00, (byte)050, (byte)0156, (byte)0165, (byte)0154, (byte)0154, (byte)051, (byte)00, (byte)0116, (byte)0141, (byte)0116, +(byte)00, (byte)0111, (byte)0156, (byte)0146, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)070, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0241, (byte)070, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0220, (byte)070, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, +(byte)0120, (byte)070, (byte)0100, (byte)00, (byte)060, (byte)070, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)020, (byte)070, (byte)0100, (byte)00, +(byte)0360, (byte)067, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0320, (byte)067, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0346, (byte)066, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0247, (byte)066, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0200, (byte)066, (byte)0100, (byte)00, +(byte)0127, (byte)066, (byte)0100, (byte)00, (byte)060, (byte)066, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)00, (byte)066, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)027, (byte)062, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)040, (byte)071, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0220, (byte)065, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0305, (byte)064, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)040, (byte)064, (byte)0100, (byte)00, (byte)0140, (byte)064, (byte)0100, (byte)00, (byte)0340, (byte)063, (byte)0100, (byte)00, +(byte)0241, (byte)063, (byte)0100, (byte)00, (byte)0145, (byte)063, (byte)0100, (byte)00, (byte)0106, (byte)063, (byte)0100, (byte)00, (byte)0140, (byte)064, (byte)0100, (byte)00, +(byte)060, (byte)063, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)06, (byte)062, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, +(byte)0370, (byte)062, (byte)0100, (byte)00, (byte)0220, (byte)065, (byte)0100, (byte)00, (byte)0300, (byte)062, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0203, (byte)062, (byte)0100, (byte)00, (byte)0360, (byte)061, (byte)0100, (byte)00, (byte)0220, (byte)065, (byte)0100, (byte)00, +(byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, (byte)0220, (byte)065, (byte)0100, (byte)00, (byte)0202, (byte)061, (byte)0100, (byte)00, +(byte)0360, (byte)061, (byte)0100, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0111, (byte)0156, (byte)0146, (byte)0151, (byte)0156, (byte)0151, (byte)0164, (byte)0171, +(byte)00, (byte)0116, (byte)0141, (byte)0116, (byte)00, (byte)060, (byte)00, (byte)00, (byte)0231, (byte)0102, (byte)0100, (byte)00, (byte)0320, (byte)0101, (byte)0100, (byte)00, +(byte)0320, (byte)0101, (byte)0100, (byte)00, (byte)020, (byte)0103, (byte)0100, (byte)00, (byte)0325, (byte)0102, (byte)0100, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)077, +(byte)0141, (byte)0103, (byte)0157, (byte)0143, (byte)0247, (byte)0207, (byte)0322, (byte)077, (byte)0263, (byte)0310, (byte)0140, (byte)0213, (byte)050, (byte)0212, (byte)0306, (byte)077, +(byte)0373, (byte)0171, (byte)0237, (byte)0120, (byte)023, (byte)0104, (byte)0323, (byte)077, (byte)04, (byte)0372, (byte)0175, (byte)0235, (byte)026, (byte)055, (byte)0224, (byte)074, +(byte)062, (byte)0132, (byte)0107, (byte)0125, (byte)023, (byte)0104, (byte)0323, (byte)077, (byte)00, (byte)00, (byte)0200, (byte)077, (byte)00, (byte)00, (byte)040, (byte)0101, +(byte)00, (byte)00, (byte)0100, (byte)0100, (byte)00, (byte)00, (byte)0340, (byte)0100, (byte)00, (byte)00, (byte)0240, (byte)0100, (byte)00, (byte)00, (byte)00, (byte)077, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)0200, (byte)0340, (byte)067, (byte)0171, (byte)0303, (byte)0101, (byte)0103, (byte)027, (byte)0156, (byte)05, (byte)0265, (byte)0265, (byte)0270, (byte)0223, (byte)0106, +(byte)0365, (byte)0371, (byte)077, (byte)0351, (byte)03, (byte)0117, (byte)070, (byte)0115, (byte)062, (byte)035, (byte)060, (byte)0371, (byte)0110, (byte)0167, (byte)0202, (byte)0132, +(byte)074, (byte)0277, (byte)0163, (byte)0177, (byte)0335, (byte)0117, (byte)025, (byte)0165, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0274, (byte)0211, (byte)0330, (byte)0227, (byte)0262, (byte)0322, (byte)0234, (byte)074, (byte)063, (byte)0247, (byte)0250, (byte)0325, (byte)043, (byte)0366, (byte)0111, (byte)071, +(byte)075, (byte)0247, (byte)0364, (byte)0104, (byte)0375, (byte)017, (byte)0245, (byte)062, (byte)0235, (byte)0227, (byte)0214, (byte)0317, (byte)010, (byte)0272, (byte)0133, (byte)045, +(byte)0103, (byte)0157, (byte)0254, (byte)0144, (byte)050, (byte)06, (byte)0310, (byte)012, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0360, (byte)077, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)044, (byte)0100, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0131, (byte)0100, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0100, (byte)0217, (byte)0100, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0210, (byte)0303, (byte)0100, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0152, (byte)0370, (byte)0100, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)0200, (byte)0204, (byte)056, (byte)0101, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0320, (byte)022, (byte)0143, (byte)0101, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)0204, (byte)0327, (byte)0227, (byte)0101, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0145, (byte)0315, (byte)0315, (byte)0101, +(byte)00, (byte)00, (byte)00, (byte)040, (byte)0137, (byte)0240, (byte)02, (byte)0102, (byte)00, (byte)00, (byte)00, (byte)0350, (byte)0166, (byte)0110, (byte)067, (byte)0102, +(byte)00, (byte)00, (byte)00, (byte)0242, (byte)0224, (byte)032, (byte)0155, (byte)0102, (byte)00, (byte)00, (byte)0100, (byte)0345, (byte)0234, (byte)060, (byte)0242, (byte)0102, +(byte)00, (byte)00, (byte)0220, (byte)036, (byte)0304, (byte)0274, (byte)0326, (byte)0102, (byte)00, (byte)00, (byte)064, (byte)046, (byte)0365, (byte)0153, (byte)014, (byte)0103, +(byte)00, (byte)0200, (byte)0340, (byte)067, (byte)0171, (byte)0303, (byte)0101, (byte)0103, (byte)00, (byte)0240, (byte)0330, (byte)0205, (byte)0127, (byte)064, (byte)0166, (byte)0103, +(byte)00, (byte)0310, (byte)0116, (byte)0147, (byte)0155, (byte)0301, (byte)0253, (byte)0103, (byte)00, (byte)075, (byte)0221, (byte)0140, (byte)0344, (byte)0130, (byte)0341, (byte)0103, +(byte)0100, (byte)0214, (byte)0265, (byte)0170, (byte)035, (byte)0257, (byte)025, (byte)0104, (byte)0120, (byte)0357, (byte)0342, (byte)0326, (byte)0344, (byte)032, (byte)0113, (byte)0104, +(byte)0222, (byte)0325, (byte)0115, (byte)06, (byte)0317, (byte)0360, (byte)0200, (byte)0104, (byte)05, (byte)00, (byte)00, (byte)00, (byte)031, (byte)00, (byte)00, (byte)00, +(byte)0175, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)0100, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0200, (byte)0305, (byte)00, (byte)00, +(byte)044, (byte)0301, (byte)00, (byte)00, (byte)0250, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)04, (byte)0306, (byte)00, (byte)00, (byte)0214, (byte)0301, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)04, (byte)0302, (byte)00, (byte)00, (byte)022, (byte)0302, (byte)00, (byte)00, (byte)042, (byte)0302, (byte)00, (byte)00, (byte)066, (byte)0302, (byte)00, (byte)00, +(byte)0110, (byte)0302, (byte)00, (byte)00, (byte)0134, (byte)0302, (byte)00, (byte)00, (byte)0154, (byte)0302, (byte)00, (byte)00, (byte)0204, (byte)0302, (byte)00, (byte)00, +(byte)0234, (byte)0302, (byte)00, (byte)00, (byte)0252, (byte)0302, (byte)00, (byte)00, (byte)0272, (byte)0302, (byte)00, (byte)00, (byte)0316, (byte)0302, (byte)00, (byte)00, +(byte)0340, (byte)0302, (byte)00, (byte)00, (byte)0374, (byte)0302, (byte)00, (byte)00, (byte)022, (byte)0303, (byte)00, (byte)00, (byte)046, (byte)0303, (byte)00, (byte)00, +(byte)076, (byte)0303, (byte)00, (byte)00, (byte)0124, (byte)0303, (byte)00, (byte)00, (byte)0140, (byte)0303, (byte)00, (byte)00, (byte)0170, (byte)0303, (byte)00, (byte)00, +(byte)0226, (byte)0303, (byte)00, (byte)00, (byte)0236, (byte)0303, (byte)00, (byte)00, (byte)0262, (byte)0303, (byte)00, (byte)00, (byte)0314, (byte)0303, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0342, (byte)0303, (byte)00, (byte)00, (byte)0362, (byte)0303, (byte)00, (byte)00, +(byte)02, (byte)0304, (byte)00, (byte)00, (byte)022, (byte)0304, (byte)00, (byte)00, (byte)042, (byte)0304, (byte)00, (byte)00, (byte)060, (byte)0304, (byte)00, (byte)00, +(byte)0102, (byte)0304, (byte)00, (byte)00, (byte)0114, (byte)0304, (byte)00, (byte)00, (byte)0126, (byte)0304, (byte)00, (byte)00, (byte)0136, (byte)0304, (byte)00, (byte)00, +(byte)0150, (byte)0304, (byte)00, (byte)00, (byte)0164, (byte)0304, (byte)00, (byte)00, (byte)0174, (byte)0304, (byte)00, (byte)00, (byte)0206, (byte)0304, (byte)00, (byte)00, +(byte)0216, (byte)0304, (byte)00, (byte)00, (byte)0226, (byte)0304, (byte)00, (byte)00, (byte)0236, (byte)0304, (byte)00, (byte)00, (byte)0250, (byte)0304, (byte)00, (byte)00, +(byte)0260, (byte)0304, (byte)00, (byte)00, (byte)0272, (byte)0304, (byte)00, (byte)00, (byte)0310, (byte)0304, (byte)00, (byte)00, (byte)0322, (byte)0304, (byte)00, (byte)00, +(byte)0334, (byte)0304, (byte)00, (byte)00, (byte)0344, (byte)0304, (byte)00, (byte)00, (byte)0356, (byte)0304, (byte)00, (byte)00, (byte)0370, (byte)0304, (byte)00, (byte)00, +(byte)02, (byte)0305, (byte)00, (byte)00, (byte)014, (byte)0305, (byte)00, (byte)00, (byte)026, (byte)0305, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)04, (byte)0302, (byte)00, (byte)00, (byte)022, (byte)0302, (byte)00, (byte)00, (byte)042, (byte)0302, (byte)00, (byte)00, +(byte)066, (byte)0302, (byte)00, (byte)00, (byte)0110, (byte)0302, (byte)00, (byte)00, (byte)0134, (byte)0302, (byte)00, (byte)00, (byte)0154, (byte)0302, (byte)00, (byte)00, +(byte)0204, (byte)0302, (byte)00, (byte)00, (byte)0234, (byte)0302, (byte)00, (byte)00, (byte)0252, (byte)0302, (byte)00, (byte)00, (byte)0272, (byte)0302, (byte)00, (byte)00, +(byte)0316, (byte)0302, (byte)00, (byte)00, (byte)0340, (byte)0302, (byte)00, (byte)00, (byte)0374, (byte)0302, (byte)00, (byte)00, (byte)022, (byte)0303, (byte)00, (byte)00, +(byte)046, (byte)0303, (byte)00, (byte)00, (byte)076, (byte)0303, (byte)00, (byte)00, (byte)0124, (byte)0303, (byte)00, (byte)00, (byte)0140, (byte)0303, (byte)00, (byte)00, +(byte)0170, (byte)0303, (byte)00, (byte)00, (byte)0226, (byte)0303, (byte)00, (byte)00, (byte)0236, (byte)0303, (byte)00, (byte)00, (byte)0262, (byte)0303, (byte)00, (byte)00, +(byte)0314, (byte)0303, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)0342, (byte)0303, (byte)00, (byte)00, +(byte)0362, (byte)0303, (byte)00, (byte)00, (byte)02, (byte)0304, (byte)00, (byte)00, (byte)022, (byte)0304, (byte)00, (byte)00, (byte)042, (byte)0304, (byte)00, (byte)00, +(byte)060, (byte)0304, (byte)00, (byte)00, (byte)0102, (byte)0304, (byte)00, (byte)00, (byte)0114, (byte)0304, (byte)00, (byte)00, (byte)0126, (byte)0304, (byte)00, (byte)00, +(byte)0136, (byte)0304, (byte)00, (byte)00, (byte)0150, (byte)0304, (byte)00, (byte)00, (byte)0164, (byte)0304, (byte)00, (byte)00, (byte)0174, (byte)0304, (byte)00, (byte)00, +(byte)0206, (byte)0304, (byte)00, (byte)00, (byte)0216, (byte)0304, (byte)00, (byte)00, (byte)0226, (byte)0304, (byte)00, (byte)00, (byte)0236, (byte)0304, (byte)00, (byte)00, +(byte)0250, (byte)0304, (byte)00, (byte)00, (byte)0260, (byte)0304, (byte)00, (byte)00, (byte)0272, (byte)0304, (byte)00, (byte)00, (byte)0310, (byte)0304, (byte)00, (byte)00, +(byte)0322, (byte)0304, (byte)00, (byte)00, (byte)0334, (byte)0304, (byte)00, (byte)00, (byte)0344, (byte)0304, (byte)00, (byte)00, (byte)0356, (byte)0304, (byte)00, (byte)00, +(byte)0370, (byte)0304, (byte)00, (byte)00, (byte)02, (byte)0305, (byte)00, (byte)00, (byte)014, (byte)0305, (byte)00, (byte)00, (byte)026, (byte)0305, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)046, (byte)00, (byte)0103, (byte)0154, (byte)0157, (byte)0163, (byte)0145, (byte)0110, (byte)0141, (byte)0156, (byte)0144, (byte)0154, +(byte)0145, (byte)00, (byte)0100, (byte)00, (byte)0103, (byte)0162, (byte)0145, (byte)0141, (byte)0164, (byte)0145, (byte)0105, (byte)0166, (byte)0145, (byte)0156, (byte)0164, (byte)0101, +(byte)00, (byte)00, (byte)0122, (byte)00, (byte)0103, (byte)0162, (byte)0145, (byte)0141, (byte)0164, (byte)0145, (byte)0116, (byte)0141, (byte)0155, (byte)0145, (byte)0144, (byte)0120, +(byte)0151, (byte)0160, (byte)0145, (byte)0101, (byte)00, (byte)00, (byte)0125, (byte)00, (byte)0103, (byte)0162, (byte)0145, (byte)0141, (byte)0164, (byte)0145, (byte)0120, (byte)0162, +(byte)0157, (byte)0143, (byte)0145, (byte)0163, (byte)0163, (byte)0101, (byte)00, (byte)00, (byte)0130, (byte)00, (byte)0103, (byte)0162, (byte)0145, (byte)0141, (byte)0164, (byte)0145, +(byte)0123, (byte)0145, (byte)0155, (byte)0141, (byte)0160, (byte)0150, (byte)0157, (byte)0162, (byte)0145, (byte)0101, (byte)00, (byte)00, (byte)0133, (byte)00, (byte)0103, (byte)0162, +(byte)0145, (byte)0141, (byte)0164, (byte)0145, (byte)0124, (byte)0150, (byte)0162, (byte)0145, (byte)0141, (byte)0144, (byte)00, (byte)00, (byte)0153, (byte)00, (byte)0104, (byte)0145, +(byte)0154, (byte)0145, (byte)0164, (byte)0145, (byte)0103, (byte)0162, (byte)0151, (byte)0164, (byte)0151, (byte)0143, (byte)0141, (byte)0154, (byte)0123, (byte)0145, (byte)0143, (byte)0164, +(byte)0151, (byte)0157, (byte)0156, (byte)00, (byte)0176, (byte)00, (byte)0105, (byte)0156, (byte)0164, (byte)0145, (byte)0162, (byte)0103, (byte)0162, (byte)0151, (byte)0164, (byte)0151, +(byte)0143, (byte)0141, (byte)0154, (byte)0123, (byte)0145, (byte)0143, (byte)0164, (byte)0151, (byte)0157, (byte)0156, (byte)00, (byte)00, (byte)0234, (byte)00, (byte)0105, (byte)0170, +(byte)0151, (byte)0164, (byte)0120, (byte)0162, (byte)0157, (byte)0143, (byte)0145, (byte)0163, (byte)0163, (byte)00, (byte)0105, (byte)01, (byte)0107, (byte)0145, (byte)0164, (byte)0114, +(byte)0141, (byte)0163, (byte)0164, (byte)0105, (byte)0162, (byte)0162, (byte)0157, (byte)0162, (byte)00, (byte)00, (byte)0121, (byte)01, (byte)0107, (byte)0145, (byte)0164, (byte)0115, +(byte)0157, (byte)0144, (byte)0165, (byte)0154, (byte)0145, (byte)0110, (byte)0141, (byte)0156, (byte)0144, (byte)0154, (byte)0145, (byte)0101, (byte)00, (byte)00, (byte)0154, (byte)01, +(byte)0107, (byte)0145, (byte)0164, (byte)0120, (byte)0162, (byte)0157, (byte)0143, (byte)0101, (byte)0144, (byte)0144, (byte)0162, (byte)0145, (byte)0163, (byte)0163, (byte)00, (byte)00, +(byte)0354, (byte)01, (byte)0111, (byte)0156, (byte)0151, (byte)0164, (byte)0151, (byte)0141, (byte)0154, (byte)0151, (byte)0172, (byte)0145, (byte)0103, (byte)0162, (byte)0151, (byte)0164, +(byte)0151, (byte)0143, (byte)0141, (byte)0154, (byte)0123, (byte)0145, (byte)0143, (byte)0164, (byte)0151, (byte)0157, (byte)0156, (byte)00, (byte)0361, (byte)01, (byte)0111, (byte)0156, +(byte)0164, (byte)0145, (byte)0162, (byte)0154, (byte)0157, (byte)0143, (byte)0153, (byte)0145, (byte)0144, (byte)0105, (byte)0170, (byte)0143, (byte)0150, (byte)0141, (byte)0156, (byte)0147, +(byte)0145, (byte)00, (byte)00, (byte)02, (byte)0111, (byte)0163, (byte)0104, (byte)0102, (byte)0103, (byte)0123, (byte)0114, (byte)0145, (byte)0141, (byte)0144, (byte)0102, (byte)0171, +(byte)0164, (byte)0145, (byte)0105, (byte)0170, (byte)00, (byte)00, (byte)013, (byte)02, (byte)0114, (byte)0145, (byte)0141, (byte)0166, (byte)0145, (byte)0103, (byte)0162, (byte)0151, +(byte)0164, (byte)0151, (byte)0143, (byte)0141, (byte)0154, (byte)0123, (byte)0145, (byte)0143, (byte)0164, (byte)0151, (byte)0157, (byte)0156, (byte)00, (byte)00, (byte)060, (byte)02, +(byte)0115, (byte)0165, (byte)0154, (byte)0164, (byte)0151, (byte)0102, (byte)0171, (byte)0164, (byte)0145, (byte)0124, (byte)0157, (byte)0127, (byte)0151, (byte)0144, (byte)0145, (byte)0103, +(byte)0150, (byte)0141, (byte)0162, (byte)00, (byte)0272, (byte)02, (byte)0123, (byte)0145, (byte)0164, (byte)0105, (byte)0166, (byte)0145, (byte)0156, (byte)0164, (byte)00, (byte)00, +(byte)0306, (byte)02, (byte)0123, (byte)0145, (byte)0164, (byte)0110, (byte)0141, (byte)0156, (byte)0144, (byte)0154, (byte)0145, (byte)0111, (byte)0156, (byte)0146, (byte)0157, (byte)0162, +(byte)0155, (byte)0141, (byte)0164, (byte)0151, (byte)0157, (byte)0156, (byte)00, (byte)00, (byte)0343, (byte)02, (byte)0123, (byte)0145, (byte)0164, (byte)0125, (byte)0156, (byte)0150, +(byte)0141, (byte)0156, (byte)0144, (byte)0154, (byte)0145, (byte)0144, (byte)0105, (byte)0170, (byte)0143, (byte)0145, (byte)0160, (byte)0164, (byte)0151, (byte)0157, (byte)0156, (byte)0106, +(byte)0151, (byte)0154, (byte)0164, (byte)0145, (byte)0162, (byte)00, (byte)0357, (byte)02, (byte)0123, (byte)0154, (byte)0145, (byte)0145, (byte)0160, (byte)00, (byte)0367, (byte)02, +(byte)0124, (byte)0145, (byte)0162, (byte)0155, (byte)0151, (byte)0156, (byte)0141, (byte)0164, (byte)0145, (byte)0120, (byte)0162, (byte)0157, (byte)0143, (byte)0145, (byte)0163, (byte)0163, +(byte)00, (byte)00, (byte)050, (byte)03, (byte)0127, (byte)0141, (byte)0151, (byte)0164, (byte)0106, (byte)0157, (byte)0162, (byte)0115, (byte)0165, (byte)0154, (byte)0164, (byte)0151, +(byte)0160, (byte)0154, (byte)0145, (byte)0117, (byte)0142, (byte)0152, (byte)0145, (byte)0143, (byte)0164, (byte)0163, (byte)00, (byte)00, (byte)056, (byte)03, (byte)0127, (byte)0151, +(byte)0144, (byte)0145, (byte)0103, (byte)0150, (byte)0141, (byte)0162, (byte)0124, (byte)0157, (byte)0115, (byte)0165, (byte)0154, (byte)0164, (byte)0151, (byte)0102, (byte)0171, (byte)0164, +(byte)0145, (byte)00, (byte)067, (byte)00, (byte)0137, (byte)0137, (byte)0147, (byte)0145, (byte)0164, (byte)0155, (byte)0141, (byte)0151, (byte)0156, (byte)0141, (byte)0162, (byte)0147, +(byte)0163, (byte)00, (byte)075, (byte)00, (byte)0137, (byte)0137, (byte)0154, (byte)0143, (byte)0137, (byte)0143, (byte)0157, (byte)0144, (byte)0145, (byte)0160, (byte)0141, (byte)0147, +(byte)0145, (byte)00, (byte)0101, (byte)00, (byte)0137, (byte)0137, (byte)0155, (byte)0142, (byte)0137, (byte)0143, (byte)0165, (byte)0162, (byte)0137, (byte)0155, (byte)0141, (byte)0170, +(byte)00, (byte)00, (byte)0115, (byte)00, (byte)0137, (byte)0137, (byte)0160, (byte)0137, (byte)0137, (byte)0145, (byte)0156, (byte)0166, (byte)0151, (byte)0162, (byte)0157, (byte)0156, +(byte)00, (byte)00, (byte)0117, (byte)00, (byte)0137, (byte)0137, (byte)0160, (byte)0137, (byte)0137, (byte)0146, (byte)0155, (byte)0157, (byte)0144, (byte)0145, (byte)00, (byte)00, +(byte)0143, (byte)00, (byte)0137, (byte)0137, (byte)0163, (byte)0145, (byte)0164, (byte)0137, (byte)0141, (byte)0160, (byte)0160, (byte)0137, (byte)0164, (byte)0171, (byte)0160, (byte)0145, +(byte)00, (byte)00, (byte)0223, (byte)00, (byte)0137, (byte)0143, (byte)0145, (byte)0170, (byte)0151, (byte)0164, (byte)00, (byte)00, (byte)0266, (byte)00, (byte)0137, (byte)0145, +(byte)0162, (byte)0162, (byte)0156, (byte)0157, (byte)00, (byte)00, (byte)012, (byte)01, (byte)0137, (byte)0151, (byte)0157, (byte)0142, (byte)00, (byte)00, (byte)0177, (byte)01, +(byte)0137, (byte)0157, (byte)0156, (byte)0145, (byte)0170, (byte)0151, (byte)0164, (byte)00, (byte)0252, (byte)01, (byte)0137, (byte)0163, (byte)0145, (byte)0164, (byte)0155, (byte)0157, +(byte)0144, (byte)0145, (byte)00, (byte)00, (byte)0107, (byte)02, (byte)0141, (byte)0142, (byte)0157, (byte)0162, (byte)0164, (byte)00, (byte)0116, (byte)02, (byte)0141, (byte)0164, +(byte)0145, (byte)0170, (byte)0151, (byte)0164, (byte)00, (byte)00, (byte)0120, (byte)02, (byte)0141, (byte)0164, (byte)0157, (byte)0151, (byte)00, (byte)00, (byte)0134, (byte)02, +(byte)0145, (byte)0170, (byte)0151, (byte)0164, (byte)00, (byte)00, (byte)0145, (byte)02, (byte)0146, (byte)0147, (byte)0145, (byte)0164, (byte)0163, (byte)00, (byte)0153, (byte)02, +(byte)0146, (byte)0160, (byte)0162, (byte)0151, (byte)0156, (byte)0164, (byte)0146, (byte)00, (byte)0154, (byte)02, (byte)0146, (byte)0160, (byte)0165, (byte)0164, (byte)0143, (byte)00, +(byte)0175, (byte)02, (byte)0147, (byte)0145, (byte)0164, (byte)0145, (byte)0156, (byte)0166, (byte)00, (byte)00, (byte)0237, (byte)02, (byte)0154, (byte)0157, (byte)0143, (byte)0141, +(byte)0154, (byte)0145, (byte)0143, (byte)0157, (byte)0156, (byte)0166, (byte)00, (byte)00, (byte)0244, (byte)02, (byte)0155, (byte)0141, (byte)0154, (byte)0154, (byte)0157, (byte)0143, +(byte)00, (byte)00, (byte)0252, (byte)02, (byte)0155, (byte)0145, (byte)0155, (byte)0143, (byte)0160, (byte)0171, (byte)00, (byte)00, (byte)0264, (byte)02, (byte)0160, (byte)0165, +(byte)0164, (byte)0163, (byte)00, (byte)00, (byte)0302, (byte)02, (byte)0163, (byte)0151, (byte)0147, (byte)0156, (byte)0141, (byte)0154, (byte)00, (byte)00, (byte)0311, (byte)02, +(byte)0163, (byte)0164, (byte)0162, (byte)0143, (byte)0141, (byte)0164, (byte)00, (byte)00, (byte)0312, (byte)02, (byte)0163, (byte)0164, (byte)0162, (byte)0143, (byte)0150, (byte)0162, +(byte)00, (byte)00, (byte)0321, (byte)02, (byte)0163, (byte)0164, (byte)0162, (byte)0154, (byte)0145, (byte)0156, (byte)00, (byte)00, (byte)0323, (byte)02, (byte)0163, (byte)0164, +(byte)0162, (byte)0156, (byte)0143, (byte)0155, (byte)0160, (byte)00, (byte)0371, (byte)02, (byte)0167, (byte)0143, (byte)0163, (byte)0154, (byte)0145, (byte)0156, (byte)00, (byte)00, +(byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, +(byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, +(byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, +(byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, +(byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, +(byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, (byte)00, (byte)0300, (byte)00, (byte)00, +(byte)0113, (byte)0105, (byte)0122, (byte)0116, (byte)0105, (byte)0114, (byte)063, (byte)062, (byte)056, (byte)0144, (byte)0154, (byte)0154, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, +(byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, +(byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, +(byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, +(byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, +(byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, +(byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, (byte)024, (byte)0300, (byte)00, (byte)00, +(byte)024, (byte)0300, (byte)00, (byte)00, (byte)0155, (byte)0163, (byte)0166, (byte)0143, (byte)0162, (byte)0164, (byte)056, (byte)0144, (byte)0154, (byte)0154, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, +(byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, (byte)00, + }; +} diff --git a/src/main/resources/META-INF/java/Java.inc b/src/main/resources/META-INF/java/Java.inc new file mode 100644 index 0000000..6f17d84 --- /dev/null +++ b/src/main/resources/META-INF/java/Java.inc @@ -0,0 +1,2084 @@ +0) { +$thiz=$ar[$arLen-1]; +return dirname($thiz); +} else { +return "java"; +} +} +function java_truncate($str) { +if (strlen($str)>955) +return substr($str,0,475).'[...]'.substr($str,-475); +return $str; +} +class java_JavaException extends Exception { +function __toString() {return $this->getMessage();} +}; +class java_RuntimeException extends java_JavaException {}; +class java_IOException extends java_JavaException {}; +class java_ConnectException extends java_IOException {}; +class java_IllegalStateException extends java_RuntimeException {}; +class java_IllegalArgumentException extends java_RuntimeException { +function __construct($ob) { +parent::__construct("illegal argument: ".gettype($ob)); +} +}; +function java_autoload_function5($x) { +$s=str_replace("_",".",$x); +$c=__javaproxy_Client_getClient(); +if(!($c->invokeMethod(0,"typeExists",array($s)))) return false; +$i="class ${x} extends Java {". +"static function type(\$sub=null){if(\$sub) \$sub='\$'.\$sub; return java('${s}'.\"\$sub\");}". +'function __construct() {$args=func_get_args();'. +'array_unshift($args,'."'$s'".'); parent::__construct($args);}}'; +eval ("$i"); +return true; +} +function java_autoload_function($x) { +$idx=strrpos($x,"\\"); if (!$idx) return java_autoload_function5($x); +$str=str_replace("\\",".",$x); +$client=__javaproxy_Client_getClient(); +if(!($client->invokeMethod(0,"typeExists",array($str)))) return false; +$package=substr($x,0,$idx); +$name=substr($x,1+$idx); +$instance="namespace $package; class ${name} extends \\Java {". +"static function type(\$sub=null){if(\$sub) \$sub='\$'.\$sub;return \\java('${str}'.\"\$sub\");}". +"static function __callStatic(\$procedure,\$args) {return \\java_invoke(\\java('${str}'),\$procedure,\$args);}". +'function __construct() {$args=func_get_args();'. +'array_unshift($args,'."'$str'".'); parent::__construct($args);}}'; +eval ("$instance"); +return true; +} +if(!defined("JAVA_DISABLE_AUTOLOAD") && function_exists("spl_autoload_register")) spl_autoload_register("java_autoload_function"); +function java_autoload($libs=null) { +trigger_error('Please use getHttpServletResponse(); +$res=new java("php.java.servlet.RemoteHttpServletResponse",$res); +$req->getRequestDispatcher($path)->include($req,$res); +if ($return) return $res->getBufferContents(); +echo $res->getBufferContents(); +return true; +} +function Java($name) { +static $classMap=array(); +if(array_key_exists($name,$classMap)) return $classMap[$name]; +return $classMap[$name]=new JavaClass($name); +} +function java_get_closure() {return java_closure_array(func_get_args());} +function java_wrap() {return java_closure_array(func_get_args());} +function java_get_values($arg) { return java_values($arg); } +function java_get_session() {return java_session_array(func_get_args());} +function java_get_context() {return java_context(); } +function java_get_server_name() { return java_server_name(); } +function java_isnull($value) { return is_null (java_values ($value)); } +function java_is_null($value) { return is_null (java_values ($value)); } +function java_istrue($value) { return (boolean)(java_values ($value)); } +function java_is_true($value) { return (boolean)(java_values ($value)); } +function java_isfalse($value) { return !(java_values ($value)); } +function java_is_false($value) { return !(java_values ($value)); } +function java_set_encoding($enc) { return java_set_file_encoding ($enc); } +function java_call_with_continuation($kontinuation=null) { +if (java_getHeader("X_JAVABRIDGE_INCLUDE",$_SERVER) && !java_getHeader("X_JAVABRIDGE_INCLUDE_ONLY",$_SERVER)) { +if (is_null($kontinuation)) +java_context()->call(java_closure()); +elseif (is_string($kontinuation)) +java_context()->call(call_user_func($kontinuation)); +elseif ($kontinuation instanceof java_JavaType) +java_context()->call($kontinuation); +else +java_context()->call(java_closure($kontinuation)); +} +} +function java_defineHostFromInitialQuery($java_base) { +if($java_base!="java") { +$url=parse_url($java_base); +if(isset($url["scheme"]) && ($url["scheme"]=="http" || $url["scheme"]=="https")) { +$scheme=$url["scheme"]=="https" ? "ssl://" : ""; +$host=$url["host"]; +$port=$url["port"]; +$path=$url["path"]; +define ("JAVA_HOSTS","${scheme}${host}:${port}"); +$dir=dirname($path); +define ("JAVA_SERVLET","$dir/servlet.phpjavabridge"); +return true; +} +} +return false; +} +define("JAVA_PEAR_VERSION","6.2.11"); +if(!defined("JAVA_SEND_SIZE")) +define("JAVA_SEND_SIZE",8192); +if(!defined("JAVA_RECV_SIZE")) +define("JAVA_RECV_SIZE",8192); +if(!defined("JAVA_HOSTS")) { +if(!java_defineHostFromInitialQuery(java_get_base())) { +if ($java_ini=get_cfg_var("java.hosts")) define("JAVA_HOSTS",$java_ini); +else define("JAVA_HOSTS","127.0.0.1:8080"); +} +} +if(!defined("JAVA_SERVLET")) { +if (!(($java_ini=get_cfg_var("java.servlet"))===false)) define("JAVA_SERVLET",$java_ini); +else define("JAVA_SERVLET",1); +} +if(!defined("JAVA_LOG_LEVEL")) +if (!(($java_ini=get_cfg_var("java.log_level"))===false)) define("JAVA_LOG_LEVEL",(int)$java_ini); +else define("JAVA_LOG_LEVEL",null); +if (!defined("JAVA_PREFER_VALUES")) +if ($java_ini=get_cfg_var("java.prefer_values")) define("JAVA_PREFER_VALUES",$java_ini); +else define("JAVA_PREFER_VALUES",0); +class java_SimpleFactory { +public $client; +function java_SimpleFactory($client) { +$this->client=$client; +} +function getProxy($result,$signature,$exception,$wrap) { +return $result; +} +function checkResult($result) { +} +} +class java_ProxyFactory extends java_SimpleFactory { +function create($result,$signature) { +return new java_JavaProxy($result,$signature); +} +function createInternal($proxy) { +return new java_InternalJava($proxy); +} +function getProxy($result,$signature,$exception,$wrap) { +$proxy=$this->create($result,$signature); +if($wrap) $proxy=$this->createInternal($proxy); +return $proxy; +} +} +class java_ArrayProxyFactory extends java_ProxyFactory { +function create($result,$signature) { +return new java_ArrayProxy($result,$signature); +} +} +class java_IteratorProxyFactory extends java_ProxyFactory { +function create($result,$signature) { +return new java_IteratorProxy($result,$signature); +} +} +class java_ExceptionProxyFactory extends java_SimpleFactory { +function create($result,$signature) { +return new java_ExceptionProxy($result,$signature); +} +function getProxy($result,$signature,$exception,$wrap) { +$proxy=$this->create($result,$signature); +if($wrap) $proxy=new java_InternalException($proxy,$exception); +return $proxy; +} +} +class java_ThrowExceptionProxyFactory extends java_ExceptionProxyFactory { +function getProxy($result,$signature,$exception,$wrap) { +$proxy=$this->create($result,$signature); +$proxy=new java_InternalException($proxy,$exception); +return $proxy; +} +function checkResult($result) { +if (JAVA_PREFER_VALUES || ($result->__hasDeclaredExceptions=='T')) +throw $result; +else { +trigger_error("Unchecked exception detected: ".java_truncate($result->__toString()),E_USER_WARNING); +} +} +} +class java_CacheEntry { +public $fmt,$signature,$factory,$java; +public $resultVoid; +function java_CacheEntry($fmt,$signature,$factory,$resultVoid) { +$this->fmt=$fmt; +$this->signature=$signature; +$this->factory=$factory; +$this->resultVoid=$resultVoid; +} +} +class java_Arg { +public $client; +public $exception; +public $factory,$val; +public $signature; +function java_Arg($client) { +$this->client=$client; +$this->factory=$client->simpleFactory; +} +function linkResult(&$val) { +$this->val=&$val; +} +function setResult($val) { +$this->val=&$val; +} +function getResult($wrap) { +$rc=$this->factory->getProxy($this->val,$this->signature,$this->exception,$wrap); +$factory=$this->factory; +$this->factory=$this->client->simpleFactory; +$factory->checkResult($rc); +return $rc; +} +function setFactory($factory) { +$this->factory=$factory; +} +function setException($string) { +$this->exception=$string; +} +function setVoidSignature() { +$this->signature="@V"; +$key=$this->client->currentCacheKey; +if($key && $key[0]!='~') { +$this->client->currentArgumentsFormat[6]="3"; +$cacheEntry=new java_CacheEntry($this->client->currentArgumentsFormat,$this->signature,$this->factory,true); +$this->client->methodCache[$key]=$cacheEntry; +} +} +function setSignature($signature) { +$this->signature=$signature; +$key=$this->client->currentCacheKey; +if($key && $key[0]!='~') { +$cacheEntry=new java_CacheEntry($this->client->currentArgumentsFormat,$this->signature,$this->factory,false); +$this->client->methodCache[$key]=$cacheEntry; +} +} +} +class java_CompositeArg extends java_Arg { +public $parentArg; +public $idx; +public $type; +public $counter; +function java_CompositeArg($client,$type) { +parent::java_Arg($client); +$this->type=$type; +$this->val=array(); +$this->counter=0; +} +function setNextIndex() { +$this->idx=$this->counter++; +} +function setIndex($val) { +$this->idx=$val; +} +function linkResult(&$val) { +$this->val[$this->idx]=&$val; +} +function setResult($val) { +$this->val[$this->idx]=$this->factory->getProxy($val,$this->signature,$this->exception,true); +$this->factory=$this->client->simpleFactory; +} +} +class java_ApplyArg extends java_CompositeArg { +public $m,$p,$v,$n; +function java_ApplyArg($client,$type,$m,$p,$v,$n) { +parent::java_CompositeArg($client,$type); +$this->m=$m; +$this->p=$p; +$this->v=$v; +$this->n=$n; +} +} +class java_Client { +public $RUNTIME; +public $result,$exception; +public $parser; +public $simpleArg,$compositeArg; +public $simpleFactory, +$proxyFactory,$iteratorProxyFacroty, +$arrayProxyFactory,$exceptionProxyFactory,$throwExceptionProxyFactory; +public $arg; +public $asyncCtx,$cancelProxyCreationCounter; +public $globalRef; +public $stack; +public $defaultCache=array(),$asyncCache=array(),$methodCache; +public $isAsync=0; +public $currentCacheKey,$currentArgumentsFormat; +public $cachedJavaPrototype; +public $sendBuffer,$preparedToSendBuffer; +public $inArgs; +function java_Client() { +$this->RUNTIME=array(); +$this->RUNTIME["NOTICE"]='***USE echo java_inspect(jVal) OR print_r(java_values(jVal)) TO SEE THE CONTENTS OF THIS JAVA OBJECT!***'; +$this->parser=new java_Parser($this); +$this->protocol=new java_Protocol($this); +$this->simpleFactory=new java_SimpleFactory($this); +$this->proxyFactory=new java_ProxyFactory($this); +$this->arrayProxyFactory=new java_ArrayProxyFactory($this); +$this->iteratorProxyFactory=new java_IteratorProxyFactory($this); +$this->exceptionProxyFactory=new java_ExceptionProxyFactory($this); +$this->throwExceptionProxyFactory=new java_ThrowExceptionProxyFactory($this); +$this->cachedJavaPrototype=new java_JavaProxyProxy($this); +$this->simpleArg=new java_Arg($this); +$this->globalRef=new java_GlobalRef(); +$this->asyncCtx=$this->cancelProxyCreationCounter=0; +$this->methodCache=$this->defaultCache; +$this->inArgs=false; +} +function read($size) { +return $this->protocol->read($size); +} +function setDefaultHandler() { +$this->methodCache=$this->defaultCache; +} +function setAsyncHandler() { +$this->methodCache=$this->asyncCache; +} +function handleRequests() { +$tail_call=false; +do { +$this->stack=array($this->arg=$this->simpleArg); +$this->idx=0; +$this->parser->parse(); +if((count($this->stack)) > 1) { +$arg=array_pop($this->stack); +$this->apply($arg); +$tail_call=true; +} else { +$tail_call=false; +} +$this->stack=null; +} while($tail_call); +return 1; +} +function getWrappedResult($wrap) { +return $this->simpleArg->getResult($wrap); +} +function getInternalResult() { +return $this->getWrappedResult(false); +} +function getResult() { +return $this->getWrappedResult(true); +} +function getProxyFactory($type) { +switch($type[0]) { +case 'E': +$factory=$this->exceptionProxyFactory; +break; +case 'C': +$factory=$this->iteratorProxyFactory; +break; +case 'A': +$factory=$this->arrayProxyFactory; +break; +default: +case 'O': +$factory=$this->proxyFactory; +} +return $factory; +} +function link(&$arg,&$newArg) { +$arg->linkResult($newArg->val); +$newArg->parentArg=$arg; +} +function getExact($str) { +return hexdec($str); +} +function getInexact($str) { +$val=null; +sscanf($str,"%e",$val); +return $val; +} +function begin($name,$st) { +$arg=$this->arg; +switch($name[0]) { +case 'A': +$object=$this->globalRef->get($this->getExact($st['v'])); +$newArg=new java_ApplyArg($this,'A', +$this->parser->getData($st['m']), +$this->parser->getData($st['p']), +$object, +$this->getExact($st['n'])); +$this->link($arg,$newArg); +array_push($this->stack,$this->arg=$newArg); +break; +case 'X': +$newArg=new java_CompositeArg($this,$st['t']); +$this->link($arg,$newArg); +array_push($this->stack,$this->arg=$newArg); +break; +case 'P': +if($arg->type=='H') { +$s=$st['t']; +if($s[0]=='N') { +$arg->setIndex($this->getExact($st['v'])); +} else { +$arg->setIndex($this->parser->getData($st['v'])); +} +} else { +$arg->setNextIndex(); +} +break; +case 'S': +$arg->setResult($this->parser->getData($st['v'])); +break; +case 'B': +$s=$st['v']; +$arg->setResult($s[0]=='T'); +break; +case 'L': +$sign=$st['p']; +$val=$this->getExact($st['v']); +if($sign[0]=='A') $val*=-1; +$arg->setResult($val); +break; +case 'D': +$arg->setResult($this->getInexact($st['v'])); +break; +case 'V': +if ($st['n']!='T') { +$arg->setVoidSignature(); +} +case 'N': +$arg->setResult(null); +break; +case 'F': +break; +case 'O': +$arg->setFactory($this->getProxyFactory($st['p'])); +$arg->setResult($this->asyncCtx=$this->getExact($st['v'])); +if($st['n']!='T') $arg->setSignature($st['m']); +break; +case 'E': +$arg->setFactory($this->throwExceptionProxyFactory); +$arg->setException($st['m']); +$arg->setResult($this->asyncCtx=$this->getExact($st['v'])); +break; +default: +$this->parser->parserError(); +} +} +function end($name) { +switch($name[0]) { +case 'X': +$frame=array_pop($this->stack); +$this->arg=$frame->parentArg; +break; +} +} +function createParserString() { +return new java_ParserString(); +} +function writeArg($arg) { +if(is_string($arg)) { +$this->protocol->writeString($arg); +} else if(is_object($arg)) { +if ((!$arg instanceof java_JavaType)) { +error_log((string)new java_IllegalArgumentException($arg)); +trigger_error("argument '".get_class($arg)."' is not a Java object,using NULL instead",E_USER_WARNING); +$this->protocol->writeObject(null); +} else { +$this->protocol->writeObject($arg->__java); +} +} else if(is_null($arg)) { +$this->protocol->writeObject(null); +} else if(is_bool($arg)) { +$this->protocol->writeBoolean($arg); +} else if(is_integer($arg)) { +$this->protocol->writeLong($arg); +} else if(is_float($arg)) { +$this->protocol->writeDouble($arg); +} else if(is_array($arg)) { +$wrote_begin=false; +foreach($arg as $key=>$val) { +if(is_string($key)) { +if(!$wrote_begin) { +$wrote_begin=1; +$this->protocol->writeCompositeBegin_h(); +} +$this->protocol->writePairBegin_s($key); +$this->writeArg($val); +$this->protocol->writePairEnd(); +} else { +if(!$wrote_begin) { +$wrote_begin=1; +$this->protocol->writeCompositeBegin_h(); +} +$this->protocol->writePairBegin_n($key); +$this->writeArg($val); +$this->protocol->writePairEnd(); +} +} +if(!$wrote_begin) { +$this->protocol->writeCompositeBegin_a(); +} +$this->protocol->writeCompositeEnd(); +} +} +function writeArgs($args) { +$this->inArgs=true; +$n=count($args); +for($i=0; $i<$n; $i++) { +$this->writeArg($args[$i]); +} +$this->inArgs=false; +} +function createObject($name,$args) { +$this->protocol->createObjectBegin($name); +$this->writeArgs($args); +$this->protocol->createObjectEnd(); +$val=$this->getInternalResult(); +return $val; +} +function referenceObject($name,$args) { +$this->protocol->referenceBegin($name); +$this->writeArgs($args); +$this->protocol->referenceEnd(); +$val=$this->getInternalResult(); +return $val; +} +function getProperty($object,$property) { +$this->protocol->propertyAccessBegin($object,$property); +$this->protocol->propertyAccessEnd(); +return $this->getResult(); +} +function setProperty($object,$property,$arg) { +$this->protocol->propertyAccessBegin($object,$property); +$this->writeArg($arg); +$this->protocol->propertyAccessEnd(); +$this->getResult(); +} +function invokeMethod($object,$method,$args) { +$this->protocol->invokeBegin($object,$method); +$this->writeArgs($args); +$this->protocol->invokeEnd(); +$val=$this->getResult(); +return $val; +} +function unref($object) { +if (isset($this->protocol)) $this->protocol->writeUnref($object); +} +function apply($arg) { +$name=$arg->p; +$object=$arg->v; +$ob=($object==null) ? $name : array(&$object,$name); +$isAsync=$this->isAsync; +$methodCache=$this->methodCache; +$currentArgumentsFormat=$this->currentArgumentsFormat; +try { +$res=$arg->getResult(true); +if((($object==null) && !function_exists($name)) || (!($object==null) && !method_exists($object,$name))) throw new JavaException("java.lang.NoSuchMethodError","$name"); +$res=call_user_func_array($ob,$res); +if (is_object($res) && (!($res instanceof java_JavaType))) { +trigger_error("object returned from $name() is not a Java object",E_USER_WARNING); +$this->protocol->invokeBegin(0,"makeClosure"); +$this->protocol->writeULong($this->globalRef->add($res)); +$this->protocol->invokeEnd(); +$res=$this->getResult(); +} +$this->protocol->resultBegin(); +$this->writeArg($res); +$this->protocol->resultEnd(); +} catch (JavaException $e) { +$trace=$e->getTraceAsString(); +$this->protocol->resultBegin(); +$this->protocol->writeException($e->__java,$trace); +$this->protocol->resultEnd(); +} catch(Exception $ex) { +error_log($ex->__toString()); +trigger_error("Unchecked exception detected in callback",E_USER_ERROR); +die (1); +} +$this->isAsync=$isAsync; +$this->methodCache=$methodCache; +$this->currentArgumentsFormat=$currentArgumentsFormat; +} +function cast($object,$type) { +switch($type[0]) { +case 'S': case 's': +return $this->invokeMethod(0,"castToString",array($object)); +case 'B': case 'b': +return $this->invokeMethod(0,"castToBoolean",array($object)); +case 'L': case 'I': case 'l': case 'i': +return $this->invokeMethod(0,"castToExact",array($object)); +case 'D': case 'd': case 'F': case 'f': +return $this->invokeMethod(0,"castToInExact",array($object)); +case 'N': case 'n': +return null; +case 'A': case 'a': +return $this->invokeMethod(0,"castToArray",array($object)); +case 'O': case 'o': +return $object; +default: +throw new java_RuntimeException("$type illegal"); +} +} +function getContext() { +static $cache=null; +if (!is_null($cache)) return $cache; +return $cache=$this->invokeMethod(0,"getContext",array()); +} +function getSession($args) { +return $this->invokeMethod(0,"getSession",$args); +} +function getServerName() { +static $cache=null; +if (!is_null($cache)) return $cache; +return $cache=$this->protocol->getServerName(); +} +} +function java_shutdown() { +global $java_initialized; +if (!$java_initialized) return; +if (session_id()) session_write_close(); +$client=__javaproxy_Client_getClient(); +if (!isset($client->protocol) || $client->inArgs) return; +if ($client->preparedToSendBuffer) +$client->sendBuffer.=$client->preparedToSendBuffer; +$client->sendBuffer.=$client->protocol->getKeepAlive(); +$client->protocol->flush(); +$client->protocol->keepAlive(); +} +register_shutdown_function("java_shutdown"); +class java_GlobalRef { +public $map; +function java_GlobalRef() { +$this->map=array(); +} +function add($object) { +if(is_null($object)) return 0; +return array_push($this->map,$object); +} +function get($id) { +if(!$id) return 0; +return $this->map[--$id]; +} +} +class java_NativeParser { +public $parser,$handler; +public $level,$event; +public $buf; +function java_NativeParser($handler) { +$this->handler=$handler; +$this->parser=xml_parser_create(); +xml_parser_set_option($this->parser,XML_OPTION_CASE_FOLDING,0); +xml_set_object($this->parser,$this); +xml_set_element_handler($this->parser,"begin","end"); +xml_parse($this->parser,""); +$this->level=0; +} +function begin($parser,$name,$param) { +$this->event=true; +switch($name) { +case 'X': case 'A': $this->level+=1; +} +$this->handler->begin($name,$param); +} +function end($parser,$name) { +$this->handler->end($name); +switch($name) { +case 'X': case 'A': $this->level-=1; +} +} +function getData($str) { +return base64_decode($str); +} +function parse() { +do { +$this->event=false; +$buf=$this->buf=$this->handler->read(JAVA_RECV_SIZE); +$len=strlen($buf); +if(!xml_parse($this->parser,$buf,$len==0)) { +$this->handler->protocol->handler->shutdownBrokenConnection( +sprintf("protocol error: %s,%s at col %d. Check the back end log for OutOfMemoryErrors.", +$buf, +xml_error_string(xml_get_error_code($this->parser)), +xml_get_current_column_number($this->parser))); +} +} while(!$this->event || $this->level>0); +} +function parserError() { +$this->handler->protocol->handler->shutdownBrokenConnection( +sprintf("protocol error: %s. Check the back end log for details.",$this->buf)); +} +} +class java_Parser { +public $parser; +function java_Parser($handler) { +if(function_exists("xml_parser_create")) { +$this->parser=new java_NativeParser($handler); +$handler->RUNTIME["PARSER"]="NATIVE"; +} else { +$this->parser=new java_SimpleParser($handler); +$handler->RUNTIME["PARSER"]="SIMPLE"; +} +} +function parse() { +$this->parser->parse(); +} +function getData($str) { +return $this->parser->getData($str); +} +function parserError() { +$this->parser->parserError(); +} +} +function java_getHeader($name,$array) { +if (array_key_exists($name,$array)) return $array[$name]; +$name="HTTP_$name"; +if (array_key_exists($name,$array)) return $array[$name]; +return null; +} +function java_checkCliSapi() { +$sapi=substr(php_sapi_name(),0,3); +return ((($sapi=='cgi') && !get_cfg_var("java.session")) || ($sapi=='cli')); +} +function java_getCompatibilityOption($client) { +static $compatibility=null; +if ($compatibility) return $compatibility; +$compatibility=$client->RUNTIME["PARSER"]=="NATIVE" +? (0103-JAVA_PREFER_VALUES) +: (0100+JAVA_PREFER_VALUES); +if(is_int(JAVA_LOG_LEVEL)) { +$compatibility |=128 | (7 & JAVA_LOG_LEVEL)<<2; +} +$compatibility=chr ($compatibility); +return $compatibility; +} +class java_EmptyChannel { +protected $handler; +private $res; +function java_EmptyChannel($handler) { +$this->handler=$handler; +} +function shutdownBrokenConnection () {} +function fwrite($data) { +return $this->handler->fwrite($data); +} +function fread($size) { +return $this->handler->fread($size); +} +function getKeepAliveA() { +return ""; +} +function getKeepAliveE() { +return ""; +} +function getKeepAlive() { +return $this->getKeepAliveE(); +} +function error() { +trigger_error("An unchecked exception occured during script execution. Please check the server log files for details.",E_USER_ERROR); +} +function checkA($peer) { +$val=$this->res[6]; +if ($val !='A') fclose($peer); +if ($val !='A' && $val !='E') { +$this->error(); +} +} +function checkE() { +$val=$this->res[6]; +if ($val !='E') { +$this->error(); +} +} +function keepAliveS() { +$this->res=$this->fread(10); +} +function keepAliveSC() { +$this->res=$this->fread(10); +$this->fwrite(""); +$this->fread(JAVA_RECV_SIZE); +} +function keepAliveH() { +$this->res=$this->handler->read(10); +} +function keepAlive() { +$this->keepAliveH(); +$this->checkE(); +} +} +abstract class java_SocketChannel extends java_EmptyChannel { +public $peer,$host; +function java_SocketChannel($peer,$host) { +$this->peer=$peer; +$this->host=$host; +} +function fwrite($data) { +return fwrite($this->peer,$data); +} +function fread($size) { +return fread($this->peer,$size); +} +function shutdownBrokenConnection () { +fclose($this->peer); +} +} +class java_SocketChannelP extends java_SocketChannel { +function getKeepAlive() {return $this->getKeepAliveA();} +function keepAlive() { $this->keepAliveS(); $this->checkA($this->peer); } +} +class java_ChunkedSocketChannel extends java_SocketChannel { +function fwrite($data) { +$len=dechex(strlen($data)); +return fwrite($this->peer,"${len}\r\n${data}\r\n"); +} +function fread($size) { +$length=hexdec(fgets($this->peer,JAVA_RECV_SIZE)); +$data=""; +while ($length > 0) { +$str=fread($this->peer,$length); +if (feof ($this->peer)) return null; +$length -=strlen($str); +$data .=$str; +} +fgets($this->peer,3); +return $data; +} +function keepAlive() { $this->keepAliveSC(); $this->checkE(); fclose ($this->peer); } +} +class java_SocketHandler { +public $protocol,$channel; +function java_SocketHandler($protocol,$channel) { +$this->protocol=$protocol; +$this->channel=$channel; +} +function write($data) { +return $this->channel->fwrite($data); +} +function fwrite($data) {return $this->write($data);} +function read($size) { +return $this->channel->fread($size); +} +function fread($size) {return $this->read($size);} +function redirect() {} +function getKeepAlive() { +return $this->channel->getKeepAlive(); +} +function keepAlive() { +$this->channel->keepAlive(); +} +function dieWithBrokenConnection($msg) { +unset($this->protocol->client->protocol); +trigger_error ($msg?$msg:"unknown error: please see back end log for details",E_USER_ERROR); +} +function shutdownBrokenConnection ($msg) { +$this->channel->shutdownBrokenConnection(); +$this->dieWithBrokenConnection($msg); +} +} +class java_SimpleHttpHandler extends java_SocketHandler { +public $headers,$cookies; +public $context,$ssl,$port; +public $host; +function createChannel() { +$channelName=java_getHeader("X_JAVABRIDGE_REDIRECT",$_SERVER); +$context=java_getHeader("X_JAVABRIDGE_CONTEXT",$_SERVER); +$len=strlen($context); +$len0=java_getCompatibilityOption($this->protocol->client); +$len1=chr($len&0xFF); $len>>=8; +$len2=chr($len&0xFF); +$this->channel=new java_EmptyChannel($this); +$this->channel=$this->getChannel($channelName); +$this->protocol->socketHandler=new java_SocketHandler($this->protocol,$this->channel); +$this->protocol->write("\177${len0}${len1}${len2}${context}"); +$this->context=sprintf("X_JAVABRIDGE_CONTEXT: %s\r\n",$context); +$this->protocol->handler=$this->protocol->socketHandler; +$this->protocol->handler->write($this->protocol->client->sendBuffer) +or $this->protocol->handler->shutdownBrokenConnection("Broken local connection handle"); +$this->protocol->client->sendBuffer=null; +$this->protocol->handler->read(1) +or $this->protocol->handler->shutdownBrokenConnection("Broken local connection handle"); +} +function java_SimpleHttpHandler($protocol,$ssl,$host,$port) { +$this->cookies=array(); +$this->protocol=$protocol; +$this->ssl=$ssl; +$this->host=$host; +$this->port=$port; +$this->createChannel(); +} +function getCookies() { +$str=""; +$first=true; +foreach($_COOKIE as $k=> $v) { +$str .=($first ? "Cookie: $k=$v":"; $k=$v"); +$first=false; +} +if(!$first) $str .="\r\n"; +return $str; +} +function getContextFromCgiEnvironment() { +$ctx=java_getHeader('X_JAVABRIDGE_CONTEXT',$_SERVER); +return $ctx; +} +function getContext() { +static $context=null; +if($context) return $context; +$ctx=$this->getContextFromCgiEnvironment(); +$context=""; +if($ctx) { +$context=sprintf("X_JAVABRIDGE_CONTEXT: %s\r\n",$ctx); +} +return $context; +} +function getWebAppInternal() { +$context=$this->protocol->webContext; +if(isset($context)) return $context; +return (JAVA_SERVLET=="User" && +array_key_exists('PHP_SELF',$_SERVER) && +array_key_exists('HTTP_HOST',$_SERVER)) +? $_SERVER['PHP_SELF']."javabridge" +: null; +} +function getWebApp() { +$context=$this->getWebAppInternal(); +if(is_null($context)) $context=JAVA_SERVLET; +if(is_null($context) || $context[0]!="/") +$context="/JavaBridge/JavaBridge.phpjavabridge"; +return $context; +} +function write($data) { +return $this->protocol->socketHandler->write($data); +} +function doSetCookie($key,$val,$path) { +$path=trim($path); +$webapp=$this->getWebAppInternal(); if(!$webapp) $path="/"; +setcookie($key,$val,0,$path); +} +function read($size) { +return $this->protocol->socketHandler->read($size); +} +function getChannel($channelName) { +$errstr=null; $errno=null; +$peer=pfsockopen($this->host,$channelName,$errno,$errstr,20); +if (!$peer) throw new java_IllegalStateException("No ContextServer for {$this->host}:{$channelName}. Error: $errstr ($errno)\n"); +stream_set_timeout($peer,-1); +return new java_SocketChannelP($peer,$this->host); +} +function keepAlive() { +parent::keepAlive(); +} +function redirect() {} +} +class java_SimpleHttpTunnelHandler extends java_SimpleHttpHandler { +public $socket; +protected $hasContentLength=false; +function createSimpleChannel () { +$this->channel=new java_EmptyChannel($this); +} +function createChannel() { +$this->createSimpleChannel(); +} +function shutdownBrokenConnection ($msg) { +fclose($this->socket); +$this->dieWithBrokenConnection($msg); +} +function checkSocket($socket,&$errno,&$errstr) { +if (!$socket) { +$msg="Could not connect to the JEE server {$this->ssl}{$this->host}:{$this->port}. Please start it."; +$msg.=java_checkCliSapi() +?" Or define('JAVA_HOSTS',9267); define('JAVA_SERVLET',false); before including 'Java.inc' and try again. Error message: $errstr ($errno)\n" +:" Error message: $errstr ($errno)\n"; +throw new java_ConnectException($msg); +} +} +function open() { +$errno=null; $errstr=null; +$socket=fsockopen("{$this->ssl}{$this->host}",$this->port,$errno,$errstr,20); +$this->checkSocket($socket,$errno,$errstr); +stream_set_timeout($socket,-1); +$this->socket=$socket; +} +function fread($size) { +$length=hexdec(fgets($this->socket,JAVA_RECV_SIZE)); +$data=""; +while ($length > 0) { +$str=fread($this->socket,$length); +if (feof ($this->socket)) return null; +$length -=strlen($str); +$data .=$str; +} +fgets($this->socket,3); +return $data; +} +function fwrite($data) { +$len=dechex(strlen($data)); +return fwrite($this->socket,"${len}\r\n${data}\r\n"); +} +function close() { +fwrite($this->socket,"0\r\n\r\n"); +fgets($this->socket,JAVA_RECV_SIZE); +fgets($this->socket,3); +fclose($this->socket); +} +function java_SimpleHttpTunnelHandler($protocol,$ssl,$host,$port) { +parent::java_SimpleHttpHandler($protocol,$ssl,$host,$port); +$this->open(); +} +function read($size) { +if(is_null($this->headers)) $this->parseHeaders(); +if (isset($this->headers["http_error"])) { +if (isset($this->headers["transfer_chunked"])) { +$str=$this->fread(JAVA_RECV_SIZE); +} elseif (isset($this->headers['content_length'])) { +$len=$this->headers['content_length']; +for($str=fread($this->socket,$len); strlen($str)<$len; $str.=fread($this->socket,$len-strlen($str))) +if (feof ($this->socket)) break; +} else { +$str=fread($this->socket,JAVA_RECV_SIZE); +} +$this->shutdownBrokenConnection($str); +} +return $this->fread(JAVA_RECV_SIZE); +} +function getBodyFor ($compat,$data) { +$len=dechex(2+strlen($data)); +return "Cache-Control: no-cache\r\nPragma: no-cache\r\nTransfer-Encoding: chunked\r\n\r\n${len}\r\n\177${compat}${data}\r\n"; +} +function write($data) { +$compat=java_getCompatibilityOption($this->protocol->client); +$this->headers=null; +$socket=$this->socket; +$webapp=$this->getWebApp(); +$cookies=$this->getCookies(); +$context=$this->getContext(); +$res="PUT "; +$res .=$webapp; +$res .=" HTTP/1.1\r\n"; +$res .="Host: {$this->host}:{$this->port}\r\n"; +$res .=$context; +$res .=$cookies; +$res .=$this->getBodyFor($compat,$data); +$count=fwrite($socket,$res) or $this->shutdownBrokenConnection("Broken connection handle"); +fflush($socket) or $this->shutdownBrokenConnection("Broken connection handle"); +return $count; +} +function parseHeaders() { +$this->headers=array(); +$line=trim(fgets($this->socket,JAVA_RECV_SIZE)); +$ar=explode (" ",$line); +$code=((int)$ar[1]); +if ($code !=200) $this->headers["http_error"]=$code; +while (($str=trim(fgets($this->socket,JAVA_RECV_SIZE)))) { +if($str[0]=='X') { +if(!strncasecmp("X_JAVABRIDGE_REDIRECT",$str,21)) { +$this->headers["redirect"]=trim(substr($str,22)); +} else if(!strncasecmp("X_JAVABRIDGE_CONTEXT",$str,20)) { +$this->headers["context"]=trim(substr($str,21)); +} +} else if($str[0]=='S') { +if(!strncasecmp("SET-COOKIE",$str,10)) { +$str=substr($str,12); +$this->cookies[]=$str; +$ar=explode(";",$str); +$cookie=explode("=",$ar[0]); +$path=""; +if(isset($ar[1])) $p=explode("=",$ar[1]); +if(isset($p)) $path=$p[1]; +$this->doSetCookie($cookie[0],$cookie[1],$path); +} +} else if($str[0]=='C') { +if(!strncasecmp("CONTENT-LENGTH",$str,14)) { +$this->headers["content_length"]=trim(substr($str,15)); +$this->hasContentLength=true; +} else if(!strncasecmp("CONNECTION",$str,10) && !strncasecmp("close",trim(substr($str,11)),5)) { +$this->headers["connection_close"]=true; +} +} else if($str[0]=='T') { +if(!strncasecmp("TRANSFER-ENCODING",$str,17) && !strncasecmp("chunked",trim(substr($str,18)),7)) { +$this->headers["transfer_chunked"]=true; +} +} +} +} +function getSimpleChannel() { +return new java_ChunkedSocketChannel($this->socket,$this->protocol,$this->host); +} +function redirect() { +$this->isRedirect=isset($this->headers["redirect"]); +if ($this->isRedirect) +$channelName=$this->headers["redirect"]; +$context=$this->headers["context"]; +$len=strlen($context); +$len0=chr(0xFF); +$len1=chr($len&0xFF); $len>>=8; +$len2=chr($len&0xFF); +if ($this->isRedirect) { +$this->protocol->socketHandler=new java_SocketHandler($this->protocol,$this->getChannel($channelName)); +$this->protocol->write("\177${len0}${len1}${len2}${context}"); +$this->context=sprintf("X_JAVABRIDGE_CONTEXT: %s\r\n",$context); +$this->close (); +$this->protocol->handler=$this->protocol->socketHandler; +$this->protocol->handler->write($this->protocol->client->sendBuffer) +or $this->protocol->handler->shutdownBrokenConnection("Broken local connection handle"); +$this->protocol->client->sendBuffer=null; +$this->protocol->handler->read(1) +or $this->protocol->handler->shutdownBrokenConnection("Broken local connection handle"); +} else { +$this->protocol->handler=$this->protocol->socketHandler=new java_SocketHandler($this->protocol,$this->getSimpleChannel()); +} +} +} +class java_HttpTunnelHandler extends java_SimpleHttpTunnelHandler { +function fread($size) { +if ($this->hasContentLength) +return fread($this->socket,$this->headers["content_length"]); +else +return parent::fread($size); +} +function fwrite($data) { +if ($this->hasContentLength) +return fwrite($this->socket,$data); +else +return parent::fwrite($data); +} +function close() { +if ($this->hasContentLength) { +fwrite($this->socket,"0\r\n\r\n"); +fclose($this->socket); +} else { +parent::fclose($this->socket); +} +} +} +class java_Protocol { +public $client; +public $webContext; +public $serverName; +function getOverrideHosts() { +if(array_key_exists('X_JAVABRIDGE_OVERRIDE_HOSTS',$_ENV)) { +$override=$_ENV['X_JAVABRIDGE_OVERRIDE_HOSTS']; +if(!is_null($override) && $override!='/') return $override; +} +return +java_getHeader('X_JAVABRIDGE_OVERRIDE_HOSTS_REDIRECT',$_SERVER); +} +static function getHost() { +static $host=null; +if(is_null($host)) { +$hosts=explode(";",JAVA_HOSTS); +$host=explode(":",$hosts[0]); +while(count ($host) < 3) array_unshift($host,""); +if (substr($host[1],0,2)=="//") $host[1]=substr($host[1],2); +} +return $host; +} +function createHttpHandler() { +$overrideHosts=$this->getOverrideHosts(); +$ssl=""; +if($overrideHosts) { +$s=$overrideHosts; +if((strlen($s)>2) && ($s[1]==':')) { +if($s[0]=='s') +$ssl="ssl://"; +$s=substr($s,2); +} +$webCtx=strpos($s,"//"); +if($webCtx) +$host=substr($s,0,$webCtx); +else +$host=$s; +$idx=strpos($host,':'); +if($idx) { +if($webCtx) +$port=substr($host,$idx+1,$webCtx); +else +$port=substr($host,$idx+1); +$host=substr($host,0,$idx); +} else { +$port="8080"; +} +if($webCtx) $webCtx=substr($s,$webCtx+1); +$this->webContext=$webCtx; +} else { +$hostVec=java_Protocol::getHost(); +if ($ssl=$hostVec[0]) $ssl .="://"; +$host=$hostVec[1]; +$port=$hostVec[2]; +} +$this->serverName="${ssl}${host}:$port"; +if ((array_key_exists("X_JAVABRIDGE_REDIRECT",$_SERVER)) || +(array_key_exists("HTTP_X_JAVABRIDGE_REDIRECT",$_SERVER))) +return new java_SimpleHttpHandler($this,$ssl,$host,$port); +return new java_HttpTunnelHandler($this,$ssl,$host,$port); +} +function createSimpleHandler($name,$again=true) { +$channelName=$name; +$errno=null; $errstr=null; +if(is_numeric($channelName)) { +$peer=@pfsockopen($host="127.0.0.1",$channelName,$errno,$errstr,5); +} else { +$type=$channelName[0]; +list($host,$channelName)=explode(":",$channelName); +$peer=pfsockopen($host,$channelName,$errno,$errstr,20); +if (!$peer) +throw new java_ConnectException("No Java server at $host:$channelName. Error message: $errstr ($errno)"); +} +if (!$peer) { +$java=file_exists(ini_get("extension_dir")."/JavaBridge.jar")?ini_get("extension_dir")."/JavaBridge.jar":(java_get_base()."/JavaBridge.jar"); +if (!file_exists($java)) +throw new java_IOException("Could not find $java in ".getcwd().". Download it from http://sf.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_".JAVA_PEAR_VERSION."/exploded/JavaBridge.jar/download and try again."); +$java_cmd="java -Dphp.java.bridge.daemon=true -jar \"${java}\" INET_LOCAL:$channelName 0"; +if (!$again) +throw new java_ConnectException("No Java back end! Please run it with: $java_cmd. Error message: $errstr ($errno)"); +if (!java_checkCliSapi()) +trigger_error("This PHP SAPI requires a JEE or SERVLET back end. Start it,define ('JAVA_SERVLET',true); define('JAVA_HOSTS',...); and try again.",E_USER_ERROR); +system ($java_cmd); +return $this->createSimpleHandler($name,false); +} +stream_set_timeout($peer,-1); +$handler=new java_SocketHandler($this,new java_SocketChannelP($peer,$host)); +$compatibility=java_getCompatibilityOption($this->client); +$this->write("\177$compatibility"); +$this->serverName="127.0.0.1:$channelName"; +return $handler; +} +function java_get_simple_channel() { +return (JAVA_HOSTS&&(!JAVA_SERVLET||(JAVA_SERVLET=="Off"))) ? JAVA_HOSTS : null; +} +function createHandler() { +if(!java_getHeader('X_JAVABRIDGE_OVERRIDE_HOSTS',$_SERVER)&& +((function_exists("java_get_default_channel")&&($defaultChannel=java_get_default_channel())) || +($defaultChannel=$this->java_get_simple_channel())) ) { +return $this->createSimpleHandler($defaultChannel); +} else { +return $this->createHttpHandler(); +} +} +function java_Protocol ($client) { +$this->client=$client; +$this->handler=$this->createHandler(); +} +function redirect() { +$this->handler->redirect(); +} +function read($size) { +return $this->handler->read($size); +} +function sendData() { +$this->handler->write($this->client->sendBuffer); +$this->client->sendBuffer=null; +} +function flush() { +$this->sendData(); +} +function getKeepAlive() { +return $this->handler->getKeepAlive(); +} +function keepAlive() { +$this->handler->keepAlive(); +} +function handle() { +$this->client->handleRequests(); +} +function write($data) { +$this->client->sendBuffer.=$data; +} +function finish() { +$this->flush(); +$this->handle(); +$this->redirect(); +} +function referenceBegin($name) { +$this->client->sendBuffer.=$this->client->preparedToSendBuffer; +$this->client->preparedToSendBuffer=null; +$signature=sprintf("",$name); +$this->write($signature); +$signature[6]="2"; +$this->client->currentArgumentsFormat=$signature; +} +function referenceEnd() { +$this->client->currentArgumentsFormat.=$format=""; +$this->write($format); +$this->finish(); +$this->client->currentCacheKey=null; +} +function createObjectBegin($name) { +$this->client->sendBuffer.=$this->client->preparedToSendBuffer; +$this->client->preparedToSendBuffer=null; +$signature=sprintf("",$name); +$this->write($signature); +$signature[6]="2"; +$this->client->currentArgumentsFormat=$signature; +} +function createObjectEnd() { +$this->client->currentArgumentsFormat.=$format=""; +$this->write($format); +$this->finish(); +$this->client->currentCacheKey=null; +} +function propertyAccessBegin($object,$method) { +$this->client->sendBuffer.=$this->client->preparedToSendBuffer; +$this->client->preparedToSendBuffer=null; +$this->write(sprintf("",$object,$method)); +$this->client->currentArgumentsFormat=""; +} +function propertyAccessEnd() { +$this->client->currentArgumentsFormat.=$format=""; +$this->write($format); +$this->finish(); +$this->client->currentCacheKey=null; +} +function invokeBegin($object,$method) { +$this->client->sendBuffer.=$this->client->preparedToSendBuffer; +$this->client->preparedToSendBuffer=null; +$this->write(sprintf("",$object,$method)); +$this->client->currentArgumentsFormat=""; +} +function invokeEnd() { +$this->client->currentArgumentsFormat.=$format=""; +$this->write($format); +$this->finish(); +$this->client->currentCacheKey=null; +} +function resultBegin() { +$this->client->sendBuffer.=$this->client->preparedToSendBuffer; +$this->client->preparedToSendBuffer=null; +$this->write(""); +} +function resultEnd() { +$this->client->currentCacheKey=null; +$this->write(""); +$this->flush(); +} +function writeString($name) { +$this->client->currentArgumentsFormat.=$format=""; +$this->write(sprintf($format,htmlspecialchars($name,ENT_COMPAT))); +} +function writeBoolean($boolean) { +$this->client->currentArgumentsFormat.=$format=""; +$this->write(sprintf($format,$boolean)); +} +function writeLong($l) { +$this->client->currentArgumentsFormat.=""; +if($l<0) { +$this->write(sprintf("",-$l)); +} else { +$this->write(sprintf("",$l)); +} +} +function writeULong($l) { +$this->client->currentArgumentsFormat.=$format=""; +$this->write(sprintf($format,$l)); +} +function writeDouble($d) { +$this->client->currentArgumentsFormat.=$format=""; +$this->write(sprintf($format,$d)); +} +function writeObject($object) { +$this->client->currentArgumentsFormat.=$format=""; +$this->write(sprintf($format,$object)); +} +function writeException($object,$str) { +$this->write(sprintf("",$object,htmlspecialchars($str,ENT_COMPAT))); +} +function writeCompositeBegin_a() { +$this->write(""); +} +function writeCompositeBegin_h() { +$this->write(""); +} +function writeCompositeEnd() { +$this->write(""); +} +function writePairBegin_s($key) { +$this->write(sprintf("

",htmlspecialchars($key,ENT_COMPAT))); +} +function writePairBegin_n($key) { +$this->write(sprintf("

",$key)); +} +function writePairBegin() { +$this->write("

"); +} +function writePairEnd() { +$this->write("

"); +} +function writeUnref($object) { +$this->client->sendBuffer.=$this->client->preparedToSendBuffer; +$this->client->preparedToSendBuffer=null; +$this->write(sprintf("",$object)); +} +function getServerName() { +return $this->serverName; +} +} +class java_ParserString { +public $string,$off,$length; +function toString() { +return $this->getString(); +} +function getString() { +return substr($this->string,$this->off,$this->length); +} +} +class java_ParserTag { +public $n,$strings; +function java_ParserTag() { +$this->strings=array(); +$this->n=0; +} +} +class java_SimpleParser { +public $SLEN=256; +public $handler; +public $tag,$buf,$len,$s; +public $type; +function java_SimpleParser($handler) { +$this->handler=$handler; +$this->tag=array(new java_ParserTag(),new java_ParserTag(),new java_ParserTag()); +$this->len=$this->SLEN; +$this->s=str_repeat(" ",$this->SLEN); +$this->type=$this->VOJD; +} +public $BEGIN=0,$KEY=1,$VAL=2,$ENTITY=3,$VOJD=5,$END=6; +public $level=0,$eor=0; public $in_dquote,$eot=false; +public $pos=0,$c=0,$i=0,$i0=0,$e; +function RESET() { +$this->type=$this->VOJD; +$this->level=0; +$this->eor=0; +$this->in_dquote=false; +$this->i=0; +$this->i0=0; +} +function APPEND($c) { +if($this->i>=$this->len-1) { +$this->s=str_repeat($this->s,2); +$this->len*=2; +} +$this->s[$this->i++]=$c; +} +function CALL_BEGIN() { +$pt=&$this->tag[1]->strings; +$st=&$this->tag[2]->strings; +$t=&$this->tag[0]->strings[0]; +$name=$t->string[$t->off]; +$n=$this->tag[2]->n; +$ar=array(); +for($i=0; $i<$n; $i++) { +$ar[$pt[$i]->getString()]=$st[$i]->getString(); +} +$this->handler->begin($name,$ar); +} +function CALL_END() { +$t=&$this->tag[0]->strings[0]; +$name=$t->string[$t->off]; +$this->handler->end($name); +} +function PUSH($t) { +$str=&$this->tag[$t]->strings; +$n=&$this->tag[$t]->n; +$this->s[$this->i]='|'; +if(!isset($str[$n])){$h=$this->handler; $str[$n]=$h->createParserString();} +$str[$n]->string=&$this->s; +$str[$n]->off=$this->i0; +$str[$n]->length=$this->i-$this->i0; +++$this->tag[$t]->n; +$this->APPEND('|'); +$this->i0=$this->i; +} +function parse() { +while($this->eor==0) { +if($this->c>=$this->pos) { +$this->buf=$this->handler->read(JAVA_RECV_SIZE); +if(is_null($this->buf) || strlen($this->buf)==0) +$this->handler->protocol->handler->shutdownBrokenConnection("protocol error. Check the back end log for OutOfMemoryErrors."); +$this->pos=strlen($this->buf); +if($this->pos==0) break; +$this->c=0; +} +switch(($ch=$this->buf[$this->c])) +{ +case '<': if($this->in_dquote) {$this->APPEND($ch); break;} +$this->level+=1; +$this->type=$this->BEGIN; +break; +case '\t': case '\f': case '\n': case '\r': case ' ': if($this->in_dquote) {$this->APPEND($ch); break;} +if($this->type==$this->BEGIN) { +$this->PUSH($this->type); +$this->type=$this->KEY; +} +break; +case '=': if($this->in_dquote) {$this->APPEND($ch); break;} +$this->PUSH($this->type); +$this->type=$this->VAL; +break; +case '/': if($this->in_dquote) {$this->APPEND($ch); break;} +if($this->type==$this->BEGIN) { $this->type=$this->END; $this->level-=1; } +$this->level-=1; +$this->eot=true; +break; +case '>': if($this->in_dquote) {$this->APPEND($ch); break;} +if($this->type==$this->END){ +$this->PUSH($this->BEGIN); +$this->CALL_END(); +} else { +if($this->type==$this->VAL) $this->PUSH($this->type); +$this->CALL_BEGIN(); +} +$this->tag[0]->n=$this->tag[1]->n=$this->tag[2]->n=0; $this->i0=$this->i=0; +$this->type=$this->VOJD; +if($this->level==0) $this->eor=1; +break; +case ';': +if($this->type==$this->ENTITY) { +switch ($this->s[$this->e+1]) { +case 'l': $this->s[$this->e]='<'; $this->i=$this->e+1; break; +case 'g': $this->s[$this->e]='>'; $this->i=$this->e+1; break; +case 'a': $this->s[$this->e]=($this->s[$this->e+2]=='m'?'&':'\''); $this->i=$this->e+1; break; +case 'q': $this->s[$this->e]='"'; $this->i=$this->e+1; break; +default: $this->APPEND($ch); +} +$this->type=$this->VAL; +} else { +$this->APPEND($ch); +} +break; +case '&': +$this->type=$this->ENTITY; +$this->e=$this->i; +$this->APPEND($ch); +break; +case '"': +$this->in_dquote=!$this->in_dquote; +if(!$this->in_dquote && $this->type==$this->VAL) { +$this->PUSH($this->type); +$this->type=$this->KEY; +} +break; +default: +$this->APPEND($ch); +} +$this->c+=1; +} +$this->RESET(); +} +function getData($str) { +return $str; +} +function parserError() { +$this->handler->protocol->handler->shutdownBrokenConnection( +sprintf("protocol error: %s. Check the back end log for details.",$this->s)); +} +} +interface java_JavaType {}; +$java_initialized=false; +function __javaproxy_Client_getClient() { +static $client=null; +if(!is_null($client)) return $client; +if (function_exists("java_create_client")) $client=java_create_client(); +else { +global $java_initialized; +$client=new java_Client(); +$java_initialized=true; +} +return $client; +} +function java_last_exception_get() { +$client=__javaproxy_Client_getClient(); +return $client->invokeMethod(0,"getLastException",array()); +} +function java_last_exception_clear() { +$client=__javaproxy_Client_getClient(); +$client->invokeMethod(0,"clearLastException",array()); +} +function java_values_internal($object) { +if(!$object instanceof java_JavaType) return $object; +$client=__javaproxy_Client_getClient(); +return $client->invokeMethod(0,"getValues",array($object)); +} +function java_invoke($object,$method,$args) { +$client=__javaproxy_Client_getClient(); +$id=($object==null) ? 0 : $object->__java; +return $client->invokeMethod($id,$method,$args); +} +function java_unwrap ($object) { +if(!$object instanceof java_JavaType) throw new java_IllegalArgumentException($object); +$client=__javaproxy_Client_getClient(); +return $client->globalRef->get($client->invokeMethod(0,"unwrapClosure",array($object))); +} +function java_values($object) { +return java_values_internal($object); +} +function java_inspect_internal($object) { +if(!$object instanceof java_JavaType) throw new java_IllegalArgumentException($object); +$client=__javaproxy_Client_getClient(); +return $client->invokeMethod(0,"inspect",array($object)); +} +function java_inspect($object) { +return java_inspect_internal($object); +} +function java_set_file_encoding($enc) { +$client=__javaproxy_Client_getClient(); +return $client->invokeMethod(0,"setFileEncoding",array($enc)); +} +function java_instanceof_internal($ob,$clazz) { +if(!$ob instanceof java_JavaType) throw new java_IllegalArgumentException($ob); +if(!$clazz instanceof java_JavaType) throw new java_IllegalArgumentException($clazz); +$client=__javaproxy_Client_getClient(); +return $client->invokeMethod(0,"instanceOf",array($ob,$clazz)); +} +function java_instanceof($ob,$clazz) { +return java_instanceof_internal($ob,$clazz); +} +function java_cast_internal($object,$type) { +if(!$object instanceof java_JavaType) { +switch($type[0]) { +case 'S': case 's': +return (string)$object; +case 'B': case 'b': +return (boolean)$object; +case 'L': case 'I': case 'l': case 'i': +return (integer)$object; +case 'D': case 'd': case 'F': case 'f': +return (float) $object; +case 'N': case 'n': +return null; +case 'A': case 'a': +return (array)$object; +case 'O': case 'o': +return (object)$object; +} +} +return $object->__cast($type); +} +function java_cast($object,$type) { +return java_cast_internal($object,$type); +} +function java_require($arg) { +trigger_error('java_require() not supported anymore. Please use
getSession($args); +} +function java_session() { +return java_session_array(func_get_args()); +} +function java_server_name() { +try { +$client=__javaproxy_Client_getClient(); +return $client->getServerName(); +} catch (java_ConnectException $ex) { +return null; +} +} +function java_context() { +$client=__javaproxy_Client_getClient(); +return $client->getContext(); +} +function java_closure_array($args) { +if(isset($args[2]) && ((!($args[2] instanceof java_JavaType))&&!is_array($args[2]))) +throw new java_IllegalArgumentException($args[2]); +$client=__javaproxy_Client_getClient(); +$args[0]=isset($args[0]) ? $client->globalRef->add($args[0]) : 0; +$client->protocol->invokeBegin(0,"makeClosure"); +$n=count($args); +$client->protocol->writeULong($args[0]); +for($i=1; $i<$n; $i++) { +$client->writeArg($args[$i]); +} +$client->protocol->invokeEnd(); +$val=$client->getResult(); +return $val; +} +function java_closure() { +return java_closure_array(func_get_args()); +} +function java_begin_document() { +} +function java_end_document() { +} +class java_JavaProxy implements java_JavaType { +public $__serialID,$__java; +public $__signature; +public $__client; +public $__tempGlobalRef; +function java_JavaProxy($java,$signature){ +$this->__java=$java; +$this->__signature=$signature; +$this->__client=__javaproxy_Client_getClient(); +} +function __cast($type) { +return $this->__client->cast($this,$type); +} +function __sleep() { +$args=array($this,java_get_lifetime()); +$this->__serialID=$this->__client->invokeMethod(0,"serialize",$args); +$this->__tempGlobalRef=$this->__client->globalRef; +return array("__serialID","__tempGlobalRef"); +} +function __wakeup() { +$args=array($this->__serialID,java_get_lifetime()); +$this->__client=__javaproxy_Client_getClient(); +if($this->__tempGlobalRef) +$this->__client->globalRef=$this->__tempGlobalRef; +$this->__tempGlobalRef=null; +$this->__java=$this->__client->invokeMethod(0,"deserialize",$args); +} +function __destruct() { +if(isset($this->__client)) +$this->__client->unref($this->__java); +} +function __get($key) { +return $this->__client->getProperty($this->__java,$key); +} +function __set($key,$val) { +$this->__client->setProperty($this->__java,$key,$val); +} +function __call($method,$args) { +return $this->__client->invokeMethod($this->__java,$method,$args); +} +function __toString() { +try { +return $this->__client->invokeMethod(0,"ObjectToString",array($this)); +} catch (JavaException $ex) { +trigger_error("Exception in Java::__toString(): ". java_truncate((string)$ex),E_USER_WARNING); +return ""; +} +} +} +class java_objectIterator implements Iterator { +private $var; +function java_ObjectIterator($javaProxy) { +$this->var=java_cast ($javaProxy,"A"); +} +function rewind() { +reset($this->var); +} +function valid() { +return $this->current() !==false; +} +function next() { +return next($this->var); +} +function key() { +return key($this->var); +} +function current() { +return current($this->var); +} +} +class java_IteratorProxy extends java_JavaProxy implements IteratorAggregate { +function getIterator() { +return new java_ObjectIterator($this); +} +} +class java_ArrayProxy extends java_IteratorProxy implements ArrayAccess { +function offsetExists($idx) { +$ar=array($this,$idx); +return $this->__client->invokeMethod(0,"offsetExists",$ar); +} +function offsetGet($idx) { +$ar=array($this,$idx); +return $this->__client->invokeMethod(0,"offsetGet",$ar); +} +function offsetSet($idx,$val) { +$ar=array($this,$idx,$val); +return $this->__client->invokeMethod(0,"offsetSet",$ar); +} +function offsetUnset($idx) { +$ar=array($this,$idx); +return $this->__client->invokeMethod(0,"offsetUnset",$ar); +} +} +class java_ExceptionProxy extends java_JavaProxy { +function __toExceptionString($trace) { +$args=array($this,$trace); +return $this->__client->invokeMethod(0,"ObjectToString",$args); +} +} +abstract class java_AbstractJava implements IteratorAggregate,ArrayAccess,java_JavaType { +public $__client; +public $__delegate; +public $__serialID; +public $__factory; +public $__java,$__signature; +public $__cancelProxyCreationTag; +function __createDelegate() { +$proxy=$this->__delegate= +$this->__factory->create($this->__java,$this->__signature); +$this->__java=$proxy->__java; +$this->__signature=$proxy->__signature; +} +function __cast($type) { +if(!isset($this->__delegate)) $this->__createDelegate(); +return $this->__delegate->__cast($type); +} +function __sleep() { +if(!isset($this->__delegate)) $this->__createDelegate(); +$this->__delegate->__sleep(); +return array("__delegate"); +} +function __wakeup() { +if(!isset($this->__delegate)) $this->__createDelegate(); +$this->__delegate->__wakeup(); +$this->__java=$this->__delegate->__java; +$this->__client=$this->__delegate->__client; +} +function __get($key) { +if(!isset($this->__delegate)) $this->__createDelegate(); +return $this->__delegate->__get($key); +} +function __set($key,$val) { +if(!isset($this->__delegate)) $this->__createDelegate(); +$this->__delegate->__set($key,$val); +} +function __call($method,$args) { +if(!isset($this->__delegate)) $this->__createDelegate(); +return $this->__delegate->__call($method,$args); +} +function __toString() { +if(!isset($this->__delegate)) $this->__createDelegate(); +return $this->__delegate->__toString(); +} +function getIterator() { +if(!isset($this->__delegate)) $this->__createDelegate(); +if(func_num_args()==0) return $this->__delegate->getIterator(); +$args=func_get_args(); return $this->__call("getIterator",$args); +} +function offsetExists($idx) { +if(!isset($this->__delegate)) $this->__createDelegate(); +if(func_num_args()==1) return $this->__delegate->offsetExists($idx); +$args=func_get_args(); return $this->__call("offsetExists",$args); +} +function offsetGet($idx) { +if(!isset($this->__delegate)) $this->__createDelegate(); +if(func_num_args()==1) return $this->__delegate->offsetGet($idx); +$args=func_get_args(); return $this->__call("offsetGet",$args); +} +function offsetSet($idx,$val) { +if(!isset($this->__delegate)) $this->__createDelegate(); +if(func_num_args()==2) return $this->__delegate->offsetSet($idx,$val); +$args=func_get_args(); return $this->__call("offsetSet",$args); +} +function offsetUnset($idx) { +if(!isset($this->__delegate)) $this->__createDelegate(); +if(func_num_args()==1) return $this->__delegate->offsetUnset($idx); +$args=func_get_args(); return $this->__call("offsetUnset",$args); +} +} +class Java extends java_AbstractJava { +function Java() { +$client=$this->__client=__javaproxy_Client_getClient(); +$args=func_get_args(); +$name=array_shift($args); +if(is_array($name)) {$args=$name; $name=array_shift($args);} +$sig="&{$this->__signature}@{$name}"; +$len=count($args); +$args2=array(); +for($i=0; $i<$len; $i++) { +switch(gettype($val=$args[$i])) { +case 'boolean': array_push($args2,$val); $sig.='@b'; break; +case 'integer': array_push($args2,$val); $sig.='@i'; break; +case 'double': array_push($args2,$val); $sig.='@d'; break; +case 'string': array_push($args2,htmlspecialchars($val,ENT_COMPAT)); $sig.='@s'; break; +case 'array':$sig="~INVALID"; break; +case 'object': +if($val instanceof java_JavaType) { +array_push($args2,$val->__java); +$sig.="@o{$val->__signature}"; +} +else { +$sig="~INVALID"; +} +break; +case 'resource': array_push($args2,$val); $sig.='@r'; break; +case 'NULL': array_push($args2,$val); $sig.='@N'; break; +case 'unknown type': array_push($args2,$val); $sig.='@u'; break; +default: throw new java_IllegalArgumentException($val); +} +} +if(array_key_exists($sig,$client->methodCache)) { +$cacheEntry=&$client->methodCache[$sig]; +$client->sendBuffer.=$client->preparedToSendBuffer; +if(strlen($client->sendBuffer)>=JAVA_SEND_SIZE) { +if($client->protocol->handler->write($client->sendBuffer)<=0) +throw new java_IllegalStateException("Connection out of sync,check backend log for details."); +$client->sendBuffer=null; +} +$client->preparedToSendBuffer=vsprintf($cacheEntry->fmt,$args2); +$this->__java=++$client->asyncCtx; +$this->__factory=$cacheEntry->factory; +$this->__signature=$cacheEntry->signature; +$this->__cancelProxyCreationTag=++$client->cancelProxyCreationTag; +} else { +$client->currentCacheKey=$sig; +$delegate=$this->__delegate=$client->createObject($name,$args); +$this->__java=$delegate->__java; +$this->__signature=$delegate->__signature; +} +} +function __destruct() { +if(!isset($this->__client)) return; +$client=$this->__client; +$preparedToSendBuffer=&$client->preparedToSendBuffer; +if($preparedToSendBuffer && +$client->cancelProxyCreationTag==$this->__cancelProxyCreationTag) { +$preparedToSendBuffer[6]="3"; +$client->sendBuffer.=$preparedToSendBuffer; +$preparedToSendBuffer=null; +$client->asyncCtx -=1; +} else { +if(!isset($this->__delegate)) { +$client->unref($this->__java); +} +} +} +function __call($method,$args) { +$client=$this->__client; +$sig="@{$this->__signature}@$method"; +$len=count($args); +$args2=array($this->__java); +for($i=0; $i<$len; $i++) { +switch(gettype($val=$args[$i])) { +case 'boolean': array_push($args2,$val); $sig.='@b'; break; +case 'integer': array_push($args2,$val); $sig.='@i'; break; +case 'double': array_push($args2,$val); $sig.='@d'; break; +case 'string': array_push($args2,htmlspecialchars($val,ENT_COMPAT)); $sig.='@s'; break; +case 'array':$sig="~INVALID"; break; +case 'object': +if($val instanceof java_JavaType) { +array_push($args2,$val->__java); +$sig.="@o{$val->__signature}"; +} +else { +$sig="~INVALID"; +} +break; +case 'resource': array_push($args2,$val); $sig.='@r'; break; +case 'NULL': array_push($args2,$val); $sig.='@N'; break; +case 'unknown type': array_push($args2,$val); $sig.='@u'; break; +default: throw new java_IllegalArgumentException($val); +} +} +if(array_key_exists($sig,$client->methodCache)) { +$cacheEntry=&$client->methodCache[$sig]; +$client->sendBuffer.=$client->preparedToSendBuffer; +if(strlen($client->sendBuffer)>=JAVA_SEND_SIZE) { +if($client->protocol->handler->write($client->sendBuffer)<=0) +throw new java_IllegalStateException("Out of sync. Check backend log for details."); +$client->sendBuffer=null; +} +$client->preparedToSendBuffer=vsprintf($cacheEntry->fmt,$args2); +if($cacheEntry->resultVoid) { +$client->cancelProxyCreationTag +=1; +return null; +} else { +$result=clone($client->cachedJavaPrototype); +$result->__factory=$cacheEntry->factory; +$result->__java=++$client->asyncCtx; +$result->__signature=$cacheEntry->signature; +$result->__cancelProxyCreationTag=++$client->cancelProxyCreationTag; +return $result; +} +} else { +$client->currentCacheKey=$sig; +$retval=parent::__call($method,$args); +return $retval; +} +} +} +class java_InternalJava extends Java { +function java_InternalJava($proxy) { +$this->__delegate=$proxy; +$this->__java=$proxy->__java; +$this->__signature=$proxy->__signature; +$this->__client=$proxy->__client; +} +} +class java_class extends Java { +function java_class() { +$this->__client=__javaproxy_Client_getClient(); +$args=func_get_args(); +$name=array_shift($args); +if(is_array($name)) { $args=$name; $name=array_shift($args); } +$delegate=$this->__delegate=$this->__client->referenceObject($name,$args); +$this->__java=$delegate->__java; +$this->__signature=$delegate->__signature; +} +} +class JavaClass extends java_class{} +class java_exception extends Exception implements java_JavaType { +public $__serialID,$__java,$__client; +public $__delegate; +public $__signature; +public $__hasDeclaredExceptions; +function java_exception() { +$this->__client=__javaproxy_Client_getClient(); +$args=func_get_args(); +$name=array_shift($args); +if(is_array($name)) { $args=$name; $name=array_shift($args); } +if (count($args)==0) +Exception::__construct($name); +else +Exception::__construct($args[0]); +$delegate=$this->__delegate=$this->__client->createObject($name,$args); +$this->__java=$delegate->__java; +$this->__signature=$delegate->__signature; +$this->__hasDeclaredExceptions='T'; +} +function __cast($type) { +return $this->__delegate->__cast($type); +} +function __sleep() { +$this->__delegate->__sleep(); +return array("__delegate"); +} +function __wakeup() { +$this->__delegate->__wakeup(); +$this->__java=$this->__delegate->__java; +$this->__client=$this->__delegate->__client; +} +function __get($key) { +return $this->__delegate->__get($key); +} +function __set($key,$val) { +$this->__delegate->__set($key,$val); +} +function __call($method,$args) { +return $this->__delegate->__call($method,$args); +} +function __toString() { +return $this->__delegate->__toExceptionString($this->getTraceAsString()); +} +} +class JavaException extends java_exception {} +class java_InternalException extends JavaException { +function java_InternalException($proxy,$exception) { +$this->__delegate=$proxy; +$this->__java=$proxy->__java; +$this->__signature=$proxy->__signature; +$this->__client=$proxy->__client; +$this->__hasDeclaredExceptions=$exception; +} +} +class java_JavaProxyProxy extends Java { +function java_JavaProxyProxy($client) { +$this->__client=$client; +} +} +} +?> diff --git a/src/main/resources/META-INF/java/JavaProxy.php b/src/main/resources/META-INF/java/JavaProxy.php new file mode 100644 index 0000000..d6133d6 --- /dev/null +++ b/src/main/resources/META-INF/java/JavaProxy.php @@ -0,0 +1,19 @@ + diff --git a/src/main/webapp/java/Java.inc b/src/main/webapp/java/Java.inc new file mode 100644 index 0000000..6f17d84 --- /dev/null +++ b/src/main/webapp/java/Java.inc @@ -0,0 +1,2084 @@ +0) { +$thiz=$ar[$arLen-1]; +return dirname($thiz); +} else { +return "java"; +} +} +function java_truncate($str) { +if (strlen($str)>955) +return substr($str,0,475).'[...]'.substr($str,-475); +return $str; +} +class java_JavaException extends Exception { +function __toString() {return $this->getMessage();} +}; +class java_RuntimeException extends java_JavaException {}; +class java_IOException extends java_JavaException {}; +class java_ConnectException extends java_IOException {}; +class java_IllegalStateException extends java_RuntimeException {}; +class java_IllegalArgumentException extends java_RuntimeException { +function __construct($ob) { +parent::__construct("illegal argument: ".gettype($ob)); +} +}; +function java_autoload_function5($x) { +$s=str_replace("_",".",$x); +$c=__javaproxy_Client_getClient(); +if(!($c->invokeMethod(0,"typeExists",array($s)))) return false; +$i="class ${x} extends Java {". +"static function type(\$sub=null){if(\$sub) \$sub='\$'.\$sub; return java('${s}'.\"\$sub\");}". +'function __construct() {$args=func_get_args();'. +'array_unshift($args,'."'$s'".'); parent::__construct($args);}}'; +eval ("$i"); +return true; +} +function java_autoload_function($x) { +$idx=strrpos($x,"\\"); if (!$idx) return java_autoload_function5($x); +$str=str_replace("\\",".",$x); +$client=__javaproxy_Client_getClient(); +if(!($client->invokeMethod(0,"typeExists",array($str)))) return false; +$package=substr($x,0,$idx); +$name=substr($x,1+$idx); +$instance="namespace $package; class ${name} extends \\Java {". +"static function type(\$sub=null){if(\$sub) \$sub='\$'.\$sub;return \\java('${str}'.\"\$sub\");}". +"static function __callStatic(\$procedure,\$args) {return \\java_invoke(\\java('${str}'),\$procedure,\$args);}". +'function __construct() {$args=func_get_args();'. +'array_unshift($args,'."'$str'".'); parent::__construct($args);}}'; +eval ("$instance"); +return true; +} +if(!defined("JAVA_DISABLE_AUTOLOAD") && function_exists("spl_autoload_register")) spl_autoload_register("java_autoload_function"); +function java_autoload($libs=null) { +trigger_error('Please use getHttpServletResponse(); +$res=new java("php.java.servlet.RemoteHttpServletResponse",$res); +$req->getRequestDispatcher($path)->include($req,$res); +if ($return) return $res->getBufferContents(); +echo $res->getBufferContents(); +return true; +} +function Java($name) { +static $classMap=array(); +if(array_key_exists($name,$classMap)) return $classMap[$name]; +return $classMap[$name]=new JavaClass($name); +} +function java_get_closure() {return java_closure_array(func_get_args());} +function java_wrap() {return java_closure_array(func_get_args());} +function java_get_values($arg) { return java_values($arg); } +function java_get_session() {return java_session_array(func_get_args());} +function java_get_context() {return java_context(); } +function java_get_server_name() { return java_server_name(); } +function java_isnull($value) { return is_null (java_values ($value)); } +function java_is_null($value) { return is_null (java_values ($value)); } +function java_istrue($value) { return (boolean)(java_values ($value)); } +function java_is_true($value) { return (boolean)(java_values ($value)); } +function java_isfalse($value) { return !(java_values ($value)); } +function java_is_false($value) { return !(java_values ($value)); } +function java_set_encoding($enc) { return java_set_file_encoding ($enc); } +function java_call_with_continuation($kontinuation=null) { +if (java_getHeader("X_JAVABRIDGE_INCLUDE",$_SERVER) && !java_getHeader("X_JAVABRIDGE_INCLUDE_ONLY",$_SERVER)) { +if (is_null($kontinuation)) +java_context()->call(java_closure()); +elseif (is_string($kontinuation)) +java_context()->call(call_user_func($kontinuation)); +elseif ($kontinuation instanceof java_JavaType) +java_context()->call($kontinuation); +else +java_context()->call(java_closure($kontinuation)); +} +} +function java_defineHostFromInitialQuery($java_base) { +if($java_base!="java") { +$url=parse_url($java_base); +if(isset($url["scheme"]) && ($url["scheme"]=="http" || $url["scheme"]=="https")) { +$scheme=$url["scheme"]=="https" ? "ssl://" : ""; +$host=$url["host"]; +$port=$url["port"]; +$path=$url["path"]; +define ("JAVA_HOSTS","${scheme}${host}:${port}"); +$dir=dirname($path); +define ("JAVA_SERVLET","$dir/servlet.phpjavabridge"); +return true; +} +} +return false; +} +define("JAVA_PEAR_VERSION","6.2.11"); +if(!defined("JAVA_SEND_SIZE")) +define("JAVA_SEND_SIZE",8192); +if(!defined("JAVA_RECV_SIZE")) +define("JAVA_RECV_SIZE",8192); +if(!defined("JAVA_HOSTS")) { +if(!java_defineHostFromInitialQuery(java_get_base())) { +if ($java_ini=get_cfg_var("java.hosts")) define("JAVA_HOSTS",$java_ini); +else define("JAVA_HOSTS","127.0.0.1:8080"); +} +} +if(!defined("JAVA_SERVLET")) { +if (!(($java_ini=get_cfg_var("java.servlet"))===false)) define("JAVA_SERVLET",$java_ini); +else define("JAVA_SERVLET",1); +} +if(!defined("JAVA_LOG_LEVEL")) +if (!(($java_ini=get_cfg_var("java.log_level"))===false)) define("JAVA_LOG_LEVEL",(int)$java_ini); +else define("JAVA_LOG_LEVEL",null); +if (!defined("JAVA_PREFER_VALUES")) +if ($java_ini=get_cfg_var("java.prefer_values")) define("JAVA_PREFER_VALUES",$java_ini); +else define("JAVA_PREFER_VALUES",0); +class java_SimpleFactory { +public $client; +function java_SimpleFactory($client) { +$this->client=$client; +} +function getProxy($result,$signature,$exception,$wrap) { +return $result; +} +function checkResult($result) { +} +} +class java_ProxyFactory extends java_SimpleFactory { +function create($result,$signature) { +return new java_JavaProxy($result,$signature); +} +function createInternal($proxy) { +return new java_InternalJava($proxy); +} +function getProxy($result,$signature,$exception,$wrap) { +$proxy=$this->create($result,$signature); +if($wrap) $proxy=$this->createInternal($proxy); +return $proxy; +} +} +class java_ArrayProxyFactory extends java_ProxyFactory { +function create($result,$signature) { +return new java_ArrayProxy($result,$signature); +} +} +class java_IteratorProxyFactory extends java_ProxyFactory { +function create($result,$signature) { +return new java_IteratorProxy($result,$signature); +} +} +class java_ExceptionProxyFactory extends java_SimpleFactory { +function create($result,$signature) { +return new java_ExceptionProxy($result,$signature); +} +function getProxy($result,$signature,$exception,$wrap) { +$proxy=$this->create($result,$signature); +if($wrap) $proxy=new java_InternalException($proxy,$exception); +return $proxy; +} +} +class java_ThrowExceptionProxyFactory extends java_ExceptionProxyFactory { +function getProxy($result,$signature,$exception,$wrap) { +$proxy=$this->create($result,$signature); +$proxy=new java_InternalException($proxy,$exception); +return $proxy; +} +function checkResult($result) { +if (JAVA_PREFER_VALUES || ($result->__hasDeclaredExceptions=='T')) +throw $result; +else { +trigger_error("Unchecked exception detected: ".java_truncate($result->__toString()),E_USER_WARNING); +} +} +} +class java_CacheEntry { +public $fmt,$signature,$factory,$java; +public $resultVoid; +function java_CacheEntry($fmt,$signature,$factory,$resultVoid) { +$this->fmt=$fmt; +$this->signature=$signature; +$this->factory=$factory; +$this->resultVoid=$resultVoid; +} +} +class java_Arg { +public $client; +public $exception; +public $factory,$val; +public $signature; +function java_Arg($client) { +$this->client=$client; +$this->factory=$client->simpleFactory; +} +function linkResult(&$val) { +$this->val=&$val; +} +function setResult($val) { +$this->val=&$val; +} +function getResult($wrap) { +$rc=$this->factory->getProxy($this->val,$this->signature,$this->exception,$wrap); +$factory=$this->factory; +$this->factory=$this->client->simpleFactory; +$factory->checkResult($rc); +return $rc; +} +function setFactory($factory) { +$this->factory=$factory; +} +function setException($string) { +$this->exception=$string; +} +function setVoidSignature() { +$this->signature="@V"; +$key=$this->client->currentCacheKey; +if($key && $key[0]!='~') { +$this->client->currentArgumentsFormat[6]="3"; +$cacheEntry=new java_CacheEntry($this->client->currentArgumentsFormat,$this->signature,$this->factory,true); +$this->client->methodCache[$key]=$cacheEntry; +} +} +function setSignature($signature) { +$this->signature=$signature; +$key=$this->client->currentCacheKey; +if($key && $key[0]!='~') { +$cacheEntry=new java_CacheEntry($this->client->currentArgumentsFormat,$this->signature,$this->factory,false); +$this->client->methodCache[$key]=$cacheEntry; +} +} +} +class java_CompositeArg extends java_Arg { +public $parentArg; +public $idx; +public $type; +public $counter; +function java_CompositeArg($client,$type) { +parent::java_Arg($client); +$this->type=$type; +$this->val=array(); +$this->counter=0; +} +function setNextIndex() { +$this->idx=$this->counter++; +} +function setIndex($val) { +$this->idx=$val; +} +function linkResult(&$val) { +$this->val[$this->idx]=&$val; +} +function setResult($val) { +$this->val[$this->idx]=$this->factory->getProxy($val,$this->signature,$this->exception,true); +$this->factory=$this->client->simpleFactory; +} +} +class java_ApplyArg extends java_CompositeArg { +public $m,$p,$v,$n; +function java_ApplyArg($client,$type,$m,$p,$v,$n) { +parent::java_CompositeArg($client,$type); +$this->m=$m; +$this->p=$p; +$this->v=$v; +$this->n=$n; +} +} +class java_Client { +public $RUNTIME; +public $result,$exception; +public $parser; +public $simpleArg,$compositeArg; +public $simpleFactory, +$proxyFactory,$iteratorProxyFacroty, +$arrayProxyFactory,$exceptionProxyFactory,$throwExceptionProxyFactory; +public $arg; +public $asyncCtx,$cancelProxyCreationCounter; +public $globalRef; +public $stack; +public $defaultCache=array(),$asyncCache=array(),$methodCache; +public $isAsync=0; +public $currentCacheKey,$currentArgumentsFormat; +public $cachedJavaPrototype; +public $sendBuffer,$preparedToSendBuffer; +public $inArgs; +function java_Client() { +$this->RUNTIME=array(); +$this->RUNTIME["NOTICE"]='***USE echo java_inspect(jVal) OR print_r(java_values(jVal)) TO SEE THE CONTENTS OF THIS JAVA OBJECT!***'; +$this->parser=new java_Parser($this); +$this->protocol=new java_Protocol($this); +$this->simpleFactory=new java_SimpleFactory($this); +$this->proxyFactory=new java_ProxyFactory($this); +$this->arrayProxyFactory=new java_ArrayProxyFactory($this); +$this->iteratorProxyFactory=new java_IteratorProxyFactory($this); +$this->exceptionProxyFactory=new java_ExceptionProxyFactory($this); +$this->throwExceptionProxyFactory=new java_ThrowExceptionProxyFactory($this); +$this->cachedJavaPrototype=new java_JavaProxyProxy($this); +$this->simpleArg=new java_Arg($this); +$this->globalRef=new java_GlobalRef(); +$this->asyncCtx=$this->cancelProxyCreationCounter=0; +$this->methodCache=$this->defaultCache; +$this->inArgs=false; +} +function read($size) { +return $this->protocol->read($size); +} +function setDefaultHandler() { +$this->methodCache=$this->defaultCache; +} +function setAsyncHandler() { +$this->methodCache=$this->asyncCache; +} +function handleRequests() { +$tail_call=false; +do { +$this->stack=array($this->arg=$this->simpleArg); +$this->idx=0; +$this->parser->parse(); +if((count($this->stack)) > 1) { +$arg=array_pop($this->stack); +$this->apply($arg); +$tail_call=true; +} else { +$tail_call=false; +} +$this->stack=null; +} while($tail_call); +return 1; +} +function getWrappedResult($wrap) { +return $this->simpleArg->getResult($wrap); +} +function getInternalResult() { +return $this->getWrappedResult(false); +} +function getResult() { +return $this->getWrappedResult(true); +} +function getProxyFactory($type) { +switch($type[0]) { +case 'E': +$factory=$this->exceptionProxyFactory; +break; +case 'C': +$factory=$this->iteratorProxyFactory; +break; +case 'A': +$factory=$this->arrayProxyFactory; +break; +default: +case 'O': +$factory=$this->proxyFactory; +} +return $factory; +} +function link(&$arg,&$newArg) { +$arg->linkResult($newArg->val); +$newArg->parentArg=$arg; +} +function getExact($str) { +return hexdec($str); +} +function getInexact($str) { +$val=null; +sscanf($str,"%e",$val); +return $val; +} +function begin($name,$st) { +$arg=$this->arg; +switch($name[0]) { +case 'A': +$object=$this->globalRef->get($this->getExact($st['v'])); +$newArg=new java_ApplyArg($this,'A', +$this->parser->getData($st['m']), +$this->parser->getData($st['p']), +$object, +$this->getExact($st['n'])); +$this->link($arg,$newArg); +array_push($this->stack,$this->arg=$newArg); +break; +case 'X': +$newArg=new java_CompositeArg($this,$st['t']); +$this->link($arg,$newArg); +array_push($this->stack,$this->arg=$newArg); +break; +case 'P': +if($arg->type=='H') { +$s=$st['t']; +if($s[0]=='N') { +$arg->setIndex($this->getExact($st['v'])); +} else { +$arg->setIndex($this->parser->getData($st['v'])); +} +} else { +$arg->setNextIndex(); +} +break; +case 'S': +$arg->setResult($this->parser->getData($st['v'])); +break; +case 'B': +$s=$st['v']; +$arg->setResult($s[0]=='T'); +break; +case 'L': +$sign=$st['p']; +$val=$this->getExact($st['v']); +if($sign[0]=='A') $val*=-1; +$arg->setResult($val); +break; +case 'D': +$arg->setResult($this->getInexact($st['v'])); +break; +case 'V': +if ($st['n']!='T') { +$arg->setVoidSignature(); +} +case 'N': +$arg->setResult(null); +break; +case 'F': +break; +case 'O': +$arg->setFactory($this->getProxyFactory($st['p'])); +$arg->setResult($this->asyncCtx=$this->getExact($st['v'])); +if($st['n']!='T') $arg->setSignature($st['m']); +break; +case 'E': +$arg->setFactory($this->throwExceptionProxyFactory); +$arg->setException($st['m']); +$arg->setResult($this->asyncCtx=$this->getExact($st['v'])); +break; +default: +$this->parser->parserError(); +} +} +function end($name) { +switch($name[0]) { +case 'X': +$frame=array_pop($this->stack); +$this->arg=$frame->parentArg; +break; +} +} +function createParserString() { +return new java_ParserString(); +} +function writeArg($arg) { +if(is_string($arg)) { +$this->protocol->writeString($arg); +} else if(is_object($arg)) { +if ((!$arg instanceof java_JavaType)) { +error_log((string)new java_IllegalArgumentException($arg)); +trigger_error("argument '".get_class($arg)."' is not a Java object,using NULL instead",E_USER_WARNING); +$this->protocol->writeObject(null); +} else { +$this->protocol->writeObject($arg->__java); +} +} else if(is_null($arg)) { +$this->protocol->writeObject(null); +} else if(is_bool($arg)) { +$this->protocol->writeBoolean($arg); +} else if(is_integer($arg)) { +$this->protocol->writeLong($arg); +} else if(is_float($arg)) { +$this->protocol->writeDouble($arg); +} else if(is_array($arg)) { +$wrote_begin=false; +foreach($arg as $key=>$val) { +if(is_string($key)) { +if(!$wrote_begin) { +$wrote_begin=1; +$this->protocol->writeCompositeBegin_h(); +} +$this->protocol->writePairBegin_s($key); +$this->writeArg($val); +$this->protocol->writePairEnd(); +} else { +if(!$wrote_begin) { +$wrote_begin=1; +$this->protocol->writeCompositeBegin_h(); +} +$this->protocol->writePairBegin_n($key); +$this->writeArg($val); +$this->protocol->writePairEnd(); +} +} +if(!$wrote_begin) { +$this->protocol->writeCompositeBegin_a(); +} +$this->protocol->writeCompositeEnd(); +} +} +function writeArgs($args) { +$this->inArgs=true; +$n=count($args); +for($i=0; $i<$n; $i++) { +$this->writeArg($args[$i]); +} +$this->inArgs=false; +} +function createObject($name,$args) { +$this->protocol->createObjectBegin($name); +$this->writeArgs($args); +$this->protocol->createObjectEnd(); +$val=$this->getInternalResult(); +return $val; +} +function referenceObject($name,$args) { +$this->protocol->referenceBegin($name); +$this->writeArgs($args); +$this->protocol->referenceEnd(); +$val=$this->getInternalResult(); +return $val; +} +function getProperty($object,$property) { +$this->protocol->propertyAccessBegin($object,$property); +$this->protocol->propertyAccessEnd(); +return $this->getResult(); +} +function setProperty($object,$property,$arg) { +$this->protocol->propertyAccessBegin($object,$property); +$this->writeArg($arg); +$this->protocol->propertyAccessEnd(); +$this->getResult(); +} +function invokeMethod($object,$method,$args) { +$this->protocol->invokeBegin($object,$method); +$this->writeArgs($args); +$this->protocol->invokeEnd(); +$val=$this->getResult(); +return $val; +} +function unref($object) { +if (isset($this->protocol)) $this->protocol->writeUnref($object); +} +function apply($arg) { +$name=$arg->p; +$object=$arg->v; +$ob=($object==null) ? $name : array(&$object,$name); +$isAsync=$this->isAsync; +$methodCache=$this->methodCache; +$currentArgumentsFormat=$this->currentArgumentsFormat; +try { +$res=$arg->getResult(true); +if((($object==null) && !function_exists($name)) || (!($object==null) && !method_exists($object,$name))) throw new JavaException("java.lang.NoSuchMethodError","$name"); +$res=call_user_func_array($ob,$res); +if (is_object($res) && (!($res instanceof java_JavaType))) { +trigger_error("object returned from $name() is not a Java object",E_USER_WARNING); +$this->protocol->invokeBegin(0,"makeClosure"); +$this->protocol->writeULong($this->globalRef->add($res)); +$this->protocol->invokeEnd(); +$res=$this->getResult(); +} +$this->protocol->resultBegin(); +$this->writeArg($res); +$this->protocol->resultEnd(); +} catch (JavaException $e) { +$trace=$e->getTraceAsString(); +$this->protocol->resultBegin(); +$this->protocol->writeException($e->__java,$trace); +$this->protocol->resultEnd(); +} catch(Exception $ex) { +error_log($ex->__toString()); +trigger_error("Unchecked exception detected in callback",E_USER_ERROR); +die (1); +} +$this->isAsync=$isAsync; +$this->methodCache=$methodCache; +$this->currentArgumentsFormat=$currentArgumentsFormat; +} +function cast($object,$type) { +switch($type[0]) { +case 'S': case 's': +return $this->invokeMethod(0,"castToString",array($object)); +case 'B': case 'b': +return $this->invokeMethod(0,"castToBoolean",array($object)); +case 'L': case 'I': case 'l': case 'i': +return $this->invokeMethod(0,"castToExact",array($object)); +case 'D': case 'd': case 'F': case 'f': +return $this->invokeMethod(0,"castToInExact",array($object)); +case 'N': case 'n': +return null; +case 'A': case 'a': +return $this->invokeMethod(0,"castToArray",array($object)); +case 'O': case 'o': +return $object; +default: +throw new java_RuntimeException("$type illegal"); +} +} +function getContext() { +static $cache=null; +if (!is_null($cache)) return $cache; +return $cache=$this->invokeMethod(0,"getContext",array()); +} +function getSession($args) { +return $this->invokeMethod(0,"getSession",$args); +} +function getServerName() { +static $cache=null; +if (!is_null($cache)) return $cache; +return $cache=$this->protocol->getServerName(); +} +} +function java_shutdown() { +global $java_initialized; +if (!$java_initialized) return; +if (session_id()) session_write_close(); +$client=__javaproxy_Client_getClient(); +if (!isset($client->protocol) || $client->inArgs) return; +if ($client->preparedToSendBuffer) +$client->sendBuffer.=$client->preparedToSendBuffer; +$client->sendBuffer.=$client->protocol->getKeepAlive(); +$client->protocol->flush(); +$client->protocol->keepAlive(); +} +register_shutdown_function("java_shutdown"); +class java_GlobalRef { +public $map; +function java_GlobalRef() { +$this->map=array(); +} +function add($object) { +if(is_null($object)) return 0; +return array_push($this->map,$object); +} +function get($id) { +if(!$id) return 0; +return $this->map[--$id]; +} +} +class java_NativeParser { +public $parser,$handler; +public $level,$event; +public $buf; +function java_NativeParser($handler) { +$this->handler=$handler; +$this->parser=xml_parser_create(); +xml_parser_set_option($this->parser,XML_OPTION_CASE_FOLDING,0); +xml_set_object($this->parser,$this); +xml_set_element_handler($this->parser,"begin","end"); +xml_parse($this->parser,""); +$this->level=0; +} +function begin($parser,$name,$param) { +$this->event=true; +switch($name) { +case 'X': case 'A': $this->level+=1; +} +$this->handler->begin($name,$param); +} +function end($parser,$name) { +$this->handler->end($name); +switch($name) { +case 'X': case 'A': $this->level-=1; +} +} +function getData($str) { +return base64_decode($str); +} +function parse() { +do { +$this->event=false; +$buf=$this->buf=$this->handler->read(JAVA_RECV_SIZE); +$len=strlen($buf); +if(!xml_parse($this->parser,$buf,$len==0)) { +$this->handler->protocol->handler->shutdownBrokenConnection( +sprintf("protocol error: %s,%s at col %d. Check the back end log for OutOfMemoryErrors.", +$buf, +xml_error_string(xml_get_error_code($this->parser)), +xml_get_current_column_number($this->parser))); +} +} while(!$this->event || $this->level>0); +} +function parserError() { +$this->handler->protocol->handler->shutdownBrokenConnection( +sprintf("protocol error: %s. Check the back end log for details.",$this->buf)); +} +} +class java_Parser { +public $parser; +function java_Parser($handler) { +if(function_exists("xml_parser_create")) { +$this->parser=new java_NativeParser($handler); +$handler->RUNTIME["PARSER"]="NATIVE"; +} else { +$this->parser=new java_SimpleParser($handler); +$handler->RUNTIME["PARSER"]="SIMPLE"; +} +} +function parse() { +$this->parser->parse(); +} +function getData($str) { +return $this->parser->getData($str); +} +function parserError() { +$this->parser->parserError(); +} +} +function java_getHeader($name,$array) { +if (array_key_exists($name,$array)) return $array[$name]; +$name="HTTP_$name"; +if (array_key_exists($name,$array)) return $array[$name]; +return null; +} +function java_checkCliSapi() { +$sapi=substr(php_sapi_name(),0,3); +return ((($sapi=='cgi') && !get_cfg_var("java.session")) || ($sapi=='cli')); +} +function java_getCompatibilityOption($client) { +static $compatibility=null; +if ($compatibility) return $compatibility; +$compatibility=$client->RUNTIME["PARSER"]=="NATIVE" +? (0103-JAVA_PREFER_VALUES) +: (0100+JAVA_PREFER_VALUES); +if(is_int(JAVA_LOG_LEVEL)) { +$compatibility |=128 | (7 & JAVA_LOG_LEVEL)<<2; +} +$compatibility=chr ($compatibility); +return $compatibility; +} +class java_EmptyChannel { +protected $handler; +private $res; +function java_EmptyChannel($handler) { +$this->handler=$handler; +} +function shutdownBrokenConnection () {} +function fwrite($data) { +return $this->handler->fwrite($data); +} +function fread($size) { +return $this->handler->fread($size); +} +function getKeepAliveA() { +return ""; +} +function getKeepAliveE() { +return ""; +} +function getKeepAlive() { +return $this->getKeepAliveE(); +} +function error() { +trigger_error("An unchecked exception occured during script execution. Please check the server log files for details.",E_USER_ERROR); +} +function checkA($peer) { +$val=$this->res[6]; +if ($val !='A') fclose($peer); +if ($val !='A' && $val !='E') { +$this->error(); +} +} +function checkE() { +$val=$this->res[6]; +if ($val !='E') { +$this->error(); +} +} +function keepAliveS() { +$this->res=$this->fread(10); +} +function keepAliveSC() { +$this->res=$this->fread(10); +$this->fwrite(""); +$this->fread(JAVA_RECV_SIZE); +} +function keepAliveH() { +$this->res=$this->handler->read(10); +} +function keepAlive() { +$this->keepAliveH(); +$this->checkE(); +} +} +abstract class java_SocketChannel extends java_EmptyChannel { +public $peer,$host; +function java_SocketChannel($peer,$host) { +$this->peer=$peer; +$this->host=$host; +} +function fwrite($data) { +return fwrite($this->peer,$data); +} +function fread($size) { +return fread($this->peer,$size); +} +function shutdownBrokenConnection () { +fclose($this->peer); +} +} +class java_SocketChannelP extends java_SocketChannel { +function getKeepAlive() {return $this->getKeepAliveA();} +function keepAlive() { $this->keepAliveS(); $this->checkA($this->peer); } +} +class java_ChunkedSocketChannel extends java_SocketChannel { +function fwrite($data) { +$len=dechex(strlen($data)); +return fwrite($this->peer,"${len}\r\n${data}\r\n"); +} +function fread($size) { +$length=hexdec(fgets($this->peer,JAVA_RECV_SIZE)); +$data=""; +while ($length > 0) { +$str=fread($this->peer,$length); +if (feof ($this->peer)) return null; +$length -=strlen($str); +$data .=$str; +} +fgets($this->peer,3); +return $data; +} +function keepAlive() { $this->keepAliveSC(); $this->checkE(); fclose ($this->peer); } +} +class java_SocketHandler { +public $protocol,$channel; +function java_SocketHandler($protocol,$channel) { +$this->protocol=$protocol; +$this->channel=$channel; +} +function write($data) { +return $this->channel->fwrite($data); +} +function fwrite($data) {return $this->write($data);} +function read($size) { +return $this->channel->fread($size); +} +function fread($size) {return $this->read($size);} +function redirect() {} +function getKeepAlive() { +return $this->channel->getKeepAlive(); +} +function keepAlive() { +$this->channel->keepAlive(); +} +function dieWithBrokenConnection($msg) { +unset($this->protocol->client->protocol); +trigger_error ($msg?$msg:"unknown error: please see back end log for details",E_USER_ERROR); +} +function shutdownBrokenConnection ($msg) { +$this->channel->shutdownBrokenConnection(); +$this->dieWithBrokenConnection($msg); +} +} +class java_SimpleHttpHandler extends java_SocketHandler { +public $headers,$cookies; +public $context,$ssl,$port; +public $host; +function createChannel() { +$channelName=java_getHeader("X_JAVABRIDGE_REDIRECT",$_SERVER); +$context=java_getHeader("X_JAVABRIDGE_CONTEXT",$_SERVER); +$len=strlen($context); +$len0=java_getCompatibilityOption($this->protocol->client); +$len1=chr($len&0xFF); $len>>=8; +$len2=chr($len&0xFF); +$this->channel=new java_EmptyChannel($this); +$this->channel=$this->getChannel($channelName); +$this->protocol->socketHandler=new java_SocketHandler($this->protocol,$this->channel); +$this->protocol->write("\177${len0}${len1}${len2}${context}"); +$this->context=sprintf("X_JAVABRIDGE_CONTEXT: %s\r\n",$context); +$this->protocol->handler=$this->protocol->socketHandler; +$this->protocol->handler->write($this->protocol->client->sendBuffer) +or $this->protocol->handler->shutdownBrokenConnection("Broken local connection handle"); +$this->protocol->client->sendBuffer=null; +$this->protocol->handler->read(1) +or $this->protocol->handler->shutdownBrokenConnection("Broken local connection handle"); +} +function java_SimpleHttpHandler($protocol,$ssl,$host,$port) { +$this->cookies=array(); +$this->protocol=$protocol; +$this->ssl=$ssl; +$this->host=$host; +$this->port=$port; +$this->createChannel(); +} +function getCookies() { +$str=""; +$first=true; +foreach($_COOKIE as $k=> $v) { +$str .=($first ? "Cookie: $k=$v":"; $k=$v"); +$first=false; +} +if(!$first) $str .="\r\n"; +return $str; +} +function getContextFromCgiEnvironment() { +$ctx=java_getHeader('X_JAVABRIDGE_CONTEXT',$_SERVER); +return $ctx; +} +function getContext() { +static $context=null; +if($context) return $context; +$ctx=$this->getContextFromCgiEnvironment(); +$context=""; +if($ctx) { +$context=sprintf("X_JAVABRIDGE_CONTEXT: %s\r\n",$ctx); +} +return $context; +} +function getWebAppInternal() { +$context=$this->protocol->webContext; +if(isset($context)) return $context; +return (JAVA_SERVLET=="User" && +array_key_exists('PHP_SELF',$_SERVER) && +array_key_exists('HTTP_HOST',$_SERVER)) +? $_SERVER['PHP_SELF']."javabridge" +: null; +} +function getWebApp() { +$context=$this->getWebAppInternal(); +if(is_null($context)) $context=JAVA_SERVLET; +if(is_null($context) || $context[0]!="/") +$context="/JavaBridge/JavaBridge.phpjavabridge"; +return $context; +} +function write($data) { +return $this->protocol->socketHandler->write($data); +} +function doSetCookie($key,$val,$path) { +$path=trim($path); +$webapp=$this->getWebAppInternal(); if(!$webapp) $path="/"; +setcookie($key,$val,0,$path); +} +function read($size) { +return $this->protocol->socketHandler->read($size); +} +function getChannel($channelName) { +$errstr=null; $errno=null; +$peer=pfsockopen($this->host,$channelName,$errno,$errstr,20); +if (!$peer) throw new java_IllegalStateException("No ContextServer for {$this->host}:{$channelName}. Error: $errstr ($errno)\n"); +stream_set_timeout($peer,-1); +return new java_SocketChannelP($peer,$this->host); +} +function keepAlive() { +parent::keepAlive(); +} +function redirect() {} +} +class java_SimpleHttpTunnelHandler extends java_SimpleHttpHandler { +public $socket; +protected $hasContentLength=false; +function createSimpleChannel () { +$this->channel=new java_EmptyChannel($this); +} +function createChannel() { +$this->createSimpleChannel(); +} +function shutdownBrokenConnection ($msg) { +fclose($this->socket); +$this->dieWithBrokenConnection($msg); +} +function checkSocket($socket,&$errno,&$errstr) { +if (!$socket) { +$msg="Could not connect to the JEE server {$this->ssl}{$this->host}:{$this->port}. Please start it."; +$msg.=java_checkCliSapi() +?" Or define('JAVA_HOSTS',9267); define('JAVA_SERVLET',false); before including 'Java.inc' and try again. Error message: $errstr ($errno)\n" +:" Error message: $errstr ($errno)\n"; +throw new java_ConnectException($msg); +} +} +function open() { +$errno=null; $errstr=null; +$socket=fsockopen("{$this->ssl}{$this->host}",$this->port,$errno,$errstr,20); +$this->checkSocket($socket,$errno,$errstr); +stream_set_timeout($socket,-1); +$this->socket=$socket; +} +function fread($size) { +$length=hexdec(fgets($this->socket,JAVA_RECV_SIZE)); +$data=""; +while ($length > 0) { +$str=fread($this->socket,$length); +if (feof ($this->socket)) return null; +$length -=strlen($str); +$data .=$str; +} +fgets($this->socket,3); +return $data; +} +function fwrite($data) { +$len=dechex(strlen($data)); +return fwrite($this->socket,"${len}\r\n${data}\r\n"); +} +function close() { +fwrite($this->socket,"0\r\n\r\n"); +fgets($this->socket,JAVA_RECV_SIZE); +fgets($this->socket,3); +fclose($this->socket); +} +function java_SimpleHttpTunnelHandler($protocol,$ssl,$host,$port) { +parent::java_SimpleHttpHandler($protocol,$ssl,$host,$port); +$this->open(); +} +function read($size) { +if(is_null($this->headers)) $this->parseHeaders(); +if (isset($this->headers["http_error"])) { +if (isset($this->headers["transfer_chunked"])) { +$str=$this->fread(JAVA_RECV_SIZE); +} elseif (isset($this->headers['content_length'])) { +$len=$this->headers['content_length']; +for($str=fread($this->socket,$len); strlen($str)<$len; $str.=fread($this->socket,$len-strlen($str))) +if (feof ($this->socket)) break; +} else { +$str=fread($this->socket,JAVA_RECV_SIZE); +} +$this->shutdownBrokenConnection($str); +} +return $this->fread(JAVA_RECV_SIZE); +} +function getBodyFor ($compat,$data) { +$len=dechex(2+strlen($data)); +return "Cache-Control: no-cache\r\nPragma: no-cache\r\nTransfer-Encoding: chunked\r\n\r\n${len}\r\n\177${compat}${data}\r\n"; +} +function write($data) { +$compat=java_getCompatibilityOption($this->protocol->client); +$this->headers=null; +$socket=$this->socket; +$webapp=$this->getWebApp(); +$cookies=$this->getCookies(); +$context=$this->getContext(); +$res="PUT "; +$res .=$webapp; +$res .=" HTTP/1.1\r\n"; +$res .="Host: {$this->host}:{$this->port}\r\n"; +$res .=$context; +$res .=$cookies; +$res .=$this->getBodyFor($compat,$data); +$count=fwrite($socket,$res) or $this->shutdownBrokenConnection("Broken connection handle"); +fflush($socket) or $this->shutdownBrokenConnection("Broken connection handle"); +return $count; +} +function parseHeaders() { +$this->headers=array(); +$line=trim(fgets($this->socket,JAVA_RECV_SIZE)); +$ar=explode (" ",$line); +$code=((int)$ar[1]); +if ($code !=200) $this->headers["http_error"]=$code; +while (($str=trim(fgets($this->socket,JAVA_RECV_SIZE)))) { +if($str[0]=='X') { +if(!strncasecmp("X_JAVABRIDGE_REDIRECT",$str,21)) { +$this->headers["redirect"]=trim(substr($str,22)); +} else if(!strncasecmp("X_JAVABRIDGE_CONTEXT",$str,20)) { +$this->headers["context"]=trim(substr($str,21)); +} +} else if($str[0]=='S') { +if(!strncasecmp("SET-COOKIE",$str,10)) { +$str=substr($str,12); +$this->cookies[]=$str; +$ar=explode(";",$str); +$cookie=explode("=",$ar[0]); +$path=""; +if(isset($ar[1])) $p=explode("=",$ar[1]); +if(isset($p)) $path=$p[1]; +$this->doSetCookie($cookie[0],$cookie[1],$path); +} +} else if($str[0]=='C') { +if(!strncasecmp("CONTENT-LENGTH",$str,14)) { +$this->headers["content_length"]=trim(substr($str,15)); +$this->hasContentLength=true; +} else if(!strncasecmp("CONNECTION",$str,10) && !strncasecmp("close",trim(substr($str,11)),5)) { +$this->headers["connection_close"]=true; +} +} else if($str[0]=='T') { +if(!strncasecmp("TRANSFER-ENCODING",$str,17) && !strncasecmp("chunked",trim(substr($str,18)),7)) { +$this->headers["transfer_chunked"]=true; +} +} +} +} +function getSimpleChannel() { +return new java_ChunkedSocketChannel($this->socket,$this->protocol,$this->host); +} +function redirect() { +$this->isRedirect=isset($this->headers["redirect"]); +if ($this->isRedirect) +$channelName=$this->headers["redirect"]; +$context=$this->headers["context"]; +$len=strlen($context); +$len0=chr(0xFF); +$len1=chr($len&0xFF); $len>>=8; +$len2=chr($len&0xFF); +if ($this->isRedirect) { +$this->protocol->socketHandler=new java_SocketHandler($this->protocol,$this->getChannel($channelName)); +$this->protocol->write("\177${len0}${len1}${len2}${context}"); +$this->context=sprintf("X_JAVABRIDGE_CONTEXT: %s\r\n",$context); +$this->close (); +$this->protocol->handler=$this->protocol->socketHandler; +$this->protocol->handler->write($this->protocol->client->sendBuffer) +or $this->protocol->handler->shutdownBrokenConnection("Broken local connection handle"); +$this->protocol->client->sendBuffer=null; +$this->protocol->handler->read(1) +or $this->protocol->handler->shutdownBrokenConnection("Broken local connection handle"); +} else { +$this->protocol->handler=$this->protocol->socketHandler=new java_SocketHandler($this->protocol,$this->getSimpleChannel()); +} +} +} +class java_HttpTunnelHandler extends java_SimpleHttpTunnelHandler { +function fread($size) { +if ($this->hasContentLength) +return fread($this->socket,$this->headers["content_length"]); +else +return parent::fread($size); +} +function fwrite($data) { +if ($this->hasContentLength) +return fwrite($this->socket,$data); +else +return parent::fwrite($data); +} +function close() { +if ($this->hasContentLength) { +fwrite($this->socket,"0\r\n\r\n"); +fclose($this->socket); +} else { +parent::fclose($this->socket); +} +} +} +class java_Protocol { +public $client; +public $webContext; +public $serverName; +function getOverrideHosts() { +if(array_key_exists('X_JAVABRIDGE_OVERRIDE_HOSTS',$_ENV)) { +$override=$_ENV['X_JAVABRIDGE_OVERRIDE_HOSTS']; +if(!is_null($override) && $override!='/') return $override; +} +return +java_getHeader('X_JAVABRIDGE_OVERRIDE_HOSTS_REDIRECT',$_SERVER); +} +static function getHost() { +static $host=null; +if(is_null($host)) { +$hosts=explode(";",JAVA_HOSTS); +$host=explode(":",$hosts[0]); +while(count ($host) < 3) array_unshift($host,""); +if (substr($host[1],0,2)=="//") $host[1]=substr($host[1],2); +} +return $host; +} +function createHttpHandler() { +$overrideHosts=$this->getOverrideHosts(); +$ssl=""; +if($overrideHosts) { +$s=$overrideHosts; +if((strlen($s)>2) && ($s[1]==':')) { +if($s[0]=='s') +$ssl="ssl://"; +$s=substr($s,2); +} +$webCtx=strpos($s,"//"); +if($webCtx) +$host=substr($s,0,$webCtx); +else +$host=$s; +$idx=strpos($host,':'); +if($idx) { +if($webCtx) +$port=substr($host,$idx+1,$webCtx); +else +$port=substr($host,$idx+1); +$host=substr($host,0,$idx); +} else { +$port="8080"; +} +if($webCtx) $webCtx=substr($s,$webCtx+1); +$this->webContext=$webCtx; +} else { +$hostVec=java_Protocol::getHost(); +if ($ssl=$hostVec[0]) $ssl .="://"; +$host=$hostVec[1]; +$port=$hostVec[2]; +} +$this->serverName="${ssl}${host}:$port"; +if ((array_key_exists("X_JAVABRIDGE_REDIRECT",$_SERVER)) || +(array_key_exists("HTTP_X_JAVABRIDGE_REDIRECT",$_SERVER))) +return new java_SimpleHttpHandler($this,$ssl,$host,$port); +return new java_HttpTunnelHandler($this,$ssl,$host,$port); +} +function createSimpleHandler($name,$again=true) { +$channelName=$name; +$errno=null; $errstr=null; +if(is_numeric($channelName)) { +$peer=@pfsockopen($host="127.0.0.1",$channelName,$errno,$errstr,5); +} else { +$type=$channelName[0]; +list($host,$channelName)=explode(":",$channelName); +$peer=pfsockopen($host,$channelName,$errno,$errstr,20); +if (!$peer) +throw new java_ConnectException("No Java server at $host:$channelName. Error message: $errstr ($errno)"); +} +if (!$peer) { +$java=file_exists(ini_get("extension_dir")."/JavaBridge.jar")?ini_get("extension_dir")."/JavaBridge.jar":(java_get_base()."/JavaBridge.jar"); +if (!file_exists($java)) +throw new java_IOException("Could not find $java in ".getcwd().". Download it from http://sf.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_".JAVA_PEAR_VERSION."/exploded/JavaBridge.jar/download and try again."); +$java_cmd="java -Dphp.java.bridge.daemon=true -jar \"${java}\" INET_LOCAL:$channelName 0"; +if (!$again) +throw new java_ConnectException("No Java back end! Please run it with: $java_cmd. Error message: $errstr ($errno)"); +if (!java_checkCliSapi()) +trigger_error("This PHP SAPI requires a JEE or SERVLET back end. Start it,define ('JAVA_SERVLET',true); define('JAVA_HOSTS',...); and try again.",E_USER_ERROR); +system ($java_cmd); +return $this->createSimpleHandler($name,false); +} +stream_set_timeout($peer,-1); +$handler=new java_SocketHandler($this,new java_SocketChannelP($peer,$host)); +$compatibility=java_getCompatibilityOption($this->client); +$this->write("\177$compatibility"); +$this->serverName="127.0.0.1:$channelName"; +return $handler; +} +function java_get_simple_channel() { +return (JAVA_HOSTS&&(!JAVA_SERVLET||(JAVA_SERVLET=="Off"))) ? JAVA_HOSTS : null; +} +function createHandler() { +if(!java_getHeader('X_JAVABRIDGE_OVERRIDE_HOSTS',$_SERVER)&& +((function_exists("java_get_default_channel")&&($defaultChannel=java_get_default_channel())) || +($defaultChannel=$this->java_get_simple_channel())) ) { +return $this->createSimpleHandler($defaultChannel); +} else { +return $this->createHttpHandler(); +} +} +function java_Protocol ($client) { +$this->client=$client; +$this->handler=$this->createHandler(); +} +function redirect() { +$this->handler->redirect(); +} +function read($size) { +return $this->handler->read($size); +} +function sendData() { +$this->handler->write($this->client->sendBuffer); +$this->client->sendBuffer=null; +} +function flush() { +$this->sendData(); +} +function getKeepAlive() { +return $this->handler->getKeepAlive(); +} +function keepAlive() { +$this->handler->keepAlive(); +} +function handle() { +$this->client->handleRequests(); +} +function write($data) { +$this->client->sendBuffer.=$data; +} +function finish() { +$this->flush(); +$this->handle(); +$this->redirect(); +} +function referenceBegin($name) { +$this->client->sendBuffer.=$this->client->preparedToSendBuffer; +$this->client->preparedToSendBuffer=null; +$signature=sprintf("",$name); +$this->write($signature); +$signature[6]="2"; +$this->client->currentArgumentsFormat=$signature; +} +function referenceEnd() { +$this->client->currentArgumentsFormat.=$format=""; +$this->write($format); +$this->finish(); +$this->client->currentCacheKey=null; +} +function createObjectBegin($name) { +$this->client->sendBuffer.=$this->client->preparedToSendBuffer; +$this->client->preparedToSendBuffer=null; +$signature=sprintf("",$name); +$this->write($signature); +$signature[6]="2"; +$this->client->currentArgumentsFormat=$signature; +} +function createObjectEnd() { +$this->client->currentArgumentsFormat.=$format=""; +$this->write($format); +$this->finish(); +$this->client->currentCacheKey=null; +} +function propertyAccessBegin($object,$method) { +$this->client->sendBuffer.=$this->client->preparedToSendBuffer; +$this->client->preparedToSendBuffer=null; +$this->write(sprintf("",$object,$method)); +$this->client->currentArgumentsFormat=""; +} +function propertyAccessEnd() { +$this->client->currentArgumentsFormat.=$format=""; +$this->write($format); +$this->finish(); +$this->client->currentCacheKey=null; +} +function invokeBegin($object,$method) { +$this->client->sendBuffer.=$this->client->preparedToSendBuffer; +$this->client->preparedToSendBuffer=null; +$this->write(sprintf("",$object,$method)); +$this->client->currentArgumentsFormat=""; +} +function invokeEnd() { +$this->client->currentArgumentsFormat.=$format=""; +$this->write($format); +$this->finish(); +$this->client->currentCacheKey=null; +} +function resultBegin() { +$this->client->sendBuffer.=$this->client->preparedToSendBuffer; +$this->client->preparedToSendBuffer=null; +$this->write(""); +} +function resultEnd() { +$this->client->currentCacheKey=null; +$this->write(""); +$this->flush(); +} +function writeString($name) { +$this->client->currentArgumentsFormat.=$format=""; +$this->write(sprintf($format,htmlspecialchars($name,ENT_COMPAT))); +} +function writeBoolean($boolean) { +$this->client->currentArgumentsFormat.=$format=""; +$this->write(sprintf($format,$boolean)); +} +function writeLong($l) { +$this->client->currentArgumentsFormat.=""; +if($l<0) { +$this->write(sprintf("",-$l)); +} else { +$this->write(sprintf("",$l)); +} +} +function writeULong($l) { +$this->client->currentArgumentsFormat.=$format=""; +$this->write(sprintf($format,$l)); +} +function writeDouble($d) { +$this->client->currentArgumentsFormat.=$format=""; +$this->write(sprintf($format,$d)); +} +function writeObject($object) { +$this->client->currentArgumentsFormat.=$format=""; +$this->write(sprintf($format,$object)); +} +function writeException($object,$str) { +$this->write(sprintf("",$object,htmlspecialchars($str,ENT_COMPAT))); +} +function writeCompositeBegin_a() { +$this->write(""); +} +function writeCompositeBegin_h() { +$this->write(""); +} +function writeCompositeEnd() { +$this->write(""); +} +function writePairBegin_s($key) { +$this->write(sprintf("

",htmlspecialchars($key,ENT_COMPAT))); +} +function writePairBegin_n($key) { +$this->write(sprintf("

",$key)); +} +function writePairBegin() { +$this->write("

"); +} +function writePairEnd() { +$this->write("

"); +} +function writeUnref($object) { +$this->client->sendBuffer.=$this->client->preparedToSendBuffer; +$this->client->preparedToSendBuffer=null; +$this->write(sprintf("",$object)); +} +function getServerName() { +return $this->serverName; +} +} +class java_ParserString { +public $string,$off,$length; +function toString() { +return $this->getString(); +} +function getString() { +return substr($this->string,$this->off,$this->length); +} +} +class java_ParserTag { +public $n,$strings; +function java_ParserTag() { +$this->strings=array(); +$this->n=0; +} +} +class java_SimpleParser { +public $SLEN=256; +public $handler; +public $tag,$buf,$len,$s; +public $type; +function java_SimpleParser($handler) { +$this->handler=$handler; +$this->tag=array(new java_ParserTag(),new java_ParserTag(),new java_ParserTag()); +$this->len=$this->SLEN; +$this->s=str_repeat(" ",$this->SLEN); +$this->type=$this->VOJD; +} +public $BEGIN=0,$KEY=1,$VAL=2,$ENTITY=3,$VOJD=5,$END=6; +public $level=0,$eor=0; public $in_dquote,$eot=false; +public $pos=0,$c=0,$i=0,$i0=0,$e; +function RESET() { +$this->type=$this->VOJD; +$this->level=0; +$this->eor=0; +$this->in_dquote=false; +$this->i=0; +$this->i0=0; +} +function APPEND($c) { +if($this->i>=$this->len-1) { +$this->s=str_repeat($this->s,2); +$this->len*=2; +} +$this->s[$this->i++]=$c; +} +function CALL_BEGIN() { +$pt=&$this->tag[1]->strings; +$st=&$this->tag[2]->strings; +$t=&$this->tag[0]->strings[0]; +$name=$t->string[$t->off]; +$n=$this->tag[2]->n; +$ar=array(); +for($i=0; $i<$n; $i++) { +$ar[$pt[$i]->getString()]=$st[$i]->getString(); +} +$this->handler->begin($name,$ar); +} +function CALL_END() { +$t=&$this->tag[0]->strings[0]; +$name=$t->string[$t->off]; +$this->handler->end($name); +} +function PUSH($t) { +$str=&$this->tag[$t]->strings; +$n=&$this->tag[$t]->n; +$this->s[$this->i]='|'; +if(!isset($str[$n])){$h=$this->handler; $str[$n]=$h->createParserString();} +$str[$n]->string=&$this->s; +$str[$n]->off=$this->i0; +$str[$n]->length=$this->i-$this->i0; +++$this->tag[$t]->n; +$this->APPEND('|'); +$this->i0=$this->i; +} +function parse() { +while($this->eor==0) { +if($this->c>=$this->pos) { +$this->buf=$this->handler->read(JAVA_RECV_SIZE); +if(is_null($this->buf) || strlen($this->buf)==0) +$this->handler->protocol->handler->shutdownBrokenConnection("protocol error. Check the back end log for OutOfMemoryErrors."); +$this->pos=strlen($this->buf); +if($this->pos==0) break; +$this->c=0; +} +switch(($ch=$this->buf[$this->c])) +{ +case '<': if($this->in_dquote) {$this->APPEND($ch); break;} +$this->level+=1; +$this->type=$this->BEGIN; +break; +case '\t': case '\f': case '\n': case '\r': case ' ': if($this->in_dquote) {$this->APPEND($ch); break;} +if($this->type==$this->BEGIN) { +$this->PUSH($this->type); +$this->type=$this->KEY; +} +break; +case '=': if($this->in_dquote) {$this->APPEND($ch); break;} +$this->PUSH($this->type); +$this->type=$this->VAL; +break; +case '/': if($this->in_dquote) {$this->APPEND($ch); break;} +if($this->type==$this->BEGIN) { $this->type=$this->END; $this->level-=1; } +$this->level-=1; +$this->eot=true; +break; +case '>': if($this->in_dquote) {$this->APPEND($ch); break;} +if($this->type==$this->END){ +$this->PUSH($this->BEGIN); +$this->CALL_END(); +} else { +if($this->type==$this->VAL) $this->PUSH($this->type); +$this->CALL_BEGIN(); +} +$this->tag[0]->n=$this->tag[1]->n=$this->tag[2]->n=0; $this->i0=$this->i=0; +$this->type=$this->VOJD; +if($this->level==0) $this->eor=1; +break; +case ';': +if($this->type==$this->ENTITY) { +switch ($this->s[$this->e+1]) { +case 'l': $this->s[$this->e]='<'; $this->i=$this->e+1; break; +case 'g': $this->s[$this->e]='>'; $this->i=$this->e+1; break; +case 'a': $this->s[$this->e]=($this->s[$this->e+2]=='m'?'&':'\''); $this->i=$this->e+1; break; +case 'q': $this->s[$this->e]='"'; $this->i=$this->e+1; break; +default: $this->APPEND($ch); +} +$this->type=$this->VAL; +} else { +$this->APPEND($ch); +} +break; +case '&': +$this->type=$this->ENTITY; +$this->e=$this->i; +$this->APPEND($ch); +break; +case '"': +$this->in_dquote=!$this->in_dquote; +if(!$this->in_dquote && $this->type==$this->VAL) { +$this->PUSH($this->type); +$this->type=$this->KEY; +} +break; +default: +$this->APPEND($ch); +} +$this->c+=1; +} +$this->RESET(); +} +function getData($str) { +return $str; +} +function parserError() { +$this->handler->protocol->handler->shutdownBrokenConnection( +sprintf("protocol error: %s. Check the back end log for details.",$this->s)); +} +} +interface java_JavaType {}; +$java_initialized=false; +function __javaproxy_Client_getClient() { +static $client=null; +if(!is_null($client)) return $client; +if (function_exists("java_create_client")) $client=java_create_client(); +else { +global $java_initialized; +$client=new java_Client(); +$java_initialized=true; +} +return $client; +} +function java_last_exception_get() { +$client=__javaproxy_Client_getClient(); +return $client->invokeMethod(0,"getLastException",array()); +} +function java_last_exception_clear() { +$client=__javaproxy_Client_getClient(); +$client->invokeMethod(0,"clearLastException",array()); +} +function java_values_internal($object) { +if(!$object instanceof java_JavaType) return $object; +$client=__javaproxy_Client_getClient(); +return $client->invokeMethod(0,"getValues",array($object)); +} +function java_invoke($object,$method,$args) { +$client=__javaproxy_Client_getClient(); +$id=($object==null) ? 0 : $object->__java; +return $client->invokeMethod($id,$method,$args); +} +function java_unwrap ($object) { +if(!$object instanceof java_JavaType) throw new java_IllegalArgumentException($object); +$client=__javaproxy_Client_getClient(); +return $client->globalRef->get($client->invokeMethod(0,"unwrapClosure",array($object))); +} +function java_values($object) { +return java_values_internal($object); +} +function java_inspect_internal($object) { +if(!$object instanceof java_JavaType) throw new java_IllegalArgumentException($object); +$client=__javaproxy_Client_getClient(); +return $client->invokeMethod(0,"inspect",array($object)); +} +function java_inspect($object) { +return java_inspect_internal($object); +} +function java_set_file_encoding($enc) { +$client=__javaproxy_Client_getClient(); +return $client->invokeMethod(0,"setFileEncoding",array($enc)); +} +function java_instanceof_internal($ob,$clazz) { +if(!$ob instanceof java_JavaType) throw new java_IllegalArgumentException($ob); +if(!$clazz instanceof java_JavaType) throw new java_IllegalArgumentException($clazz); +$client=__javaproxy_Client_getClient(); +return $client->invokeMethod(0,"instanceOf",array($ob,$clazz)); +} +function java_instanceof($ob,$clazz) { +return java_instanceof_internal($ob,$clazz); +} +function java_cast_internal($object,$type) { +if(!$object instanceof java_JavaType) { +switch($type[0]) { +case 'S': case 's': +return (string)$object; +case 'B': case 'b': +return (boolean)$object; +case 'L': case 'I': case 'l': case 'i': +return (integer)$object; +case 'D': case 'd': case 'F': case 'f': +return (float) $object; +case 'N': case 'n': +return null; +case 'A': case 'a': +return (array)$object; +case 'O': case 'o': +return (object)$object; +} +} +return $object->__cast($type); +} +function java_cast($object,$type) { +return java_cast_internal($object,$type); +} +function java_require($arg) { +trigger_error('java_require() not supported anymore. Please use
getSession($args); +} +function java_session() { +return java_session_array(func_get_args()); +} +function java_server_name() { +try { +$client=__javaproxy_Client_getClient(); +return $client->getServerName(); +} catch (java_ConnectException $ex) { +return null; +} +} +function java_context() { +$client=__javaproxy_Client_getClient(); +return $client->getContext(); +} +function java_closure_array($args) { +if(isset($args[2]) && ((!($args[2] instanceof java_JavaType))&&!is_array($args[2]))) +throw new java_IllegalArgumentException($args[2]); +$client=__javaproxy_Client_getClient(); +$args[0]=isset($args[0]) ? $client->globalRef->add($args[0]) : 0; +$client->protocol->invokeBegin(0,"makeClosure"); +$n=count($args); +$client->protocol->writeULong($args[0]); +for($i=1; $i<$n; $i++) { +$client->writeArg($args[$i]); +} +$client->protocol->invokeEnd(); +$val=$client->getResult(); +return $val; +} +function java_closure() { +return java_closure_array(func_get_args()); +} +function java_begin_document() { +} +function java_end_document() { +} +class java_JavaProxy implements java_JavaType { +public $__serialID,$__java; +public $__signature; +public $__client; +public $__tempGlobalRef; +function java_JavaProxy($java,$signature){ +$this->__java=$java; +$this->__signature=$signature; +$this->__client=__javaproxy_Client_getClient(); +} +function __cast($type) { +return $this->__client->cast($this,$type); +} +function __sleep() { +$args=array($this,java_get_lifetime()); +$this->__serialID=$this->__client->invokeMethod(0,"serialize",$args); +$this->__tempGlobalRef=$this->__client->globalRef; +return array("__serialID","__tempGlobalRef"); +} +function __wakeup() { +$args=array($this->__serialID,java_get_lifetime()); +$this->__client=__javaproxy_Client_getClient(); +if($this->__tempGlobalRef) +$this->__client->globalRef=$this->__tempGlobalRef; +$this->__tempGlobalRef=null; +$this->__java=$this->__client->invokeMethod(0,"deserialize",$args); +} +function __destruct() { +if(isset($this->__client)) +$this->__client->unref($this->__java); +} +function __get($key) { +return $this->__client->getProperty($this->__java,$key); +} +function __set($key,$val) { +$this->__client->setProperty($this->__java,$key,$val); +} +function __call($method,$args) { +return $this->__client->invokeMethod($this->__java,$method,$args); +} +function __toString() { +try { +return $this->__client->invokeMethod(0,"ObjectToString",array($this)); +} catch (JavaException $ex) { +trigger_error("Exception in Java::__toString(): ". java_truncate((string)$ex),E_USER_WARNING); +return ""; +} +} +} +class java_objectIterator implements Iterator { +private $var; +function java_ObjectIterator($javaProxy) { +$this->var=java_cast ($javaProxy,"A"); +} +function rewind() { +reset($this->var); +} +function valid() { +return $this->current() !==false; +} +function next() { +return next($this->var); +} +function key() { +return key($this->var); +} +function current() { +return current($this->var); +} +} +class java_IteratorProxy extends java_JavaProxy implements IteratorAggregate { +function getIterator() { +return new java_ObjectIterator($this); +} +} +class java_ArrayProxy extends java_IteratorProxy implements ArrayAccess { +function offsetExists($idx) { +$ar=array($this,$idx); +return $this->__client->invokeMethod(0,"offsetExists",$ar); +} +function offsetGet($idx) { +$ar=array($this,$idx); +return $this->__client->invokeMethod(0,"offsetGet",$ar); +} +function offsetSet($idx,$val) { +$ar=array($this,$idx,$val); +return $this->__client->invokeMethod(0,"offsetSet",$ar); +} +function offsetUnset($idx) { +$ar=array($this,$idx); +return $this->__client->invokeMethod(0,"offsetUnset",$ar); +} +} +class java_ExceptionProxy extends java_JavaProxy { +function __toExceptionString($trace) { +$args=array($this,$trace); +return $this->__client->invokeMethod(0,"ObjectToString",$args); +} +} +abstract class java_AbstractJava implements IteratorAggregate,ArrayAccess,java_JavaType { +public $__client; +public $__delegate; +public $__serialID; +public $__factory; +public $__java,$__signature; +public $__cancelProxyCreationTag; +function __createDelegate() { +$proxy=$this->__delegate= +$this->__factory->create($this->__java,$this->__signature); +$this->__java=$proxy->__java; +$this->__signature=$proxy->__signature; +} +function __cast($type) { +if(!isset($this->__delegate)) $this->__createDelegate(); +return $this->__delegate->__cast($type); +} +function __sleep() { +if(!isset($this->__delegate)) $this->__createDelegate(); +$this->__delegate->__sleep(); +return array("__delegate"); +} +function __wakeup() { +if(!isset($this->__delegate)) $this->__createDelegate(); +$this->__delegate->__wakeup(); +$this->__java=$this->__delegate->__java; +$this->__client=$this->__delegate->__client; +} +function __get($key) { +if(!isset($this->__delegate)) $this->__createDelegate(); +return $this->__delegate->__get($key); +} +function __set($key,$val) { +if(!isset($this->__delegate)) $this->__createDelegate(); +$this->__delegate->__set($key,$val); +} +function __call($method,$args) { +if(!isset($this->__delegate)) $this->__createDelegate(); +return $this->__delegate->__call($method,$args); +} +function __toString() { +if(!isset($this->__delegate)) $this->__createDelegate(); +return $this->__delegate->__toString(); +} +function getIterator() { +if(!isset($this->__delegate)) $this->__createDelegate(); +if(func_num_args()==0) return $this->__delegate->getIterator(); +$args=func_get_args(); return $this->__call("getIterator",$args); +} +function offsetExists($idx) { +if(!isset($this->__delegate)) $this->__createDelegate(); +if(func_num_args()==1) return $this->__delegate->offsetExists($idx); +$args=func_get_args(); return $this->__call("offsetExists",$args); +} +function offsetGet($idx) { +if(!isset($this->__delegate)) $this->__createDelegate(); +if(func_num_args()==1) return $this->__delegate->offsetGet($idx); +$args=func_get_args(); return $this->__call("offsetGet",$args); +} +function offsetSet($idx,$val) { +if(!isset($this->__delegate)) $this->__createDelegate(); +if(func_num_args()==2) return $this->__delegate->offsetSet($idx,$val); +$args=func_get_args(); return $this->__call("offsetSet",$args); +} +function offsetUnset($idx) { +if(!isset($this->__delegate)) $this->__createDelegate(); +if(func_num_args()==1) return $this->__delegate->offsetUnset($idx); +$args=func_get_args(); return $this->__call("offsetUnset",$args); +} +} +class Java extends java_AbstractJava { +function Java() { +$client=$this->__client=__javaproxy_Client_getClient(); +$args=func_get_args(); +$name=array_shift($args); +if(is_array($name)) {$args=$name; $name=array_shift($args);} +$sig="&{$this->__signature}@{$name}"; +$len=count($args); +$args2=array(); +for($i=0; $i<$len; $i++) { +switch(gettype($val=$args[$i])) { +case 'boolean': array_push($args2,$val); $sig.='@b'; break; +case 'integer': array_push($args2,$val); $sig.='@i'; break; +case 'double': array_push($args2,$val); $sig.='@d'; break; +case 'string': array_push($args2,htmlspecialchars($val,ENT_COMPAT)); $sig.='@s'; break; +case 'array':$sig="~INVALID"; break; +case 'object': +if($val instanceof java_JavaType) { +array_push($args2,$val->__java); +$sig.="@o{$val->__signature}"; +} +else { +$sig="~INVALID"; +} +break; +case 'resource': array_push($args2,$val); $sig.='@r'; break; +case 'NULL': array_push($args2,$val); $sig.='@N'; break; +case 'unknown type': array_push($args2,$val); $sig.='@u'; break; +default: throw new java_IllegalArgumentException($val); +} +} +if(array_key_exists($sig,$client->methodCache)) { +$cacheEntry=&$client->methodCache[$sig]; +$client->sendBuffer.=$client->preparedToSendBuffer; +if(strlen($client->sendBuffer)>=JAVA_SEND_SIZE) { +if($client->protocol->handler->write($client->sendBuffer)<=0) +throw new java_IllegalStateException("Connection out of sync,check backend log for details."); +$client->sendBuffer=null; +} +$client->preparedToSendBuffer=vsprintf($cacheEntry->fmt,$args2); +$this->__java=++$client->asyncCtx; +$this->__factory=$cacheEntry->factory; +$this->__signature=$cacheEntry->signature; +$this->__cancelProxyCreationTag=++$client->cancelProxyCreationTag; +} else { +$client->currentCacheKey=$sig; +$delegate=$this->__delegate=$client->createObject($name,$args); +$this->__java=$delegate->__java; +$this->__signature=$delegate->__signature; +} +} +function __destruct() { +if(!isset($this->__client)) return; +$client=$this->__client; +$preparedToSendBuffer=&$client->preparedToSendBuffer; +if($preparedToSendBuffer && +$client->cancelProxyCreationTag==$this->__cancelProxyCreationTag) { +$preparedToSendBuffer[6]="3"; +$client->sendBuffer.=$preparedToSendBuffer; +$preparedToSendBuffer=null; +$client->asyncCtx -=1; +} else { +if(!isset($this->__delegate)) { +$client->unref($this->__java); +} +} +} +function __call($method,$args) { +$client=$this->__client; +$sig="@{$this->__signature}@$method"; +$len=count($args); +$args2=array($this->__java); +for($i=0; $i<$len; $i++) { +switch(gettype($val=$args[$i])) { +case 'boolean': array_push($args2,$val); $sig.='@b'; break; +case 'integer': array_push($args2,$val); $sig.='@i'; break; +case 'double': array_push($args2,$val); $sig.='@d'; break; +case 'string': array_push($args2,htmlspecialchars($val,ENT_COMPAT)); $sig.='@s'; break; +case 'array':$sig="~INVALID"; break; +case 'object': +if($val instanceof java_JavaType) { +array_push($args2,$val->__java); +$sig.="@o{$val->__signature}"; +} +else { +$sig="~INVALID"; +} +break; +case 'resource': array_push($args2,$val); $sig.='@r'; break; +case 'NULL': array_push($args2,$val); $sig.='@N'; break; +case 'unknown type': array_push($args2,$val); $sig.='@u'; break; +default: throw new java_IllegalArgumentException($val); +} +} +if(array_key_exists($sig,$client->methodCache)) { +$cacheEntry=&$client->methodCache[$sig]; +$client->sendBuffer.=$client->preparedToSendBuffer; +if(strlen($client->sendBuffer)>=JAVA_SEND_SIZE) { +if($client->protocol->handler->write($client->sendBuffer)<=0) +throw new java_IllegalStateException("Out of sync. Check backend log for details."); +$client->sendBuffer=null; +} +$client->preparedToSendBuffer=vsprintf($cacheEntry->fmt,$args2); +if($cacheEntry->resultVoid) { +$client->cancelProxyCreationTag +=1; +return null; +} else { +$result=clone($client->cachedJavaPrototype); +$result->__factory=$cacheEntry->factory; +$result->__java=++$client->asyncCtx; +$result->__signature=$cacheEntry->signature; +$result->__cancelProxyCreationTag=++$client->cancelProxyCreationTag; +return $result; +} +} else { +$client->currentCacheKey=$sig; +$retval=parent::__call($method,$args); +return $retval; +} +} +} +class java_InternalJava extends Java { +function java_InternalJava($proxy) { +$this->__delegate=$proxy; +$this->__java=$proxy->__java; +$this->__signature=$proxy->__signature; +$this->__client=$proxy->__client; +} +} +class java_class extends Java { +function java_class() { +$this->__client=__javaproxy_Client_getClient(); +$args=func_get_args(); +$name=array_shift($args); +if(is_array($name)) { $args=$name; $name=array_shift($args); } +$delegate=$this->__delegate=$this->__client->referenceObject($name,$args); +$this->__java=$delegate->__java; +$this->__signature=$delegate->__signature; +} +} +class JavaClass extends java_class{} +class java_exception extends Exception implements java_JavaType { +public $__serialID,$__java,$__client; +public $__delegate; +public $__signature; +public $__hasDeclaredExceptions; +function java_exception() { +$this->__client=__javaproxy_Client_getClient(); +$args=func_get_args(); +$name=array_shift($args); +if(is_array($name)) { $args=$name; $name=array_shift($args); } +if (count($args)==0) +Exception::__construct($name); +else +Exception::__construct($args[0]); +$delegate=$this->__delegate=$this->__client->createObject($name,$args); +$this->__java=$delegate->__java; +$this->__signature=$delegate->__signature; +$this->__hasDeclaredExceptions='T'; +} +function __cast($type) { +return $this->__delegate->__cast($type); +} +function __sleep() { +$this->__delegate->__sleep(); +return array("__delegate"); +} +function __wakeup() { +$this->__delegate->__wakeup(); +$this->__java=$this->__delegate->__java; +$this->__client=$this->__delegate->__client; +} +function __get($key) { +return $this->__delegate->__get($key); +} +function __set($key,$val) { +$this->__delegate->__set($key,$val); +} +function __call($method,$args) { +return $this->__delegate->__call($method,$args); +} +function __toString() { +return $this->__delegate->__toExceptionString($this->getTraceAsString()); +} +} +class JavaException extends java_exception {} +class java_InternalException extends JavaException { +function java_InternalException($proxy,$exception) { +$this->__delegate=$proxy; +$this->__java=$proxy->__java; +$this->__signature=$proxy->__signature; +$this->__client=$proxy->__client; +$this->__hasDeclaredExceptions=$exception; +} +} +class java_JavaProxyProxy extends Java { +function java_JavaProxyProxy($client) { +$this->__client=$client; +} +} +} +?> diff --git a/src/main/webapp/java/JavaProxy.php b/src/main/webapp/java/JavaProxy.php new file mode 100644 index 0000000..d6133d6 --- /dev/null +++ b/src/main/webapp/java/JavaProxy.php @@ -0,0 +1,19 @@ + From 55b3a7b7ad1e91aca4f160d702a60b927e38c519 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Fri, 27 Jan 2017 18:50:20 +0100 Subject: [PATCH 50/75] corrections web.xml --- src/main/webapp/WEB-INF/web.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index cf06817..1935bfc 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -3,7 +3,8 @@ "http://java.sun.com/dtd/web-app_2_3.dtd"> - + @@ -11,10 +12,12 @@ prefer_system_php_exec On - + php_exec - php-cgi.exe + php-cgi "); - File parentFile = f.getParentFile(); - String parentName = parentFile == null ? "/" : parentFile.getName(); - out.println("

Directory Listing for " + fullName + " - Up To " + parentName + "


"); - out.println(""); - out.println(""); - out.println(""); - out.println(""); - out.println(""); - out.println(""); - out.println(""); - File[] dir = f.listFiles(); - int count = 0; - StringBuffer b = new StringBuffer(); - for (int i = 0; i < dir.length; i++) { - File file = dir[i]; - if (file.isHidden()) continue; - boolean even = count++ % 2 == 0; - if (even) - out.println(""); - else - out.println(""); - - // mozilla replaces everything after the last slash: - // foo/bar baz becomes foo/baz and foo/bar/ baz becomes foo/bar/baz - if (fullName.length() != 0 && !fullName.endsWith("/")) { - b.append(f.getName()); - b.append("/"); - } - b.append(file.getName()); - if (file.isDirectory()) b.append("/"); - - out.println(""); - out.println(""); - } else { - out.println("" + file.getName() + ""); - out.println(""); - } - out.println(""); - out.println(""); + try (PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(xout, Util.UTF8)))) { + out.println(""); + out.println(""); + out.println("Directory Listing for " + fullName + "/"); + out.println(""); + File parentFile = f.getParentFile(); + String parentName = parentFile == null ? "/" : parentFile.getName(); + out.println("

Directory Listing for " + fullName + " - Up To " + parentName + "


FilenameTypeSizeLast Modified
  "); - - if (file.isDirectory()) { - out.println("" + file.getName() + "/  "); - out.println("directory  "); - out.println("file" + file.length() + "" + Util.formatDateTime(file.lastModified()) + "
"); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + out.println(""); out.println(""); - b.setLength(0); - } - out.println("
FilenameTypeSizeLast Modified
"); - out.println("

Simple JSR 223 enabled web server version 0.0.1

"); - out.println("

Available script engines

    "); - try { - Class c = Class.forName("javax.script.ScriptEngineManager"); - Object o = c.newInstance(); - Method ex = c.getMethod("getEngineByExtension", new Class[]{String.class}); - if (ex.invoke(o, (Object[]) new String[]{"php"}) == null) { - out.println("Warning: php-script.jar not found. Please copy it to the directory containing JavaBridge.jar before starting JavaBridge.

    "); + File[] dir = f.listFiles(); + int count = 0; + StringBuilder b = new StringBuilder(); + for (File file : dir) { + if (file.isHidden()) continue; + boolean even = count++ % 2 == 0; + if (even) + out.println(""); + else + out.println(""); + + // mozilla replaces everything after the last slash: + // foo/bar baz becomes foo/baz and foo/bar/ baz becomes foo/bar/baz + if (fullName.length() != 0 && !fullName.endsWith("/")) { + b.append(f.getName()); + b.append("/"); + } + b.append(file.getName()); + if (file.isDirectory()) b.append("/"); + + out.println("  "); + + if (file.isDirectory()) { + out.println("" + file.getName() + "/"); + out.println("  "); + out.println("directory"); + } else { + out.println("" + file.getName() + ""); + out.println("  "); + out.println("file"); + } + out.println("" + file.length() + ""); + out.println("" + Util.formatDateTime(file.lastModified()) + ""); + out.println(""); + b.setLength(0); } - - Method e = c.getMethod("getEngineFactories", new Class[]{}); - List factories = (List) e.invoke(o, new Object[]{}); - StringBuffer buf = new StringBuffer(); - for (Iterator ii = factories.iterator(); ii.hasNext(); ) { - o = ii.next(); - Method getName = o.getClass().getMethod("getEngineName", new Class[]{}); - Method getVersion = o.getClass().getMethod("getEngineVersion", new Class[]{}); - Method getNames = o.getClass().getMethod("getNames", new Class[]{}); - Method getExtensions = o.getClass().getMethod("getExtensions", new Class[]{}); - buf.append("
  • "); - buf.append(getName.invoke(o, new Object[]{})); - buf.append(", "); - buf.append("ver.: "); - buf.append(getVersion.invoke(o, new Object[]{})); - buf.append(", "); - buf.append("alias: "); - buf.append(getNames.invoke(o, new Object[]{})); - buf.append(", "); - buf.append(".ext: "); - buf.append(getExtensions.invoke(o, new Object[]{})); - buf.append("
  • "); - out.println(buf); - buf.setLength(0); + out.println(""); + out.println("

    Simple JSR 223 enabled web server version 0.0.1

    "); + out.println("

    Available script engines

      "); + try { + Class c = Class.forName("javax.script.ScriptEngineManager"); + Object o = c.newInstance(); + Method ex = c.getMethod("getEngineByExtension", new Class[]{String.class}); + if (ex.invoke(o, (Object[]) new String[]{"php"}) == null) { + out.println("Warning: php-script.jar not found. Please copy it to the directory containing JavaBridge.jar before starting JavaBridge.

      "); + } + + Method e = c.getMethod("getEngineFactories", new Class[]{}); + List factories = (List) e.invoke(o, new Object[]{}); + StringBuffer buf = new StringBuffer(); + for (Iterator ii = factories.iterator(); ii.hasNext(); ) { + o = ii.next(); + Method getName = o.getClass().getMethod("getEngineName", new Class[]{}); + Method getVersion = o.getClass().getMethod("getEngineVersion", new Class[]{}); + Method getNames = o.getClass().getMethod("getNames", new Class[]{}); + Method getExtensions = o.getClass().getMethod("getExtensions", new Class[]{}); + buf.append("
    • "); + buf.append(getName.invoke(o, new Object[]{})); + buf.append(", "); + buf.append("ver.: "); + buf.append(getVersion.invoke(o, new Object[]{})); + buf.append(", "); + buf.append("alias: "); + buf.append(getNames.invoke(o, new Object[]{})); + buf.append(", "); + buf.append(".ext: "); + buf.append(getExtensions.invoke(o, new Object[]{})); + buf.append("
    • "); + out.println(buf); + buf.setLength(0); + } + } catch (Exception e) { + e.printStackTrace(); } - } catch (Exception e) { - e.printStackTrace(); + out.println("
    "); + out.println(""); + out.println(""); + res.addHeader("Content-Type", "text/html; charset=UTF-8"); + res.addHeader("Last-Modified", Util.formatDateTime(f.lastModified())); } - out.println("
"); - out.println(""); - out.println(""); - res.addHeader("Content-Type", "text/html; charset=UTF-8"); - res.addHeader("Last-Modified", Util.formatDateTime(f.lastModified())); - out.close(); int outLength = xout.size(); res.setContentLength(outLength); xout.writeTo(res.getOutputStream()); @@ -353,6 +356,7 @@ protected boolean showDirectory(String fullName, File f, int length, HttpRequest * JSR223 script engine to the java ext dirs (usually /usr/share/java/ext or /usr/java/packages/lib/ext) and start the HTTP server: * java -jar JavaBridge.jar HTTP_LOCAL:8080. Browse to http://localhost:8080/test.php. * + * @param name * @param f The full name as a file * @param params The request parameter * @param length The length of the file @@ -368,11 +372,13 @@ protected boolean handleScriptContent(String name, String params, File f, int le /** * Display a simple text file * + * @param name * @param f The full name as a file * @param params The request parameter * @param length The length of the file * @param req The HTTP request object * @param res The HTTP response object + * @param show * @throws IOException */ protected void showTextFile(String name, String params, File f, int length, HttpRequest req, HttpResponse res, boolean show) throws IOException { @@ -383,11 +389,11 @@ protected void showTextFile(String name, String params, File f, int length, Http res.addHeader("Last-Modified", Util.formatDateTime(f.lastModified())); if (show) res.addHeader("Content-Type", "text/plain"); res.setContentLength(length); - InputStream in = new FileInputStream(f); - buf = new byte[Util.BUF_SIZE]; - out = res.getOutputStream(); - while ((c = in.read(buf)) != -1) out.write(buf, 0, c); - in.close(); + try (InputStream in = new FileInputStream(f)) { + buf = new byte[Util.BUF_SIZE]; + out = res.getOutputStream(); + while ((c = in.read(buf)) != -1) out.write(buf, 0, c); + } } /** @@ -398,7 +404,9 @@ protected void showTextFile(String name, String params, File f, int length, Http * * @param req The HttpRequest * @param res The HttpResponse + * @throws java.io.IOException */ + @Override protected void doGet(HttpRequest req, HttpResponse res) throws IOException { handleDoGet(req, res); } @@ -410,6 +418,7 @@ protected void doGet(HttpRequest req, HttpResponse res) throws IOException { * * @param req The HttpRequest * @param res The HttpResponse + * @throws java.io.IOException */ protected void handleDoGet(HttpRequest req, HttpResponse res) throws IOException { @@ -432,7 +441,7 @@ protected void handleDoGet(HttpRequest req, HttpResponse res) throws IOException } File f = Standalone.getCanonicalWindowsFile(name); if (f == null || !f.exists()) f = new File(Util.HOME_DIR, name); - if (f == null || !f.exists()) return; + if (!f.exists()) return; if (f.isHidden()) return; long l = f.length(); if (l >= Integer.MAX_VALUE) throw new IOException("file " + name + " too large"); diff --git a/src/main/java/io/soluble/pjb/bridge/Options.java b/src/main/java/io/soluble/pjb/bridge/Options.java index 16ba91b..5fb9068 100644 --- a/src/main/java/io/soluble/pjb/bridge/Options.java +++ b/src/main/java/io/soluble/pjb/bridge/Options.java @@ -28,7 +28,7 @@ * * @author jostb */ -class Options { +public class Options { protected byte options = 0; @@ -37,14 +37,20 @@ class Options { */ private String encoding = null; + private boolean valuesCache, valuesCacheSet = false; + private boolean base64Cache, base64CacheSet = false; + + /** * Returns the file encoding, see java_set_file_encoding(). This option may change for each packet. * * @return The file encoding */ public String getEncoding() { - if (encoding != null) return encoding; - return encoding = Util.DEFAULT_ENCODING; + if (encoding != null) { + encoding = Util.DEFAULT_ENCODING; + } + return encoding; } /** @@ -62,8 +68,6 @@ public byte[] getBytes(String s) { } } - private boolean valuesCache, valuesCacheSet = false; - /** * Returns true when the bridge must destroy object identity (see PROTOCOL.TXT) due * to limitations in the client (for PHP4 for example). @@ -73,9 +77,9 @@ public byte[] getBytes(String s) { */ public boolean preferValues() { if (!valuesCacheSet) { - int options = 3 & this.options; + int opts = 3 & this.options; valuesCacheSet = true; - return valuesCache = options == 2 || options == 1; + return valuesCache = opts == 2 || opts == 1; } return valuesCache; } @@ -106,8 +110,6 @@ public void updateOptions(byte b) { this.options = b; } - private boolean base64Cache, base64CacheSet = false; - /** * Return true if we must return a base 64 encoded string * due to limitations in the client's XML parser. @@ -117,9 +119,9 @@ public void updateOptions(byte b) { */ public boolean base64Data() { if (!base64CacheSet) { - int options = 2 & this.options; + int opts = 2 & this.options; base64CacheSet = true; - return base64Cache = options == 2; + return base64Cache = opts == 2; } return base64Cache; } diff --git a/src/main/java/io/soluble/pjb/bridge/ParserTag.java b/src/main/java/io/soluble/pjb/bridge/ParserTag.java index 8d7d623..58f59f0 100644 --- a/src/main/java/io/soluble/pjb/bridge/ParserTag.java +++ b/src/main/java/io/soluble/pjb/bridge/ParserTag.java @@ -27,7 +27,7 @@ * * @author jostb */ -class ParserTag { +public class ParserTag { /** * The number of strings. */ diff --git a/src/main/java/io/soluble/pjb/bridge/Request.java b/src/main/java/io/soluble/pjb/bridge/Request.java index d9987fa..b6bc2c0 100644 --- a/src/main/java/io/soluble/pjb/bridge/Request.java +++ b/src/main/java/io/soluble/pjb/bridge/Request.java @@ -34,18 +34,25 @@ */ public final class Request implements IDocHandler { - private Parser parser; - private JavaBridge defaultBridge, bridge; protected static final IntegerComparator PHP_ARRAY_KEY_COMPARATOR = new IntegerComparator(); + protected static final PhpNull PHPNULL = new PhpNull(); + protected static final Object[] ZERO_ARGS = new Object[0]; + protected static final byte[] ZERO = {0}; + protected static final Object ZERO_OBJECT = new Object(); - // Only used when the async. protocol is enabled. - protected static final class PhpNull { - public String toString() { - return ""; //evaluates to false - } - } - protected static final PhpNull PHPNULL = new PhpNull(); + private final Parser parser; + private JavaBridge defaultBridge, bridge; + private SimpleContext contextCache; + private Arg arg; + + /** + * The current response handle or null. + * There is only one response handle for each request object. + * response.reset() or response.flush() must be called at the end of each packet. + */ + Response response = null; + protected Object getGlobalRef(int i) { Object ref = bridge.globalRef.get(i); @@ -53,30 +60,6 @@ protected Object getGlobalRef(int i) { return ref; } - static final Object[] ZERO_ARGS = new Object[0]; - - private class SimpleContext { - public void parseID(ParserString string) { - } - - public void setID(Response response) { - } - } - - private class Context extends SimpleContext { - protected long id; - - public void parseID(ParserString string) { - this.id = string.getLongValue(); - } - - public void setID(Response response) { - response.setID(id); - } - } - - private SimpleContext contextCache; - SimpleContext getContext() { if (contextCache != null) return contextCache; if (bridge.options.passContext()) { @@ -85,94 +68,6 @@ SimpleContext getContext() { return contextCache = new SimpleContext(); } - private abstract class Arg { - protected byte type; - protected Object callObject; - protected String method; - protected SimpleContext id = getContext(); - protected byte predicate; - protected Object key; - protected byte composite; - - public abstract void add(Object val); - - public abstract Object[] getArgs(); - - public abstract void reset(); - } - - private final class SimpleArg extends Arg { - private LinkedList list; - - public void add(Object val) { - if (list == null) list = new LinkedList(); - list.add(val); - } - - public Object[] getArgs() { - return (list == null) ? Request.ZERO_ARGS : list.toArray(); - } - - public void reset() { - list = null; - composite = 0; - type = 0; - callObject = null; - method = null; - key = null; - } - } - - private final class CompositeArg extends Arg { - private PhpArray ht = null; - private int count = 0; - private Arg parent; - - public CompositeArg(Arg parent) { - this.parent = parent; - } - - public void add(Object val) { - if (ht == null) ht = new PhpArray(); - if (key != null) { - ht.put(key, val); - } else { - ht.put(new Integer(count++), val); - } - - } - - protected Arg pop() { - if (ht == null) ht = new PhpArray(); - parent.add(ht); - return parent; - } - - /* (non-Javadoc) - * @see php.java.bridge.Request.Arg#getArgs() - */ - public Object[] getArgs() { - bridge.logError("Protocol error: getArgs"); - return ZERO_ARGS; - } - - /* (non-Javadoc) - * @see php.java.bridge.Request.Arg#reset() - */ - public void reset() { - bridge.logError("Protocol error: reset"); - } - } - - private Arg arg; - - /** - * The current response handle or null. - * There is only one response handle for each request object. - * response.reset() or response.flush() must be called at the end of each packet. - */ - Response response = null; - /** * Creates an empty request object. * @@ -184,9 +79,6 @@ public Request(JavaBridge bridge) { this.parser = new Parser(bridge, this); } - static final byte[] ZERO = {0}; - static final Object ZERO_OBJECT = new Object(); - /** * This method must be called with the current header option byte. * It initializes the request object. @@ -208,7 +100,6 @@ public void init(byte ch) { */ public boolean init(InputStream in, OutputStream out) throws IOException { switch (parser.initOptions(in, out)) { - case Parser.PING: bridge.logDebug("PING - PONG - Closing Request"); out.write(ZERO, 0, 1); @@ -228,7 +119,7 @@ private long getClassicPhpLong(ParserString st[]) { } private Object createClassicExact(ParserString st[]) { - return new Integer(st[0].getClassicIntValue()); + return st[0].getClassicIntValue(); } private long getPhpLong(ParserString st[]) { @@ -243,13 +134,14 @@ private Object createExact(ParserString st[]) { int val = st[0].getIntValue(); if (st[1].string[st[1].off] != 'O') val *= -1; - return (new Integer(val)); + return (val); } } /** * {@inheritDoc} */ + @Override public boolean begin(ParserTag[] tag) { boolean reply = true; ParserString[] st = tag[2].strings; @@ -393,6 +285,7 @@ public boolean begin(ParserTag[] tag) { /** * {@inheritDoc} */ + @Override public void end(ParserString[] string) { switch (string[0].string[0]) { case 'X': { @@ -799,4 +692,112 @@ public void recycle() { public void parseHeader(InputStream in) throws IOException { bridge.getFactory().parseHeader(this, in); } + + // Only used when the async. protocol is enabled. + protected static final class PhpNull { + @Override + public String toString() { + return ""; //evaluates to false + } + } + + private class SimpleContext { + public void parseID(ParserString string) { + } + + public void setID(Response response) { + } + } + + private class Context extends SimpleContext { + protected long id; + + @Override + public void parseID(ParserString string) { + this.id = string.getLongValue(); + } + + @Override + public void setID(Response response) { + response.setID(id); + } + } + + private abstract class Arg { + protected byte type; + protected Object callObject; + protected String method; + protected SimpleContext id = getContext(); + protected byte predicate; + protected Object key; + protected byte composite; + + public abstract void add(Object val); + public abstract Object[] getArgs(); + public abstract void reset(); + } + + private final class SimpleArg extends Arg { + private LinkedList list; + + public void add(Object val) { + if (list == null) list = new LinkedList(); + list.add(val); + } + + public Object[] getArgs() { + return (list == null) ? Request.ZERO_ARGS : list.toArray(); + } + + public void reset() { + list = null; + composite = 0; + type = 0; + callObject = null; + method = null; + key = null; + } + } + + private final class CompositeArg extends Arg { + private PhpArray ht = null; + private int count = 0; + private Arg parent; + + public CompositeArg(Arg parent) { + this.parent = parent; + } + + public void add(Object val) { + if (ht == null) ht = new PhpArray(); + if (key != null) { + ht.put(key, val); + } else { + ht.put(new Integer(count++), val); + } + + } + + protected Arg pop() { + if (ht == null) ht = new PhpArray(); + parent.add(ht); + return parent; + } + + /* (non-Javadoc) + * @see php.java.bridge.Request.Arg#getArgs() + */ + public Object[] getArgs() { + bridge.logError("Protocol error: getArgs"); + return ZERO_ARGS; + } + + /* (non-Javadoc) + * @see php.java.bridge.Request.Arg#reset() + */ + public void reset() { + bridge.logError("Protocol error: reset"); + } + } + } diff --git a/src/main/java/io/soluble/pjb/bridge/Standalone.java b/src/main/java/io/soluble/pjb/bridge/Standalone.java index df20174..fd44d66 100644 --- a/src/main/java/io/soluble/pjb/bridge/Standalone.java +++ b/src/main/java/io/soluble/pjb/bridge/Standalone.java @@ -1,6 +1,3 @@ -/*-*- mode: Java; tab-width:8 -*-*/ -package io.soluble.pjb.bridge; - /* * Copyright (C) 2003-2007 Jost Boekemeier * @@ -23,6 +20,8 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +package io.soluble.pjb.bridge; + import java.io.File; import java.io.IOException; import java.lang.reflect.Method; @@ -268,10 +267,8 @@ public static void main(String s[]) { args[5] = "-classpath"; args[6] = System.getProperty("java.class.path", "."); args[7] = "io.soluble.pjb.bridge.Standalone"; - - for (int j = 0; j < s.length; j++) { - args[j + 8] = s[j]; - } + System.arraycopy(s, 0, args, 8, s.length); + try { System.in.close(); System.out.close(); @@ -281,6 +278,7 @@ public static void main(String s[]) { } new Util.Thread(new Runnable() { + @Override public void run() { try { Runtime.getRuntime().exec(args); @@ -289,9 +287,10 @@ public void run() { } } }).start(); + try { Thread.sleep(20000); - } catch (Throwable t) { + } catch (InterruptedException t) { } System.exit(0); } @@ -314,7 +313,11 @@ public void run() { if (s.length == 0 && (System.getProperty("io.soluble.pjb.bridge.exec_sun_vm", "true").equals("true")) && ((sunJavaInstalled && checkGNUVM()) || isExecutableJavaBridgeJar)) { - Process p = Runtime.getRuntime().exec(new String[]{javaExec, "-Dio.soluble.pjb.bridge.exec_sun_vm=false", "-classpath", cp, "io.soluble.pjb.bridge.Standalone"}, null, wd); + Process p = Runtime.getRuntime().exec(new String[]{ + javaExec, + "-Dio.soluble.pjb.bridge.exec_sun_vm=false", + "-classpath", cp, + "io.soluble.pjb.bridge.Standalone"}, null, wd); if (p != null) System.exit(p.waitFor()); } } catch (Throwable t) {/*ignore*/} diff --git a/src/main/java/io/soluble/pjb/bridge/http/HttpServer.java b/src/main/java/io/soluble/pjb/bridge/http/HttpServer.java index 6222d43..b86aeaa 100644 --- a/src/main/java/io/soluble/pjb/bridge/http/HttpServer.java +++ b/src/main/java/io/soluble/pjb/bridge/http/HttpServer.java @@ -314,20 +314,34 @@ protected void doPut(HttpRequest req, HttpResponse res) throws IOException { /** * Sets the content length but leaves the rest of the body untouched. + * @param req + * @param res + * @throws java.io.IOException */ protected void service(HttpRequest req, HttpResponse res) throws IOException { String contentLength = req.getHeader("Content-Length"); if (contentLength == null) req.setContentLength(-1); else req.setContentLength(Integer.parseInt(contentLength)); String method = req.getMethod(); - if (method == PUT) doPut(req, res); - else if (method == GET) doGet(req, res); - else if (method == POST) doPost(req, res); + if (null != method) switch (method) { + case PUT: + doPut(req, res); + break; + case GET: + doGet(req, res); + break; + case POST: + doPost(req, res); + break; + default: + break; + } } /** * {@inheritDoc} */ + @Override public void run() { try { doRun(); From 316b3aaa606ce9ad3b8c25d486026e48e6b05cca Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sat, 28 Jan 2017 08:32:09 +0100 Subject: [PATCH 52/75] add sourceJar and javadocJar to build --- build.gradle | 68 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/build.gradle b/build.gradle index e275eab..ae71c55 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,16 @@ group 'io.soluble.pjb' version '6.2.11' +def artifactName = 'JavaBridge' + +buildscript { + repositories { + jcenter() + } + + dependencies { + classpath 'com.bmuschko:gradle-tomcat-plugin:2.2.5' + } +} apply plugin: 'java' apply plugin: 'jacoco' @@ -19,12 +30,13 @@ repositories { dependencies { providedCompile('javax.servlet:servlet-api:2.5') + runtime('log4j:log4j:1.2.17') testCompile('junit:junit:3.8.2') // the test code still uses this junit API def tomcatVersion = '7.0.59' - tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}", - "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}" - tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") { + tomcat 'org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}', + 'org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}' + tomcat('org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}') { exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj' } } @@ -36,46 +48,48 @@ if (System.getProperty('php_exec') == null) { ant.importBuild 'build.xml' jar { - baseName "JavaBridge" + baseName artifactName manifest { - attributes("Main-Class": "io.soluble.pjb.Standalone", - "Implementation-Title": "php-java-bridge.jar", - "Implementation-Version": version) + attributes('Main-Class': 'io.soluble.pjb.Standalone') } } war { - dependsOn jar - baseName "JavaBridge" - //from 'src/rootContent' // adds a file-set to the root of the archive + baseName artifactName + //from 'src/rootContent' // could add a file-set to the root of the archive } -clean { - dependsOn genClean -} - -compileJava { - dependsOn genAll +tomcatRun { + contextPath = '/' + httpPort = 8090 +// httpsPort = 8091 +// enableSSL = true + daemon = true } jacocoTestReport { - group = "Reporting" + group = 'Reporting' reports { xml.enabled true csv.enabled false - html.destination "${buildDir}/reports/coverage" + html.destination '${buildDir}/reports/coverage' } } -buildscript { - repositories { - jcenter() - } +task sourcesJar(type: Jar, dependsOn: classes) { + baseName = artifactName + classifier = 'sources' + from sourceSets.main.allSource +} - dependencies { - classpath 'com.bmuschko:gradle-tomcat-plugin:2.0' - } +task javadocJar(type: Jar, dependsOn: javadoc) { + baseName = artifactName + classifier = 'javadoc' + from javadoc.destinationDir } -tomcatRun.contextPath = '/JavaBridge' -tomcatRun.daemon = true +artifacts { + archives jar + archives sourcesJar + archives javadocJar +} From 6d62699da621eea1b376a854222a844d30895e0e Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sat, 28 Jan 2017 10:00:15 +0100 Subject: [PATCH 53/75] cleanup gradle build file --- build.gradle | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/build.gradle b/build.gradle index 14c11b2..9cf6a09 100644 --- a/build.gradle +++ b/build.gradle @@ -12,16 +12,6 @@ buildscript { } } -buildscript { - repositories { - jcenter() - } - - dependencies { - classpath 'com.bmuschko:gradle-tomcat-plugin:2.2.5' - } -} - apply plugin: 'java' apply plugin: 'jacoco' apply plugin: 'war' @@ -57,10 +47,6 @@ if (System.getProperty('php_exec') == null) { ant.importBuild 'build.xml' -clean { - dependsOn genClean -} - jar { baseName artifactName manifest { From 2c03720f68e9ed1a0c87ab0cb9141876ffad753f Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sat, 28 Jan 2017 10:01:22 +0100 Subject: [PATCH 54/75] correct error in package name --- server/TestInstallation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/TestInstallation.java b/server/TestInstallation.java index a5e0eb3..6aee3ca 100644 --- a/server/TestInstallation.java +++ b/server/TestInstallation.java @@ -248,8 +248,8 @@ private static final boolean checkGNUVM() { */ public static void main(String[] args) { try { // Hack for Unix: execute the standalone container using the default SUN VM - if (args.length == 0 && (new File("/usr/java/default/bin/java")).exists() && checkGNUVM() && (System.getProperty("php.java.bridge.exec_sun_vm", "true").equals("true"))) { - Process p = Runtime.getRuntime().exec(new String[]{"/usr/java/default/bin/java", "-Dphp.java.bridge.exec_sun_vm=false", "-classpath", System.getProperty("java.class.path"), "TestInstallation"}); + if (args.length == 0 && (new File("/usr/java/default/bin/java")).exists() && checkGNUVM() && (System.getProperty("io.soluble.pjb.exec_sun_vm", "true").equals("true"))) { + Process p = Runtime.getRuntime().exec(new String[]{"/usr/java/default/bin/java", "-Dio.soluble.pjb.exec_sun_vm=false", "-classpath", System.getProperty("java.class.path"), "TestInstallation"}); (new Thread() { InputStream in; From 54bd86764dc32acf01c887fca2bdb04897586d14 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sat, 28 Jan 2017 10:02:07 +0100 Subject: [PATCH 55/75] correct all javadoc errors --- src/main/java/io/soluble/pjb/bridge/Session.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/soluble/pjb/bridge/Session.java b/src/main/java/io/soluble/pjb/bridge/Session.java index 7f7bbb2..b80b7c5 100644 --- a/src/main/java/io/soluble/pjb/bridge/Session.java +++ b/src/main/java/io/soluble/pjb/bridge/Session.java @@ -95,7 +95,7 @@ public void putAll(Map vars) { } /* (non-Javadoc) - * @see php.java.bridge.ISession#getAll() + * @see io.soluble.pjb.ISession#getAll() */ public Map getAll() { this.lastAccessedTime = System.currentTimeMillis(); From c88a3d447c97850a75f3c97d075c9580639e45a2 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sat, 28 Jan 2017 10:03:54 +0100 Subject: [PATCH 56/75] correct all javadoc errors --- .../io/soluble/pjb/bridge/AppThreadPool.java | 2 +- .../io/soluble/pjb/bridge/ChainsawLogger.java | 1 - .../pjb/bridge/IJavaBridgeFactory.java | 4 +- .../java/io/soluble/pjb/bridge/ILogger.java | 8 +- .../java/io/soluble/pjb/bridge/IManaged.java | 4 +- .../java/io/soluble/pjb/bridge/Invocable.java | 4 +- .../io/soluble/pjb/bridge/JavaBridge.java | 3 +- .../soluble/pjb/bridge/JavaBridgeFactory.java | 12 +-- .../soluble/pjb/bridge/JavaBridgeRunner.java | 6 +- .../pjb/bridge/JavaBridgeSecurityManager.java | 9 ++- .../java/io/soluble/pjb/bridge/JavaInc.java | 4 +- .../io/soluble/pjb/bridge/ParserString.java | 4 +- .../io/soluble/pjb/bridge/PhpProcedure.java | 5 +- .../java/io/soluble/pjb/bridge/Request.java | 6 +- .../java/io/soluble/pjb/bridge/Response.java | 8 +- .../io/soluble/pjb/bridge/SessionFactory.java | 12 +-- .../io/soluble/pjb/bridge/Standalone.java | 2 +- .../io/soluble/pjb/bridge/ThreadPool.java | 2 +- src/main/java/io/soluble/pjb/bridge/Util.java | 2 +- .../pjb/bridge/http/AbstractChannel.java | 6 +- .../io/soluble/pjb/bridge/http/Context.java | 6 +- .../pjb/bridge/http/ContextFactory.java | 15 ++-- .../pjb/bridge/http/ContextServer.java | 4 +- .../io/soluble/pjb/bridge/http/FCGIUtil.java | 2 +- .../soluble/pjb/bridge/http/HttpServer.java | 7 +- .../pjb/bridge/http/IContextFactory.java | 14 ++-- .../pjb/bridge/http/IFCGIProcessFactory.java | 27 +++---- .../bridge/http/RemoteHttpContextFactory.java | 2 +- .../pjb/bridge/http/SimpleContextFactory.java | 4 +- .../pjb/script/AbstractPhpScriptContext.java | 6 +- .../pjb/script/AbstractPhpScriptEngine.java | 24 +++--- .../io/soluble/pjb/script/FCGIProcess.java | 2 +- .../io/soluble/pjb/script/FastCGIProxy.java | 2 +- .../soluble/pjb/script/IPhpScriptEngine.java | 5 +- .../io/soluble/pjb/script/IScriptReader.java | 9 +-- .../pjb/script/InvocablePhpScriptEngine.java | 4 +- .../soluble/pjb/script/PhpScriptContext.java | 28 ++++++- .../java/io/soluble/pjb/script/URLReader.java | 2 +- .../script/servlet/PhpHttpScriptContext.java | 74 +++++++++++++------ .../pjb/servlet/ContextLoaderListener.java | 2 +- .../io/soluble/pjb/servlet/HttpContext.java | 4 +- .../io/soluble/pjb/servlet/PhpCGIFilter.java | 4 +- .../soluble/pjb/servlet/PhpJavaServlet.java | 8 +- .../servlet/RemoteHttpServletResponse.java | 2 +- .../servlet/SimpleServletContextFactory.java | 2 +- .../pjb/servlet/fastcgi/FCGIProcess.java | 2 +- .../pjb/servlet/fastcgi/FastCGIServlet.java | 55 ++++++++------ 47 files changed, 243 insertions(+), 177 deletions(-) diff --git a/src/main/java/io/soluble/pjb/bridge/AppThreadPool.java b/src/main/java/io/soluble/pjb/bridge/AppThreadPool.java index 63a5ea2..72d1db9 100644 --- a/src/main/java/io/soluble/pjb/bridge/AppThreadPool.java +++ b/src/main/java/io/soluble/pjb/bridge/AppThreadPool.java @@ -183,7 +183,7 @@ protected ThreadPool.Delegate createDelegate(String name) { * Creates a new thread pool. * * @param name - The name of the pool threads. - * @param poolMaxSize - The max. number of threads, must be >= 1. + * @param poolMaxSize - The max. number of threads, must be >= 1. */ public AppThreadPool(String name, int poolMaxSize) { super(name, poolMaxSize); diff --git a/src/main/java/io/soluble/pjb/bridge/ChainsawLogger.java b/src/main/java/io/soluble/pjb/bridge/ChainsawLogger.java index 8f12fa6..4a66632 100644 --- a/src/main/java/io/soluble/pjb/bridge/ChainsawLogger.java +++ b/src/main/java/io/soluble/pjb/bridge/ChainsawLogger.java @@ -89,7 +89,6 @@ protected void init() throws Exception { /** * Create a new chainsaw logger. * - * @throws UnknownHostException If the host does not exist. * @see io.soluble.pjb.bridge.Util#setDefaultLogger(ILogger) */ protected ChainsawLogger() { diff --git a/src/main/java/io/soluble/pjb/bridge/IJavaBridgeFactory.java b/src/main/java/io/soluble/pjb/bridge/IJavaBridgeFactory.java index 4b2cd43..5ba6281 100644 --- a/src/main/java/io/soluble/pjb/bridge/IJavaBridgeFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/IJavaBridgeFactory.java @@ -39,7 +39,7 @@ public interface IJavaBridgeFactory { * @param clientIsNew one of {@link ISession#SESSION_CREATE_NEW} {@link ISession#SESSION_GET_OR_CREATE} or {@link ISession#SESSION_GET} * @param timeout timeout in seconds. If 0 the session does not expire. * @return The session - * @see php.java.bridge.ISession + * @see io.soluble.pjb.bridge.ISession */ public ISession getSession(String name, short clientIsNew, int timeout); @@ -47,7 +47,7 @@ public interface IJavaBridgeFactory { * Return the associated JSR223 context * * @return The JSR223 context, if supported by the environment or null. - * @see php.java.bridge.http.ContextFactory#getContext() + * @see io.soluble.pjb.bridge.http.ContextFactory#getContext() */ public IContext getContext(); diff --git a/src/main/java/io/soluble/pjb/bridge/ILogger.java b/src/main/java/io/soluble/pjb/bridge/ILogger.java index 0fd8647..7d25ef9 100644 --- a/src/main/java/io/soluble/pjb/bridge/ILogger.java +++ b/src/main/java/io/soluble/pjb/bridge/ILogger.java @@ -26,9 +26,9 @@ * The log interface for the PHP/Java Bridge log. * * @author jostb - * @see php.java.bridge.FileLogger - * @see php.java.bridge.ChainsawLogger - * @see php.java.bridge.SimpleLog4jLogger + * @see io.soluble.pjb.bridge.FileLogger + * @see io.soluble.pjb.bridge.ChainsawLogger + * @see io.soluble.pjb.bridge.SimpleLog4jLogger */ public interface ILogger { @@ -65,7 +65,7 @@ public interface ILogger { void log(int level, String msg); /** - * Display a warning if logLevel >= 1 + * Display a warning if logLevel >= 1 * * @param msg The warn message */ diff --git a/src/main/java/io/soluble/pjb/bridge/IManaged.java b/src/main/java/io/soluble/pjb/bridge/IManaged.java index 86d4424..0fa5334 100644 --- a/src/main/java/io/soluble/pjb/bridge/IManaged.java +++ b/src/main/java/io/soluble/pjb/bridge/IManaged.java @@ -32,7 +32,7 @@ public interface IManaged { /** - * Initialize a library. This method may be called via java_context()->init(...) + * Initialize a library. This method may be called via java_context()->init(...) * to initialize a library. Within init() onShutdown() may be called to * register a shutdown hook for the library. * @@ -43,7 +43,7 @@ public interface IManaged { public Object init(Object callable) throws Exception; /** - * Register a shutdown hook for the library. This method may be called via java_context()->onShutdown(...) + * Register a shutdown hook for the library. This method may be called via java_context()->onShutdown(...) * to register a shutdown hook during init(). * * @param closeable Its close() method will be called before the context or the VM terminates. diff --git a/src/main/java/io/soluble/pjb/bridge/Invocable.java b/src/main/java/io/soluble/pjb/bridge/Invocable.java index 8c28131..5a5052e 100644 --- a/src/main/java/io/soluble/pjb/bridge/Invocable.java +++ b/src/main/java/io/soluble/pjb/bridge/Invocable.java @@ -33,8 +33,8 @@ *
* * @author jostb - * @see php.java.bridge.PhpProcedure#invoke(Object, String, Object[]) - * @see php.java.bridge.PhpProcedure#invoke(Object, java.lang.reflect.Method, Object[]) + * @see io.soluble.pjb.bridge.PhpProcedure#invoke(Object, String, Object[]) + * @see io.soluble.pjb.bridge.PhpProcedure#invoke(Object, java.lang.reflect.Method, Object[]) */ public interface Invocable { diff --git a/src/main/java/io/soluble/pjb/bridge/JavaBridge.java b/src/main/java/io/soluble/pjb/bridge/JavaBridge.java index 39df18d..63fca89 100644 --- a/src/main/java/io/soluble/pjb/bridge/JavaBridge.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaBridge.java @@ -1824,8 +1824,7 @@ public Object getContext() { * * @param name The session name, if any * @param clientIsNew true, if the client wants a new session - * @param timeout session timeout in seconds. If timeout is <= 0, the session will never expire @return The session context - * . + * @param timeout session timeout in seconds. If timeout is <= 0, the session will never expire @return The session context * @return * @throws Exception * @see io.soluble.pjb.bridge.ISession diff --git a/src/main/java/io/soluble/pjb/bridge/JavaBridgeFactory.java b/src/main/java/io/soluble/pjb/bridge/JavaBridgeFactory.java index e0f5225..5b057ee 100644 --- a/src/main/java/io/soluble/pjb/bridge/JavaBridgeFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaBridgeFactory.java @@ -34,12 +34,12 @@ * Create new JavaBridge instances * * @author jostb - * @see php.java.bridge.Session + * @see io.soluble.pjb.bridge.Session * @see io.soluble.pjb.bridge.http.Context - * @see php.java.servlet.HttpContext + * @see io.soluble.pjb.servlet.HttpContext * @see io.soluble.pjb.bridge.http.ContextFactory - * @see php.java.servlet.ServletContextFactory - * @see php.java.script.PhpScriptContextFactory + * @see io.soluble.pjb.servlet.ServletContextFactory + * @see io.soluble.pjb.script.PhpScriptContextFactory */ public abstract class JavaBridgeFactory implements IJavaBridgeFactory { @@ -52,7 +52,7 @@ public abstract class JavaBridgeFactory implements IJavaBridgeFactory { * @param clientIsNew one of {@link ISession#SESSION_CREATE_NEW} {@link ISession#SESSION_GET_OR_CREATE} or {@link ISession#SESSION_GET} * @param timeout timeout in seconds. If 0 the session does not expire. * @return The session - * @see php.java.bridge.ISession + * @see io.soluble.pjb.bridge.ISession */ public abstract ISession getSession(String name, short clientIsNew, int timeout); @@ -60,7 +60,7 @@ public abstract class JavaBridgeFactory implements IJavaBridgeFactory { * Return the associated JSR223 context * * @return Always null - * @see php.java.bridge.http.ContextFactory#getContext() + * @see io.soluble.pjb.bridge.http.ContextFactory#getContext() */ public abstract IContext getContext(); diff --git a/src/main/java/io/soluble/pjb/bridge/JavaBridgeRunner.java b/src/main/java/io/soluble/pjb/bridge/JavaBridgeRunner.java index 9a37b19..dc20637 100644 --- a/src/main/java/io/soluble/pjb/bridge/JavaBridgeRunner.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaBridgeRunner.java @@ -57,7 +57,7 @@ * }
* * @author jostb - * @see php.java.script.PhpScriptContext + * @see io.soluble.pjb.script.PhpScriptContext */ public class JavaBridgeRunner extends HttpServer { @@ -207,8 +207,8 @@ private static String getHeader(String key, HttpRequest req) { /** * Handles both, override-redirect and redirect, see - * see php.java.servlet.PhpJavaServlet#handleSocketConnection(HttpServletRequest, HttpServletResponse, String, boolean) - * see php.java.servlet.PhpJavaServlet#handleRedirectConnection(HttpServletRequest, HttpServletResponse) + * see io.soluble.pjb.servlet.PhpJavaServlet#handleSocketConnection(HttpServletRequest, HttpServletResponse, String, boolean) + * see io.soluble.pjb.servlet.PhpJavaServlet#handleRedirectConnection(HttpServletRequest, HttpServletResponse) * @param req * @param res * @throws java.io.IOException diff --git a/src/main/java/io/soluble/pjb/bridge/JavaBridgeSecurityManager.java b/src/main/java/io/soluble/pjb/bridge/JavaBridgeSecurityManager.java index 5ed27a7..a33ed60 100644 --- a/src/main/java/io/soluble/pjb/bridge/JavaBridgeSecurityManager.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaBridgeSecurityManager.java @@ -45,8 +45,10 @@ public class JavaBridgeSecurityManager extends SecurityManager { protected static final Permission MODIFY_THREAD_PERMISSION = new RuntimePermission("modifyThread"); /** - * @inheritDoc Internal groups may pass, user groups are checked against the javabridge.policy file. + * {@inheritDoc} + * Internal groups may pass, user groups are checked against the javabridge.policy file. */ + @Override public void checkAccess(ThreadGroup g) { if (g == null) { throw new NullPointerException("thread group can't be null"); @@ -77,6 +79,7 @@ else if (g instanceof AppThreadPool.AppGroup) * * @return The current thread group */ + @Override public ThreadGroup getThreadGroup() { try { AppThreadPool.Delegate delegate = (AppThreadPool.Delegate) Thread.currentThread(); @@ -88,10 +91,12 @@ public ThreadGroup getThreadGroup() { } /** - * @inheritDoc System.exit(...) can by switched off by removing + * {@inheritDoc} + * System.exit(...) can by switched off by removing * permission java.lang.RuntimePermission "exitVM"; * from the policy file. */ + @Override public void checkExit(int status) { //super.checkExit(status); diff --git a/src/main/java/io/soluble/pjb/bridge/JavaInc.java b/src/main/java/io/soluble/pjb/bridge/JavaInc.java index 8c64985..41daa0a 100644 --- a/src/main/java/io/soluble/pjb/bridge/JavaInc.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaInc.java @@ -72,9 +72,9 @@ public class JavaInc { "}\n"+ "function java_virtual($path,$return=false) {\n"+ "$req=java_context()->getHttpServletRequest();\n"+ -"$req=new java(\"php.java.servlet.VoidInputHttpServletRequest\",$req);\n"+ +"$req=new java(\"io.soluble.pjb.servlet.VoidInputHttpServletRequest\",$req);\n"+ "$res=java_context()->getHttpServletResponse();\n"+ -"$res=new java(\"php.java.servlet.RemoteHttpServletResponse\",$res);\n"+ +"$res=new java(\"io.soluble.pjb.servlet.RemoteHttpServletResponse\",$res);\n"+ "$req->getRequestDispatcher($path)->include($req,$res);\n"+ "if ($return) return $res->getBufferContents();\n"+ "echo $res->getBufferContents();\n"+ diff --git a/src/main/java/io/soluble/pjb/bridge/ParserString.java b/src/main/java/io/soluble/pjb/bridge/ParserString.java index b39b85f..2e4b4db 100644 --- a/src/main/java/io/soluble/pjb/bridge/ParserString.java +++ b/src/main/java/io/soluble/pjb/bridge/ParserString.java @@ -80,7 +80,7 @@ public String getUTF8StringValue() { * Returns the string encoded via java_set_file_encoding(). * * @return The encoded string value. - * @see php.java.bridge.Options#getEncoding() + * @see io.soluble.pjb.Options#getEncoding() */ public String getStringValue() { return bridge.getString(string, off, length); @@ -90,7 +90,7 @@ public String getStringValue() { * Returns the cached string encoded via java_set_file_encoding(). * * @return The encoded string value. - * @see php.java.bridge.Options#getEncoding() + * @see io.soluble.pjb.Options#getEncoding() */ public String getCachedStringValue() { return bridge.getCachedString(string, off, length); diff --git a/src/main/java/io/soluble/pjb/bridge/PhpProcedure.java b/src/main/java/io/soluble/pjb/bridge/PhpProcedure.java index c66303b..b6b09a8 100644 --- a/src/main/java/io/soluble/pjb/bridge/PhpProcedure.java +++ b/src/main/java/io/soluble/pjb/bridge/PhpProcedure.java @@ -53,8 +53,9 @@ protected PhpProcedure(IJavaBridgeFactory bridge, long object, String name, Map * * @param bridge - The request handling bridge * @param name - The name, e.g. java_closure($this, "alwaysCallMe") - * @param names - A map of names, e.g. java_closure($this, array("javaName1" => "php_name1", ...); - * @param interfaces - The list of interfaces that this proxy must implement, may be empty. E.g. java_closure($this, null, null, array(new Java("java.awt.event.ActionListener")); + * @param names - A map of names, e.g. java_closure($this, array("javaName1" => "php_name1", ...); + * @param interfaces - The list of interfaces that this proxy must implement, may be empty. E.g. + * java_closure($this, null, null, array(new Java("java.awt.event.ActionListener")); * @param object - An opaque object ID (protocol-level). * @return A new proxy instance. */ diff --git a/src/main/java/io/soluble/pjb/bridge/Request.java b/src/main/java/io/soluble/pjb/bridge/Request.java index b6bc2c0..2daea05 100644 --- a/src/main/java/io/soluble/pjb/bridge/Request.java +++ b/src/main/java/io/soluble/pjb/bridge/Request.java @@ -654,7 +654,7 @@ public void reset() { * associated session-/contextFactory will be automatically destroyed when the request is done. * * @param bridge The fresh bridge and its ContextFactory - * @see php.java.bridge.http.IContextFactory#recycle(String) + * @see io.soluble.pjb.bridge.http.IContextFactory#recycle(String) */ public void setBridge(JavaBridge bridge) { defaultBridge = this.bridge; @@ -785,7 +785,7 @@ protected Arg pop() { } /* (non-Javadoc) - * @see php.java.bridge.Request.Arg#getArgs() + * @see io.soluble.pjb.Request.Arg#getArgs() */ public Object[] getArgs() { bridge.logError("Protocol error: getArgs"); @@ -793,7 +793,7 @@ public Object[] getArgs() { } /* (non-Javadoc) - * @see php.java.bridge.Request.Arg#reset() + * @see io.soluble.pjb.Request.Arg#reset() */ public void reset() { bridge.logError("Protocol error: reset"); diff --git a/src/main/java/io/soluble/pjb/bridge/Response.java b/src/main/java/io/soluble/pjb/bridge/Response.java index 1ff345d..469697a 100644 --- a/src/main/java/io/soluble/pjb/bridge/Response.java +++ b/src/main/java/io/soluble/pjb/bridge/Response.java @@ -356,8 +356,8 @@ private boolean setResultArray(Object value) { } /** - * Writer used by the async protocol. It always returns - * or , even for NULL, Class values, although Exceptions + * Writer used by the async protocol. It always returns <V ...> + * or <O ...>, even for NULL, Class values, although Exceptions * are handled. When the client-side cache is enabled, the client * will select an Async or AsyncVoidWriter in the next call. */ @@ -385,7 +385,7 @@ public boolean setResult(Object value) { /** * Writer used by the async protocol (begin/end document). It - * always returns or , even for NULL, Class or + * always returns <V ...> or <O ...>, even for NULL, Class or * Exception values. When the client-side cache is enabled, the * client will select an Async or AsyncVoidWriter in the next * call. @@ -715,7 +715,7 @@ public Writer setAsyncVoidWriter() { } /** - * Selects a specialized writer which always writes or , even for NULL, Class and Exception values. + * Selects a specialized writer which always writes <O ...> or <V ..>, even for NULL, Class and Exception values. * This triggers the client cache so that it selects the AsyncNull or AsyncWriter. * * @return The async. writer diff --git a/src/main/java/io/soluble/pjb/bridge/SessionFactory.java b/src/main/java/io/soluble/pjb/bridge/SessionFactory.java index f2914ac..0aa0299 100644 --- a/src/main/java/io/soluble/pjb/bridge/SessionFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/SessionFactory.java @@ -36,12 +36,12 @@ * Create new session instances * * @author jostb - * @see php.java.bridge.Session + * @see io.soluble.pjb.bridge.Session * @see io.soluble.pjb.bridge.http.Context - * @see php.java.servlet.HttpContext + * @see io.soluble.pjb.servlet.HttpContext * @see io.soluble.pjb.bridge.http.ContextFactory - * @see php.java.servlet.ServletContextFactory - * @see php.java.script.PhpScriptContextFactory + * @see io.soluble.pjb.servlet.ServletContextFactory + * @see io.soluble.pjb.script.PhpScriptContextFactory */ public class SessionFactory extends JavaBridgeFactory { @@ -90,7 +90,7 @@ private ISession session(String name, short clientIsNew, int timeout) { * @param clientIsNew one of {@link ISession#SESSION_CREATE_NEW} {@link ISession#SESSION_GET_OR_CREATE} or {@link ISession#SESSION_GET} * @param timeout timeout in seconds. If 0 the session does not expire. * @return The session - * @see php.java.bridge.ISession + * @see io.soluble.pjb.bridge.ISession */ public ISession getSession(String name, short clientIsNew, int timeout) { if (name == null) name = JavaBridge.PHPSESSION; @@ -102,7 +102,7 @@ public ISession getSession(String name, short clientIsNew, int timeout) { * Return the associated context * * @return Always null - * @see php.java.bridge.http.ContextFactory#getContext() + * @see io.soluble.pjb.bridge.http.ContextFactory#getContext() */ public IContext getContext() { return null; diff --git a/src/main/java/io/soluble/pjb/bridge/Standalone.java b/src/main/java/io/soluble/pjb/bridge/Standalone.java index fd44d66..52f37f6 100644 --- a/src/main/java/io/soluble/pjb/bridge/Standalone.java +++ b/src/main/java/io/soluble/pjb/bridge/Standalone.java @@ -38,7 +38,7 @@ * (starts the built-in servlet engine listening on all interfaces or loopback). *

Example:
java * -Djava.awt.headless=true -jar JavaBridge.jar INET_LOCAL:9676 5 - * bridge.log &
telnet localhost 9676
<CreateInstance + * bridge.log
telnet localhost 9676
<CreateInstance * value="java.lang.Long" predicate="Instance" id="0">
<Long * value="6"/>
</CreateInstance>
<Invoke * value="1" method="toString" predicate="Invoke" id="0"/>
diff --git a/src/main/java/io/soluble/pjb/bridge/ThreadPool.java b/src/main/java/io/soluble/pjb/bridge/ThreadPool.java index d36abd7..7a06d8e 100644 --- a/src/main/java/io/soluble/pjb/bridge/ThreadPool.java +++ b/src/main/java/io/soluble/pjb/bridge/ThreadPool.java @@ -150,7 +150,7 @@ public void destroy() { * Creates a new thread pool. * * @param name - The name of the pool threads. - * @param poolMaxSize - The max. number of threads, must be >= 1. + * @param poolMaxSize - The max. number of threads, must be >= 1. */ public ThreadPool(String name, int poolMaxSize) { if (poolMaxSize < 1) throw new IllegalArgumentException("poolMaxSize must be >0"); diff --git a/src/main/java/io/soluble/pjb/bridge/Util.java b/src/main/java/io/soluble/pjb/bridge/Util.java index 915fe7a..7d8d9a1 100644 --- a/src/main/java/io/soluble/pjb/bridge/Util.java +++ b/src/main/java/io/soluble/pjb/bridge/Util.java @@ -503,7 +503,7 @@ public static void warn(String msg) { } /** - * Display a stack trace if logLevel >= 1 + * Display a stack trace if logLevel >= 1 * * @param t The Throwable */ diff --git a/src/main/java/io/soluble/pjb/bridge/http/AbstractChannel.java b/src/main/java/io/soluble/pjb/bridge/http/AbstractChannel.java index 56c2de1..e1af38b 100644 --- a/src/main/java/io/soluble/pjb/bridge/http/AbstractChannel.java +++ b/src/main/java/io/soluble/pjb/bridge/http/AbstractChannel.java @@ -38,7 +38,7 @@ public abstract class AbstractChannel { * Returns the channel's input stream. * * @return The InputStream - * @throws FileNotFoundException + * @throws IOException */ public abstract InputStream getInputStream() throws IOException; @@ -46,7 +46,7 @@ public abstract class AbstractChannel { * Returns the channel's output stream. * * @return The OutputStream. - * @throws FileNotFoundException + * @throws IOException */ public abstract OutputStream getOuptutStream() throws IOException; @@ -59,7 +59,7 @@ public abstract class AbstractChannel { * Returns the name of the channel, for example the socket # or the pipe name. * * @return the name of the channel. - * @see php.java.bridge.http.AbstractChannelName#getName() + * @see io.soluble.pjb.bridge.http.AbstractChannelName#getName() */ public abstract String getName(); } diff --git a/src/main/java/io/soluble/pjb/bridge/http/Context.java b/src/main/java/io/soluble/pjb/bridge/http/Context.java index 73fa6ea..f861009 100644 --- a/src/main/java/io/soluble/pjb/bridge/http/Context.java +++ b/src/main/java/io/soluble/pjb/bridge/http/Context.java @@ -50,9 +50,9 @@ *
* * @author jostb - * @see php.java.script.IPhpScriptContext + * @see io.soluble.pjb.script.IPhpScriptContext * @see javax.script.ScriptContext - * @see php.java.script.PhpScriptContext + * @see io.soluble.pjb.script.PhpScriptContext */ public class Context implements IManaged, Invocable, IContext { @@ -251,7 +251,7 @@ protected Map getEngineScope() { * Used when scripts are running outside of a servlet environment: * Either the Standalone or the JSR223 Standalone (see PhpScriptContext).
* Within a servlet environment use the ContextLoaderListener instead: - * Either php.java.servlet.Context or the JSR223 Context (see PhpSimpleHttpScriptContext). + * Either io.soluble.pjb.servlet.Context or the JSR223 Context (see PhpSimpleHttpScriptContext). * * @param closeable The procedure close(), will be called before the VM terminates */ diff --git a/src/main/java/io/soluble/pjb/bridge/http/ContextFactory.java b/src/main/java/io/soluble/pjb/bridge/http/ContextFactory.java index 65ea2c0..41baa50 100644 --- a/src/main/java/io/soluble/pjb/bridge/http/ContextFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/ContextFactory.java @@ -79,9 +79,9 @@ * belongs to the same ContextServer. *

* - * @see php.java.servlet.ServletContextFactory + * @see io.soluble.pjb.servlet.ServletContextFactory * @see io.soluble.pjb.bridge.http.ContextServer - * @see php.java.bridge.SessionFactory#TIMER_DURATION + * @see io.soluble.pjb.bridge.SessionFactory#TIMER_DURATION */ public final class ContextFactory extends SessionFactory implements IContextFactory { @@ -95,6 +95,7 @@ public final class ContextFactory extends SessionFactory implements IContextFact static { try { getTimer().addJob(new Runnable() { + @Override public void run() { destroyOrphaned(); } @@ -107,8 +108,8 @@ public void run() { private static final HashMap contexts = new HashMap(); private static final HashMap liveContexts = new HashMap(); - private String id; - private long timestamp; + private final String id; + private final long timestamp; private IContextFactoryVisitor visitor; private boolean initialized; @@ -166,7 +167,7 @@ public ContextFactory(String webContext, boolean isManaged) { * to the list of context factories kept by this classloader. * * @return The created ContextFactory. - * @see php.java.bridge.http.ContextFactory#get(String) + * @see io.soluble.pjb.bridge.http.ContextFactory#get(String) */ public static IContextFactory addNew() { return new SimpleContextFactory(EMPTY_CONTEXT_NAME, false); @@ -180,7 +181,7 @@ public static IContextFactory addNew() { * @param id The ID * @return The ContextFactory or null. * @throws SecurityException if id belongs to a different ContextServer. - * @see php.java.bridge.http.ContextFactory#addNew() + * @see io.soluble.pjb.bridge.http.ContextFactory#addNew() */ /* See PhpJavaServlet#contextServer, http.ContextRunner#contextServer and * JavaBridgeRunner#ctxServer. */ @@ -350,7 +351,7 @@ public IContext getContext() { * Should be called by Context.addNew() only. * * @param context The context. - * @see php.java.bridge.http.ContextFactory#addNew() + * @see io.soluble.pjb.bridge.http.ContextFactory#addNew() */ public void setContext(IContext context) { visitor.setContext(context); diff --git a/src/main/java/io/soluble/pjb/bridge/http/ContextServer.java b/src/main/java/io/soluble/pjb/bridge/http/ContextServer.java index 80edd51..28a14df 100644 --- a/src/main/java/io/soluble/pjb/bridge/http/ContextServer.java +++ b/src/main/java/io/soluble/pjb/bridge/http/ContextServer.java @@ -33,8 +33,8 @@ * A bridge pattern which either uses the PipeContextServer or the SocketContextServer, * depending on the OS and/or the security restrictions. On windows, which cannot use named pipes, * a SocketContextServer is used. All other operating systems use a PipeContextServer unless the - * system property php.java.bridge.promiscuous is set to true or the system property - * php.java.bridge.no_pipe_server is set to true. + * system property io.soluble.pjb.promiscuous is set to true or the system property + * io.soluble.pjb.no_pipe_server is set to true. *

* A ContextServer instance represents the current web context. * When the PipeContextServer is used, there can be more than one PipeContextServer instance per classloader, the ContextFactory.get() checks diff --git a/src/main/java/io/soluble/pjb/bridge/http/FCGIUtil.java b/src/main/java/io/soluble/pjb/bridge/http/FCGIUtil.java index b319f01..8526242 100644 --- a/src/main/java/io/soluble/pjb/bridge/http/FCGIUtil.java +++ b/src/main/java/io/soluble/pjb/bridge/http/FCGIUtil.java @@ -117,7 +117,7 @@ public class FCGIUtil { * This controls how many child processes the PHP process spawns. * Default is 5. The value should be less than THREAD_POOL_MAX_SIZE * - * @see php.java.bridge.Util#THREAD_POOL_MAX_SIZE + * @see io.soluble.pjb.bridge.Util#THREAD_POOL_MAX_SIZE */ public static final String PHP_FCGI_CONNECTION_POOL_SIZE = "5"; // should be less than Util.THREAD_POOL_MAX_SIZE; diff --git a/src/main/java/io/soluble/pjb/bridge/http/HttpServer.java b/src/main/java/io/soluble/pjb/bridge/http/HttpServer.java index b86aeaa..5b37e23 100644 --- a/src/main/java/io/soluble/pjb/bridge/http/HttpServer.java +++ b/src/main/java/io/soluble/pjb/bridge/http/HttpServer.java @@ -44,9 +44,9 @@ * @author jostb * @see io.soluble.pjb.bridge.http.HttpRequest * @see io.soluble.pjb.bridge.http.HttpResponse - * @see php.java.script.Continuation - * @see php.java.script.URLReader - * @see php.java.script.Continuation + * @see io.soluble.pjb.script.Continuation + * @see io.soluble.pjb.script.URLReader + * @see io.soluble.pjb.script.Continuation */ public abstract class HttpServer implements Runnable { /** @@ -120,7 +120,6 @@ protected HttpServer(String serverPort, boolean isSecure) throws IOException { * Create a new HTTP Server. * * @param serverPort The port# as a string. Prefix may be INET: or INET_LOCAL: - * @param isSecure * @throws IOException * @see HttpServer#destroy() */ diff --git a/src/main/java/io/soluble/pjb/bridge/http/IContextFactory.java b/src/main/java/io/soluble/pjb/bridge/http/IContextFactory.java index fde70ad..a943aa8 100644 --- a/src/main/java/io/soluble/pjb/bridge/http/IContextFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/IContextFactory.java @@ -40,9 +40,9 @@ public interface IContextFactory extends IJavaBridgeFactory { *

* * @param id The fresh id - * @see php.java.bridge.http.ContextFactory#recycle() - * @see php.java.bridge.Request#setBridge(php.java.bridge.JavaBridge) - * @see php.java.bridge.Request#recycle() + * @see io.soluble.pjb.bridge.http.ContextFactory#recycle() + * @see io.soluble.pjb.bridge.Request#setBridge(io.soluble.pjb.JavaBridge) + * @see io.soluble.pjb.bridge.Request#recycle() */ public void recycle(String id); @@ -86,7 +86,7 @@ public interface IContextFactory extends IJavaBridgeFactory { * Return a JSR223 context * * @return The context - * @see php.java.servlet.ServletContextFactory#getContext() + * @see io.soluble.pjb.servlet.ServletContextFactory#getContext() * @see io.soluble.pjb.bridge.http.Context */ public IContext getContext(); @@ -96,7 +96,7 @@ public interface IContextFactory extends IJavaBridgeFactory { * Should be called by Context.addNew() only. * * @param context - * @see php.java.bridge.http.ContextFactory#addNew() + * @see io.soluble.pjb.bridge.http.ContextFactory#addNew() */ public void setContext(IContext context); @@ -105,7 +105,7 @@ public interface IContextFactory extends IJavaBridgeFactory { * @param clientIsNew true if the client wants a new session * @param timeout timeout in seconds. If 0 the session does not expire. * @return The session - * @see php.java.bridge.ISession + * @see io.soluble.pjb.bridge.ISession */ public ISession getSession(String name, short clientIsNew, int timeout); @@ -114,7 +114,7 @@ public interface IContextFactory extends IJavaBridgeFactory { * @param clientIsNew true if the client wants a new session * @param timeout timeout in seconds. If 0 the session does not expire. * @return The session - * @see php.java.bridge.ISession + * @see io.soluble.pjb.bridge.ISession */ public ISession getSimpleSession(String name, short clientIsNew, int timeout); diff --git a/src/main/java/io/soluble/pjb/bridge/http/IFCGIProcessFactory.java b/src/main/java/io/soluble/pjb/bridge/http/IFCGIProcessFactory.java index 82e3a9b..cf80674 100644 --- a/src/main/java/io/soluble/pjb/bridge/http/IFCGIProcessFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/IFCGIProcessFactory.java @@ -31,7 +31,7 @@ /** * Implementing classes are able to use the FastCGI machinery. - * Currently implemented by {@link php.java.servlet.fastcgi.FastCGIServlet} and {@link php.java.script.FastCGIProxy} + * Currently implemented by {@link io.soluble.pjb.servlet.fastcgi.FastCGIServlet} and {@link io.soluble.pjb.script.FastCGIProxy} */ public interface IFCGIProcessFactory { /** @@ -39,83 +39,80 @@ public interface IFCGIProcessFactory { * * @param msg The message to log */ - public void log(String msg); + void log(String msg); /** * Create a FastCGI Process * * @param args The PHP arguments - * @param webInfDir The web inf dir - * @param pearDir The bear dir - * @param cgiDir The cgi dir * @param includeJava automatically include Java.inc in each script * @param home The PHP home dir or null * @param env The process environment * @return a FastCGI process object * @throws IOException */ - public IFCGIProcess createFCGIProcess(String[] args, boolean includeJava, File home, Map env) throws IOException; + IFCGIProcess createFCGIProcess(String[] args, boolean includeJava, File home, Map env) throws IOException; /** * Get the connection pool size, usually FCGIUtil#PHP_FCGI_CONNECTION_POOL_SIZE * * @return The connection pool size */ - public String getPhpConnectionPoolSize(); + String getPhpConnectionPoolSize(); /** * Get the max requests value, usually {@link FCGIUtil#PHP_FCGI_MAX_REQUESTS} * * @return The connection pool size */ - public String getPhpMaxRequests(); + String getPhpMaxRequests(); /** * Get the path to the PHP binary. For example "/usr/bin/php-cgi". * * @return The path or the name of the PHP FastCGI binary or null (defaults to php-cgi or php-cgi.exe on the PATH) */ - public String getPhp(); + String getPhp(); /** * Get the value of the php_include_java option from the WEB-INF/web.xml. Should return true in most cases. * * @return the php_include_java option */ - public boolean getPhpIncludeJava(); + boolean getPhpIncludeJava(); /** * Get the process environment map used for PHP. * * @return the process environment. */ - public HashMap getEnvironment(); + HashMap getEnvironment(); /** * Used for debugging only. Should always return true. * * @return true */ - public boolean canStartFCGI(); + boolean canStartFCGI(); /** * The full path to the pear dir. Defaults to WEB-INF/cgi. Use TMPDIR for a standalone runner. * * @return the full path to the cgi dir */ - public String getCgiDir(); + String getCgiDir(); /** * The full path to the pear dir. Defaults to WEB-INF/pear. Use TMPDIR for a standalone runner. * * @return the full path to the pear dir */ - public String getPearDir(); + String getPearDir(); /** * The full path to the web-inf dir. Defaults to WEB-INF. Use TMPDIR for a standalone runner. * * @return the full path to the WEB-INF dir */ - public String getWebInfDir(); + String getWebInfDir(); } diff --git a/src/main/java/io/soluble/pjb/bridge/http/RemoteHttpContextFactory.java b/src/main/java/io/soluble/pjb/bridge/http/RemoteHttpContextFactory.java index d1c7c00..da85414 100644 --- a/src/main/java/io/soluble/pjb/bridge/http/RemoteHttpContextFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/RemoteHttpContextFactory.java @@ -159,7 +159,7 @@ public void destroy() { * Return an emulated JSR223 context. * * @return The context. - * @see php.java.servlet.HttpContext + * @see io.soluble.pjb.servlet.HttpContext */ private IContext createContext() { return new Context(); diff --git a/src/main/java/io/soluble/pjb/bridge/http/SimpleContextFactory.java b/src/main/java/io/soluble/pjb/bridge/http/SimpleContextFactory.java index bf4cdaf..0818d36 100644 --- a/src/main/java/io/soluble/pjb/bridge/http/SimpleContextFactory.java +++ b/src/main/java/io/soluble/pjb/bridge/http/SimpleContextFactory.java @@ -38,8 +38,8 @@ *

* Instances of this class are thrown away at the end of the request. * - * @see php.java.servlet.ServletContextFactory - * @see php.java.script.PhpScriptContextFactory + * @see io.soluble.pjb.servlet.ServletContextFactory + * @see io.soluble.pjb.script.PhpScriptContextFactory */ public class SimpleContextFactory implements IContextFactoryVisitor { diff --git a/src/main/java/io/soluble/pjb/script/AbstractPhpScriptContext.java b/src/main/java/io/soluble/pjb/script/AbstractPhpScriptContext.java index 94941be..40d8cae 100644 --- a/src/main/java/io/soluble/pjb/script/AbstractPhpScriptContext.java +++ b/src/main/java/io/soluble/pjb/script/AbstractPhpScriptContext.java @@ -83,7 +83,7 @@ public void startContinuation() { } /** - * @inheritDoc + * {@inheritDoc} */ public void setContinuation(Continuation kont) { this.kont = kont; @@ -91,14 +91,14 @@ public void setContinuation(Continuation kont) { } /** - * @inheritDoc + * {@inheritDoc} */ public Continuation getContinuation() { return kont; } /** - * @inheritDoc + * {@inheritDoc} */ public boolean call(Object kont) throws Exception { if (!continuationCalled) { diff --git a/src/main/java/io/soluble/pjb/script/AbstractPhpScriptEngine.java b/src/main/java/io/soluble/pjb/script/AbstractPhpScriptEngine.java index 5256b8e..834a463 100644 --- a/src/main/java/io/soluble/pjb/script/AbstractPhpScriptEngine.java +++ b/src/main/java/io/soluble/pjb/script/AbstractPhpScriptEngine.java @@ -60,7 +60,8 @@ * @see io.soluble.pjb.script.InvocablePhpScriptEngine * @see io.soluble.pjb.script.PhpScriptEngine */ -abstract class AbstractPhpScriptEngine extends AbstractScriptEngine implements IPhpScriptEngine, Compilable, java.io.FileFilter, CloneableScript { +abstract class AbstractPhpScriptEngine extends AbstractScriptEngine + implements IPhpScriptEngine, Compilable, java.io.FileFilter, CloneableScript { /** * The allocated script @@ -139,6 +140,7 @@ protected void setNewContextFactory() { /* (non-Javadoc) * @see javax.script.ScriptEngine#eval(java.io.Reader, javax.script.ScriptContext) */ + @Override public Object eval(Reader reader, ScriptContext context) throws ScriptException { return evalPhp(reader, context); } @@ -181,18 +183,15 @@ protected void compilePhp(Reader reader) throws IOException { } FileWriter writer = new FileWriter(compilerOutputFile); char[] buf = new char[Util.BUF_SIZE]; - Reader localReader = getLocalReader(reader, true); - try { + try (Reader localReader = getLocalReader(reader, true)) { int c; while ((c = localReader.read(buf)) > 0) writer.write(buf, 0, c); writer.close(); - } finally { - localReader.close(); } } - private void updateGlobalEnvironment(ScriptContext context) throws IOException { + private void updateGlobalEnvironment() throws IOException { if (isCompiled) { if (compilerOutputFile == null) throw new NullPointerException("SCRIPT_FILENAME"); @@ -201,12 +200,13 @@ private void updateGlobalEnvironment(ScriptContext context) throws IOException { } private final class SimpleHeaderParser extends HeaderParser { - private WriterOutputStream writer; + private final WriterOutputStream writer; public SimpleHeaderParser(WriterOutputStream writer) { this.writer = writer; } + @Override public void parseHeader(String header) { if (header == null) return; int idx = header.indexOf(':'); @@ -216,6 +216,7 @@ public void parseHeader(String header) { addHeader(key, val); } + @Override public void addHeader(String key, String val) { if (val != null && key.equals("content-type")) { int idx = val.indexOf(';'); @@ -232,7 +233,7 @@ public void addHeader(String key, String val) { protected Continuation getContinuation(Reader reader, ScriptContext context) throws IOException { HeaderParser headerParser = HeaderParser.DEFAULT_HEADER_PARSER; // ignore encoding, we pass everything directly IPhpScriptContext phpScriptContext = (IPhpScriptContext) context; - updateGlobalEnvironment(context); + updateGlobalEnvironment(); OutputStream out = ((PhpScriptWriter) (context.getWriter())).getOutputStream(); OutputStream err = ((PhpScriptWriter) (context.getErrorWriter())).getOutputStream(); @@ -271,8 +272,9 @@ final protected Object doEval(Reader reader, ScriptContext context) throws Excep */ /** - * @inheritDoc + * {@inheritDoc} */ + @Override public Object eval(String script, ScriptContext context) throws ScriptException { if (script == null) return evalPhp((Reader) null, context); @@ -289,8 +291,9 @@ public Object eval(String script, ScriptContext context) } /** - * @inheritDoc + * {@inheritDoc} */ + @Override public ScriptEngineFactory getFactory() { return this.factory; } @@ -298,6 +301,7 @@ public ScriptEngineFactory getFactory() { /** * Release the continuation */ + @Override public void release() { if (continuation != null) { try { diff --git a/src/main/java/io/soluble/pjb/script/FCGIProcess.java b/src/main/java/io/soluble/pjb/script/FCGIProcess.java index 5752d76..a2d265c 100644 --- a/src/main/java/io/soluble/pjb/script/FCGIProcess.java +++ b/src/main/java/io/soluble/pjb/script/FCGIProcess.java @@ -67,7 +67,7 @@ protected String[] getArgumentArray(String[] php, String[] args) { } /* (non-Javadoc) - * @see php.java.servlet.fastcgi.IFCGIProcess#start() + * @see io.soluble.pjb.servlet.fastcgi.IFCGIProcess#start() */ public void start() throws NullPointerException, IOException { super.start(); diff --git a/src/main/java/io/soluble/pjb/script/FastCGIProxy.java b/src/main/java/io/soluble/pjb/script/FastCGIProxy.java index 79e9c18..64ba6b8 100644 --- a/src/main/java/io/soluble/pjb/script/FastCGIProxy.java +++ b/src/main/java/io/soluble/pjb/script/FastCGIProxy.java @@ -53,7 +53,7 @@ * This class can be used to run (and to connect to) a FastCGI server. * * @author jostb - * @see php.java.script.servlet.HttpFastCGIProxy + * @see io.soluble.pjb.script.servlet.HttpFastCGIProxy */ public class FastCGIProxy extends Continuation implements IFCGIProcessFactory { diff --git a/src/main/java/io/soluble/pjb/script/IPhpScriptEngine.java b/src/main/java/io/soluble/pjb/script/IPhpScriptEngine.java index dc3980a..3b0b400 100644 --- a/src/main/java/io/soluble/pjb/script/IPhpScriptEngine.java +++ b/src/main/java/io/soluble/pjb/script/IPhpScriptEngine.java @@ -41,12 +41,11 @@ public interface IPhpScriptEngine extends ScriptEngine, Compilable, java.io.File * * @throws IOException */ - public void close() throws IOException; + void close() throws IOException; /** * alias for {@link #close()} * - * @throws IOException */ - public void release(); + void release(); } diff --git a/src/main/java/io/soluble/pjb/script/IScriptReader.java b/src/main/java/io/soluble/pjb/script/IScriptReader.java index 1b45c2a..8eab9d3 100644 --- a/src/main/java/io/soluble/pjb/script/IScriptReader.java +++ b/src/main/java/io/soluble/pjb/script/IScriptReader.java @@ -42,8 +42,9 @@ public interface IScriptReader { /** * These header values appear in the environment map passed to PHP */ - public static final String[] HEADER = new String[]{Util.X_JAVABRIDGE_CONTEXT, Util.X_JAVABRIDGE_OVERRIDE_HOSTS, - Util.X_JAVABRIDGE_INCLUDE_ONLY, Util.X_JAVABRIDGE_INCLUDE, Util.X_JAVABRIDGE_REDIRECT, Util.X_JAVABRIDGE_OVERRIDE_HOSTS_REDIRECT}; + static final String[] HEADER = new String[]{Util.X_JAVABRIDGE_CONTEXT, Util.X_JAVABRIDGE_OVERRIDE_HOSTS, + Util.X_JAVABRIDGE_INCLUDE_ONLY, Util.X_JAVABRIDGE_INCLUDE, Util.X_JAVABRIDGE_REDIRECT, + Util.X_JAVABRIDGE_OVERRIDE_HOSTS_REDIRECT}; /** * Read from the URL and write the data to out. @@ -52,9 +53,7 @@ public interface IScriptReader { * @param out The OutputStream. * @param headerParser The header parser * @throws IOException - * @throws ServletException */ - public abstract void read(Map env, OutputStream out, - HeaderParser headerParser) throws IOException; + abstract void read(Map env, OutputStream out, HeaderParser headerParser) throws IOException; } \ No newline at end of file diff --git a/src/main/java/io/soluble/pjb/script/InvocablePhpScriptEngine.java b/src/main/java/io/soluble/pjb/script/InvocablePhpScriptEngine.java index ea31d29..514b6a6 100644 --- a/src/main/java/io/soluble/pjb/script/InvocablePhpScriptEngine.java +++ b/src/main/java/io/soluble/pjb/script/InvocablePhpScriptEngine.java @@ -71,8 +71,8 @@ *

* * ScriptEngine e = (new ScriptEngineManager()).getEngineByName("php-invocable");
- * e.eval(new php.java.script.URLReader(new URL("http://localhost/hello.php")));
- * System.out.println(((Invocable)e).invokeMethod(e.get("php.java.bridge.PhpProcedure"), "f", new Object[]{}));
+ * e.eval(new io.soluble.pjb.script.URLReader(new URL("http://localhost/hello.php")));
+ * System.out.println(((Invocable)e).invokeMethod(e.get("io.soluble.pjb.PhpProcedure"), "f", new Object[]{}));
* ((Closeable)e).close();
*
*
diff --git a/src/main/java/io/soluble/pjb/script/PhpScriptContext.java b/src/main/java/io/soluble/pjb/script/PhpScriptContext.java index ee6e74b..1b3cef3 100644 --- a/src/main/java/io/soluble/pjb/script/PhpScriptContext.java +++ b/src/main/java/io/soluble/pjb/script/PhpScriptContext.java @@ -44,11 +44,11 @@ * This class implements a simple script context for PHP. It starts a standalone * JavaBridgeRunner which listens for requests from php instances.

*

- * In a servlet environment please use a php.java.script.http.PhpSimpleHttpScriptContext instead. + * In a servlet environment please use a io.soluble.pjb.script.http.PhpSimpleHttpScriptContext instead. * * @author jostb * @see io.soluble.pjb.script.PhpScriptContext - * @see php.java.bridge.JavaBridgeRunner + * @see io.soluble.pjb.bridge.JavaBridgeRunner */ public final class PhpScriptContext extends AbstractPhpScriptContext { @@ -59,6 +59,7 @@ public PhpScriptContext(ScriptContext ctx) { /** * {@inheritDoc} */ + @Override public Object init(Object callable) throws Exception { return io.soluble.pjb.bridge.http.Context.getManageable(callable); } @@ -66,6 +67,7 @@ public Object init(Object callable) throws Exception { /** * {@inheritDoc} */ + @Override public void onShutdown(Object closeable) { io.soluble.pjb.bridge.http.Context.handleManaged(closeable); } @@ -75,6 +77,7 @@ public void onShutdown(Object closeable) { * * @return none */ + @Override public Object getHttpServletRequest() { throw new IllegalStateException("PHP not running in a servlet environment"); } @@ -84,6 +87,7 @@ public Object getHttpServletRequest() { * * @return none */ + @Override public Object getServletContext() { throw new IllegalStateException("PHP not running in a servlet environment"); } @@ -93,6 +97,7 @@ public Object getServletContext() { * * @return none */ + @Override public Object getHttpServletResponse() { throw new IllegalStateException("PHP not running in a servlet environment"); } @@ -102,6 +107,7 @@ public Object getHttpServletResponse() { * * @return none */ + @Override public Object getServlet() { throw new IllegalStateException("PHP not running in a servlet environment"); } @@ -111,6 +117,7 @@ public Object getServlet() { * * @return none */ + @Override public Object getServletConfig() { throw new IllegalStateException("PHP not running in a servlet environment"); } @@ -118,6 +125,7 @@ public Object getServletConfig() { /** * {@inheritDoc} */ + @Override public String getRealPath(String path) { return io.soluble.pjb.bridge.http.Context.getRealPathInternal(path); } @@ -125,6 +133,7 @@ public String getRealPath(String path) { /** * {@inheritDoc} */ + @Override public Object get(String key) { return getBindings(IContext.ENGINE_SCOPE).get(key); } @@ -132,6 +141,7 @@ public Object get(String key) { /** * {@inheritDoc} */ + @Override public void put(String key, Object val) { getBindings(IContext.ENGINE_SCOPE).put(key, val); } @@ -139,6 +149,7 @@ public void put(String key, Object val) { /** * {@inheritDoc} */ + @Override public void remove(String key) { getBindings(IContext.ENGINE_SCOPE).remove(key); } @@ -146,6 +157,7 @@ public void remove(String key) { /** * {@inheritDoc} */ + @Override public void putAll(Map map) { getBindings(IContext.ENGINE_SCOPE).putAll(map); } @@ -153,6 +165,7 @@ public void putAll(Map map) { /** * {@inheritDoc} */ + @Override public Map getAll() { return Collections.unmodifiableMap(getBindings(IContext.ENGINE_SCOPE)); } @@ -160,6 +173,7 @@ public Map getAll() { /** * {@inheritDoc} */ + @Override public Continuation createContinuation(Reader reader, Map env, OutputStream out, OutputStream err, HeaderParser headerParser, ResultProxy result, ILogger logger, boolean isCompiled) { @@ -175,7 +189,7 @@ public Continuation createContinuation(Reader reader, Map env, private static JavaBridgeRunner httpServer; - private static synchronized final JavaBridgeRunner getHttpServer() { + private static synchronized JavaBridgeRunner getHttpServer() { if (httpServer != null) return httpServer; try { return httpServer = JavaBridgeRunner.getRequiredInstance(); @@ -188,20 +202,26 @@ private static synchronized final JavaBridgeRunner getHttpServer() { /** * {@inheritDoc} */ + @Override public String getSocketName() { return getHttpServer().getSocket().getSocketName(); } /** + * @return * @deprecated */ + @Override public String getRedirectString() { throw new NotImplementedException(); } /** + * @param webPath + * @return * @deprecated */ + @Override public String getRedirectString(String webPath) { throw new NotImplementedException(); } @@ -209,6 +229,7 @@ public String getRedirectString(String webPath) { /** * {@inheritDoc} */ + @Override public String getRedirectURL(String webPath) { return "http://127.0.0.1:" + getSocketName() + webPath; } @@ -216,6 +237,7 @@ public String getRedirectURL(String webPath) { /** * {@inheritDoc} */ + @Override public ContextServer getContextServer() { return getHttpServer().getContextServer(); } diff --git a/src/main/java/io/soluble/pjb/script/URLReader.java b/src/main/java/io/soluble/pjb/script/URLReader.java index d2856b3..9bdd8c3 100644 --- a/src/main/java/io/soluble/pjb/script/URLReader.java +++ b/src/main/java/io/soluble/pjb/script/URLReader.java @@ -179,7 +179,7 @@ private void appendListValues(StringBuffer buf, List list) { } /* (non-Javadoc) - * @see php.java.script.IScriptReader#read(java.util.Map, java.io.OutputStream, php.java.bridge.Util.HeaderParser) + * @see io.soluble.pjb.script.IScriptReader#read(java.util.Map, java.io.OutputStream, io.soluble.pjb.Util.HeaderParser) */ public void read(Map env, OutputStream out, HeaderParser headerParser) throws IOException { InputStream natIn = null; diff --git a/src/main/java/io/soluble/pjb/script/servlet/PhpHttpScriptContext.java b/src/main/java/io/soluble/pjb/script/servlet/PhpHttpScriptContext.java index 9ba50d3..1d8a4d5 100644 --- a/src/main/java/io/soluble/pjb/script/servlet/PhpHttpScriptContext.java +++ b/src/main/java/io/soluble/pjb/script/servlet/PhpHttpScriptContext.java @@ -27,8 +27,6 @@ import io.soluble.pjb.script.PhpScriptContextDecorator; import io.soluble.pjb.script.PhpScriptWriter; import io.soluble.pjb.script.ResultProxy; -import io.soluble.pjb.script.servlet.HttpFastCGIProxy; -import io.soluble.pjb.script.servlet.PhpScriptLogWriter; import io.soluble.pjb.servlet.ContextLoaderListener; import io.soluble.pjb.servlet.ServletUtil; @@ -60,9 +58,9 @@ * Use *

* - * static final CompiledScript script = ((Compilable)(new ScriptEngineManager().getEngineByName("php-invocable"))).compile("");
+ * static final CompiledScript script = ((Compilable)(new ScriptEngineManager().getEngineByName("php-invocable"))).compile("<?php ...?>");
*
- * script.eval(new php.java.script.servlet.PhpCompiledHttpScriptContext(script.getEngine().getContext(),this,application,request,response)); + * script.eval(new io.soluble.pjb.script.servlet.PhpCompiledHttpScriptContext(script.getEngine().getContext(),this,application,request,response)); *
*
* @@ -75,6 +73,10 @@ public class PhpHttpScriptContext extends PhpScriptContextDecorator { * PhpScriptContext * * @param ctx the script context to be decorated + * @param servlet + * @param context + * @param request + * @param response */ public PhpHttpScriptContext(ScriptContext ctx, Servlet servlet, ServletContext context, HttpServletRequest request, HttpServletResponse response) { super((IPhpScriptContext) ctx); @@ -87,6 +89,7 @@ public PhpHttpScriptContext(ScriptContext ctx, Servlet servlet, ServletContext c /** * {@inheritDoc} */ + @Override public Continuation createContinuation(Reader reader, Map env, OutputStream out, OutputStream err, HeaderParser headerParser, ResultProxy result, ILogger logger, boolean isCompiled) { @@ -100,6 +103,7 @@ public Continuation createContinuation(Reader reader, Map env, return cont; } + @Override public void startContinuation() { ContextLoaderListener listener = ContextLoaderListener.getContextLoaderListener((ServletContext) getServletContext()); listener.getThreadPool().start(getContinuation()); @@ -129,21 +133,24 @@ public void startContinuation() { /** * {@inheritDoc} */ + @Override public Object getAttribute(String key, int scope) { - if (scope == REQUEST_SCOPE) { - return request.getAttribute(key); - } else if (scope == SESSION_SCOPE) { - return request.getSession().getAttribute(key); - } else if (scope == APPLICATION_SCOPE) { - return context.getAttribute(key); - } else { - return super.getAttribute(key, scope); + switch (scope) { + case REQUEST_SCOPE: + return request.getAttribute(key); + case SESSION_SCOPE: + return request.getSession().getAttribute(key); + case APPLICATION_SCOPE: + return context.getAttribute(key); + default: + return super.getAttribute(key, scope); } } /** * {@inheritDoc} */ + @Override public Object getAttribute(String name) throws IllegalArgumentException { Object result; if (name == null) { @@ -164,16 +171,22 @@ public Object getAttribute(String name) throws IllegalArgumentException { /** * {@inheritDoc} */ + @Override public void setAttribute(String key, Object value, int scope) throws IllegalArgumentException { - if (scope == REQUEST_SCOPE) { - request.setAttribute(key, value); - } else if (scope == SESSION_SCOPE) { - request.getSession().setAttribute(key, value); - } else if (scope == APPLICATION_SCOPE) { - context.setAttribute(key, value); - } else { - super.setAttribute(key, value, scope); + switch (scope) { + case REQUEST_SCOPE: + request.setAttribute(key, value); + break; + case SESSION_SCOPE: + request.getSession().setAttribute(key, value); + break; + case APPLICATION_SCOPE: + context.setAttribute(key, value); + break; + default: + super.setAttribute(key, value, scope); + break; } } @@ -209,6 +222,7 @@ public ServletContext getContext() { /** * {@inheritDoc} */ + @Override public Writer getWriter() { if (writer == null) { try { @@ -223,6 +237,7 @@ public Writer getWriter() { /** * {@inheritDoc} */ + @Override public void setWriter(Writer writer) { if (!(writer instanceof PhpScriptWriter)) { writer = new PhpScriptWriter(new WriterOutputStream(writer)); @@ -235,6 +250,7 @@ public void setWriter(Writer writer) { /** * {@inheritDoc} */ + @Override public Writer getErrorWriter() { if (errorWriter == null) { setErrorWriter(PhpScriptLogWriter.getWriter(new io.soluble.pjb.servlet.Logger())); @@ -245,6 +261,7 @@ public Writer getErrorWriter() { /** * {@inheritDoc} */ + @Override public void setErrorWriter(Writer errorWriter) { if (!(errorWriter instanceof PhpScriptWriter)) { errorWriter = new PhpScriptWriter(new WriterOutputStream(errorWriter)); @@ -257,6 +274,7 @@ public void setErrorWriter(Writer errorWriter) { /** * {@inheritDoc} */ + @Override public Reader getReader() { if (reader == null) { try { @@ -268,6 +286,7 @@ public Reader getReader() { return reader; } + @Override public void setReader(Reader reader) { super.setReader(this.reader = reader); } @@ -275,6 +294,7 @@ public void setReader(Reader reader) { /** * {@inheritDoc} */ + @Override public Object init(Object callable) throws Exception { return io.soluble.pjb.bridge.http.Context.getManageable(callable); } @@ -282,6 +302,7 @@ public Object init(Object callable) throws Exception { /** * {@inheritDoc} */ + @Override public void onShutdown(Object closeable) { io.soluble.pjb.servlet.HttpContext.handleManaged(closeable, context); } @@ -291,6 +312,7 @@ public void onShutdown(Object closeable) { * * @return The http servlet reponse */ + @Override public Object getHttpServletResponse() { return response; } @@ -300,6 +322,7 @@ public Object getHttpServletResponse() { * * @return The http servlet request */ + @Override public Object getHttpServletRequest() { return request; } @@ -309,6 +332,7 @@ public Object getHttpServletRequest() { * * @return The http servlet */ + @Override public Object getServlet() { return servlet; } @@ -318,6 +342,7 @@ public Object getServlet() { * * @return The servlet config */ + @Override public Object getServletConfig() { return servlet.getServletConfig(); } @@ -327,6 +352,7 @@ public Object getServletConfig() { * * @return The servlet context */ + @Override public Object getServletContext() { return context; } @@ -334,6 +360,7 @@ public Object getServletContext() { /** * {@inheritDoc} */ + @Override public String getRealPath(String path) { return ServletUtil.getRealPath(context, path); } @@ -341,6 +368,7 @@ public String getRealPath(String path) { /** * @deprecated */ + @Override public String getRedirectString(String webPath) { throw new NotImplementedException(); } @@ -348,6 +376,7 @@ public String getRedirectString(String webPath) { /** * @deprecated */ + @Override public String getRedirectString() { throw new NotImplementedException(); } @@ -355,8 +384,9 @@ public String getRedirectString() { /** * {@inheritDoc} */ + @Override public String getRedirectURL(String webPath) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(getSocketName()); buf.append("/"); buf.append(webPath); @@ -372,6 +402,7 @@ public String getRedirectURL(String webPath) { /** * {@inheritDoc} */ + @Override public String getSocketName() { return String.valueOf(ServletUtil.getLocalPort(request)); } @@ -379,6 +410,7 @@ public String getSocketName() { /** * {@inheritDoc} */ + @Override public ContextServer getContextServer() { return ContextLoaderListener.getContextLoaderListener(context).getContextServer(); } diff --git a/src/main/java/io/soluble/pjb/servlet/ContextLoaderListener.java b/src/main/java/io/soluble/pjb/servlet/ContextLoaderListener.java index f72f699..c3ac740 100644 --- a/src/main/java/io/soluble/pjb/servlet/ContextLoaderListener.java +++ b/src/main/java/io/soluble/pjb/servlet/ContextLoaderListener.java @@ -57,7 +57,7 @@ */ /** - * Register the PHP/Java Bridge when the web context starts. Used by java_context()->onShutdown(proc). The + * Register the PHP/Java Bridge when the web context starts. Used by java_context()->onShutdown(proc). The * WEB-INF/web.xml contains a listener attribute: *
* diff --git a/src/main/java/io/soluble/pjb/servlet/HttpContext.java b/src/main/java/io/soluble/pjb/servlet/HttpContext.java index aba32a7..cbfc43f 100644 --- a/src/main/java/io/soluble/pjb/servlet/HttpContext.java +++ b/src/main/java/io/soluble/pjb/servlet/HttpContext.java @@ -138,7 +138,7 @@ public Object getServletContext() { /** * Only for internal use.

* Used when scripts are running within of a servlet environment: - * Either php.java.servlet.Context or the JSR223 Context (see PhpSimpleHttpScriptContext).
+ * Either io.soluble.pjb.servlet.Context or the JSR223 Context (see PhpSimpleHttpScriptContext).
* Outside of a servlet environment use the ContextLoaderListener instead: * Either the Standalone or the JSR223 Standalone (see PhpScriptContext). * @@ -172,7 +172,7 @@ public void onShutdown(Object closeable) { * @param path the path * @param ctx the servlet context * @return the real path - * @deprecated Use {@link php.java.servlet.ServletUtil#getRealPath(ServletContext, String)} + * @deprecated Use {@link io.soluble.pjb.servlet.ServletUtil#getRealPath(ServletContext, String)} */ public static String getRealPathInternal(String path, ServletContext ctx) { return ServletUtil.getRealPath(ctx, path); diff --git a/src/main/java/io/soluble/pjb/servlet/PhpCGIFilter.java b/src/main/java/io/soluble/pjb/servlet/PhpCGIFilter.java index e98d8ab..877eb20 100644 --- a/src/main/java/io/soluble/pjb/servlet/PhpCGIFilter.java +++ b/src/main/java/io/soluble/pjb/servlet/PhpCGIFilter.java @@ -48,7 +48,7 @@ * * <filter>
* <filter-name>PhpCGIFilter</filter-name>
- * <filter-class>php.java.servlet.PhpCGIFilter</filter-class>
+ * <filter-class>io.soluble.pjb.servlet.PhpCGIFilter</filter-class>
* </filter>
* <filter-mapping>
* <filter-name>PhpCGIFilter</filter-name>
@@ -57,7 +57,7 @@ *
*
* - * @see php.java.servlet.fastcgi.FastCGIServlet + * @see io.soluble.pjb.servlet.fastcgi.FastCGIServlet */ public class PhpCGIFilter implements Filter { diff --git a/src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java b/src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java index 21988ea..f71ed99 100644 --- a/src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java +++ b/src/main/java/io/soluble/pjb/servlet/PhpJavaServlet.java @@ -47,11 +47,11 @@ * requests and then re-directs to a private (socket- or pipe-) * communication channel. This is the fastest mechanism to connect * php and java. It is even 1.5 times faster than local ("unix - * domain") sockets used by the php.java.bridge.JavaBridge standalone + * domain") sockets used by the io.soluble.pjb.JavaBridge standalone * listener.

*

- * To enable fcg/servlet debug code start the servlet engine with -Dphp.java.bridge.default_log_level=6. - * For example: java -Dphp.java.bridge.default_log_level=6 -jar /opt/jakarta-tomcat-5.5.9/bin/bootstrap.jar + * To enable fcg/servlet debug code start the servlet engine with -Dio.soluble.pjb.default_log_level=6. + * For example: java -Dio.soluble.pjb.default_log_level=6 -jar /opt/jakarta-tomcat-5.5.9/bin/bootstrap.jar *

*

There cannot be more than one PhpJavaServlet instance per web application. If you extend from this class, make sure to change * the .phpjavabridge => PhpJavaServlet mapping in the WEB-INF/web.xml.

@@ -73,7 +73,7 @@ private String keepAliveParam; /** - * @inheritDoc + * {@inheritDoc} */ @Override public void init(ServletConfig config) throws ServletException { diff --git a/src/main/java/io/soluble/pjb/servlet/RemoteHttpServletResponse.java b/src/main/java/io/soluble/pjb/servlet/RemoteHttpServletResponse.java index 74a838b..f208153 100644 --- a/src/main/java/io/soluble/pjb/servlet/RemoteHttpServletResponse.java +++ b/src/main/java/io/soluble/pjb/servlet/RemoteHttpServletResponse.java @@ -34,7 +34,7 @@ /** * A servlet response which writes its output to an internal buffer. The buffer can be fetched using - * "getBufferContents()". May be used by remote PHP scripts (those accessing PhpJavaServlet) through the "java_context()->getHttpServletResponse()" API. + * "getBufferContents()". May be used by remote PHP scripts (those accessing PhpJavaServlet) through the "java_context()->getHttpServletResponse()" API. * Also used by the "java_virtual()" API. * * @author jostb diff --git a/src/main/java/io/soluble/pjb/servlet/SimpleServletContextFactory.java b/src/main/java/io/soluble/pjb/servlet/SimpleServletContextFactory.java index 7ee0ea9..3524735 100644 --- a/src/main/java/io/soluble/pjb/servlet/SimpleServletContextFactory.java +++ b/src/main/java/io/soluble/pjb/servlet/SimpleServletContextFactory.java @@ -60,7 +60,7 @@ protected SimpleServletContextFactory(Servlet servlet, ServletContext ctx, HttpS * Set the HttpServletRequest for session sharing. This implementation does nothing, the proxy must have been set in the constructor. * * @param req The HttpServletRequest - * @see php.java.servlet.RemoteServletContextFactory#setSessionFactory(HttpServletRequest) + * @see io.soluble.pjb.servlet.RemoteServletContextFactory#setSessionFactory(HttpServletRequest) */ protected void setSessionFactory(HttpServletRequest req) { } diff --git a/src/main/java/io/soluble/pjb/servlet/fastcgi/FCGIProcess.java b/src/main/java/io/soluble/pjb/servlet/fastcgi/FCGIProcess.java index 2c4b96d..fc86b93 100644 --- a/src/main/java/io/soluble/pjb/servlet/fastcgi/FCGIProcess.java +++ b/src/main/java/io/soluble/pjb/servlet/fastcgi/FCGIProcess.java @@ -64,7 +64,7 @@ protected String[] getArgumentArray(String[] php, String[] args) { } /* (non-Javadoc) - * @see php.java.servlet.fastcgi.IFCGIProcess#start() + * @see io.soluble.pjb.servlet.fastcgi.IFCGIProcess#start() */ public void start() throws NullPointerException, IOException { super.start(); diff --git a/src/main/java/io/soluble/pjb/servlet/fastcgi/FastCGIServlet.java b/src/main/java/io/soluble/pjb/servlet/fastcgi/FastCGIServlet.java index f9362f4..80c7d1f 100644 --- a/src/main/java/io/soluble/pjb/servlet/fastcgi/FastCGIServlet.java +++ b/src/main/java/io/soluble/pjb/servlet/fastcgi/FastCGIServlet.java @@ -67,7 +67,7 @@ * launcher.exe -a "path_to_php-cgi.exe" -b 9667.

* * @author jostb - * @see php.java.bridge.Util#DEFAULT_CGI_LOCATIONS + * @see io.soluble.pjb.bridge.Util#DEFAULT_CGI_LOCATIONS */ public class FastCGIServlet extends HttpServlet { protected static final String _80 = "80"; @@ -114,6 +114,7 @@ protected static class Environment { * @see io.soluble.pjb.bridge.http.FCGIConnectionPool * @see #destroy() */ + @Override public void init(ServletConfig config) throws ServletException { super.init(config); @@ -143,6 +144,7 @@ public void init(ServletConfig config) throws ServletException { /** * Destroys the FastCGI connection pool, if it exists. */ + @Override public void destroy() { super.destroy(); } @@ -197,7 +199,7 @@ protected void setupCGIEnvironment(HttpServletRequest req, HttpServletResponse r envp.put("GATEWAY_INTERFACE", "CGI/1.1"); envp.put("SERVER_PROTOCOL", ServletUtil.nullsToBlanks(req.getProtocol())); int port = ServletUtil.getLocalPort(req); - Integer iPort = (port == 0 ? new Integer(-1) : new Integer(port)); + Integer iPort = (port == 0 ? -1 : port); envp.put("SERVER_PORT", iPort.toString()); envp.put("REQUEST_METHOD", ServletUtil.nullsToBlanks(req.getMethod())); envp.put("SCRIPT_NAME", env.contextPath + env.servletPath); @@ -221,7 +223,7 @@ protected void setupCGIEnvironment(HttpServletRequest req, HttpServletResponse r Enumeration headers = req.getHeaderNames(); - String header = null; + String header; StringBuffer buffer = new StringBuffer(); while (headers.hasMoreElements()) { @@ -255,14 +257,14 @@ protected void setupCGIEnvironment(HttpServletRequest req, HttpServletResponse r String sPort = (String) env.environment.get("SERVER_PORT"); String standardPort = req.isSecure() ? _443 : _80; - StringBuffer httpHost = new StringBuffer((String) env.environment.get("SERVER_NAME")); + StringBuilder httpHost = new StringBuilder((String) env.environment.get("SERVER_NAME")); if (!standardPort.equals(sPort)) { // append port only if necessary, see Patch#3040838 httpHost.append(":"); httpHost.append(sPort); } env.environment.put("HTTP_HOST", httpHost.toString()); - String remotePort = null; + String remotePort; try { remotePort = String.valueOf(req.getRemotePort()); } catch (Throwable t) { @@ -301,14 +303,14 @@ protected void setupCGIEnvironment(HttpServletRequest req, HttpServletResponse r * Optimized run method for FastCGI. Makes use of the large FCGI_BUF_SIZE and the specialized in.read(). * It is a modified copy of the parseBody. * - * @throws InterruptedException - * @see HeaderParser#parseBody(byte[], InputStream, OutputStream, HeaderParser) + * @see io.soluble.pjb.bridge.http.HeaderParser#parseBody(byte[], java.io.InputStream, io.soluble.pjb.bridge.http.OutputStreamFactory, io.soluble.pjb.bridge.http.HeaderParser) */ - protected void parseBody(HttpServletRequest req, HttpServletResponse res, Environment env) throws FCGIConnectionException, FCGIConnectException, IOException, ServletException { + protected void parseBody(HttpServletRequest req, HttpServletResponse res, Environment env) + throws FCGIConnectionException, FCGIConnectException, IOException, ServletException { final byte[] buf = new byte[FCGIUtil.FCGI_BUF_SIZE];// headers cannot be larger than this value! - InputStream in = null; - OutputStream out = null; + InputStream in; + OutputStream out; FCGIInputStream natIn = null; FCGIOutputStream natOut = null; @@ -327,7 +329,7 @@ protected void parseBody(HttpServletRequest req, HttpServletResponse res, Enviro natOut.writeBegin(); natOut.writeParams(env.environment); - String line = null; + String line; int i = 0, n, s = 0; boolean eoh = false; boolean rn = false; @@ -339,10 +341,11 @@ protected void parseBody(HttpServletRequest req, HttpServletResponse res, Enviro // used by either http/1.1 chunked connections or "WebSockets", // see http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-70 final InputStream inputStream = in; - in = null; + //in = null; final FCGIOutputStream natOutputStream = natOut; natOut = null; (new Thread() { + @Override public void run() { int n; try { @@ -445,7 +448,8 @@ protected Environment getEnvironment() { return new Environment(); } - protected void execute(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException, InterruptedException { + protected void execute(HttpServletRequest req, HttpServletResponse res) + throws IOException, ServletException, InterruptedException { Environment env = getEnvironment(); setupRequestVariables(req, env); @@ -458,11 +462,10 @@ protected void execute(HttpServletRequest req, HttpServletResponse res) throws I Util.logDebug("PHP FastCGI server failed: " + ex); Util.printStackTrace(ex); } - IOException ex2 = new IOException("PHP FastCGI server failed: "); - ex2.initCause(ex); - throw ex2; + throw new IOException("PHP FastCGI server failed: ", ex); } catch (FCGIConnectionException x) { - Util.logError("PHP application terminated unexpectedly, have you started php-cgi with the environment setting PHP_FCGI_MAX_REQUESTS=" + contextLoaderListener.getPhpMaxRequests() + "? Error: " + x); + Util.logError("PHP application terminated unexpectedly, have you started php-cgi with the environment setting PHP_FCGI_MAX_REQUESTS=" + + contextLoaderListener.getPhpMaxRequests() + "? Error: " + x); if (Util.logLevel > 1) { Util.logDebug("PHP FastCGI instance failed: " + x); Util.printStackTrace(x); @@ -495,7 +498,8 @@ protected void addHeader(HttpServletResponse response, String line, Environment env.allHeaders.add(line); } } - } catch (ArrayIndexOutOfBoundsException e) {/*not a valid header*/} catch (StringIndexOutOfBoundsException e) {/*not a valid header*/} + } catch (ArrayIndexOutOfBoundsException | StringIndexOutOfBoundsException e) {/*not a valid header*/} + /*not a valid header*/ } protected void handle(HttpServletRequest req, HttpServletResponse res) @@ -506,14 +510,15 @@ protected void handle(HttpServletRequest req, HttpServletResponse res) try { res.reset(); } catch (Exception ex) {/*ignore*/} - StringBuffer buf = new StringBuffer("PHP FastCGI server not running. Please see server log for details."); + StringBuilder buf = new StringBuilder("PHP FastCGI server not running. Please see server log for details."); if (contextLoaderListener.getChannelName() != null && context != null) { buf.append(" Or start a PHP FastCGI server using the command:\n"); - buf.append(contextLoaderListener.getChannelName().getFcgiStartCommand(ServletUtil.getRealPath(context, ContextLoaderListener.CGI_DIR), contextLoaderListener.getPhpMaxRequests())); + buf.append(contextLoaderListener.getChannelName() + .getFcgiStartCommand(ServletUtil.getRealPath( + context, ContextLoaderListener.CGI_DIR), + contextLoaderListener.getPhpMaxRequests())); } - IOException ex = new IOException(buf.toString()); - ex.initCause(e); - throw ex; + throw new IOException(buf.toString(), e); } catch (ServletException e) { try { res.reset(); @@ -528,21 +533,25 @@ protected void handle(HttpServletRequest req, HttpServletResponse res) } } + @Override protected void doPut(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { handle(req, res); } + @Override protected void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { handle(req, res); } + @Override protected void doDelete(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { handle(req, res); } + @Override protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { if (Util.logLevel > 4) { From 6f449ffe9152f4fc2d1d7379f831829c0116ad55 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sat, 28 Jan 2017 14:08:21 +0100 Subject: [PATCH 57/75] some corrections because of failing tests --- .gitignore | 1 + build.gradle | 10 +++++----- .../META-INF/java/JavaProxy.php | 19 +++++++++++++++++++ server/META-INF/java/JavaBridge.inc | 6 +++--- server/META-INF/java/Protocol.inc | 2 +- .../java/io/soluble/pjb/bridge/JavaInc.java | 2 +- .../java/io/soluble/pjb/bridge/Options.java | 2 +- src/main/resources/META-INF/java/Java.inc | 6 +++--- src/main/webapp/java/Java.inc | 6 +++--- .../java/io/soluble/pjb/script/AllTests.java | 4 +++- 10 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 out/production/php-java-bridge/META-INF/java/JavaProxy.php diff --git a/.gitignore b/.gitignore index cf971e7..525fd61 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ manifest.mf *.lock *.log devNull +out/ diff --git a/build.gradle b/build.gradle index 9cf6a09..685e866 100644 --- a/build.gradle +++ b/build.gradle @@ -34,9 +34,9 @@ dependencies { testCompile('junit:junit:3.8.2') // the test code still uses this junit API def tomcatVersion = '7.0.59' - tomcat 'org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}', - 'org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}' - tomcat('org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}') { + tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}", + "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}" + tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") { exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj' } } @@ -50,7 +50,7 @@ ant.importBuild 'build.xml' jar { baseName artifactName manifest { - attributes('Main-Class': 'io.soluble.pjb.Standalone') + attributes('Main-Class': 'io.soluble.pjb.bridge.Standalone') } } @@ -72,7 +72,7 @@ jacocoTestReport { reports { xml.enabled true csv.enabled false - html.destination '${buildDir}/reports/coverage' + html.destination "${buildDir}/reports/coverage" } } diff --git a/out/production/php-java-bridge/META-INF/java/JavaProxy.php b/out/production/php-java-bridge/META-INF/java/JavaProxy.php new file mode 100644 index 0000000..d6133d6 --- /dev/null +++ b/out/production/php-java-bridge/META-INF/java/JavaProxy.php @@ -0,0 +1,19 @@ + diff --git a/server/META-INF/java/JavaBridge.inc b/server/META-INF/java/JavaBridge.inc index 33e9104..f990285 100644 --- a/server/META-INF/java/JavaBridge.inc +++ b/server/META-INF/java/JavaBridge.inc @@ -174,10 +174,10 @@ if(!function_exists("java_get_base")) { function java_virtual($path, $return=false) { $req = java_context()->getHttpServletRequest(); - $req = new java("php.java.servlet.VoidInputHttpServletRequest", $req); + $req = new java("io.soluble.pjb.servlet.VoidInputHttpServletRequest", $req); $res = java_context()->getHttpServletResponse(); - $res = new java("php.java.servlet.RemoteHttpServletResponse", $res); + $res = new java("io.soluble.pjb.servlet.RemoteHttpServletResponse", $res); $req->getRequestDispatcher($path)->include($req, $res); if ($return) return $res->getBufferContents(); @@ -390,7 +390,7 @@ if(!function_exists("java_get_base")) { * ByteArrayOutputStream out; * OutputStreamWriter writer; * e.getContext().setWriter(writer=new OutputStreamWriter(out=new ByteArrayOutputStream())); - * Object res=e.eval(new php.java.script.URLReader(new URL("http://localhost/calculateSales.php"))); + * Object res=e.eval(new io.soluble.pjb.script.URLReader(new URL("http://localhost/calculateSales.php"))); * System.err.println(((Invocable)e).invokeFunction("calculateSales", new Object[]{month})); * ((Closeable)e).close(); * System.err.println("PHP exit() code:" + String.valueOf(res)); diff --git a/server/META-INF/java/Protocol.inc b/server/META-INF/java/Protocol.inc index 494a57e..f5fdfc2 100644 --- a/server/META-INF/java/Protocol.inc +++ b/server/META-INF/java/Protocol.inc @@ -705,7 +705,7 @@ class java_Protocol { $java=file_exists(ini_get("extension_dir")."/JavaBridge.jar")?ini_get("extension_dir")."/JavaBridge.jar":(java_get_base()."/JavaBridge.jar"); if (!file_exists($java)) throw new java_IOException("Could not find $java in ".getcwd().". Download it from http://sf.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_".JAVA_PEAR_VERSION."/exploded/JavaBridge.jar/download and try again."); - $java_cmd = "java -Dphp.java.bridge.daemon=true -jar \"${java}\" INET_LOCAL:$channelName 0"; + $java_cmd = "java -Dio.soluble.pjb.bridge.daemon=true -jar \"${java}\" INET_LOCAL:$channelName 0"; if (!$again) throw new java_ConnectException("No Java back end! Please run it with: $java_cmd. Error message: $errstr ($errno)"); diff --git a/src/main/java/io/soluble/pjb/bridge/JavaInc.java b/src/main/java/io/soluble/pjb/bridge/JavaInc.java index 41daa0a..665b343 100644 --- a/src/main/java/io/soluble/pjb/bridge/JavaInc.java +++ b/src/main/java/io/soluble/pjb/bridge/JavaInc.java @@ -1227,7 +1227,7 @@ public class JavaInc { "$java=file_exists(ini_get(\"extension_dir\").\"/JavaBridge.jar\")?ini_get(\"extension_dir\").\"/JavaBridge.jar\":(java_get_base().\"/JavaBridge.jar\");\n"+ "if (!file_exists($java))\n"+ "throw new java_IOException(\"Could not find $java in \".getcwd().\". Download it from http://sf.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_\".JAVA_PEAR_VERSION.\"/exploded/JavaBridge.jar/download and try again.\");\n"+ -"$java_cmd=\"java -Dphp.java.bridge.daemon=true -jar \\\"${java}\\\" INET_LOCAL:$channelName 0\";\n"+ +"$java_cmd=\"java -Dio.soluble.pjb.bridge.daemon=true -jar \\\"${java}\\\" INET_LOCAL:$channelName 0\";\n"+ "if (!$again)\n"+ "throw new java_ConnectException(\"No Java back end! Please run it with: $java_cmd. Error message: $errstr ($errno)\");\n"+ "if (!java_checkCliSapi())\n"+ diff --git a/src/main/java/io/soluble/pjb/bridge/Options.java b/src/main/java/io/soluble/pjb/bridge/Options.java index 5fb9068..b3beb90 100644 --- a/src/main/java/io/soluble/pjb/bridge/Options.java +++ b/src/main/java/io/soluble/pjb/bridge/Options.java @@ -47,7 +47,7 @@ public class Options { * @return The file encoding */ public String getEncoding() { - if (encoding != null) { + if (encoding == null) { encoding = Util.DEFAULT_ENCODING; } return encoding; diff --git a/src/main/resources/META-INF/java/Java.inc b/src/main/resources/META-INF/java/Java.inc index 6f17d84..58aa375 100644 --- a/src/main/resources/META-INF/java/Java.inc +++ b/src/main/resources/META-INF/java/Java.inc @@ -70,9 +70,9 @@ trigger_error('Please use getHttpServletResponse(); -$res=new java("php.java.servlet.RemoteHttpServletResponse",$res); +$res=new java("io.soluble.pjb.servlet.RemoteHttpServletResponse",$res); $req->getRequestDispatcher($path)->include($req,$res); if ($return) return $res->getBufferContents(); echo $res->getBufferContents(); @@ -1225,7 +1225,7 @@ if (!$peer) { $java=file_exists(ini_get("extension_dir")."/JavaBridge.jar")?ini_get("extension_dir")."/JavaBridge.jar":(java_get_base()."/JavaBridge.jar"); if (!file_exists($java)) throw new java_IOException("Could not find $java in ".getcwd().". Download it from http://sf.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_".JAVA_PEAR_VERSION."/exploded/JavaBridge.jar/download and try again."); -$java_cmd="java -Dphp.java.bridge.daemon=true -jar \"${java}\" INET_LOCAL:$channelName 0"; +$java_cmd="java -Dio.soluble.pjb.bridge.daemon=true -jar \"${java}\" INET_LOCAL:$channelName 0"; if (!$again) throw new java_ConnectException("No Java back end! Please run it with: $java_cmd. Error message: $errstr ($errno)"); if (!java_checkCliSapi()) diff --git a/src/main/webapp/java/Java.inc b/src/main/webapp/java/Java.inc index 6f17d84..58aa375 100644 --- a/src/main/webapp/java/Java.inc +++ b/src/main/webapp/java/Java.inc @@ -70,9 +70,9 @@ trigger_error('Please use getHttpServletResponse(); -$res=new java("php.java.servlet.RemoteHttpServletResponse",$res); +$res=new java("io.soluble.pjb.servlet.RemoteHttpServletResponse",$res); $req->getRequestDispatcher($path)->include($req,$res); if ($return) return $res->getBufferContents(); echo $res->getBufferContents(); @@ -1225,7 +1225,7 @@ if (!$peer) { $java=file_exists(ini_get("extension_dir")."/JavaBridge.jar")?ini_get("extension_dir")."/JavaBridge.jar":(java_get_base()."/JavaBridge.jar"); if (!file_exists($java)) throw new java_IOException("Could not find $java in ".getcwd().". Download it from http://sf.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_".JAVA_PEAR_VERSION."/exploded/JavaBridge.jar/download and try again."); -$java_cmd="java -Dphp.java.bridge.daemon=true -jar \"${java}\" INET_LOCAL:$channelName 0"; +$java_cmd="java -Dio.soluble.pjb.bridge.daemon=true -jar \"${java}\" INET_LOCAL:$channelName 0"; if (!$again) throw new java_ConnectException("No Java back end! Please run it with: $java_cmd. Error message: $errstr ($errno)"); if (!java_checkCliSapi()) diff --git a/src/test/java/io/soluble/pjb/script/AllTests.java b/src/test/java/io/soluble/pjb/script/AllTests.java index 94c64eb..83f9a77 100644 --- a/src/test/java/io/soluble/pjb/script/AllTests.java +++ b/src/test/java/io/soluble/pjb/script/AllTests.java @@ -4,9 +4,11 @@ import junit.framework.TestSuite; public class AllTests { + + public static TestSuite suite; public static Test suite() { - TestSuite suite = new TestSuite("Test for io.soluble.pjb.test"); + suite = new TestSuite("Test for io.soluble.pjb.test"); //$JUnit-BEGIN$ suite.addTestSuite(TestException.class); suite.addTestSuite(TestGetResult.class); From 72893191d12765723ec0af226eb8494033b4ca01 Mon Sep 17 00:00:00 2001 From: "Christian P. Lerch" Date: Sat, 28 Jan 2017 14:39:51 +0100 Subject: [PATCH 58/75] add basic setup for maven publishing (TBC) --- build.gradle | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 685e866..11c487b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ group 'io.soluble.pjb' version '6.2.11' -def artifactName = 'JavaBridge' +def artifactId = 'JavaBridge' +description 'A PHP/Java bridge' buildscript { repositories { @@ -16,6 +17,9 @@ apply plugin: 'java' apply plugin: 'jacoco' apply plugin: 'war' apply plugin: 'com.bmuschko.tomcat' // provides embedded tomcat 7 for testing purposes +// required for publishing to MavenCentral +apply plugin: 'signing' +apply plugin: 'maven' compileJava.options.encoding = 'UTF-8' compileTestJava.options.encoding = 'UTF-8' @@ -48,14 +52,14 @@ if (System.getProperty('php_exec') == null) { ant.importBuild 'build.xml' jar { - baseName artifactName + baseName artifactId manifest { attributes('Main-Class': 'io.soluble.pjb.bridge.Standalone') } } war { - baseName artifactName + baseName artifactId //from 'src/rootContent' // could add a file-set to the root of the archive } @@ -77,20 +81,45 @@ jacocoTestReport { } task sourcesJar(type: Jar, dependsOn: classes) { - baseName = artifactName + baseName = artifactId classifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { - baseName = artifactName + baseName = artifactId classifier = 'javadoc' from javadoc.destinationDir } artifacts { - archives jar - archives sourcesJar - archives javadocJar + archives jar, sourcesJar, javadocJar +} + +uploadArchives { + repositories { + mavenDeployer { + pom.project { + name = project.name + artifactId = artifactId + packaging 'jar' + url 'https://github.com/belgattitude/php-java-bridge' + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution 'repo' + } + } + developers { + developer { + id = 'youraccount' + name = 'Your Name' + email = 'your.account@mail.com' + } + } + } + } + } } From 4315768451c2a39a380e5ec8111deae7f92cb674 Mon Sep 17 00:00:00 2001 From: sebastien Date: Mon, 30 Jan 2017 12:30:27 +0100 Subject: [PATCH 59/75] Preliminary support for travis --- .travis.yml | 23 ++++ .travis/.gitignore | 1 + .travis/phpunit.travis.xml | 90 ++++++++++++++++ .travis/test_build_against_soluble_japha.sh | 76 +++++++++++++ CHANGELOG.md | 5 + README.md | 102 ++++++++---------- build.gradle | 12 ++- .../WEB-INF/cgi/amd64-linux/launcher.sh | 8 ++ .../amd64-linux/php-cgi.MISSING.README.txt | 1 + 9 files changed, 259 insertions(+), 59 deletions(-) create mode 100644 .travis.yml create mode 100644 .travis/.gitignore create mode 100644 .travis/phpunit.travis.xml create mode 100755 .travis/test_build_against_soluble_japha.sh create mode 100644 src/main/webapp/WEB-INF/cgi/amd64-linux/launcher.sh create mode 100644 src/main/webapp/WEB-INF/cgi/amd64-linux/php-cgi.MISSING.README.txt diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..edc5b7e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,23 @@ +dist: trusty +sudo: required + +language: java + +jdk: + - oraclejdk8 + +#services: +# - mysql + +os: + - linux + +before_install: + # for debugging purposes + - php --version + +script: + - ./gradlew test + - ./.travis/test_build_against_soluble_japha.sh + + diff --git a/.travis/.gitignore b/.travis/.gitignore new file mode 100644 index 0000000..26adbb2 --- /dev/null +++ b/.travis/.gitignore @@ -0,0 +1 @@ +soluble-japha \ No newline at end of file diff --git a/.travis/phpunit.travis.xml b/.travis/phpunit.travis.xml new file mode 100644 index 0000000..8a426ea --- /dev/null +++ b/.travis/phpunit.travis.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ./test/src/SolubleTest/Japha + + + + + + ./src + + ./src/Soluble/Japha/Bridge/Driver/Pjb62/SimpleParser.php + + + + + + + + \ No newline at end of file diff --git a/.travis/test_build_against_soluble_japha.sh b/.travis/test_build_against_soluble_japha.sh new file mode 100755 index 0000000..f2218b1 --- /dev/null +++ b/.travis/test_build_against_soluble_japha.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env bash +# +# Travis specific post-test script to run the test suite provided +# in the latest release of https://github.com/belgattitude/soluble-japha client. +# +# Very hacky +# +# usage: +# > ./test_build_against_soluble_japha.sh +# +# requirements: +# - php >= 5.6, php 7+ +# - git +# - composer +# - java +# - linux +# +# @author Vanvelthem Sébastien +# + +set -e + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +PROJECT_DIR="$SCRIPT_DIR/.." +JAPHA_DIR="$SCRIPT_DIR/soluble-japha" + +install_soluble_japha() { + + echo "[*] Installing latest release of soluble-japha"; + + # 1. Clone the soluble-japha project (if not already exists) + if [ ! -d $JAPHA_DIR ]; then + git clone https://github.com/belgattitude/soluble-japha.git $JAPHA_DIR + fi + + # 2. Clone the soluble-japha project + cd $JAPHA_DIR + + # 3. Checkout latest release + git fetch --tags + latestTag=$(git describe --tags `git rev-list --tags --max-count=1`) + git checkout ${latestTag} + + # 4. Run composer install + composer install + + # 5. Restore path + cd $PROJECT_DIR +} + + +runEmbeddedTomcat() { + cd $PROJECT_DIR + gradle tomcatRun + +} + +runPHPUnit() { + cd $JAPHA_DIR + echo "[*] Running phpunit" + cp ../phpunit.travis.xml . + phpunit -c ./phpunit.travis.xml +} + +stopEmbeddedTomcat() { + cd $PROJECT_DIR + gradle tomcatStop +} + + +# Here's the steps + +install_soluble_japha; +runEmbeddedTomcat; +runPHPUnit; +stopEmbeddedTomcat; diff --git a/CHANGELOG.md b/CHANGELOG.md index 7706438..0f9d67b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] + ### Added - Build: Preliminary support for Gradle (still relying on ant build.xml), see [#5](https://github.com/belgattitude/php-java-bridge/issues/5) and [#9](https://github.com/belgattitude/php-java-bridge/pull/9) - Build: New tasks added in gradle 'jacocoTestReport', see P/R [#9](https://github.com/belgattitude/php-java-bridge/pull/9) +- Test: Resurrect existing unit tests - Test: test and coverage using Jacoco added, see P/R [#9](https://github.com/belgattitude/php-java-bridge/pull/9) - Doc: trick to build when default interpreter is php 7+, see [#4](https://github.com/belgattitude/php-java-bridge/issues/4) +### Removed + +- Removed obsolete javax.script sources ### Changed diff --git a/README.md b/README.md index f70d01d..c17ecb7 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,16 @@ Please **[participate in the discussion for future ideas here](https://github.co - You can download pre-compiled [java bridge binaries](https://github.com/belgattitude/php-java-bridge/releases) on the releases page (jdk8). - Alternatively you can build the project, first clone the project and follow the build steps. - [Gradle starter project](https://github.com/belgattitude/pjb-starter-gradle) on it's way !!! + +## Build the project + +### Requirements + + - Oracle JDK 7,8 + - Gradle and Ant installed + - PHP CLI >= 5.3, < 7.0, [see #4](https://github.com/belgattitude/php-java-bridge/issues/4) -## Clone the project +### Clone the project Run the `git clone` command clone in a directory: @@ -59,79 +67,69 @@ $ git clone https://github.com/belgattitude/php-java-bridge.git $ cd php-java-bridge ``` -## Build +### Build -Building the project requires a php interpreter (5.3 - 5.6) installed, see (for building under PHP7, [see #4](https://github.com/belgattitude/php-java-bridge/issues/4). -You can specify its location through the `-Dphp_exec=/usr/bin/php5.6`. +> Building the project requires a php interpreter (5.3 - 5.6) installed. By default +> it will use the `php` found in system path, but you can specify another location through the `-Dphp_exec=` argument. -See the `build.xml` for registered tasks. - -### Option 1: with ant - -```shell -$ ant -Dphp_exec=/usr/bin/php5.6 ``` - -**Warning** due to gradle support, the ant `clean` has been renamed in `cleanBuild`. See [5](https://github.com/belgattitude/php-java-bridge/issues/5). - -### Option 2: with gradle - -``` -$ gradle all -Dphp_exec=php5.6 +$ gradle build ``` -## Compiled files +### Generated files -See the `/dist` folder : +See the `/build/libs` folder : -- The bridge files. - - - `JavaBridge.jar`: Main library, providing also a standalone server - - `php-servlet.jar`: Servlet for php-java communication (required). Approx 58k. - - `php-script.jar`: Lib to allow java to talk with a php-cgi instance. Approx 58k. - -- For convenience, you'll find ready to run war bundles, you can choose between : - - - `JavaBridgeTemplate.war`: Minimal war file (only php-servlet.jar, php-script.jar, web.xml and support for system php-cgi). Approx 500k. - - `JavaBridge.war`: Example war file with some lib and examples. Approx **47Mb** !!! - -- Obsolete files kept for compatibility - - `script-api.jar`: *obsolete javax.script package. Included from Java 1.6, see [doc](https://docs.oracle.com/javase/7/docs/api/index.html?javax/script/package-summary.html)* - - `Java.inc`: *obsolete php client, replaced by [soluble-japha](https://github.com/belgattitude/soluble-japha)* +| File | Description | Approx. size | +| ------------- | ------------- | ------------ | +| `JavaBridge-.jar` | JavaBridge library. | +/- 500k | +| `JavaBridge-.war` | Ready to deploy war template file. | +/- 900k | +| `JavaBridge--sources.jar` | JavaBridge sources. | +/- 400k | +| `JavaBridge--javadoc.jar` | Generated API documentation. | +/- 600k | - - -## Deploy -Tested containers are : +## Develop + +### Gradle tasks -- Tomcat 7 -- Tomcat 8 +```shell +$ gradle tomcatRun +$ # gradle tomcatStop (to stop the server) +``` + + +## Usage + +### Deploy -### Tomcat (Ubuntu) +> Currently only tested on Tomcat 7/8, should be running on any servlet 2.5 compatible container. -Ensure you have tomcat installed and a php-cgi +#### Deploy on Tomcat8 + +Ensure you have tomcat installed and a php-cgi ```shell $ sudo apt-get install tomcat8 tomcat8-admin $ sudo apt-get install php-cgi ``` -And copy the ready to run `JavaBridgeTemplate.war` (or `JavaBridge.war` or bundle yours) in the tomcat webapps folder: +And copy the ready to run `JavaBridge-.war` in the tomcat webapps folder: ```shell -cp dist/JavaBridgeTemplate.war /var/lib/tomcat8/webapps +$ cp build/libs/JavaBridge-.war /var/lib/tomcat8/webapps/JavaBridge.war ``` -Wait few seconds for deployment and point your browser to [http://localhost:8080/JavaBridgeTemplate](http://localhost:8080/JavaBridgeTemplate). +Wait few seconds for deployment and point your browser to [http://localhost:8080/JavaBridge](http://localhost:8080/JavaBridge). -Errors are logged by default into +Have a look to the error log if needed: ```shell $ cat /var/log/tomcat8/catalina.out ``` -### Tomcat tuning tips +## FAQ + +### OutOfMemory errors under Tomcat If you get OutOfMemory errors, you can increase the java heap tomcat: @@ -148,18 +146,8 @@ JAVA_OPTS="-Djava.awt.headless=true -Xmx512m -XX:+UseConcMarkSweepGC" and restart ```shell -sudo service tomcat8 restart +$ sudo service tomcat8 restart ``` - -### How to build documentation - -You can build the doc with - -```shell -$ ant JavaDoc -``` - -Documentation will be generated in the `/doc/API` folder. ## Contribute diff --git a/build.gradle b/build.gradle index 11c487b..5c856d7 100644 --- a/build.gradle +++ b/build.gradle @@ -38,8 +38,10 @@ dependencies { testCompile('junit:junit:3.8.2') // the test code still uses this junit API def tomcatVersion = '7.0.59' - tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}", - "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}" + tomcat( + "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}", + "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}", + ) tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") { exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj' } @@ -96,6 +98,12 @@ artifacts { archives jar, sourcesJar, javadocJar } + +task wrapper(type: Wrapper) { + gradleVersion = '3.3' +} + + uploadArchives { repositories { mavenDeployer { diff --git a/src/main/webapp/WEB-INF/cgi/amd64-linux/launcher.sh b/src/main/webapp/WEB-INF/cgi/amd64-linux/launcher.sh new file mode 100644 index 0000000..1377c97 --- /dev/null +++ b/src/main/webapp/WEB-INF/cgi/amd64-linux/launcher.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# php fcgi launcher +#set -x + +"$@" 1>&2 & +trap "kill $! && exit 0;" 1 2 15 +read result 1>&2 +kill $! diff --git a/src/main/webapp/WEB-INF/cgi/amd64-linux/php-cgi.MISSING.README.txt b/src/main/webapp/WEB-INF/cgi/amd64-linux/php-cgi.MISSING.README.txt new file mode 100644 index 0000000..5fea609 --- /dev/null +++ b/src/main/webapp/WEB-INF/cgi/amd64-linux/php-cgi.MISSING.README.txt @@ -0,0 +1 @@ +You can add "php-cgi" to this directory and re-deploy your web application. From 96e04e1eb6bef8228c13c94d1122bf340ef1090a Mon Sep 17 00:00:00 2001 From: sebastien Date: Mon, 30 Jan 2017 12:42:24 +0100 Subject: [PATCH 60/75] Doc update --- CHANGELOG.md | 3 ++- LICENSE | 21 +++++++++++++++++++++ README.md | 6 ++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 LICENSE diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f9d67b..b601998 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,11 +8,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added -- Build: Preliminary support for Gradle (still relying on ant build.xml), see [#5](https://github.com/belgattitude/php-java-bridge/issues/5) and [#9](https://github.com/belgattitude/php-java-bridge/pull/9) +- Build: Support for Gradle (still relying on ant build.xml), see [#5](https://github.com/belgattitude/php-java-bridge/issues/5) and [#9](https://github.com/belgattitude/php-java-bridge/pull/9) - Build: New tasks added in gradle 'jacocoTestReport', see P/R [#9](https://github.com/belgattitude/php-java-bridge/pull/9) - Test: Resurrect existing unit tests - Test: test and coverage using Jacoco added, see P/R [#9](https://github.com/belgattitude/php-java-bridge/pull/9) - Doc: trick to build when default interpreter is php 7+, see [#4](https://github.com/belgattitude/php-java-bridge/issues/4) +- License: MIT license where applicable, see [#10](https://github.com/belgattitude/php-java-bridge/issues/10) ### Removed diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8864d4a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index c17ecb7..c4a3df7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +[![Build Status](https://travis-ci.org/belgattitude/php-java-bridge.svg?branch=master)](https://travis-ci.org/belgattitude/pjb-starter-gradle) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + # Unofficial fork of the [PHP/Java bridge](http://php-java-bridge.sourceforge.net/pjb/) server. The VM Bridge is a network protocol which can be used to connect a native @@ -37,6 +40,9 @@ Latest version 6.2.1 has been released long ago but, AFAIK, proved stable and ma - [ ] Start refactorings and improve ;) - [ ] Documentation (always a wip) +- Master branch: [![Build Status](https://travis-ci.org/belgattitude/php-java-bridge.svg?branch=master)](https://travis-ci.org/belgattitude/php-java-bridge) +- Develop branch: [![Build Status](https://travis-ci.org/belgattitude/php-java-bridge.svg?branch=develop)](https://travis-ci.org/belgattitude/php-java-bridge) + Please **[participate in the discussion for future ideas here](https://github.com/belgattitude/php-java-bridge/issues/6)**. ## Documentation From 03961a0bef5321fce93bd229fc53371a0df09856 Mon Sep 17 00:00:00 2001 From: sebastien Date: Mon, 30 Jan 2017 13:31:43 +0100 Subject: [PATCH 61/75] Doc update --- .travis.yml | 11 ++++++++--- .travis/test_build_against_soluble_japha.sh | 4 ++-- CHANGELOG.md | 6 ++---- COPYING => doc/legacy/COPYING | 0 CREDITS.md => doc/legacy/CREDITS.md | 0 ChangeLog => doc/legacy/ChangeLog | 0 FAQ.html => doc/legacy/FAQ.html | 0 INSTALL.J2EE => doc/legacy/INSTALL.J2EE | 0 INSTALL.J2SE => doc/legacy/INSTALL.J2SE | 0 INSTALL.STANDALONE => doc/legacy/INSTALL.STANDALONE | 0 NEWS => doc/legacy/NEWS | 0 PROTOCOL.TXT => doc/legacy/PROTOCOL.TXT | 0 README => doc/legacy/README | 0 13 files changed, 12 insertions(+), 9 deletions(-) rename COPYING => doc/legacy/COPYING (100%) rename CREDITS.md => doc/legacy/CREDITS.md (100%) rename ChangeLog => doc/legacy/ChangeLog (100%) rename FAQ.html => doc/legacy/FAQ.html (100%) rename INSTALL.J2EE => doc/legacy/INSTALL.J2EE (100%) rename INSTALL.J2SE => doc/legacy/INSTALL.J2SE (100%) rename INSTALL.STANDALONE => doc/legacy/INSTALL.STANDALONE (100%) rename NEWS => doc/legacy/NEWS (100%) rename PROTOCOL.TXT => doc/legacy/PROTOCOL.TXT (100%) rename README => doc/legacy/README (100%) diff --git a/.travis.yml b/.travis.yml index edc5b7e..d8f67f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,12 +12,17 @@ jdk: os: - linux -before_install: - # for debugging purposes - - php --version +before_script: + # for debugging purposes + - php --version + - chmod +x gradlew script: - ./gradlew test - ./.travis/test_build_against_soluble_japha.sh + - ./gradlew jacocoTestReport + +after_success: + - bash <(curl -s https://codecov.io/bash) diff --git a/.travis/test_build_against_soluble_japha.sh b/.travis/test_build_against_soluble_japha.sh index f2218b1..a0b5ff7 100755 --- a/.travis/test_build_against_soluble_japha.sh +++ b/.travis/test_build_against_soluble_japha.sh @@ -52,7 +52,6 @@ install_soluble_japha() { runEmbeddedTomcat() { cd $PROJECT_DIR gradle tomcatRun - } runPHPUnit() { @@ -69,8 +68,9 @@ stopEmbeddedTomcat() { # Here's the steps - install_soluble_japha; runEmbeddedTomcat; +# Sleep for travis +sleep 3 runPHPUnit; stopEmbeddedTomcat; diff --git a/CHANGELOG.md b/CHANGELOG.md index b601998..136b5c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,10 +24,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Moved namespace `php.java` into `io.soluble.pjb`, see P/R [#9](https://github.com/belgattitude/php-java-bridge/pull/9) - Project directory structure _mavenized_, sources moved from './server' to './src/main/java', see P/R [#9](https://github.com/belgattitude/php-java-bridge/pull/9) -### Fixed - - - ## 6.2.10 (2017-01-15) @@ -42,4 +38,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Added a `build-php5.6.xml` ant config +## 6.2.1 (2010-06-01) +For reference see the doc/legacy/Changelog \ No newline at end of file diff --git a/COPYING b/doc/legacy/COPYING similarity index 100% rename from COPYING rename to doc/legacy/COPYING diff --git a/CREDITS.md b/doc/legacy/CREDITS.md similarity index 100% rename from CREDITS.md rename to doc/legacy/CREDITS.md diff --git a/ChangeLog b/doc/legacy/ChangeLog similarity index 100% rename from ChangeLog rename to doc/legacy/ChangeLog diff --git a/FAQ.html b/doc/legacy/FAQ.html similarity index 100% rename from FAQ.html rename to doc/legacy/FAQ.html diff --git a/INSTALL.J2EE b/doc/legacy/INSTALL.J2EE similarity index 100% rename from INSTALL.J2EE rename to doc/legacy/INSTALL.J2EE diff --git a/INSTALL.J2SE b/doc/legacy/INSTALL.J2SE similarity index 100% rename from INSTALL.J2SE rename to doc/legacy/INSTALL.J2SE diff --git a/INSTALL.STANDALONE b/doc/legacy/INSTALL.STANDALONE similarity index 100% rename from INSTALL.STANDALONE rename to doc/legacy/INSTALL.STANDALONE diff --git a/NEWS b/doc/legacy/NEWS similarity index 100% rename from NEWS rename to doc/legacy/NEWS diff --git a/PROTOCOL.TXT b/doc/legacy/PROTOCOL.TXT similarity index 100% rename from PROTOCOL.TXT rename to doc/legacy/PROTOCOL.TXT diff --git a/README b/doc/legacy/README similarity index 100% rename from README rename to doc/legacy/README From 0689eafeae3392d2061dff040a27dba804622914 Mon Sep 17 00:00:00 2001 From: sebastien Date: Mon, 30 Jan 2017 14:06:31 +0100 Subject: [PATCH 62/75] Attempt to fix travis --- .travis/test_build_against_soluble_japha.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis/test_build_against_soluble_japha.sh b/.travis/test_build_against_soluble_japha.sh index a0b5ff7..9b9227f 100755 --- a/.travis/test_build_against_soluble_japha.sh +++ b/.travis/test_build_against_soluble_japha.sh @@ -49,7 +49,8 @@ install_soluble_japha() { } -runEmbeddedTomcat() { +runEmbeddedTomcatDaemon() { + # Launch through the embedded gradle tomcat plugin cd $PROJECT_DIR gradle tomcatRun } @@ -58,7 +59,7 @@ runPHPUnit() { cd $JAPHA_DIR echo "[*] Running phpunit" cp ../phpunit.travis.xml . - phpunit -c ./phpunit.travis.xml + ./vendor/bin/phpunit -c ./phpunit.travis.xml -v --debug } stopEmbeddedTomcat() { @@ -69,8 +70,6 @@ stopEmbeddedTomcat() { # Here's the steps install_soluble_japha; -runEmbeddedTomcat; -# Sleep for travis -sleep 3 +runEmbeddedTomcatDaemon; runPHPUnit; stopEmbeddedTomcat; From bdc87abe25089a782133f7d449254b2b9f38bee1 Mon Sep 17 00:00:00 2001 From: sebastien Date: Mon, 30 Jan 2017 14:40:54 +0100 Subject: [PATCH 63/75] Attempt to fix travis --- .travis/test_build_against_soluble_japha.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis/test_build_against_soluble_japha.sh b/.travis/test_build_against_soluble_japha.sh index 9b9227f..d8bc0d1 100755 --- a/.travis/test_build_against_soluble_japha.sh +++ b/.travis/test_build_against_soluble_japha.sh @@ -37,9 +37,11 @@ install_soluble_japha() { cd $JAPHA_DIR # 3. Checkout latest release - git fetch --tags - latestTag=$(git describe --tags `git rev-list --tags --max-count=1`) - git checkout ${latestTag} + #git fetch --tags + #latestTag=$(git describe --tags `git rev-list --tags --max-count=1`) + #git checkout ${latestTag} + + git checkout master # 4. Run composer install composer install From e2bb638e996ad6f0ef584cae8c493691a186bf1b Mon Sep 17 00:00:00 2001 From: sebastien Date: Mon, 30 Jan 2017 15:15:43 +0100 Subject: [PATCH 64/75] Attempt to fix travis --- .travis.yml | 4 ++++ .travis/phpunit.travis.xml | 2 +- .travis/test_build_against_soluble_japha.sh | 10 +++++++--- build.gradle | 18 +++++++++++++++++- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index d8f67f3..c5bfb52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,10 @@ script: - ./.travis/test_build_against_soluble_japha.sh - ./gradlew jacocoTestReport +after_failure: + - + - cat ./tomcat.log + after_success: - bash <(curl -s https://codecov.io/bash) diff --git a/.travis/phpunit.travis.xml b/.travis/phpunit.travis.xml index 8a426ea..a44ee61 100644 --- a/.travis/phpunit.travis.xml +++ b/.travis/phpunit.travis.xml @@ -42,7 +42,7 @@ - +