RE: [PHP] PHP & Java, calling a static method
| From: | Wendy | Date: | Wed, 07 May 2003 01:55:11 +0000 |
| Subject: | RE: [PHP] PHP & Java, calling a static method | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146611@lists.php.net to get a copy of this message | ||
On Mon, 2003-05-05 at 14:14, Chris McCluskey wrote:
> The direct conversion would be:
> From:
> DAOFactory udFactory = DAOFactory.getDAOFactory();
> To:
> $udFactory = DAOFactory::getDAOFactory();
> That help?
Sort of... that looks like the conversion I would use if I were going to
rewrite the DAOFactory class in PHP. I tried it and got 'undefined
class name' as expected. What I have is a Java class that has to stay
in Java, and I need to use it from PHP.
So typically you instantiate the Java object by using one of the
constructors:
$myObject = new Java( "JavaClassName()" );
But DAOFactory is a class that you can't use that way. You're supposed
to use the 'getFactory' method on the class itself, and in fact you
can't make an instance of the class.
I can't figure out how to call a static method on a Java class from PHP.
Thanks for your response! Do you have any idea where to find out more
information on the experimental extensions? I'm sure the Java extension
isn't widely used, but it will neatly solve a big problem if I can get
it to work.
--
Wendy Smoak
Chandler, AZ