PEAR class: System

The System PEAR class is available as part of the basic PEAR install:
<?php
require_once "System.php";
$tmp_file = System::mktemp();
copy("http://php.net/robots.txt", $tmp_file);
$pear_command = System::which("pear");
?>
PEAR class: OS_Guess
The OS_Guess class uses the php_uname() function to determine on which
operating system it is running. It also provides ways of generalizing and comparing
OS signatures:
<?php
require_once "OS/Guess.php";
$os = new OS_Guess;
print "OS signature: " . $os->getSignature() . "\n";
if ($os->matchSignature("linux-*-i386")) {

print "Linux running on an Intel x86 CPU\n";
}
?>

Example output:
OS signature: linux-2.4-i386-glibc2.1
Linux running on an Intel x86 CPU