Menu

[r244]: / trunk / php-java-bridge / tests.php5 / loadLib.php  Maximize  Restore  History

Download this file

31 lines (28 with data), 615 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
25
26
27
28
29
30
#!/usr/bin/php
<?php
if(!extension_loaded('java')) {
dl('java.' . PHP_SHLIB_SUFFIX);
}
$here=trim(`pwd`);
$ext=trim(`php-config --extension-dir`);
if(!file_exists("$ext/lib")) {
mkdir("$ext/lib");
}
if(file_exists("$ext/lib/array/array.jar")) {
unlink("$ext/lib/array/array.jar");
}
if(file_exists("$ext/lib/array")) {
rmdir("$ext/lib/array");
}
mkdir("$ext/lib/array");
copy("$here/array.jar", "$ext/lib/array/array.jar");
try {
java_set_library_path("array/array.jar");
$testvar = new Java('Array');
echo "Test okay";
exit(0);
} catch (Exception $e) {
echo "Exception: " . $e;
exit(1);
}
?>
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.