Subversion Repositories ALCASAR

Rev

Rev 2976 | Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
2770 rexy 1
<?php
2
/**
3
 * thinkpad sensor class, getting hardware temperature information and fan speed from /sys/devices/platform/thinkpad_hwmon/
4
 *
5
 * PHP version 5
6
 *
7
 * @category  PHP
8
 * @package   PSI_Sensor
9
 * @author    Mieczyslaw Nalewaj <namiltd@users.sourceforge.net>
10
 * @copyright 2017 phpSysInfo
11
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
12
 * @version   Release: 3.0
13
 * @link      http://phpsysinfo.sourceforge.net
14
 */
15
class Thinkpad extends Hwmon
16
{
17
    /**
18
     * get the information
19
     *
20
     * @see PSI_Interface_Sensor::build()
21
     *
22
     * @return Void
23
     */
24
    public function build()
25
    {
26
        if (PSI_OS == 'Linux') {
27
            $hwpaths = glob("/sys/devices/platform/thinkpad_hwmon/", GLOB_NOSORT);
28
            if (is_array($hwpaths) && (count($hwpaths) == 1)) {
29
                $this->_temperature($hwpaths[0]);
30
                $this->_fans($hwpaths[0]);
31
            }
32
        }
33
    }
34
}