HomePHP Page 8 - Retrieving System Information With patSysinfo
Mounting Up - PHP
Linux file structure contains within it a special area called /proc. Now, some believe that there's black magic in that directory. For those who know better than to fear the /proc, there awaits much good magic, in the form of server info. Looking for a way to retrieve real-time server information and display it to users in your Web application? Today's your lucky day! Take a look at the patSysinfo PHP class, which lets you do that and a whole lot more.
Finally, you can obtain information on mounted file system with the getMounts() method, which returns an array containing detailed information from both the "df" command and "/proc/mounts". Take a look:
<?php // include class include("patSysinfo.php");
// instantiate object $sys = new patSysinfo();
// get mounted file systems $mounts = $sys->getMount();
// output mount information print_r($mounts); die;
? >
Here's what the output of this script might look like: