Subversion Repositories ALCASAR

Rev

Rev 3037 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3037 Rev 3100
Line 22... Line 22...
22
     * @return void
22
     * @return void
23
     */
23
     */
24
    private function _temperature()
24
    private function _temperature()
25
    {
25
    {
26
        $ar_buf = array();
26
        $ar_buf = array();
27
        if ((PSI_OS == 'Linux') && !defined('PSI_EMU_HOSTNAME')) switch (defined('PSI_SENSOR_HDDTEMP_ACCESS')?strtolower(PSI_SENSOR_HDDTEMP_ACCESS):'command') {
27
        if ((PSI_OS == 'Linux') && (!defined('PSI_EMU_HOSTNAME') || defined('PSI_EMU_PORT'))) switch (defined('PSI_SENSOR_HDDTEMP_ACCESS')?strtolower(PSI_SENSOR_HDDTEMP_ACCESS):'command') {
28
        case 'tcp':
28
        case 'tcp':
29
            $lines = '';
29
            $lines = '';
30
            // Timo van Roermund: connect to the hddtemp daemon, use a 5 second timeout.
30
            // Timo van Roermund: connect to the hddtemp daemon, use a 5 second timeout.
31
            $fp = @fsockopen('localhost', 7634, $errno, $errstr, 5);
31
            $fp = @fsockopen(defined('PSI_EMU_HOSTNAME')?PSI_EMU_HOSTNAME:'localhost', 7634, $errno, $errstr, 5);
32
            // if connected, read the output of the hddtemp daemon
32
            // if connected, read the output of the hddtemp daemon
33
            if ($fp) {
33
            if ($fp) {
34
                while (!feof($fp)) {
34
                while (!feof($fp)) {
35
                    $lines .= fread($fp, 1024);
35
                    $lines .= fread($fp, 1024);
36
                }
36
                }