Executing a Java Method with PhP?

Discussion in 'Plugin Development' started by Uniclaw, Nov 13, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Uniclaw

    Hi!
    how i can execute a method of my plugin, with php?

    Like so:

    root directory
    -> server
    --->plugins
    ----->myplugin <- in my plugin is a method like phpmethod(String[] args)
    ->php
    ---> the script <- execute server.plugins.myplugin.phpmethod(args)

    Greet
     
  2. Offline

    Jazed

    I don't think that is possible, allthough it is possible through HTML parameters. I would recommend having an callback function so you call an PHP file through your java program and have it report back. Otherwise try building the same class you have in java in PHP.
     
  3. Offline

    Uniclaw

    Yeah, but how? Because i would make a thing that if i click on a button on my homepage, it's call a method from the plugin..
     
  4. Offline

    Zidkon

    Certainly PhP cannot call Java directly, since they are not related.

    What you can do is a Java class that works to check the PhP as the other guys told you, I have never done something similar but, something like a file that logs the IP of the person who pressed a button and you check this file on the web with a Java class, I think that could work, but pretty much sure there should be better ways to do it :p

    I think what Jazed says is that you can use JavaScript to call a Java class through AJAX, you know JavaScript is pretty much compatible with most explorers and AJAX is just like PhP.

    Well my knowledge is not so long for all those, I think you should research a little more then if no more answers :p
     
  5. Offline

    ase34

    fireblast709 likes this.
Thread Status:
Not open for further replies.

Share This Page