Subversion Repositories ALCASAR

Rev

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

Rev 2770 Rev 2976
Line 23... Line 23...
23
     *
23
     *
24
     * @return Void
24
     * @return Void
25
     */
25
     */
26
    public function build()
26
    public function build()
27
    {
27
    {
28
        if (PSI_OS == 'Linux') {
28
        if ((PSI_OS == 'Linux') && !defined('PSI_EMU_HOSTNAME')) {
29
            $hwpaths = glob("/sys/devices/platform/coretemp.*/", GLOB_NOSORT);
29
            $hwpaths = glob("/sys/devices/platform/coretemp.*/", GLOB_NOSORT);
30
            if (is_array($hwpaths) && (count($hwpaths) > 0)) {
30
            if (is_array($hwpaths) && (count($hwpaths) > 0)) {
31
                $hwpaths = array_merge($hwpaths, glob("/sys/devices/platform/coretemp.*/hwmon/hwmon*/", GLOB_NOSORT));
31
                $hwpaths2 = glob("/sys/devices/platform/coretemp.*/hwmon/hwmon*/", GLOB_NOSORT);
-
 
32
                if (is_array($hwpaths2) && (count($hwpaths2) > 0)) {
-
 
33
                    $hwpaths = array_merge($hwpaths, $hwpaths2);
32
            }
34
                }
33
            if (is_array($hwpaths) && (($totalh = count($hwpaths)) > 0)) {
35
                $totalh = count($hwpaths);
34
                for ($h = 0; $h < $totalh; $h++) {
36
                for ($h = 0; $h < $totalh; $h++) {
35
                    $this->_temperature($hwpaths[$h]);
37
                    $this->_temperature($hwpaths[$h]);
36
                }
38
                }
37
            }
39
            }
38
        } else {
40
        } elseif (PSI_OS == 'FreeBSD') {
39
            $smp = 1;
41
            $smp = 1;
40
            CommonFunctions::executeProgram('sysctl', '-n kern.smp.cpus', $smp);
42
            CommonFunctions::executeProgram('sysctl', '-n kern.smp.cpus', $smp);
41
            for ($i = 0; $i < $smp; $i++) {
43
            for ($i = 0; $i < $smp; $i++) {
42
                $temp = 0;
44
                $temp = 0;
43
                if (CommonFunctions::executeProgram('sysctl', '-n dev.cpu.'.$i.'.temperature', $temp)) {
45
                if (CommonFunctions::executeProgram('sysctl', '-n dev.cpu.'.$i.'.temperature', $temp)) {