Menu

[r292]: / trunk / php-java-bridge / test.php  Maximize  Restore  History

Download this file

26 lines (22 with data), 694 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/php
<?php
if (!extension_loaded('java')) {
if ((version_compare("5.0.0", phpversion(), "<=")) && (version_compare("5.0.4", phpversion(), ">"))) {
echo "This PHP version does not support dl().\n";
echo "Please add an extension=java.so or extension=php_java.dll entry to your php.ini file.\n";
exit(1);
}
echo "Please permanently activate the extension. Loading java extension now...\n";
if (!dl('java.so')&&!dl('php_java.dll')) {
echo "java extension not installed.";
exit(2);
}
}
phpinfo();
print "\n\n";
$v = new java("java.lang.System");
$arr=$v->getProperties();
foreach ($arr as $key => $value) {
print $key . " -> " . $value . "<br>\n";
}
?>
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.