private function _fetchPciNames()
    {
        for ($v = false, $file = @fopen($this->_pci_file, 'r'); $file != false && $contents = fgets($file);) {
            if (preg_match('/^(\S{4})\s+([^$]+)$/', $contents, $vend_match) == 1) {
                $v = $vend_match;
            } elseif (preg_match('/^\s+(\S{4})\s+([^$]+)$/', $contents, $dev_match) == 1) {
                if ($v && isset($this->_pci_entries[strtolower($v[1])][strtolower($dev_match[1])])) {
                    $this->_pci_devices[$v[1]][$dev_match[1]] = array('vendor' => rtrim($v[2]), 'device' => rtrim($dev_match[2]));
                }
            }
        }
        $file && @fclose($file);
    }
private function _fetchPciNames()
    {
        for ($v = false, $file = @fopen($this->_pci_file, 'r'); $file != false && $contents = fgets($file);) {
            if (preg_match('/^(\S{4})\s+([^$]+)$/', $contents, $vend_match) == 1) {
                $v = $vend_match;
            } elseif (preg_match('/^\s+(\S{4})\s+([^$]+)$/', $contents, $dev_match) == 1) {
                if ($v && isset($this->_pci_entries[strtolower($v[1])][strtolower($dev_match[1])])) {
                    $this->_pci_devices[$v[1]][$dev_match[1]] = array('vendor' => rtrim($v[2]), 'device' => rtrim($dev_match[2]));
                }
            }
        }
        $file && @fclose($file);
    }
private function _fetchPciNames ( ) { for ( $ v = false , $ file = @ fopen ( $ this -> _pci_file , 'r' ) ; $ file != false && $ contents = fgets ( $ file ) ; ) { if ( preg_match ( '/^(\S{4})\s+([^$]+)$/' , $ contents , $ vend_match ) == 1 ) { $ v = $ vend_match ; } elseif ( preg_match ( '/^\s+(\S{4})\s+([^$]+)$/' , $ contents , $ dev_match ) == 1 ) { if ( $ v && isset ( $ this -> _pci_entries [ strtolower ( $ v [ 1 ] ) ] [ strtolower ( $ dev_match [ 1 ] ) ] ) ) { $ this -> _pci_devices [ $ v [ 1 ] ] [ $ dev_match [ 1 ] ] = array ( 'vendor' => rtrim ( $ v [ 2 ] ) , 'device' => rtrim ( $ dev_match [ 2 ] ) ) ; } } } $ file && @ fclose ( $ file ) ; }
Use the pci.ids file to translate the ids to names.
Use the pci . ids file to translate the ids to names .