Current version of PHPhD (version 126.96.36.199) support for PHP 5.2.x (tested with PHP 5.2.1) and distributed under the terms and conditions of Mozilla Public License version 1.1. This PHP extension is available to download at http://elect.wikispaces.com/Downloads
Using PHPhD users can access server hardware ports with minimum amount of coding and complexity. Example PHP source code which was based on PHPhD is listed in below,
//Initialize and open hardware device driver
die("Unable to open PHP hardware port access device driver");
//read printer (LPT) port and get the curent port value
$lpt_port_val = phphd_read_port(0x378+1);
echo("LPT port value [0x378+1] : ".$lpt_port_val);
//close device driver
Current version of PHPhD (version 188.8.131.52) has following functions,
- phphd_open_driver : Function to load device driver and initialize the hardware access session.
- phphd_close_driver : Function to close current device driver and release all the hardware sessions.
- phphd_isopen : Function to get the initialization status of the device driver.
- phphd_read_port : Read specified hardware port and return the value.
- phphd_write_port : Function to write value to the specified hardware port.
- phphd_sound : Function to trigger the system (server) speaker with given frequency and period. Most of the times we use this function to test the device driver and functionality of PHPhD.
Please note that this PHP extension is available for the Windows platforms only.