Menu

[r213]: / trunk / php-java-bridge / ChangeLog  Maximize  Restore  History

Download this file

1153 lines (761 with data), 38.8 kB

2005-03-27  Jost Boekemeier <jostb@intern>

	* VERSION, php-java-bridge.spec: New version
	
	* multicast.c: Added windows ifdefs 

	* php-java-bridge 2.0.5 released.

2005-03-27  Jost Boekemeier <jostb@intern>

	* multicast.c, multicast.h: New files

	* bind.c (test_server): New function.

	* client.c (begin): Removed obsolete GET_RESULT.
	(try_connect_to_server): pass down spec (M for Mono)
	(java_connect_to_mono): New function

	* config.m4: multicast.c added.

	* init_cfg.c.in: Init multicast socket.

	* server/php/java/bridge/JavaBridge.java (ObjectToString): New function.

	* java.c (java_monoclass): Removed dup.
	(__tostring): The automatic type conversions now use
	ObjectToString. -- We want to avoid support calls when someone
	attempts to "format" binary data e.g.: echo $byteArrayOutputStream + " ".
	(cast): dito.

	* java_bridge.c (php_java_call_function_handler): Check for mono
	object, send out a multicast to find an Mono or NET VM. 
	
	* parser.c (parse): <P> must call BEGN, not END. This fixes a bug
	in the 2.0 protocol which was not able to parse arrays into PHP 4.

	* server/php/java/bridge/Parser.java (parse): dito.

	* server/php/java/bridge/JavaBridgeClassLoader.java: Inherit from
	URLClassLoader.

	* server/php/java/bridge/Request.java (push): Array: An empty array is
	not a null argument.

	* tests.mono+net/load_assembly.php: Fixed typo.

	* tests.mono+net/params.php: Copied from parms.php
	
	* tests.mono+net/parms.php: Removed.

	* tests.php5/ShowResourses.java, tests.php5/showResources.jar,
	tests.php5/showResources.php: New tests.

	* tests.php5/arrayArray.php4: New PHP4 array test.

	* tests.php5/printToOutputStream.php: New test

	* server/php/java/bridge/TCPServerSocket.java (create): Start listener.

	* server/php/java/bridge/Listener.java: New file.

	* server/php/java/bridge/JavaBridge.java (getLoad): New function.
	(run): Calculate load.
	(loadLock): Lock object
	
	
2005-03-15  Jost Boekemeier <jostb@intern>

	* java.c (php_java_jsr_class_class_entry): Obsolete.
	(mono, mono_class, monoclass): New methods.
	(php_java_call_function_handler4): Mono support added.
	(PHP_MINIT_FUNCTION): Mono support added.

	* server/php/java/bridge/JavaBridge.java (select): Prefer more
	specific args.

	* tests.mono+net/bench.php, tests.mono+net/excel_antitest.php,
	tests.mono+net/helloworld.php, tests.mono+net/load_assembly.php,
	tests.mono+net/params.php, tests.mono+net/parms.php,
	tests.mono+net/sample_lib.cs, tests.mono+net/sample_lib.dll,
	tests.mono+net/stack.php: New tests.
	
2005-03-13  Jost Boekemeier <jostb@intern>

	* php_java_snprintf.c: New file

	* protocol.c: Use php_java_snprintf() in order to avoid surprises
	with certain locales (DK locale formats 1234.00 as 1.234,00).

	* protocol.c (PRECISION): New const.
	(Double): Use precision.

	* config.m4: Add php_java_snprintf.c

	* client.c (begin): Use send_string_to_double in order to avoid
	surprises with certain locales.

	* php-java-bridge 2.0.4 released.
	
2005-03-11  Jost Boekemeier <jostb@intern>

	* INSTALL.WINDOWS: java.hosts and module version supported. CGI
	version still recommended.

	* bind.c (java_test_server): java.hosts for windows.

	* client.c (try_connect_to_server): new function.
	(java_connect_to_server, java_try_connect_to_server): Use it.

	* protocol.c (GROW_QUOTE): Didn't work if len < 10.
	(replaceQuote): Spell "&quote;" as "&quot;"
	(java_createSecureEnvironment): Store server_name.
	
	* java.c (PHP_RSHUTDOWN_FUNCTION): Free server_name.
	(java_get_server_name): Use java_try_connect_to_server.
	
	* php_java.h (closesocket): Alias for close on windows in order to
	shut down the windows socket.

	* php-java-bridge.spec, VERSION: New version
		
	* php-java-bridge 2.0.3 released
	
	
2005-03-09  Jost Boekemeier <jostb@intern>

	* PROTOCOL.TXT: Document Bit 0 as reserved.

	* parser.c (parse): Removed blob.

	* protocol.c (GROW): Grow by no less than required size.
	(replaceQuote): &amp must be quoted, too.
	(String): Require _len.
	(String): Do not use sprintf to print the string, it may binary
	data.

	* server/php/java/bridge/JavaBridge.java (setResult): Do not
	convert binary data into a string.
	
	* server/php/java/bridge/Parser.java (parse): Removed blob.

	* server/php/java/bridge/Request.java (begin): Do not convert
	binary data into a string.

	* server/php/java/bridge/Response.java (OutBuf): New inner class
	replaces StringBuffer in order to deal with binary data.

	* tests.php5/binaryData.php, tests.php5/BinaryData.java,
	tests.php5/binaryData.jar: New tests.

	* tests.php5/session.php: Added dl().
	
	* java.c (java_get_server_name): New user function.

	* README: Document java_get_server_name.

	* php-java-bridgge.spec, VERSION: New version
	
	* php-java-bridge 2.0.2 released. It replaces 2.0.1 which was not
	able to deal with binary data.
	
	
2005-03-06  Jost Boekemeier <jostb@intern>

	* server/Makefile_unix.am: Updated sources list.
	
	* php-java-bridge 2.0.1 released
	
	
2005-03-06  Jost Boekemeier <jostb@intern>

	* java.c (java_session_get): Renamed to java_get_session.
	(java_class_functions): Renamed to php_java_class functions in
	order to check for java objects.
	(call_function_handler): Renamed to
	php_java_call_function_handler4.
	
	* tests.php5/session.php: Renamed java_session_get to
	java_get_session.
	
	* java_bridge.c (is_type): Use php_java_class_functions and
	php_java_call_function_handler4 (for php4) to determine if object
	is a java object.
	(is_java_type): Obsolete.
	(writeArguments, writeArgument, php_java_invoke): Pass additional
	boolean to ignore non-java objects.

	* java.c (java_get_session): Accept $_SESSION variable and ignore
	all non-java objects.

	* INSTALL.WINDOWS: New file.

	* php-java-bridge.spec, VERSION: Updated version.

	* java.c (java_last_exception_get, java_last_exception_clear, java_set_library_path, java_instanceof): Re-enabled.
	
	
2005-03-05  Jost Boekemeier <jostb@intern>

	* server/php/java/bridge/Session.java: New file.
	
	* tests.php5/session.php: New test.

	* PROTOCOL.TXT: Renamed Unref to Destroy.

	* client.c (setResultFromException, setResultFromObject): Do not
	store head of resource list but the object handle so that we can
	store java values in the $_SESSION var. Remove obsolete resoure
	list.
	
	* java_bridge.c (php_java_destructor): No longer necessary.
	
	* java.c (le_jobject): No longer necessary.

	* client.c (is_java_type, is_type): New functions.
	(java_get_jobject_from_object): Use is_type, return 0 if object is not a java object.
	(php_java_invoke): Issue a warning if received a non-java object.
	
	* java.c (check_type): Renamed to is_type and moved to client.c
	(java_session_get): New function.
	(MINIT): register_list_destructors no longer necessary.
	
	* parser.c (parse): Renamed VOID to VOJD. Reason: winsock2.h
	exports a VOID type... oh billy boy...
	(parse): Use ssize_t for socket operations.
	(parse): Use recv instead of read (for winsock2).
	(parse): Add Solaris' errno=EINTR nonsense.
	(parse): Correct typo in blob handling.

	* server/php/java/bidge/Parser.java (parse): Updated with code from parser.c.
	
	* server/php/java/bridge/*.java: Replaced all Hashtables by HashMap in order
	to store null values.

	* server/php/java/bridge/JavaBridge.java (getSession): New method

	* server/php/java/bridge/JavaBridge.java
	(Invoke, GetSetProp, CreateObject): Removed obsolete "connection
	abort" handler. Store candidates instead of matches for error
	reporting.

	* server/php/java/bridge/GlobalRef.java (get): Throw NullPointer
	if value is null (we do not store null values in the global ref, a
	null is represented as id="0" or id="").

	* server/natcJavaBridge.c (send, recv): Add solaris' EINTR handling.

	* protocol.c (flush): Use send instead of write (for winsock2).
	(flush): Add slowlaris EINTR handling
	
	* bind.c, client.c, java_bridge.c: Add MINGW32 #ifdefs.

	* protocol.h: Default level is now 2 (on unix).

	* protocol.c (replaceQuote): Fixed typo; store correct len and terminate with 0.

	* update_policy.sh.in (EXTENSION_DIR): Replace all values in a line.

	* examples/clients/README, examples/clients/getProperties.py,
	examples/clients/getProperties.scm,
	examples/clients/listToArray.scm,
	examples/clients/formatArray.xsl: New client examples written in
	Scheme and Python.

	* server/RunJavaBridge.c.in (usage, main): Updated for 2.0.0
	
	
2005-02-13  Jost Boekemeier  <jostb@intern>

	* PROTOCOL.TXT: New file

	* bind.c (java_test_server): Removed reference to jni

	* java.c (PHP_RSHUTDOWN_FUNCTION): Removed jni.
	(java_last_exception_get): disabled
	(java_last_exception_clear): disabled
	(java_set_library_path): disabled
	(java_instanceof): disabled 
	(php_java_alloc_globals_ctor): Removed jni

	* java_bridge.h, php_java.h: Removed jni

	* java_bridge.c, client.c: Removed jni, new protocol added

	* protocol.c, parser.c, parser.h: New files.

	* protocol.h: Removed JNI protocol, added new XML protocol.

	* proxyenv.c: Removed

	* config.m4: Added protocol.c, parser.c
	
	* server/JavaBridge: Removed

	* server/natcJavaBridge.c: Removed JNI protocol.
	
	* server/php/java/bridge/GlobalRef.java,
	server/php/java/bridge/IDocHandler.java,
	server/php/java/bridge/JavaBridge.java,
	server/php/java/bridge/JavaBridgeClassLoader.java,
	server/php/java/bridge/Parser.java,
	server/php/java/bridge/ParserString.java,
	server/php/java/bridge/ParserTag.java,
	server/php/java/bridge/PhpMap.java,
	server/php/java/bridge/Request.java,
	server/php/java/bridge/Response.java,
	server/php/java/bridge/Util.java: New files

	* server/Makefile_unix.am: Compile new bridge classes.

2005-02-05  Jost Boekemeier  <jostb@intern>
	
        * php-java-bridge 1.0.8 released
	
2005-02-04  Jost Boekemeier  <jostb@intern>

	* INSTALL: document worker MPM

	* client.c, java.c: ZTS

2005-02-03  Jost Boekemeier  <jostb@intern>

	* server/JavaBridge.java (load, findClass): Store reason for
	failure.
	
	* tests.php5/ArrayArray.java, tests.php5/arrayArray.jar,
	arrayArray.php: New tests.

	* php-java-bridge.fc: Removed

	* php-java-bridge.fc.in: New from php-java-bridge.fc

	* Makefile.frag (install_policy): Removed

	* update_policy.sh.in: New from Makefile.frag

	* INSTALL, README: Section about SELinux updated.

	* config.m4: Create php-java-bridge.fc and update_policy.sh.

	* php-java-bridge.te: Updated.

	* php-java-bridge.spec: Updated SELinux section.

	* examples/j2ee/globals.php, examples/j2ee/README: Cleaned up.
	
	* tests.m4/function_checks.m4 (sem_init): Add real-time lib if
	necessary (solaris x86).
	
2005-02-01  Jost Boekemeier  <jostb@intern>

	* server/JavaBridge.java (findResources): New method.
	
	* java.c (iterator_current_key, init_current_data): PHP does not
	necessarily return "clean" zvals. Zero out the allocated zval so
	that setResultFromObject can initialize it properly.  This fixes a
	bug in the iterator interface which was not able to iterate over
	arrays of non-primitive types.

	* java.c (javaclass): New method for jsr223 compatibility.
	(java_class_functions): Terminate array with a NULL entry.
	(create_exception_object): New from parent in order to implement
	object casting.
	(PHP_MINIT_FUNCTION): Use create_exception_object.
	
	
2005-01-28  Jost Boekemeier  <jostb@intern>
	
	* java.c (PHP_MINIT_FUNCTION): For java_class, javaclass and
	javaexception: Do not override parent methods with themselfs. PHP
	5.0.3 doesn't like that...
	
	* README: Updated windows install description.
	
	* config.m4: Embedding into PHP works again.  Use m4_include so
	that autoheader scans the included files.
	
	
2005-01-27  Jost Boekemeier  <jostb@intern>
	
	* tests.php5/exception.php: Extract cause.
	
	* README: Note about 5.0.3 dl() issue added.

	* test.php: Output phpinfo().

	* bind.c (use_wrapper): New function; we must call the SELinux
	wrapper if it exists.
	(java_get_server_string): New function.

	* java.c (get_server_args): Removed.
	(PHP_MINFO_FUNCTION): Use java_get_server_string instead of
	get_server_args.

	* php_java.h (java_get_server_args): Replaced by
	java_get_server_string.
	
	
2005-01-26  Jost Boekemeier  <jostb@intern>

	* INSTALL, README: Security Enhanced Linux (SEL) supported.

	* README: Removed support for Mac OSX. Recommend RHEL/IBM JDK1.4.1
	on Mac/PPC instead.
	
	* unsupported/gcc3.4-broken-jni-method-lookup.patch: New file.
	
	* unsupported/php5-crash-in-evaluator-shutdown_workaround.patch:
	Moved here.
	
	* examples/bench/bench.php, examples/bench/excel_antitest.php,
	examples/bench/exceltest.jar, examples/bench/ExcelTest.java,
	examples/bench/README: New files

	* examples/j2ee/documentBean.jar,
	examples/j2ee/documentClient.php, examples/j2ee/globals.php,
	examples/j2ee/README, examples/j2ee/src/DocumentBean.java,
	examples/j2ee/src/DocumentHome.java,
	examples/j2ee/src/DocumentRemote.java,
	examples/j2ee/src/Page.java, examples/j2ee/src/README,
	examples/j2ee/src/META-INF/ejb-jar.xml,
	examples/j2ee/src/META-INF/sun-ejb-jar.xml: New files.
	
	* examples/languages/scheme-demo.php, examples/languages/README: New
	files.

	* scheme-demo.php: Removed, now in examples.

	* tests.php5/bench.php, tests.php5/excel_antitest.php,
	tests.php5/ExcelTest.java, tests.php5/exceltest.jar: Removed, now
	in examples.
	
2005-01-25  Jost Boekemeier  <jostb@intern>

	* bind.c (java_get_server_args): Append library path.
	
	* client.c, java_bridge.c (ZEND_DECLARE_MODULE_GLOBALS): Removed.
	(ZEND_EXTERN_MODULE_GLOBALS): Added.

	* client.c (check_error): Removed.
	(java_connect_to_server): Do not call check_error, assume out of
	memory when the server cannot return global refs.
	
	* config.m4: Removed obsolete checks.

	* server/autogen.sh: Removed.
	
	* server/configure.gnu.in: New file, from autogen.sh.
	
	* config.m4: Create server/configure.gnu from configure.gnu.in

	* php-java-bridge: Only change LD_LIBRARY_PATH and PATH if the
	script is installed in one of the standard directories.  Invoke
	RunJavaBridge which is tagged with the SEL security context.

2005-01-24  Jost Boekemeier  <jostb@intern>

	* php-java-bridge.te, php-java-bridge.fc, RunJavaBridge.c.in: New
	files for Security Enhanced Linux.

	* server/Makefile_unix.am: Create RunJavaBridge.
	
	* Makefile.frag (install_policy): New target to install the
	SELinux policy files.

	* php-java-bridge.spec: Install SELinux policy files.

	* README: Update from index.html

	* README.GNU_JAVA: New file.

	* README: Note about UTF-8 added.

	* server/acinclude.m4: No longer include tests from PHP

	* server/JavaBridge.java (run, handleRequests): Pass down Hash.
	server/natcJavaBridge.c
	(connection_startup): Obsolete.

	* server/natcJavaBridge.c: Avoid calling JNI when logLevel is too
	low.
	(getObjectHash): New function.
	(handleRequest): Use getObjectHash() in order to avoid allocating
	a hash too often.

2005-01-07  Jost Boekemeier  <jostb@intern>

	* server/JavaBridge.java
	(CreateObject, Invoke, GetSetProp): The server must survive a out
	of memory conditions. Check for OutOfMemoryError and abort the
	client-connection immediately, release all memory the client has
	allocated without client-notification.

	* server/natcJavaBridge.c
	(Java_JavaBridge_handleRequest): Release object hash after
	OutOfMemoryError.
	
2005-01-05  Jost Boekemeier  <jostb@intern>

	* server/JavaBridge.java
	(setException): Store method name, object, and arguments, print
	original cause.
	(Invoke, GetSetProp, CreateObject): Pass name, object and
	arguments.

	* server/JavaBridge.java (argsToString): Check if args is null.

	* server/JavaBridge.java (GetSetProp): Invocation or field access
	may fail if object is class and getter/setter/field is not static.
	Throw a NoSuchFieldException if no getter/setter or field was
	found.

	* php-java-bridge: Do not destroy LANG, which is needed by the VM
	to select the default file.encoding (usually UTF-8).  If LANG is
	not set, use en_US.UTF-8 as default.
	
2005-01-04  Jost Boekemeier  <jostb@intern>

	* server/JavaBridge.java: Changed indent.
	
	* server/JavaBridge.java (getResource, findResource): New methods
	needed to load resources from the private classloader.
	
2005-01-02  Jost Boekemeier  <jostb@intern>

	* server/configure.in, config.m4: follow symlinks to find the
	include directories.
	
	* README: Updated documentation from index.html
	
	* php_java.h: Use php_config.h.

	* tests.m4/function_checks.m4: Removed checks already provided by
	php/php_config.h
	
	* init_cfg.c.in, bind.c, client.c, java.c, java_bridge.c,
	php_java.h: cfg is now a true global.
	
	* bind.c (java_start_server): Check server, start, wait.
	(java_wait_server): New function
	(java_test_server): New function
	
	* php_java.h (java_start_server, java_test_server): New functions.

	* client.c (java_do_test_server, java_test_server): Removed.

	* java.c (init_server): Removed.
	(PHP_MINIT_FUNCTION): Call java_start_server instead of
	init_server.

	* init_cfg.c.in (init_socket): Generate a unique socketname in the
	Linux abstract namespace.
	
	* server/configure.in: AC_CONFIG_AUX_DIR before AM_INIT_AUTOMAKE,
	required by automake 1.8

	* tests.m4/threads.m4, tests.m4/function_checks.m4: Avoid
	"underquoted" warnings.
	
2004-12-19  Jost Boekemeier  <jostb@intern>

	* client.c, bind.c, server/natcJavaBridge.c, server/JavaBridge.java, server/acinclude.m4, server/configure.in, config.m4, java.c: 
	Support credentials on Linux, only.

	* client.c (java_connect_to_server): Connect if not already
	connected. Replaces all old init checks.
	
	* java.c (PHP_RINIT_FUNCTION): Don't connect until a java method
	is called.
	
	* client.c, bind.c, java.c: Use java_connect_to_server.

	* init_cfg.c.in (init_socket): Fixed typo.

	* php-java-bridge: Require sh instead of bash. Create PID in /tmp
	if /var/run does not exist.

	* README: Require GNU make.

	* README: Removed documentation about secure mode. Privilege
	dropping cannot be supported in java. Users should use java
	security instead.  In the future we'll use our bridge JVM as a
	relay to access beans deployed in WebSphere, WebLogic or 9iAS and
	these AS have their own policy anyway.

	* server/configure.in: Use links instead of modifying the include
	path. Require versions for automake and autoconf.

	* server/JavaBridge.java (now): New function to workaround a bug
	in GNU java (calendar not available).

	* server/JavaBridge.java (println): New function.

	* server/JavaBridge.java (select): enum is a keyword since 1.5
	
	
2004-12-12  Jost Boekemeier  <jostb@intern>

	* tests.m4/java_check_abstract_namespace.m4,
	tests.m4/java_check_struct_ucred.m4: New tests.
	
	* client.c, bind.c, server/natcJavaBridge.c, server/JavaBridge.java, server/acinclude.m4, server/configure.in, config.m4, java.c: 
	Use abstract namespace and struct ucred, if available.  This means
	that a) the communication channel is no longer visible and b) that
	only authorised users can connect to the server (checked by the
	kernel). 

	* server/JavaBridge.java (println): New procedure.
	(HandleRequests): Log the user ID and the group ID of the user
	that connects to the PHP/Java Bridge.  

	* tests.m4/function_checks.m4: Check for AF_LOCAL and PF_LOCAL.
	
	
2004-12-05  Jost Boekemeier  <jostb@intern>

	* php-java-bridge 1.0.7 released
	

2004-12-04  Jost Boekemeier  <jostb@intern>

	* java.c (function_entry): Set the arginfo for __call, __get, __set.

	* php5-crash-in-evaluator-shutdown_workaround.patch: New file.

2004-12-03  Jost Boekemeier  <jostb@intern>

	* server/natcJavaBridge.c (Java_JavaBridge_startNative): Do not
	catch SIGPWR, which is used by the Boehm GC.
	(post): Next kill should kill.

	* bind.c (wait_for_daemon): kill three times, if necessary.

	* client. (handle_request): Do not discard retval for PHP 4.

2004-12-01  Jost Boekemeier  <jostb@intern>

	* php_wrapper.h: New file 

	* java.c, bind.c, client.c, java.c, java_bridge.c, java_bridge.h,
	php_java.h, proxyenv.c: Do not use php.h directly but include
	php_wrapper.h to avoid problems with NDEBUG.

	* README: Replaced NDEBUG with JAVA_COMPILE_DEBUG

	* proxyenv.c, protocol.h
	(CallObjectMethod, CallVoidMethod, NewObject): Functions removed.
	(CallObjectMethodA, CallVoidMethodA, NewObjectA): New functions.
	
	* java.c, client.c, java.c, java_bridge.c: Use new functions in
	order to avoid varargs problems.

	* client.c (setResultFromException, setResultFromObject): Fix
	memory leak.

	* client.c (setException): correctly set the result, then throw
	and exception.

	* client.c (java_connect_to_server), java.c
	(PHP_RSHUTDOWN_FUNCTION): Global ref for the reflect_class.

	* php_java.h, java.c (php_java_class_class_entry): New global.
	
	* java.c (java__destruct): Issue a warning if PHP 5 calls the
	destructor after the module doesn't exist anymore.  -- PHP 5 first
	unmaps the module and then shuts down the evaluator which in turn
	calls the destructors for the objects it manages.  This is a bug
	because the classes and their handlers do not exist anymore.  If
	the module was loaded via dl(), PHP 5 will crash in shutdown.
	(java_instanceof): check for object class or class class.
	
	* java.c (create_object): Use ALLOC_HASHTABLE instead of
	ALLOC_HASHTABLE_REL.
	(iterator_current_key): PHP 5 wants the string length +1.

	* java_bridge.c (php_java_getset_property): Remove transaction
	(php_java_get_property_handler): Protect by transaction.
	(php_java_getset_property): Protect by transaction.

	* php-java-bridge.service: Changed description.

	* protocol.h (LOGFILE): New constant

	* server/natcJavaBridge.c, server/JavaBridge.java (trampoline):
	Return if communication is broken.
	(openLog): New function.

	* server/JavaBridge.java (coerce): Better error reporting.
	(argsToString): New function.
	(select): Identify component type.

	* tests.php/ArrayToString, tests.php5/ExcelTest.java,
	tests.php5/arrayToString.php, tests.php5/arrayToString.jar,
	tests.php5/bench.php, tests.php5/excel_antitest.php: New files.
	
2004-11-28  Jost Boekemeier  <jostb@intern>

	* test.php: use <br>
	
	* php-java-bridge.spec: test.php added
	
	* java_bridge.c (java_get_jobject_from_object): new function.
	
	* server/JavaBridge.java (handleRequest, HandleRequest,
	trampoline, Trampoline): New methods.
	(getPhpMap): Cast null to (Object)null in order to appease gnu
	java. Pass value, not this.
	(printStackTrace): Print trace if fatal or level >=2

	* client.c (java_instanceof): rewritten.
	(java__destruct): new function.


	Until now local variables were not deallocated until script
	termination.  A long running php script could provoke out of
	memory conditions on the server side. In order to allow long
	running scripts and in order to make client side programming
	easier and more robust, the server now maintains both, global
	_and_ local refs.  The JNI DeleteLocalRef should not be used
	anymore. To protect variables from beeing garbage collected, the
	new protocol requests BEGIN/END_TRANSACTION(env) must be used.  If
	the client does not call END_TRANSACTION, the server will
	automatically terminate all transactions at the end of the
	script. If the client does not call BEGIN_TRANSACTION and calls a
	method that creates and returns a new object, the object will be
	reclaimed immediately after the client has received it
	(i.e. the received object becomes invalid). Server replies
	(protocol #101..110) are an exception; the values they return
	remain valid until client acknowledges the reply (as usual).
	
	* protocol.h, proxyenv.c (DELETELOCALREF, DeleteLocalRef): Removed
	(BEGIN_TRANSACTION, END_TRANSACTION): New macros
	(TRANSACTION_BEGIN, TRANSACTION_END): New constants

	* server/natcJavaBridge.c (trampoline, handleRequest): New globals.
	(DELETEGLOBALREF): Removed.
	(TRANSACTION_BEGIN, TRANSACTION_END): New protocol requests.
	(handle_request_impl): Removed. (replaced by handleRequest)
	(handleRequest): New function
	(trampoline): New function
	(handleRequests): Rewritten (code moved to trampoline)
	(javabridge): Define handleRequest and trampoline
	
	* client.c (java_connect_to_server, java_set_library_path,
	java_instanceof, offsetExists, offsetGet, offsetSet, offsetUnset,
	cast, iterator_move_forward, get_iterator,
	php_java_call_function_handler, php_java_makeObject,
	php_java_getset_property): Use TRANSACTION_BEGIN/END instead of
	DeleteLocalRef. Use java_get_jobject_from_object.
	
	
2004-11-26  Jost Boekemeier  <jostb@intern>

	* php-java-bridge: use sh to start the sub-process so that only
	one "php-java-bridge" process appears in the process list.

	* java.c, php_java.h (php_java_handlers, create_object, cast): New
	functions/globals for PHP 5.
	* tests.php5/toString.php: New test

	* server/JavaBridge.java (getPhpMap): correct documentation.

	* server/natcJava.c, server/JavaBridge.java, client.c
	(nextElement, hashUpdate, hashIndexUpdate, setResultFromArray):
	Replaced by the new PHP 5 iterator and array interfaces. -- These
	functions should have never been written, they copied entire
	arrays or hash tables from java to PHP.  But we have to keep them
	for PHP 4 for backward compatibility with ext/java.  They even
	caused trouble in the past, see change log entries from 2004-09-09
	and 2004-09-19, where we had to correct a problem interited from
	the original PHP 4 ext/java extension.
	
2004-11-24  Jost Boekemeier  <jostb@timon.intern>

	* instanceof.php, iteratorInterface.php, arrayInterface.php,
	array.php, Array.java, array.jar: new files in tests.php5
	
	* client.c (handle_request): Do not discard null results for PHP 5

	
	PHP 5 Iterator interface:
	
	* php_java.h (clearEx, lastEx, setJarPath, getPhpMap, invoke, gsp,
	co, hasMore, getType, moveForward): New globals.
	
	* client.c (java_connect_to_server): Init globals
	
	* java_bridge.c, java_bridge.h (php_java_invoke): New function.
	
	* java_bridge.c (php_java_call_function_handler): Use globals
	
	* java.c (java_iterator, iterator_dtor, iterator_valid,
	iterator_current_key, init_current_data, iterator_move_forward,
	java_iterator_funcs, get_iterator): New functions/structures.
	(PHP_MINIT_FUNCTION): Rewritten.
	
	* server/JavaBridge.java (PhpMap): New abstract class.
	(getPhpMap): Factory.
	
	* protocol.h, proxyenv.c, server/handleRequest.c (IsInstanceOf):
	New protocol request.
	
	* php-java-bridge.spec, server/MakefileUnix.am: Fiddle with the
	new generated JavaBridge$$foo1,2,3xyz output classes. Fortunately
	they don't have slashes or backslashes in their names ...

	
	PHP 5 array interface:
	
	* java.c (offsetExists, offsetGet, offsetSet, offsetUnset,
	arginfo_array_offsetSet, arginfo_array_offsetGet): New
	functions/structures for PHP 5.
	(PHP_MINIT_FUNCTION): Rewritten.
	
	
	* server/natcJavaBridge.c (handle_request): Fixed typo.
	
2004-11-21  Jost Boekemeier  <jostb@intern>

	* README, server/natcJavaBridge.c, server/JavaBridge.java,
	INSTALL, client.c, java_bridge.c, java_bridge.h, java_bridge,
	protocol.h, proxyenv.c, java.c: New "java_class" constructor.
	
2004-11-20  Jost Boekemeier  <jostb@intern>

	* server/JavaBridge.c (findClass): Use String.valueOf instead of
	.toString so that we get the proper ClassNotFoundException instead
	of a null pointer exception.
	
2004-11-18  Jost Boekemeier  <jostb@intern>

	* README: Removed sections about Sun's JSR 223 and outdated notes
	from Sam Ruby.

	* VERSION, php-java-bridge.spec: Version

	True try/catch handling.
	* client.c, server/natcJavaBridge.c, server/JavaBridge.java: Pass
	jthrowable to client.
	* client.c (setResultFromException): New method
	(setException): Call setResultFromException with the jthrowable object

	New class: java_exception
	* java.c, php_java.h (php_java_exception_class_entry): New variable
	* java.c (PHP_MINIT_FUNCTION): New class
	
	Display java objects
	* java.c (java_class_functions): New entry
	(java__tostring): New function

	* java_bridge.c (checkError): Disable for PHP5

	* tests.php5/exception.php: Rewritten

	* tests.php5/printStackTrace.php: New file
	
2004-11-16  Jost Boekemeier  <jostb@intern>
	
	PHP 5 supported
	* java_bridge.h, java_bridge.c (php_java_call_function_handler,
	php_java_set_property_handler, php_java_get_property_handler),
	php_java.h (php_java_class_entry): rewritten to use PHP 5 style
	* java.c (javajava, java__call, java__set, java__get, make_lambda): New functions (PHP 5)
	(call_function_handler, get_property_handler, set_property_handler): New functions (PHP 4)
	(java_class_functions): New structure
	(PHP_MINIT_FUNCION): rewritten
	(PHP_MSHUTDOWN_FUNCTION): rewritten

	* java_bridge.c (wait_for_daemon, php_java_shutdown_library): removed
	* bind.c (wait_for_daemon, php_java_shutdown_library): new from java_bridge.c
	* client.c (swrite, sread, id): removed
	* proxyenv.c (java_swrite, java_sread, java_id): new from client.c

	* client.c (CFG_JAVA_SOCKET_INET): Fixed typo

	The PHP 5 object system revealed a bug in the core protocol: If
	someone managed to send a PHP array with an PHP OBJ type in it, the
	client stopped working immediately.
	* server/natcJavaBridge.c (handle_request NEWOBJECT): Accept a count
	(short), not a length (size_t).
	
	
2004-11-11  Boekemeier  <jost2345@intern>

	* server/natcJavaBridge.c, sio.c, sio.h, protocol.h, java.c, init_cfg.c.in, client.c: 
	Disable threads and use TCP sockets on windows.
	
2004-11-03  Boekemeier  <jost2345@intern>

	* init_cfg.c.in (java_destroy_cfg): Free the memory _we_ have
	allocated, not the memory that apache has allocated. Otherwise
	apache 2.0 will loop in malloc_consolidate.
	* java.c (PHP_MSHUTDOWN_FUNCTION): Code re-enabled.

	* server/JavaBridge.java (init): Log the log file name only if
	level >= logdebug

2004-11-02  Jost Boekemeier  <jostb@intern>

	* java.c (PHP_MSHUTDOWN_FUNCTION): Reverted last change (code
	disabled). This caused a loop in malloc_consolidate in apache 2.0.
	
	* php-java-bridge 1.0.6a released
	
	
2004-10-31  Jost Boekemeier  <jostb@intern>

	* bind.c (java_start_server): Protect guard; a dead guard isn't
	really useful.
	
	* server/natcJavaBridge.c 
	(Java_JavaBridge_startNative): Removed debug code.
	(Java_JavaBridge_handleRequests): Cleanup.

	* php-java-bridge 1.0.6 released.

2004-10-30  Boekemeier  <jost2345@intern>

	* server/natJavaBridge.c (java_bridge_main_gcj): Correct typo.
	
	* server/natcJavaBridge.java (readChunks, read): New functions
	(load): Use these to work around a bug in GNU java

	* server/java.c (usage): New function

2004-10-28  Boekemeier  <jost2345@intern>

	* README: Document java.log_level
	
	* server/natcJavaBridge.java: log jars as info, not debug.

	* server/Makefile.am: Removed
	* server/Makefile.in: New file

	* server/java.c: Print usage().
	
2004-10-26  Boekemeier  <jost2345@intern>

	Split the unix and windows functionality into two makefiles to
	work around a problem in autoconf
	* server/Makefile_unix.am, server/Makefile_windows.am: New files
	* server/Makefile.am: Rewritten
	* server/autogen.sh: return value from autoconf

2004-10-24  Jost Boekemeier  <jostb@diego.intern>

	* README: Document java_set_library_path
	* java.c, scheme_demo.php: Renamed java_set_jar_library_path to java_set_library_path
	
	* server/JavaBridge.java, server/natcJavaBridge.c, server/configure.in: Load libraries from /usr/share/java or from ext_dir/lib

	* ChangeLog: Changed order, latest at top

	* config.m4: Do not build DLLs for win98

	* server/acinclude.m4: rewritten.

	* server/configure.in: AC_PROG_LIBTOOL should recognize
	AM_PROG_GCJ
	
2004-10-23  Jost Boekemeier  <jostb@diego.intern>

	Added support for Solaris 64 and Solaris broken stdio.
	* protocol.h, proxyenv.c, client.c, natcJavaBridge.c: Use SFREAD ... instead of fread.
	* sio.c, sio.h: New files
	* tests.m4/function_checks.m4, tests.m4/java_check_broken_gcc_installation.m4, tests.m4/java_check_broken_stdio_buffering.m4, tets.m4/threads.m4: New files

	* LICENSE: Correct author.

	Correct classpath problem
	* natcJavaBridge.c, client.c: Client receives the bridge instance as first element.
	* JavaBridge.java: Start a new thread, set the context classloader on java level.
	* natcJavaBridge.c: Do not call attachCurrentThread, which is broken in gcj.

	Added support for static binaries.
	* natcJavaBridge.c, bind.c: Invoke jniRegisterNatives.

	Use GNU autoconf to configure the server part separately. Share the
	test macros from PHP and the java module with the server part.
	* Makefile.frag: rewritten
	* server/acinclude.m4, server/autogen.sh, server/configure.in: new files
	* config.m4: Include all tests in tests.m4.

	Win98 support.
	* sio.h: Do not depend on HAVE_CONFIG_H
	* natcJavaBridge: Win98 does not support sigwait

	* function_checks.m4 (lsocket): test rewritten

	* README: Solaris, 64 bit VM's and Win98 are supported
	
2004-09-27  Jost Boekemeier  <jost2345@mail.yahoo.de>

	* JavaBridge.java (findClass): Store the classes into a weak-value 
	hash so that classes don't get loaded multiple times (some JVM's
	don't have a class GC).

	* natcJavaBridge (handle_request, connection_cleanup): Count
	the # of handles the client has aquired.

	* java_bridge.c (wait_for_daemon): gcj uses the 2 internaly(!), we
	must send it twice to kill it. 
	
2004-09-26  Jost Boekemeier  <jost2345@mail.yahoo.de>

	* natcJavaBridge.c (Java_JavaBridge_startNative): do not restart
	when signal arrived, this caused problems on some OS.

	It is now possible to set the library path at run-time e.g.:
	java_set_jar_library_path(";file:c:/test.jar;http://foo.com/xy.jar");
	* Javabridge.java (setJarLibraryPath, load, findClass): New methods.
	(CreateObject): Load classes via our own classloader.
	* java.c (java_set_jar_library_path): New function.
	* client.c (java_connect_to_server): Call constructor.
	* sample.php: Use new function.

	* java.c (java_last_exception_clear, java_last_exception_get):
	Check if java is initialized.

	* client.c (abort_on_error): Renamed to check_error.

	* client.c (java_do_test_server): Check return value from close().

	* php-java-bridge 1.0.5 released.

2004-09-23  Jost Boekemeier  <jost2345@mail.yahoo.de>

	Use a guard thread instead of a async signal to shutdown the server.
	* natcJavaBridge.c (mutex, cond, count, block): New variables.
	(exit_sig): removed
	(block_sig, enter, leave, guard_requests): New functions.
	(initGlobals): initialization added
	(handle_requests): update thread count
	(Java_JavaBridge_startNative): terminate after guard has terminated.
	* README: Note about dynamic loading via dl() added.
		
        The bridge must do its own resource tracking because php4 calls 
	the php_java_destructor too late (*after* rshutdown!).
	* java_bridge.c (php_java_destructor): Code disabled.
	* natcJavaBridge.c (enumClass, hashKeys, enumMore, enumNext): New
	globals.
	(initGlobals): initialization
	(connection_startup, connection_cleanup): New functions.
	(handle_requests, handle_request_impl, handle_request): Trace global
	refs.
	
2004-09-21  Jost Boekemeier  <jost2345@mail.yahoo.de>

        * java.c (PHP_MINIT_FUNCTION): Fixed a typo that caused a massive
	memory leak on the java side of the bridge.  The DeleteGlobalRef
	was never called and since Java does not release the memory when
	a client detaches from the VM (thanks, Sun!) the memory remained
	locked until the VM ran out of memory.

	* natcJavaBridge.c (Java_JavaBridge_startNative): Linux handles
	accept different than the BSD variants.  Check errno.

	Starting java as a daemon should solve the sub-process problem.
	* bind.c (java_start_server): Start java as a daemon, if possible.
	(readpid): New function.
	* java_bridge.c (php_java_shutdown_library): Wait for daemon
	(wait_for_daemon): New function
	* README: Delete the note about Apache 1.3.
	
	Correctly shut down the connection in rshutdown
	* java.c (PHP_RSHUTDOWN_FUNCTION): Delete global refs and close
	file descriptors.
	
2004-09-19  Jost Boekemeier  <jostb@diego.intern>

        Allocate pval's correctly, part II -- the previous change for 1.0.2
	was incorrect: the php interpreter could not work reliable anymore if nextElement,
	hashIndexUpdate or hashUpdate was called.
	* client.c (nextElement, hashIndexUpdate, hashUpdate): Increment the refcount.

	* php-java-bridge.spec, php-java-bridge.service, php-java-bridge:
	New file.

	* php.ini: Removed (now in php-java-bridge.spec).

	* INSTALL, LICENSE: New file.
	
	Starting the JVM from the web-server caused several problems.  
	Apache 1.3 even killed the server-part of the bridge.
	* README: Recommend to start the JVM separately and to hardcode the 
	java.socketname.
	* bind.c (java_start_server): Do not start the server part of the
	bridge if the user has hardcoded the java.socketname in java.ini.
	(can_fork): New function.

	* natcJavaBridge.c (handle_request): If the JVM ran out of memory
	do nothing, send back null-pointer.
	(exit_sig): Workaround for a bug in the IBM JVM. This VM should
	not hang anymore when started as a sub-process from Apache --
	starting the VM as a sub-process of Apache is now deprecated
	anyway.

	* php-java-bridge 1.0.4 released.
	

2004-09-15  Jost Boekemeier  <jost2345@mail.yahoo.de>

	* JavaBridge.java: The bridge now catches errors and runtime
	exceptions such as "class not found" and reports them to the
	client.

2004-09-12  Jost Boekemeier  <jost2345@mail.yahoo.de>

	* README: GNU Java supported

	The SUN Java implementation may store objects on the stack.
	Objects on the heap may reference them. So in this JVM we cannot
	simply longjmp to clear the stack, because some heap objects may
	still refer to dead locations.  The result would be that the VM
	will barf when the GC tries to follow these phantom references.
	* natcJavaBridge.c: Longjmp to the last savepoint, then return
	back to java, throw an exception to return to one of the three
	native main methods and then jump back to the loop.  This fixes a
	crash in the SUN VM which occured after apache has aborted the
	connection.

	* php-java-bridge 1.0.3 released.
	
2004-09-10  Jost Boekemeier  <jost2345@mail.yahoo.de>

	* java.c: Display empty string as ''.

	REL3 or RH9 running a non-NPTL kernel require to set the
	environment variable LD_ASSUME_KERNEL=2.4.19 in order to run
	jdk1.4 correctly.
	* bind.c: Pass modified environment on to the child process.

2004-09-09  Jost Boekemeier  <jost2345@mail.yahoo.de>
	
	Initialize PVAL's so that they have a proper ref-count.  Otherwise 
	either the bridge or the JVM might crash (or both).
	* java.c: Allocate pval's correctly.

	* php-java-bridge 1.0.2 released.

2004-08-30  Jost Boekemeier  <jost2345@mail.yahoo.de>

	* bind.c: wait until the JVM is initialized

	Initialize the cfg vars correctly so that only one VM is started
	* java.c, init_cfg: set the defaults _after_ the cfg changes.

	* php-java-bridge 1.0.1 released.
	
2004-08-29  Jost Boekemeier  <jost2345@mail.yahoo.de>

	* php-java-bridge 1.0.0 released.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.