Code Duplication    Length = 20-20 lines in 2 locations

phpsysinfo/includes/os/class.HPUX.inc.php 1 location

@@ 145-164 (lines=20) @@
142
    {
143
        if (CommonFunctions::rfts('/proc/pci', $bufr)) {
144
            $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
145
            foreach ($bufe as $buf) {
146
                if (preg_match('/^\s*Bus\s/', $buf)) {
147
                    $device = true;
148
                    continue;
149
                }
150
                if ($device) {
151
                    $dev = new HWDevice();
152
                    $dev->setName(preg_replace('/\([^\)]+\)\.$/', '', trim($buf)));
153
                    $this->sys->setPciDevices($dev);
154
/*
155
                    list($key, $value) = preg_split('/: /', $buf, 2);
156
                    if (!preg_match('/bridge/i', $key) && !preg_match('/USB/i', $key)) {
157
                        $dev = new HWDevice();
158
                        $dev->setName(preg_replace('/\([^\)]+\)\.$/', '', trim($value)));
159
                        $this->sys->setPciDevices($dev);
160
                    }
161
*/
162
                    $device = false;
163
                }
164
            }
165
        }
166
    }
167

phpsysinfo/includes/os/class.Linux.inc.php 1 location

@@ 399-418 (lines=20) @@
396
        } elseif (CommonFunctions::rfts('/proc/pci', $strBuf, 0, 4096, false)) {
397
            $booDevice = false;
398
            $arrBuf = preg_split("/\n/", $strBuf, -1, PREG_SPLIT_NO_EMPTY);
399
            foreach ($arrBuf as $strLine) {
400
                if (preg_match('/^\s*Bus\s/', $strLine)) {
401
                    $booDevice = true;
402
                    continue;
403
                }
404
                if ($booDevice) {
405
                    $dev = new HWDevice();
406
                    $dev->setName(preg_replace('/\([^\)]+\)\.$/', '', trim($strLine)));
407
                    $this->sys->setPciDevices($dev);
408
/*
409
                    list($strKey, $strValue) = preg_split('/: /', $strLine, 2);
410
                    if (!preg_match('/bridge/i', $strKey) && !preg_match('/USB/i ', $strKey)) {
411
                        $dev = new HWDevice();
412
                        $dev->setName(preg_replace('/\([^\)]+\)\.$/', '', trim($strValue)));
413
                        $this->sys->setPciDevices($dev);
414
                    }
415
*/
416
                    $booDevice = false;
417
                }
418
            }
419
        } else {
420
            $pcidevices = glob('/sys/bus/pci/devices/*/uevent', GLOB_NOSORT);
421
            if (($total = count($pcidevices)) > 0) {