You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(6) |
Nov
(8) |
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(19) |
Feb
(15) |
Mar
(10) |
Apr
(8) |
May
(7) |
Jun
(9) |
Jul
(13) |
Aug
(31) |
Sep
(111) |
Oct
(52) |
Nov
(72) |
Dec
(42) |
| 2006 |
Jan
(21) |
Feb
(32) |
Mar
(33) |
Apr
(24) |
May
(15) |
Jun
(40) |
Jul
(32) |
Aug
(19) |
Sep
(38) |
Oct
(37) |
Nov
(63) |
Dec
(37) |
| 2007 |
Jan
(18) |
Feb
(39) |
Mar
(69) |
Apr
(49) |
May
(71) |
Jun
(59) |
Jul
(71) |
Aug
(85) |
Sep
(46) |
Oct
(14) |
Nov
(25) |
Dec
(56) |
| 2008 |
Jan
(24) |
Feb
(77) |
Mar
(104) |
Apr
(44) |
May
(41) |
Jun
(11) |
Jul
(31) |
Aug
(59) |
Sep
(44) |
Oct
(86) |
Nov
(66) |
Dec
(93) |
| 2009 |
Jan
(88) |
Feb
(41) |
Mar
(49) |
Apr
(135) |
May
(22) |
Jun
(31) |
Jul
(60) |
Aug
(71) |
Sep
(76) |
Oct
(18) |
Nov
(52) |
Dec
(20) |
| 2010 |
Jan
(8) |
Feb
(50) |
Mar
(35) |
Apr
(48) |
May
(46) |
Jun
(84) |
Jul
(38) |
Aug
(61) |
Sep
(51) |
Oct
(31) |
Nov
(17) |
Dec
(18) |
| 2011 |
Jan
(51) |
Feb
(14) |
Mar
(17) |
Apr
(23) |
May
(15) |
Jun
(11) |
Jul
(5) |
Aug
(5) |
Sep
(15) |
Oct
(8) |
Nov
(5) |
Dec
(25) |
| 2012 |
Jan
(2) |
Feb
(4) |
Mar
(6) |
Apr
(9) |
May
(27) |
Jun
(32) |
Jul
(36) |
Aug
(10) |
Sep
(16) |
Oct
(3) |
Nov
(13) |
Dec
(7) |
| 2013 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(4) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(9) |
Jul
(5) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(3) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(5) |
Oct
(1) |
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
(6) |
Feb
|
Mar
|
Apr
(10) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2018 |
Jan
(2) |
Feb
(5) |
Mar
|
Apr
|
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
|
2
|
3
(3) |
4
|
|
5
(1) |
6
(4) |
7
|
8
(6) |
9
(3) |
10
(1) |
11
(1) |
|
12
|
13
(2) |
14
(3) |
15
(9) |
16
(5) |
17
(3) |
18
|
|
19
|
20
(2) |
21
(5) |
22
(5) |
23
(2) |
24
|
25
|
|
26
|
27
|
28
(4) |
29
(2) |
30
(2) |
|
|
|
From: <php...@li...> - 2006-11-17 18:40:34
|
Hi Verena,
> PhpScriptEngine engine = new PhpScriptEngine();
> String s = "<?php \n";
> s += "java_context()->setAttribute( 'obj', new
> MyClass(), 100 ); \n";
> s += "java_context()->call(java_closure()); \n";
> s += "?>";
> engine.eval( new StringReader(s) );
the above code should work, it evaluates the php
script stored in the Java string s.
However, you'll get a warning that the instance of
MyClass is not a Java object. Use
java_closure(new MyClass())
instead.
> Invocable inv = (Invocable) engine;
> inv.invokeMethod( engine.get("obj"), "saySomething",
> new Object() );
You will get a null pointer exception because obj is
bound to null, see the warning above. Furthermore you
have captured the top-level environment, but you
probably want to invoke methods from MyClass().
Frameworks such as Java Server Faces allow you to
define PHP beans and to inject these beans into the
framework:
http://php-java-bridge.cvs.sourceforge.net/php-java-bridge/php-java-bridge/examples/java-server-faces/helloWorld.php?revision=1.6&view=markup
java_context()->call(java_closure(new helloWorld()))
||include("index.php");
The above code creates an instance of the PHP
helloWorld() class, creates a Java proxy for it and
then calls the framework (the java_context()->call
magic does this).
When the call() failed (which means that the first
request came in from the web server, and not from the
framework), we redirect to index.php, which forwards
the browser to the framework, which in turn evaluates
the PHP script. The script creates the PHP bean and
injects it into the framework. After that the
framework holds a reference to the PHP bean and can
call its methods:
http://php-java-bridge.cvs.sourceforge.net/php-java-bridge/php-java-bridge/server/php/java/faces/Script.java?revision=1.6&view=markup
return
((Invocable)((PhpFacesContext)FacesContext.getCurrentInstance()).getScriptEngine(this,
new URL(script))).invoke(name, args);
I think this is exactly what you want. The only
difference is that the above method calls out to a URL
instead of a local script file.
> String script = "var obj = new Object();
> obj.hello = function(name)
> { print('Hello, ' + name); }";
> Any chance todo something similar with PHP?
It is certainly possible to automatically call
java_closure(), when a php object is passed to a Java
procedure. But for several reasons we've decided to
require java_closure(php_object). Furthermore, if I
understand the above code correctly, the "new
Object()" above instanciates a Java object, not an
object from the js script interpreter.
Regards,
Jost Boekemeier
___________________________________________________________
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
|
|
From: <php...@li...> - 2006-11-17 15:54:16
|
Sorry, once again ;-)
I wrote this little part of a Java method for testing:
PhpScriptEngine engine = new PhpScriptEngine();
String s = "<?php \n";
s += "require_once 'MyClass.php'; \n";
s += "java_context()->setAttribute( 'obj', new MyClass(), 100 ); \n";
s += "java_context()->call(java_closure()); \n";
s += "?>";
engine.eval( new StringReader(s) );
Invocable inv = (Invocable) engine;
inv.invokeMethod( engine.get("obj"), "saySomething", new Object() );
The resulting errors are:
java.lang.NullPointerException
at java.lang.reflect.Proxy.getInvocationHandler(Proxy.java:636)
at php.java.script.PhpScriptEngine.invokeMethod(PhpScriptEngine.java:202)
at Bootstrap.main(Bootstrap.java:30)
Nov 17 16:30:28 JavaBridge ERROR: PHP Warning: Argument is not (or does not
contain) Java object(s). in - on line 3
The NullPointerException happens in the line where invokeMethod is called.
Line 3 of the PHP script is the one where setAttribute() is called. As I
understand the error message text, it is not possible to set a PHP object as
an attribute to the java context, but only Java objects?
Another thing I tried was:
String s = "<?php \n";
s += "require_once 'MyClass.php'; \n";
s += "$obj = new MyClass(); \n";
s += "java_context()->call(java_closure()); \n";
s += "?>";
but there was the same NullPointerException.
This was inspired from the Javascript example provided by SUN here:
https://java.sun.com/javase/6/docs/technotes/guides/scripting/programmer_guide/index.html#invoke
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("JavaScript");
String script = "var obj = new Object(); obj.hello = function(name)
{ print('Hello, ' + name); }";
engine.eval(script);
Invocable inv = (Invocable) engine;
Object obj = engine.get("obj");
inv.invokeMethod(obj, "hello", "Script Method !!" );
Any chance todo something similar with PHP?
Regards,
Verena
|
|
From: <php...@li...> - 2006-11-17 14:14:51
|
php...@li... schrieb: > http://php-java-bridge.cvs.sourceforge.net/php-java-bridge/php-java-bridge/server/test/SwingTest.php?view=markup > thanks for the link. Verena |