w32API gone?

liunx

Guest
ok before you point me to FFI id like to give you a bit of info and my script. Im aware that php5 stoped supporting php_w32API.dll and now pecl is doing a DLL almost the same called ffi <!-- m --><a class="postlink" href="http://pecl.php.net/package/ffi">http://pecl.php.net/package/ffi</a><!-- m --> Anyway has anyone used ffi and is it much of a change from w32api? Id like to test it but I dont have a compiler nor do I want to figure out how to compile it if I had one lol. So if anyone has used FFI and it works as good or better then w32API can someone host the dll file?

On a side note I was using w32API mainly to get system uptime. Here is my php code.

<?
if (!dl("php_w32api.dll")) {
echo "Unable to load php_w32api.dll";
exit;
}

$api = new win32;
$api->registerfunction("bool QueryPerformanceCounter (float &lpPerformanceCount) From kernel32.dll");
$api->registerfunction("bool QueryPerformanceFrequency (float &lpPerformanceFrequency) From kernel32.dll");

$api->QueryPerformanceCounter($a);
$api->QueryPerformanceFrequency($b);
$c = $a/$b;
$days = floor($c / 86400);
$output = gmstrftime("Uptime: %dd %Hh %Mm %Ss", $c);
$output2 = gmstrftime("Username: DeathfireD");
$output3 = gmstrftime("OS: Win2k");


$image = imagecreatefrompng('sysuptime2.png');

header("Content-type: image/png");

$black = imagecolorallocate($image, 0, 0, 0);

Imagestring($image,2,(imagesy+5),(imagesy+9),$output2,$black);
Imagestring($image,2,(imagesy+5),(imagesy+23),$output,$black);
Imagestring($image,2,(imagesy+5),(imagesy+37),$output3,$black);

imagepng($image);
imagedestroy($image);
?>


If anyone can help me modify it without using a DLL then thats even better.Does anyone know howto get the system uptime for windows 2000 any other way then by using the new fii.DLL?Im sure there would be a way to get to it through COM, not sure where exactly though.I'm sure <!-- m --><a class="postlink" href="http://www.google.com/search?q=uptime+site%3A.microsoft.com">http://www.google.com/search?q=uptime+s ... rosoft.com</a><!-- m --> would turn up something as well.....ahh sweet thanks as alwase weedpacket
 
Back
Top