Subversion Repositories ALCASAR

Rev

Rev 2976 | Rev 3100 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2976 Rev 3037
Line 38... Line 38...
38
            $arrLines = preg_split("/\n/", $strBuf, -1, PREG_SPLIT_NO_EMPTY);
38
            $arrLines = preg_split("/\n/", $strBuf, -1, PREG_SPLIT_NO_EMPTY);
39
            foreach ($arrLines as $strLine) {
39
            foreach ($arrLines as $strLine) {
40
                $dev = new HWDevice();
40
                $dev = new HWDevice();
41
                $arrParams = preg_split('/(\"? ")|(\" (?=-))/', trim($strLine));
41
                $arrParams = preg_split('/(\"? ")|(\" (?=-))/', trim($strLine));
42
                if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS && ($cp = count($arrParams)) >= 6) {
42
                if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS && ($cp = count($arrParams)) >= 6) {
43
                    $arrParams[$cp-1] = trim($arrParams[$cp-1],'"'); // remove last "
43
                    $arrParams[$cp-1] = trim($arrParams[$cp-1], '"'); // remove last "
44
                    $dev->setName($arrParams[1].': '.$arrParams[2].' '.$arrParams[3]);
44
                    $dev->setName($arrParams[1].': '.$arrParams[2].' '.$arrParams[3]);
45
                    if (preg_match('/^-/', $arrParams[4])) {
45
                    if (preg_match('/^-/', $arrParams[4])) {
46
                        if (($arrParams[5] !== "") && !preg_match('/^Unknown vendor/', $arrParams[5])) {
46
                        if (($arrParams[5] !== "") && !preg_match('/^Unknown vendor/', $arrParams[5])) {
47
                            $dev->setManufacturer(trim($arrParams[5]));
47
                            $dev->setManufacturer(trim($arrParams[5]));
48
                        }
48
                        }
Line 115... Line 115...
115
                    $parm['name'] = $mount_buf[1];
115
                    $parm['name'] = $mount_buf[1];
116
                    if (PSI_SHOW_MOUNT_OPTION) $parm['options'] = isset($mount_buf[5]) ? $mount_buf[5] : '';
116
                    if (PSI_SHOW_MOUNT_OPTION) $parm['options'] = isset($mount_buf[5]) ? $mount_buf[5] : '';
117
                    $mount_parm[] = $parm;
117
                    $mount_parm[] = $parm;
118
                }
118
                }
119
            }
119
            }
120
        } elseif (CommonFunctions::rfts("/etc/mtab", $mount)) {
120
        } elseif (CommonFunctions::rfts(((PSI_ROOT_FILESYSTEM === '')||(PHP_OS !== 'Linux'))?"/etc/mtab":"/proc/1/mounts", $mount)) {
121
            $mount = preg_split("/\n/", $mount, -1, PREG_SPLIT_NO_EMPTY);
121
            $mount = preg_split("/\n/", $mount, -1, PREG_SPLIT_NO_EMPTY);
122
            foreach ($mount as $mount_line) {
122
            foreach ($mount as $mount_line) {
123
                if (preg_match("/(\S+) (\S+) (\S+) (\S+) ([0-9]+) ([0-9]+)/", $mount_line, $mount_buf)) {
123
                if (preg_match("/(\S+) (\S+) (\S+) (\S+) ([0-9]+) ([0-9]+)/", $mount_line, $mount_buf)) {
124
                    $parm = array();
124
                    $parm = array();
125
                    $mount_point = preg_replace("/\\\\040/i", ' ', $mount_buf[2]); //space as \040
125
                    $mount_point = preg_replace("/\\\\040/i", ' ', $mount_buf[2]); //space as \040